/* ============================================================
   GARO — hoja de estilos
   ============================================================ */

:root {
  --brand:        #1d4ed8;
  --brand-600:    #2563eb;
  --brand-700:    #1d4ed8;
  --brand-050:    #eff4ff;

  --sidebar-bg:   #0f172a;
  --sidebar-bg-2: #1e293b;
  --sidebar-ink:  #cbd5e1;
  --sidebar-mut:  #64748b;

  --bg:           #f1f5f9;
  --surface:      #ffffff;
  --ink:          #0f172a;
  --ink-soft:     #475569;
  --muted:        #64748b;
  --line:         #e2e8f0;

  --ok:           #15803d;
  --err:          #b91c1c;
  --err-bg:       #fef2f2;
  --err-line:     #fecaca;

  --radius:       10px;
  --shadow-sm:    0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.04);
  --shadow-md:    0 4px 12px rgba(15,23,42,.08);
  --sidebar-w:    252px;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; }

.ic { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -3px; }

.logo {
  font-weight: 700; font-size: 20px; letter-spacing: .14em; color: #fff;
}
.logo__sub {
  display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--sidebar-mut); margin-top: 3px; font-weight: 500;
}

/* ---------- Login ---------------------------------------- */

body.auth {
  display: flex; align-items: center; justify-content: center;
  padding: 32px 16px;
  background:
    radial-gradient(1200px 600px at 15% -10%, #1e293b 0%, transparent 55%),
    radial-gradient(1000px 700px at 110% 120%, #1d4ed8 0%, transparent 45%),
    #0b1220;
}
.auth__wrap { width: 100%; max-width: 400px; }
.auth__card {
  background: var(--surface);
  border-radius: 14px;
  padding: 34px 32px 30px;
  box-shadow: 0 20px 50px rgba(2,6,23,.45);
}
.auth__brand { text-align: center; margin-bottom: 22px; }
.auth__brand .logo { color: var(--brand-700); }
.auth__brand .logo__sub { color: var(--muted); }
.auth__title { font-size: 19px; font-weight: 650; text-align: center; }
.auth__hint { text-align: center; color: var(--muted); margin: 4px 0 22px; font-size: 13px; }
.auth__foot {
  margin: 18px 0 0; text-align: center; color: #94a3b8; font-size: 12px;
}
.auth__foot .ic { width: 14px; height: 14px; }

/* ---------- Formularios --------------------------------- */

.form .field { margin-bottom: 15px; }
.form label,
.field > label {
  display: block; font-weight: 600; font-size: 12.5px;
  color: var(--ink-soft); margin-bottom: 6px;
}
input[type=text], input[type=password], .campo {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  font: inherit; color: var(--ink); background: #fff;
  transition: border-color .12s, box-shadow .12s;
}
input[type=text]:focus, input[type=password]:focus, .campo:focus {
  outline: none; border-color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.check {
  display: flex; align-items: center; gap: 9px;
  font-weight: 500; font-size: 13px; color: var(--ink-soft);
  margin: 14px 0 20px; cursor: pointer;
}
.check input { width: 16px; height: 16px; accent-color: var(--brand-600); }

.err { color: var(--err); font-size: 12.5px; margin: 5px 0 0; }
.alerta {
  background: var(--err-bg); border: 1px solid var(--err-line); color: var(--err);
  padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 13px;
}
.alerta p { margin: 0; }

/* ---------- Botones ------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border: 1px solid transparent; border-radius: 8px;
  font: inherit; font-weight: 600; cursor: pointer;
}
.btn--primary { background: var(--brand-600); color: #fff; }
.btn--primary:hover { background: var(--brand-700); text-decoration: none; }
.btn--block { width: 100%; }

/* ---------- Layout de la app --------------------------- */

.nav-toggle { position: absolute; }
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex: none;
  background: linear-gradient(180deg, var(--sidebar-bg), #0b1220);
  color: var(--sidebar-ink);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar__brand {
  padding: 22px 22px 18px; border-bottom: 1px solid rgba(148,163,184,.12);
}
.nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.nav__group {
  margin: 16px 12px 6px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase; color: var(--sidebar-mut);
}
.nav__group:first-child { margin-top: 6px; }
.nav__item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--sidebar-ink); font-weight: 500; font-size: 13.5px;
  border-left: 3px solid transparent;
}
.nav__item:hover { background: rgba(148,163,184,.10); text-decoration: none; color: #fff; }
.nav__item.is-active {
  background: rgba(37,99,235,.18); color: #fff;
  border-left-color: var(--brand-600);
}
.nav__item .ic { color: inherit; opacity: .9; }

.sidebar__foot {
  padding: 14px; border-top: 1px solid rgba(148,163,184,.12);
  display: flex; flex-direction: column; gap: 10px;
}
.userbox { display: flex; align-items: center; gap: 10px; }
.userbox__avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--brand-600); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.userbox__meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.userbox__meta strong { color: #fff; font-size: 13.5px; }
.userbox__meta small { color: var(--sidebar-mut); font-size: 11.5px; }
.sidebar__link { color: #93c5fd; font-size: 12px; }
.btn-logout {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 12px; border: 1px solid rgba(148,163,184,.20);
  background: transparent; color: var(--sidebar-ink);
  border-radius: 8px; font: inherit; font-weight: 500; font-size: 13px; cursor: pointer;
}
.btn-logout:hover { background: rgba(148,163,184,.10); color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 0 28px; height: 60px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.topbar__title { font-size: 16px; font-weight: 650; }
.topbar__burger { display: none; cursor: pointer; color: var(--ink-soft); }

.content { padding: 28px; max-width: 1080px; width: 100%; }
.lead { color: var(--ink-soft); margin: 0 0 22px; font-size: 15px; }

/* ---------- Tarjetas de módulos ------------------------ */

.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px; margin-bottom: 26px;
}
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card--link {
  display: flex; align-items: center; gap: 13px; padding: 16px;
  color: var(--ink);
}
.card--link:hover {
  text-decoration: none; border-color: #c7d2fe;
  box-shadow: var(--shadow-md); transform: translateY(-1px);
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.card__icon {
  width: 40px; height: 40px; border-radius: 9px; flex: none;
  background: var(--brand-050); color: var(--brand-700);
  display: flex; align-items: center; justify-content: center;
}
.card__body { display: flex; flex-direction: column; line-height: 1.35; flex: 1; min-width: 0; }
.card__body strong { font-size: 14px; }
.card__body small { color: var(--muted); font-size: 12px; }
.card__go { color: var(--muted); }

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm);
}
.panel h2 { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.panel p { margin: 0; color: var(--ink-soft); }

/* ---------- Cabecera + estado vacío de sección --------- */

.section-head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 22px;
}
.section-head__icon {
  width: 46px; height: 46px; border-radius: 10px; flex: none;
  background: var(--brand-050); color: var(--brand-700);
  display: flex; align-items: center; justify-content: center;
}
.section-head__icon .ic { width: 22px; height: 22px; }
.section-head h2 { font-size: 18px; font-weight: 700; }
.muted { color: var(--muted); font-size: 12.5px; margin: 2px 0 0; }

.empty {
  background: var(--surface); border: 1px dashed #cbd5e1;
  border-radius: var(--radius); padding: 40px 28px; text-align: center;
}
.empty__title { font-weight: 700; font-size: 15px; margin: 0 0 6px; }
.empty__text { color: var(--ink-soft); margin: 0 auto; max-width: 420px; }

/* ---------- Mensajes ----------------------------------- */

.messages { list-style: none; margin: 0; padding: 16px 28px 0; }
.msg { padding: 10px 14px; border-radius: 8px; background: var(--brand-050); font-size: 13px; }
.msg--error { background: var(--err-bg); color: var(--err); }
.msg--success { background: #f0fdf4; color: var(--ok); }

/* ---------- Responsive --------------------------------- */

@media (max-width: 860px) {
  .sidebar {
    position: fixed; z-index: 40; left: 0; top: 0;
    transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: 0 0 40px rgba(2,6,23,.4);
  }
  .nav-toggle:checked ~ .layout .sidebar { transform: translateX(0); }
  .nav-toggle:checked ~ .layout .scrim {
    position: fixed; inset: 0; z-index: 30; background: rgba(2,6,23,.45);
  }
  .topbar__burger { display: inline-flex; }
  .content { padding: 20px 16px; }
  .topbar { padding: 0 16px; }
}

@media (min-width: 861px) {
  .scrim { display: none; }
}
