/* ============================================================
   Unimagdalena · Ruta de transición — sistema de diseño
   Paleta: navy #203d76 · cyan #54c6cc · slate #44546b
           orange #ee7e34 · blue #5a9ad5
   ============================================================ */

:root {
  --navy:   #203d76;
  --navy-d: #182d57;
  --cyan:   #54c6cc;
  --slate:  #44546b;
  --orange: #ee7e34;
  --blue:   #5a9ad5;

  --ink:    #1b2438;
  --muted:  #6c7689;
  --line:   #e4e8f0;
  --bg:     #eef1f6;
  --card:   #ffffff;

  --shadow-sm: 0 1px 2px rgba(32, 61, 118, .06);
  --shadow:    0 12px 30px -12px rgba(32, 61, 118, .22);
  --shadow-lg: 0 30px 60px -25px rgba(24, 45, 87, .45);
  --radius: 16px;

  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --display: "Archivo", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--bg);
  /* textura sutil: malla de puntos + dos focos de color */
  background-image:
    radial-gradient(900px 500px at 100% -10%, rgba(90, 154, 213, .12), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgba(84, 198, 204, .12), transparent 60%),
    radial-gradient(rgba(32, 61, 118, .045) 1px, transparent 1px);
  background-size: auto, auto, 22px 22px;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; }

/* ---------------- Topbar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), transparent 40%),
    linear-gradient(100deg, var(--navy-d) 0%, var(--navy) 55%, #25478a 100%);
  box-shadow: 0 10px 30px -16px rgba(24, 45, 87, .7);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1.5rem; gap: 1rem;
}
.accent-bar {
  display: block; height: 3px;
  background: linear-gradient(90deg, var(--orange) 0%, #f4a05e 45%, var(--orange) 100%);
  box-shadow: 0 0 18px rgba(238, 126, 52, .5);
}

/* Marca */
.brand { display: flex; align-items: center; gap: .85rem; }
.emblem {
  width: 48px; height: 48px; flex: none;
  object-fit: contain; transition: transform .25s;
}
.brand:hover .emblem { transform: rotate(-6deg) scale(1.04); }

.wordmark { display: flex; flex-direction: column; line-height: 1; color: #fff; }
.wordmark small {
  font-size: .62rem; letter-spacing: .22em; text-transform: uppercase;
  opacity: .72; font-weight: 500;
}
.wordmark strong {
  font-family: var(--display); font-weight: 800; font-size: 1.32rem;
  letter-spacing: .02em; text-transform: uppercase; margin-top: 2px;
}

/* Navegación */
.topnav { display: flex; align-items: center; gap: .25rem; }
.nav-link {
  color: rgba(255,255,255,.82); font-weight: 500; font-size: .92rem;
  padding: .5rem .9rem; border-radius: 10px; transition: .18s; white-space: nowrap;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,.1); }
.nav-link.active {
  color: #fff; background: rgba(255,255,255,.16);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}
.nav-sep { width: 1px; height: 22px; background: rgba(255,255,255,.22); margin: 0 .35rem; }
.nav-user {
  color: #cfe0f3; font-size: .82rem; font-weight: 500;
  padding-right: .25rem; display: inline-flex; align-items: center; gap: .4rem;
}
.nav-user::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 8px var(--cyan);
}

/* ---------------- Layout ---------------- */
.page { max-width: 1180px; margin: 0 auto; padding: 2rem 1.5rem 3rem; }
.page-head { margin-bottom: 1.4rem; }
.page-head h1 {
  font-family: var(--display); font-weight: 800; font-size: 1.7rem;
  letter-spacing: -.01em; margin: 0;
}
.page-head .sub { color: var(--muted); font-size: .95rem; margin-top: .25rem; }
.eyebrow {
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--blue); font-weight: 700;
}

/* ---------------- Cards ---------------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  animation: rise .5s cubic-bezier(.2,.8,.25,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.card-head {
  padding: 1.05rem 1.3rem; border-bottom: 1px solid var(--line);
  font-family: var(--display); font-weight: 700; font-size: 1.02rem;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
.card-head .hint { font-family: var(--sans); font-weight: 400; font-size: .8rem; color: var(--muted); }
.card-body { padding: 1.3rem; }

/* ---------------- Botones ---------------- */
.btn {
  --c: var(--navy);
  font-family: var(--sans); font-weight: 600; font-size: .92rem;
  border: none; border-radius: 11px; padding: .6rem 1.15rem;
  display: inline-flex; align-items: center; gap: .45rem;
  cursor: pointer; transition: transform .12s, box-shadow .2s, background .2s; color: #fff;
}
.btn:active { transform: translateY(1px); }
.btn-navy   { background: var(--navy); box-shadow: 0 10px 20px -10px var(--navy); }
.btn-navy:hover   { background: #284a8c; color: #fff; }
.btn-cyan   { background: var(--cyan); color: #0a3b3e; box-shadow: 0 10px 20px -10px var(--cyan); }
.btn-cyan:hover   { background: #45b6bc; color: #0a3b3e; }
.btn-orange { background: var(--orange); box-shadow: 0 10px 20px -10px var(--orange); }
.btn-orange:hover { background: #e06f23; color: #fff; }
.btn-ghost  { background: transparent; color: var(--slate); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover  { background: #f4f6fa; color: var(--navy); }
.btn-danger-soft { background: #fff; color: #c43b2f; box-shadow: inset 0 0 0 1.5px #f3c6c1; }
.btn-danger-soft:hover { background: #fdecea; color: #b5342a; }
.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: .8rem 1.4rem; font-size: 1rem; }

/* ---------------- Auth · split screen ---------------- */
.auth-body { background: var(--navy-d); }
.auth-split {
  min-height: 100vh;
  display: grid; grid-template-columns: 1.04fr .96fr;
}

/* --- Panel izquierdo (hero) --- */
.auth-left {
  position: relative; overflow: hidden; color: #fff;
  padding: 3.5rem 3.2rem; display: flex; flex-direction: column;
  background:
    radial-gradient(620px 420px at 88% 6%, rgba(84,198,204,.22), transparent 62%),
    radial-gradient(560px 460px at 6% 96%, rgba(238,126,52,.20), transparent 60%),
    linear-gradient(155deg, #16294f 0%, var(--navy) 58%, #29508f 100%);
  border-right: 3px solid var(--orange);
}
.auth-left::after { /* malla de puntos */
  content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 26px 26px; mask-image: linear-gradient(160deg, #000, transparent 75%);
}
.math-motif {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  font-family: var(--display); font-weight: 700; color: #fff; line-height: 1;
}
.math-motif span { position: absolute; opacity: .05; user-select: none; }
.math-motif span:nth-child(1){ top:8%;  right:10%; font-size:8rem; }
.math-motif span:nth-child(2){ top:38%; left:-1%;  font-size:11rem; opacity:.04; }
.math-motif span:nth-child(3){ bottom:6%; right:18%; font-size:9rem; }
.math-motif span:nth-child(4){ top:62%; right:4%;  font-size:6rem; }
.math-motif span:nth-child(5){ bottom:24%; left:8%; font-size:5rem; opacity:.06; }

.auth-left-inner { position: relative; z-index: 1; margin-top: auto; margin-bottom: auto; max-width: 510px; }
.auth-left .emblem {
  width: 86px; height: 86px; object-fit: contain;
  filter: drop-shadow(0 14px 28px rgba(0,0,0,.45)); margin-bottom: 1.6rem;
}
.brand-line {
  font-size: .84rem; letter-spacing: .26em; text-transform: uppercase;
  color: var(--cyan); font-weight: 700; margin-bottom: 1rem;
}
.auth-left h1 {
  font-family: var(--display); font-weight: 900; font-size: 3.7rem;
  line-height: .98; letter-spacing: -.02em; margin: 0;
}
.auth-left h1 .accent { color: var(--orange); }
.auth-left .lead { color: rgba(255,255,255,.82); font-size: 1.18rem; line-height: 1.5; margin: 1.2rem 0 2rem; max-width: 32ch; }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: .85rem; }
.auth-points li { display: flex; align-items: center; gap: .8rem; font-size: 1.05rem; color: rgba(255,255,255,.92); }
.auth-points li i {
  flex: none; width: 25px; height: 25px; border-radius: 8px; display: grid; place-items: center;
  background: rgba(84,198,204,.18); color: var(--cyan); font-style: normal; font-weight: 800; font-size: .82rem;
}
.auth-left-foot {
  position: relative; z-index: 1; margin-top: 2.6rem;
  font-size: .85rem; letter-spacing: .04em; color: rgba(255,255,255,.6);
}

/* --- Panel derecho (formulario) --- */
.auth-right {
  background: #fff; display: flex; align-items: center; justify-content: center;
  padding: 3rem 2.5rem;
}
.auth-form-wrap { width: 100%; max-width: 390px; animation: rise .5s cubic-bezier(.2,.8,.25,1) both; }
.auth-form-wrap .eyebrow { display: block; margin-bottom: .5rem; }
.auth-form-wrap h2 {
  font-family: var(--display); font-weight: 800; font-size: 1.9rem; letter-spacing: -.01em; margin: 0 0 .35rem;
}
.auth-form-wrap .muted { color: var(--muted); font-size: .94rem; margin: 0 0 1.8rem; }
.auth-form-wrap .mb-3 { margin-bottom: 1.15rem; }

@media (max-width: 920px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-left {
    padding: 2.4rem 1.7rem; border-right: none; border-bottom: 3px solid var(--orange);
  }
  .auth-left .emblem { width: 64px; height: 64px; margin-bottom: 1.1rem; }
  .auth-left h1 { font-size: 2.6rem; }
  .auth-left .lead { margin: .9rem 0 1.2rem; }
  .auth-points, .auth-left-foot { display: none; }
  .auth-right { padding: 2.4rem 1.7rem; }
}

/* Formularios */
.field-hint { display: block; margin-top: .4rem; font-size: .8rem; color: var(--muted); }
.form-label {
  font-weight: 600; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--slate); margin-bottom: .4rem;
}
.form-control {
  border-radius: 9px; border: 1.5px solid var(--line); padding: .8rem .9rem;
  font-family: var(--sans); font-size: .95rem; background: #fbfcfe; transition: .18s;
}
.form-control:focus {
  border-color: var(--cyan); background: #fff;
  box-shadow: 0 0 0 4px rgba(84,198,204,.18); outline: none;
}
.auth-foot { text-align: left; font-size: .9rem; margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); color: var(--muted); }
.auth-foot a { color: var(--navy); font-weight: 700; }

/* Botón con esquinas más definidas en el login */
.auth-form-wrap .btn { border-radius: 9px; }
.auth-form-wrap .btn-navy {
  background: linear-gradient(100deg, var(--navy), #2a4f95);
  box-shadow: 0 14px 26px -12px rgba(32,61,118,.8); transition: transform .14s, box-shadow .2s, filter .2s;
}
.auth-form-wrap .btn-navy:hover { filter: brightness(1.08); box-shadow: 0 18px 30px -12px rgba(32,61,118,.9); }

.alert-soft {
  border: none; border-radius: 11px; padding: .7rem .9rem; font-size: .9rem;
  background: #fdecea; color: #b5342a; border-left: 3px solid var(--orange);
}

/* ---------------- Stats ---------------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; position: relative; overflow: hidden; box-shadow: var(--shadow-sm);
  animation: rise .5s both;
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent, var(--navy));
}
.stat .num { font-family: var(--display); font-weight: 800; font-size: 2rem; line-height: 1; color: var(--ink); }
.stat .lbl { font-size: .82rem; color: var(--muted); margin-top: .35rem; }
.stat.c-navy   { --accent: var(--navy);   } .stat.c-navy .num   { color: var(--navy); }
.stat.c-cyan   { --accent: var(--cyan);   } .stat.c-cyan .num   { color: #2c8f95; }
.stat.c-slate  { --accent: var(--slate);  } .stat.c-slate .num  { color: var(--slate); }
.stat.c-orange { --accent: var(--orange); } .stat.c-orange .num { color: var(--orange); }
.stat.c-blue   { --accent: var(--blue);   } .stat.c-blue .num   { color: var(--blue); }

/* ---------------- Checklist materias ---------------- */
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.check-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .6rem .85rem; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; cursor: pointer; transition: .15s;
}
.check-item:hover { border-color: var(--cyan); background: #f3fdfd; }
.check-item input { width: 18px; height: 18px; accent-color: var(--navy); flex: none; }
.check-item:has(input:checked) {
  border-color: var(--navy); background: linear-gradient(0deg, #f5f8ff, #fff);
  box-shadow: inset 0 0 0 1px rgba(32,61,118,.15);
}
.check-item .ci-name { font-size: .92rem; }
.check-item:has(input:checked) .ci-name { font-weight: 600; color: var(--navy); }
.check-item .ci-cr { margin-left: auto; font-size: .78rem; color: var(--muted); flex: none; }

/* ---------------- Ruta por semestre ---------------- */
.sem-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: .9rem; box-shadow: var(--shadow-sm); }
.sem-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem 1rem; color: #fff; font-family: var(--display); font-weight: 700;
  background: linear-gradient(100deg, var(--navy), #2c5197);
}
.sem-head .pill {
  font-family: var(--sans); font-weight: 600; font-size: .76rem;
  background: rgba(255,255,255,.18); padding: .2rem .6rem; border-radius: 999px;
}
.sem-body { background: #fff; }
.sem-row {
  display: flex; align-items: center; gap: .6rem; padding: .55rem 1rem;
  border-bottom: 1px solid #f1f4f9; font-size: .92rem;
}
.sem-row:last-child { border-bottom: none; }
.sem-row::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); flex: none; }
.sem-row .cr { margin-left: auto; color: var(--muted); font-size: .82rem; }

/* ---------------- Badges de estado ---------------- */
.estado {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .75rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
}
.estado::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.estado.aceptada    { background: #e4f7f0; color: #0c8a5b; }
.estado.no_aceptada { background: #fde7e4; color: #c43b2f; }
.estado.borrador    { background: #fff1da; color: #b5740a; }
.estado.sin         { background: #eef1f6; color: var(--slate); }

/* ---------------- Tags ---------------- */
.tag {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .28rem .6rem; margin: .15rem; border-radius: 9px;
  font-size: .82rem; background: #eef3fb; color: var(--slate);
}
.tag.ok { background: #e4f7f0; color: #0c8a5b; }
.tag.ok::before { content: "✓"; font-weight: 700; }

/* ---------------- Info list ---------------- */
.howto { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.howto li {
  position: relative; padding: 0 0 .9rem 2.2rem; color: var(--muted); font-size: .9rem;
}
.howto li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -2px; width: 26px; height: 26px;
  display: grid; place-items: center; border-radius: 8px;
  background: var(--navy); color: #fff; font-family: var(--display); font-weight: 700; font-size: .82rem;
}
.howto li:nth-child(2)::before { background: var(--blue); }
.howto li:nth-child(3)::before { background: var(--cyan); color: #0a3b3e; }
.howto li:nth-child(4)::before { background: var(--orange); }

/* ---------------- Tabla admin ---------------- */
.table-card { overflow: hidden; }
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl thead th {
  text-align: left; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; padding: .8rem 1rem; background: #f7f9fc;
  border-bottom: 1px solid var(--line);
}
table.tbl tbody td { padding: .85rem 1rem; border-bottom: 1px solid #f1f4f9; vertical-align: middle; }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr { transition: background .15s; }
table.tbl tbody tr:hover { background: #f6f9fe; }
.avatar {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: grid; place-items: center; color: #fff; font-family: var(--display); font-weight: 700; font-size: .9rem;
  background: linear-gradient(135deg, var(--navy), var(--blue));
}

/* ---------------- Footer ---------------- */
.footer-note {
  text-align: center; color: var(--muted); font-size: .82rem; padding: 2rem 1rem 2.5rem;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
}
.footer-note .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }

/* ---------------- Buscador y paginación (admin) ---------------- */
.search-bar { display: flex; gap: .7rem; margin-bottom: 1.3rem; flex-wrap: wrap; }
.search-field {
  position: relative; flex: 1; min-width: 240px; display: flex; align-items: center;
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  box-shadow: 0 1px 2px rgba(24,45,87,.04);
  transition: border-color .15s, box-shadow .15s;
}
.search-field:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(84,198,204,.18);
}
.search-icon {
  width: 19px; height: 19px; margin-left: .9rem; flex: none;
  color: var(--muted); transition: color .15s;
}
.search-field:focus-within .search-icon { color: var(--navy); }
.search-input {
  flex: 1; width: 100%;
  border: 0; background: transparent; outline: none;
  padding: .8rem .9rem; font: inherit; color: var(--slate);
}
.search-input::placeholder { color: #9aa6b8; }
/* Oculta la X nativa del input[type=search] para usar la nuestra. */
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-clear {
  flex: none; display: grid; place-items: center;
  width: 26px; height: 26px; margin-right: .5rem; border-radius: 50%;
  color: var(--muted); font-size: 1.1rem; line-height: 1; text-decoration: none;
  transition: background .15s, color .15s;
}
.search-clear:hover { background: #f1f3f8; color: var(--navy); }
.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.3rem; }
.pager-info { color: var(--muted); font-size: .9rem; }
.btn.is-disabled { opacity: .45; pointer-events: none; }

/* ---------------- Utilidades ---------------- */
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.4rem; align-items: start; }
.mb-stats { margin-bottom: 1.4rem; }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }

@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .check-grid { grid-template-columns: 1fr; }
  .wordmark small { font-size: .55rem; }
  .wordmark strong { font-size: 1.1rem; }
  .nav-user { display: none; }
}
