/* ================= Tokens ================= */
:root {
  /* superficies y tinta (light) */
  --ink: #14171F;            /* topbar */
  --ink-2: #1B1F29;
  --bg: #F7F8FB;
  --bg-2: #EEF1F6;
  --panel: #FFFFFF;
  --panel-2: #F6F8FB;        /* hover sutil / cajas internas */
  --line: #EDF0F4;
  --line-2: #DCE1E9;

  /* marca / semánticos */
  --primary: #3D5AFE;
  --primary-ink: #2C3FB0;
  --primary-soft: #ECEFFF;
  --accent: #B45309;         /* ámbar CTA/realce (AA sobre blanco) */
  --accent-soft: #FBF1DE;
  --hi: #15824B;  --hi-soft: #E5F4EC;
  --mid: #B0700C; --mid-soft: #FBF1DE;
  --lo: #C8322F;  --lo-soft: #FBE8E8;

  /* texto */
  --text: #181C25;
  --muted: #5B6473;
  --on-dark-dim: #c2c8d4;
  --on-dark-mute: #9aa3b5;

  /* skeleton */
  --skel: #E7ECF3;
  --skel-hi: #F2F5F9;

  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20,23,31,.04);
  --shadow-lg: 0 12px 40px rgba(20,23,31,.12);
  --sidebar-w: 248px;
  --ring: 0 0 0 3px color-mix(in srgb, var(--primary) 35%, transparent);

  --t-fast: .12s ease;
  --t: .18s ease;
}

/* dark — toggle manual */
:root[data-theme="dark"] {
  --ink: #0B0D12;
  --ink-2: #11141B;
  --bg: #0E1117;
  --bg-2: #141925;
  --panel: #161B24;
  --panel-2: #1C222E;
  --line: #262D3A;
  --line-2: #313a4a;
  --primary: #6E86FF;
  --primary-ink: #AFC0FF;
  --primary-soft: #1B2440;
  --accent: #F0A94B;
  --accent-soft: #2C2415;
  --hi: #4ED08A;  --hi-soft: #13301F;
  --mid: #E0A94A; --mid-soft: #2C2415;
  --lo: #F2756F;  --lo-soft: #341B1B;
  --text: #E6EAF2;
  --muted: #9AA4B5;
  --on-dark-dim: #c2c8d4;
  --on-dark-mute: #9aa3b5;
  --skel: #1F2632;
  --skel-hi: #2A3340;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.45);
  --shadow-lg: 0 10px 34px rgba(0,0,0,.6);
}

/* dark — preferencia del sistema (si no hay override manual) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #0B0D12;
    --ink-2: #11141B;
    --bg: #0E1117;
    --bg-2: #141925;
    --panel: #161B24;
    --panel-2: #1C222E;
    --line: #262D3A;
    --line-2: #313a4a;
    --primary: #6E86FF;
    --primary-ink: #AFC0FF;
    --primary-soft: #1B2440;
    --accent: #F0A94B;
    --accent-soft: #2C2415;
    --hi: #4ED08A;  --hi-soft: #13301F;
    --mid: #E0A94A; --mid-soft: #2C2415;
    --lo: #F2756F;  --lo-soft: #341B1B;
    --text: #E6EAF2;
    --muted: #9AA4B5;
    --skel: #1F2632;
    --skel-hi: #2A3340;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.45);
    --shadow-lg: 0 10px 34px rgba(0,0,0,.6);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--t), color var(--t);
}
a { color: var(--primary-ink); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* icono inline */
.ic { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* skip link accesible */
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 200;
  background: var(--primary); color: #fff; padding: 9px 14px; border-radius: 8px;
  font-size: 14px; font-weight: 600; transition: top var(--t);
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Shell + barra lateral ---------- */
.shell { display: flex; min-height: 100dvh; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  position: sticky; top: 0; height: 100dvh;
  background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 14px;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: -.02em; padding: 6px 8px 14px; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #7B5BFF);
  display: grid; place-items: center; color: #fff;
  font-family: var(--mono); font-size: 15px; font-weight: 700;
}
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }

.sidenav { display: flex; flex-direction: column; gap: 18px; margin-top: 4px; flex: 1; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-label {
  font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); padding: 4px 10px 6px;
}
.sidenav button,
.sidenav a {
  display: flex; align-items: center; gap: 11px;
  background: transparent; border: 0; color: var(--text); text-align: left;
  padding: 9px 11px; border-radius: 10px; font-size: 14px; font-weight: 500; width: 100%;
  transition: background-color var(--t-fast), color var(--t-fast);
  text-decoration: none; cursor: pointer;
}
.sidenav button .ni,
.sidenav a .ni { display: inline-flex; color: var(--muted); transition: color var(--t-fast); }
.sidenav button:hover,
.sidenav a:hover { background: var(--panel-2); }
.sidenav button.active { background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }
.sidenav button.active .ni { color: var(--primary-ink); }

.side-portal {
  display: flex; align-items: center; gap: 7px; justify-content: center;
  font-size: 13px; color: var(--muted); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 9px 12px; margin-top: 4px;
  transition: border-color var(--t-fast), color var(--t-fast);
}
.side-portal:hover { border-color: var(--primary); color: var(--primary-ink); }

.user-menu {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  padding-top: 12px; border-top: 1px solid var(--line);
}
.user-chip { flex: 1; display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: 13.5px; font-weight: 600; min-width: 0; }
.user-chip .ic { color: var(--muted); }
.user-chip .uname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn {
  background: transparent; border: 1px solid var(--line-2); color: var(--muted);
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0;
  transition: border-color var(--t-fast), color var(--t-fast);
}
.logout-btn:hover { border-color: var(--lo); color: var(--lo); }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- Topbar slim (área de contenido) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  padding: 0 28px; height: 60px; display: flex; align-items: center; gap: 16px;
}
.topbar .spacer { flex: 1; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  background: var(--panel); border: 1px solid var(--line-2); color: var(--text);
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  transition: border-color var(--t-fast), background-color var(--t-fast);
}
.icon-btn:hover { border-color: var(--primary); background: var(--panel-2); }

/* ---------- Barra lateral responsiva ---------- */
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: auto; height: auto; position: sticky; top: 0; z-index: 50;
    flex-direction: row; align-items: center; gap: 8px;
    padding: 10px 14px; overflow-x: auto;
  }
  .brand { padding: 0 6px 0 0; }
  .brand span:not(.mark) { display: none; }
  .sidenav { flex-direction: row; gap: 6px; margin-top: 0; align-items: center; }
  .nav-group { flex-direction: row; align-items: center; gap: 4px; }
  .nav-group-label { display: none; }
  .sidenav button { white-space: nowrap; padding: 8px 12px; }
  .sidenav button .ni { display: none; }
  .side-portal { display: none; }
  .user-menu { margin: 0 0 0 auto; padding: 0; border: 0; }
  .user-chip .uname { display: none; }
}

/* ---------- Notificaciones ---------- */
.bell { position: relative; }
.bell-count {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px;
  background: var(--lo); color: #fff; border-radius: 9px; font-size: 11px;
  font-weight: 700; display: grid; place-items: center; padding: 0 5px; border: 2px solid var(--bg);
}
.notif-panel {
  position: absolute; right: 0; top: 48px; width: 340px; max-width: 92vw;
  background: var(--panel); color: var(--text); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); border: 1px solid var(--line); overflow: hidden;
  display: none; transform-origin: top right;
}
.notif-panel.open { display: block; animation: pop .16s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }
.notif-head { display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 600; }
.notif-head button { background: none; border: 0; color: var(--primary-ink); font-size: 13px; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background-color var(--t-fast); }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--panel-2); }
.notif-item.unread { background: var(--primary-soft); }
.notif-item .t { font-weight: 600; font-size: 13.5px; }
.notif-item .m { color: var(--muted); font-size: 13px; }
.notif-item .d { color: var(--muted); opacity: .8; font-size: 11px; margin-top: 3px; }
.notif-empty { padding: 28px 14px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- Layout ---------- */
.wrap { max-width: 1120px; margin: 0 auto; width: 100%; padding: 36px 28px 96px; }
.view { display: none; }
.view.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; letter-spacing: -.025em; margin: 0; font-weight: 650; }
.page-head .sub { color: var(--muted); font-size: 14px; }
.page-head .spacer { flex: 1; }
@media (max-width: 860px) { .wrap { padding: 22px 16px 72px; } .page-head h1 { font-size: 22px; } }

/* ---------- Botones ---------- */
.btn {
  border: 1px solid var(--line-2); background: var(--panel); color: var(--text);
  padding: 9px 15px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: border-color var(--t-fast), background-color var(--t-fast), transform var(--t-fast);
}
.btn:hover { border-color: #b9c1cd; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-ink); border-color: var(--primary-ink); }
.btn-danger { color: var(--lo); border-color: color-mix(in srgb, var(--lo) 40%, var(--line-2)); }
.btn-danger:hover { background: var(--lo-soft); border-color: var(--lo); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn .spin { width: 15px; height: 15px; }

/* spinner */
.spin {
  display: inline-block; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);     margin-bottom: 2em;}
.grid { display: grid; gap: 20px; }
.metrics { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 28px; gap: 16px; }
.metric { padding: 22px; position: relative; overflow: hidden; }
.metric .label { color: var(--muted); font-size: 12.5px; font-weight: 500; letter-spacing: .02em; display: flex; align-items: center; gap: 8px; }
.metric .label .ic { color: var(--muted); }
.metric .num { font-size: 32px; font-weight: 650; letter-spacing: -.03em; margin-top: 10px; font-variant-numeric: tabular-nums; }
.metric .num small { font-size: 14px; color: var(--muted); }

/* pipeline mini */
.pipeline-bar { padding: 24px; }
.pipeline-bar h3 { margin: 0 0 16px; font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: .03em; }
.pipe-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pipe-chip { flex: 1; min-width: 110px; border: 1px solid var(--line); border-radius: 12px; padding: 14px 12px; text-align: center; background: var(--panel-2); }
.pipe-chip .n { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.pipe-chip .l { font-size: 12px; color: var(--muted); }

/* ---------- Lista de requisiciones ---------- */
.req-grid { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.req-card { padding: 22px; cursor: pointer; transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast); }
.req-card:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.req-card:focus-visible { border-color: var(--primary); box-shadow: var(--ring); }
.req-card h3 { margin: 0 0 4px; font-size: 17px; letter-spacing: -.01em; }
.req-card .meta { color: var(--muted); font-size: 13px; }
.req-card .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.req-card .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.tag { font-size: 11.5px; padding: 3px 9px; border-radius: 20px; background: var(--bg-2); color: var(--muted); border: 1px solid var(--line); }
.status { font-size: 11.5px; padding: 3px 10px; border-radius: 20px; font-weight: 600; text-transform: capitalize; }
.status.abierta { background: var(--primary-soft); color: var(--primary-ink); }
.status.publicada { background: var(--hi-soft); color: var(--hi); }
.status.borrador, .status.cerrada { background: var(--bg-2); color: var(--muted); }
.cand-count { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Formulario ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 22px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.field label .hint { font-weight: 400; color: var(--muted); }
.field .req-star { color: var(--lo); margin-left: 2px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  font-size: 16px; font-family: inherit; background: var(--panel); color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
@media (min-width: 640px) { .field input, .field select, .field textarea { font-size: 14px; } }
.field textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); outline: none; box-shadow: var(--ring); }
.field .helper { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* ---------- Detalle requisición ---------- */
.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; align-items: start; }
.wide-grid { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; margin-top: 22px; }
.section { padding: 24px; }
.danger-zone { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.section h2 { margin: 0 0 6px; font-size: 16px; font-weight: 650; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.section .desc { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; }
/* respiro cuando un formulario/contenido va directo bajo el encabezado (sin .desc) */
.section h2 + .form-grid,
.section h2 + .cand-filters,
.section .sec-head + .form-grid,
.section h2 + .accept-row,
.section h2 + .audit-table,
.section h2 + div > .audit-table { margin-top: 18px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.skill-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.skill-pill { font-size: 12.5px; padding: 4px 10px; border-radius: 7px; background: var(--primary-soft); color: var(--primary-ink); }
.skill-pill.opt { background: var(--bg-2); color: var(--muted); }

/* recomendaciones de plataformas */
.plat { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.plat:last-child { border-bottom: 0; }
.plat input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; cursor: pointer; }
.plat .info { flex: 1; }
.plat .info .name { font-weight: 600; font-size: 14.5px; }
.plat .info .why { color: var(--muted); font-size: 12.5px; }
.prio { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: .03em; }
.prio.Alta { background: var(--hi-soft); color: var(--hi); }
.prio.Media { background: var(--mid-soft); color: var(--mid); }
.prio.Baja { background: var(--bg-2); color: var(--muted); }

/* ---------- Score dial ---------- */
.score-badge {
  font-family: var(--mono); font-weight: 700; font-size: 17px;
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  flex-shrink: 0; border: 2.5px solid; font-variant-numeric: tabular-nums;
}
.score-badge.alta { color: var(--hi); border-color: var(--hi); background: var(--hi-soft); }
.score-badge.revision { color: var(--mid); border-color: var(--mid); background: var(--mid-soft); }
.score-badge.descarte { color: var(--lo); border-color: var(--lo); background: var(--lo-soft); }

.reco-badge { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px; display: inline-flex; align-items: center; gap: 5px; }
.reco-badge.alta { background: var(--hi-soft); color: var(--hi); }
.reco-badge.revision { background: var(--mid-soft); color: var(--mid); }
.reco-badge.descarte { background: var(--lo-soft); color: var(--lo); }

/* segmented scale 1-10 */
.scale { display: flex; gap: 3px; margin: 10px 0 4px; }
.scale .seg { flex: 1; height: 26px; border-radius: 4px; display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; color: #fff; font-weight: 600; opacity: .35; transition: opacity var(--t); }
.scale .seg.z-lo { background: var(--lo); }
.scale .seg.z-mid { background: var(--mid); }
.scale .seg.z-hi { background: var(--hi); }
.scale .seg.on { opacity: 1; box-shadow: inset 0 0 0 2px rgba(0,0,0,.18); }
.scale-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.scale-legend span { display: inline-flex; align-items: center; gap: 5px; }
.scale-legend span::before { content: ""; width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.scale-legend .lo::before { background: var(--lo); }
.scale-legend .mid::before { background: var(--mid); }
.scale-legend .hi::before { background: var(--hi); }

/* ---------- Lista candidatos ---------- */
.cand-row { display: flex; align-items: center; gap: 14px; padding: 14px 10px; margin: 0 -10px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 8px; transition: background-color var(--t-fast); }
.cand-row:hover { background: var(--panel-2); }
.cand-row:focus-visible { background: var(--panel-2); box-shadow: var(--ring); }
.cand-row .who { flex: 1; min-width: 0; }
.cand-row .who .name { font-weight: 600; }
.cand-row .who .mail { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Detalle candidato ---------- */
.cand-head { display: flex; align-items: center; gap: 16px; padding: 20px; flex-wrap: wrap; }
.cand-head .big-score {
  width: 76px; height: 76px; border-radius: 16px; display: grid; place-items: center;
  font-family: var(--mono); font-weight: 700; font-size: 30px; border: 3px solid; font-variant-numeric: tabular-nums;
}
.cand-head .big-score.alta { color: var(--hi); border-color: var(--hi); background: var(--hi-soft); }
.cand-head .big-score.revision { color: var(--mid); border-color: var(--mid); background: var(--mid-soft); }
.cand-head .big-score.descarte { color: var(--lo); border-color: var(--lo); background: var(--lo-soft); }
.cand-head h1 { margin: 0; font-size: 21px; }
.cand-head .contact { color: var(--muted); font-size: 13.5px; }

.bd { display: grid; grid-template-columns: auto 1fr auto; gap: 10px 12px; align-items: center; font-size: 13.5px; }
.bd .lbl { color: var(--muted); }
.bd .bar { height: 8px; border-radius: 6px; background: var(--bg-2); overflow: hidden; }
.bd .bar > i { display: block; height: 100%; width: 100%; background: var(--primary); border-radius: 6px; transform: scaleX(0); transform-origin: left; transition: transform .5s cubic-bezier(.22,.61,.36,1); }
.bd .pct { font-family: var(--mono); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

.match-list { display: flex; flex-wrap: wrap; gap: 6px; }
.m-yes, .m-no { font-size: 12px; padding: 3px 9px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px; }
.m-yes { background: var(--hi-soft); color: var(--hi); }
.m-no { background: var(--lo-soft); color: var(--lo); }

/* pipeline selector */
.stages { display: flex; flex-wrap: wrap; gap: 6px; }
.stage-btn { border: 1px solid var(--line-2); background: var(--panel); padding: 7px 12px; border-radius: 20px; font-size: 13px; color: var(--muted); transition: all var(--t-fast); }
.stage-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.stage-btn:hover:not(.active) { border-color: #b9c1cd; color: var(--text); }

/* induccion */
.task { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task input { width: 19px; height: 19px; accent-color: var(--hi); cursor: pointer; }
.task label { font-size: 14px; cursor: pointer; }
.task.done label { color: var(--muted); text-decoration: line-through; }
.progress-wrap { margin-bottom: 14px; }
.progress { height: 8px; background: var(--bg-2); border-radius: 6px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 100%; background: var(--hi); transform: scaleX(0); transform-origin: left; transition: transform .5s cubic-bezier(.22,.61,.36,1); }

/* ---------- candidate portal (bolsa de trabajo) ---------- */
.cportal { max-width: 1000px; margin: 0 auto; padding: 32px 20px 90px; }

/* hero + buscador */
.job-hero {
  text-align: center; margin-bottom: 26px; padding: 30px 20px 6px;
}
.job-hero h1 { font-size: 32px; line-height: 1.15; letter-spacing: -.03em; margin: 0 0 8px; font-weight: 700; }
.job-hero p { color: var(--muted); margin: 0 0 20px; font-size: 15px; }
.job-search {
  display: flex; align-items: center; gap: 10px; max-width: 560px; margin: 0 auto 16px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 4px 18px; box-shadow: var(--shadow); transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.job-search:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.job-search .ic { color: var(--muted); flex-shrink: 0; }
.job-search input { flex: 1; border: 0; background: transparent; padding: 12px 0; font-size: 15px; color: var(--text); outline: none; }
.filter-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.filter-chips .chip {
  border: 1px solid var(--line-2); background: var(--panel); color: var(--muted);
  padding: 7px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  transition: all var(--t-fast);
}
.filter-chips .chip:hover { border-color: var(--primary); color: var(--primary-ink); }
.filter-chips .chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.results-head { margin: 6px 2px 14px; }
.results-count { color: var(--muted); font-size: 14px; font-weight: 500; }

/* lista y tarjetas de vacante */
.job-list { display: flex; flex-direction: column; gap: 12px; }
.job-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; cursor: pointer; display: flex; align-items: center; gap: 16px;
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.job-card:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.job-card:focus-visible { border-color: var(--primary); box-shadow: var(--ring); outline: none; }
a.job-card { text-decoration: none; color: inherit; }
.job-ic { width: 48px; height: 48px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-ink); display: grid; place-items: center; flex-shrink: 0; }
.job-main { flex: 1; min-width: 0; }
.job-main h3 { margin: 0 0 4px; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.job-sub { color: var(--muted); font-size: 13.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.jloc { display: inline-flex; align-items: center; gap: 3px; }
.jloc .ic { opacity: .8; }
.jtags { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 11px; }
.jchip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500;
  padding: 4px 10px; border-radius: 8px; background: var(--bg-2); color: var(--muted); border: 1px solid var(--line);
}
.jchip .ic { opacity: .85; }
.jchip.mod-presencial { background: var(--primary-soft); color: var(--primary-ink); border-color: transparent; }
.jchip.mod-remoto { background: var(--hi-soft); color: var(--hi); border-color: transparent; }
.jchip.mod-hibrido { background: var(--mid-soft); color: var(--mid); border-color: transparent; }
.job-go { color: var(--muted); flex-shrink: 0; transition: transform var(--t-fast), color var(--t-fast); }
.job-card:hover .job-go { color: var(--primary); transform: translate(2px, -2px); }

/* detalle de vacante */
.job-detail-head { margin: 6px 2px 20px; }
.job-detail-head h1 { font-size: 27px; letter-spacing: -.025em; margin: 0 0 12px; font-weight: 700; }
.job-layout { display: grid; grid-template-columns: 1fr 380px; gap: 22px; align-items: start; }
.job-desc h2 { font-size: 16px; font-weight: 650; margin: 0 0 12px; }
.apply-card { padding: 24px; position: sticky; top: 84px; }
.apply-card h2 { font-size: 18px; font-weight: 650; margin: 0 0 4px; letter-spacing: -.01em; }
.apply-card .apply-sub { font-size: 13px; margin: 0 0 16px; }
.apply-card .field { margin-bottom: 12px; }
.field-label { display: block; font-size: 13px; font-weight: 600; margin: 4px 0 6px; }
.field-label .req-star { color: var(--lo); margin-left: 2px; }
@media (max-width: 860px) {
  .job-layout { grid-template-columns: 1fr; }
  .apply-card { position: static; }
  .job-hero h1 { font-size: 26px; }
}

/* aviso de privacidad colapsable */
.privacy-det { margin: 4px 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.privacy-det summary { cursor: pointer; padding: 11px 14px; font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 7px; list-style: none; }
.privacy-det summary::-webkit-details-marker { display: none; }
.privacy-det summary .ic { color: var(--muted); }
.privacy-box { padding: 0 14px 14px; font-size: 12.5px; color: var(--muted); max-height: 180px; overflow-y: auto; line-height: 1.6; }
.accept-row { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); margin-bottom: 16px; cursor: pointer; transition: border-color var(--t-fast); }
.accept-row:hover { border-color: var(--primary); }
.accept-row input { width: 20px; height: 20px; accent-color: var(--primary); margin-top: 1px; cursor: pointer; flex-shrink: 0; }
.accept-row span { font-size: 13px; cursor: pointer; color: var(--muted); line-height: 1.5; }
.file-drop { width: 100%; border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 22px 18px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color var(--t-fast), background-color var(--t-fast), color var(--t-fast); display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 14px; }
.file-drop:hover, .file-drop.drag { border-color: var(--primary); color: var(--primary-ink); background: var(--primary-soft); }
.file-drop.drag { border-style: solid; }
.file-drop.has { border-style: solid; border-color: var(--hi); color: var(--hi); background: var(--hi-soft); }
.file-drop .drop-ic { color: inherit; }
.file-drop .fname { font-weight: 600; word-break: break-word; font-size: 14px; }
.file-drop .drop-hint { font-size: 12px; opacity: .85; }

.arco-form { max-width: 620px; margin: 0 auto; }

/* seguimiento de postulación */
.track-card { max-width: 640px; margin: 0 auto; }
.track-head { text-align: center; margin-bottom: 6px; }
.track-head h1 { font-size: 22px; margin: 10px 0 6px; letter-spacing: -.02em; }
.stepper { list-style: none; display: flex; padding: 0; margin: 26px 0 22px; }
.stepper .step { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; gap: 8px; }
.stepper .step::before { content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 2px; background: var(--line-2); z-index: 0; }
.stepper .step:first-child::before { display: none; }
.stepper .step.done::before, .stepper .step.current::before { background: var(--primary); }
.stepper .dot { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 2px solid var(--line-2); color: var(--muted); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stepper .step.done .dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.stepper .step.current .dot { border-color: var(--primary); color: var(--primary-ink); box-shadow: var(--ring); }
.stepper .slabel { font-size: 11.5px; color: var(--muted); text-align: center; }
.stepper .step.current .slabel, .stepper .step.done .slabel { color: var(--text); font-weight: 500; }
.track-status { text-align: center; background: var(--primary-soft); border-radius: 12px; padding: 16px; }
.track-status strong { font-size: 17px; color: var(--primary-ink); }
.track-status p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.track-status.exito { background: var(--hi-soft); }
.track-status.exito strong { color: var(--hi); }
.track-closed { display: flex; gap: 12px; align-items: flex-start; background: var(--bg-2); border-radius: 12px; padding: 16px; }
.track-closed .ic { color: var(--muted); flex-shrink: 0; margin-top: 2px; }
.track-closed strong { color: var(--text); }
.track-closed p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.track-meta { margin-top: 14px; padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.track-meta .ic { color: var(--primary-ink); }
.track-tip { margin-top: 16px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; justify-content: center; }

.ok-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.ok-hint { font-size: 12px; margin-top: 12px; }
.ok-box { text-align: center; padding: 56px 24px; max-width: 480px; margin: 40px auto 0; }
.ok-box .check { width: 76px; height: 76px; border-radius: 50%; background: var(--hi-soft); color: var(--hi); display: grid; place-items: center; margin: 0 auto 20px; animation: pop-in .35s cubic-bezier(.16,1,.3,1); }
.ok-box h1 { font-size: 23px; margin: 0 0 6px; letter-spacing: -.02em; }
.ok-box .ok-role { font-weight: 600; color: var(--primary-ink); margin: 0 0 10px; }
@keyframes pop-in { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- Skeletons ---------- */
.skeleton { position: relative; overflow: hidden; background: var(--skel); border-radius: 8px; }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--skel-hi), transparent);
  transform: translateX(-100%); animation: shimmer 1.3s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
.sk-line { height: 13px; margin-bottom: 9px; }
.sk-line.lg { height: 22px; }
.sk-line.w-40 { width: 40%; } .sk-line.w-60 { width: 60%; } .sk-line.w-80 { width: 80%; }

/* ---------- utils ---------- */
.muted { color: var(--muted); }
.empty { text-align: center; padding: 52px 20px; color: var(--muted); }
.empty .big { width: 56px; height: 56px; border-radius: 14px; background: var(--bg-2); color: var(--muted); display: grid; place-items: center; margin: 0 auto 14px; }
.empty .big .ic { width: 28px; height: 28px; }
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; }
.mt { margin-top: 18px; }
.back { background: none; border: 0; color: var(--muted); font-size: 14px; padding: 6px 8px 6px 0; margin-bottom: 8px; display: inline-flex; align-items: center; gap: 5px; border-radius: 6px; transition: color var(--t-fast); }
.back:hover { color: var(--text); }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--ink-2); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px;
  box-shadow: var(--shadow-lg); z-index: 100; opacity: 0; transition: opacity var(--t), transform var(--t);
  pointer-events: none; display: flex; align-items: center; gap: 9px; max-width: 92vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .ic { color: var(--primary); }
.toast.ok .ic { color: var(--hi); }
.toast.err .ic { color: var(--lo); }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .topbar nav button { padding: 8px 10px; font-size: 13px; }
  .topbar nav { margin-left: 0; }
  .brand small { display: none; }
  .ghost-link span.txt { display: none; }
  .topbar-inner { gap: 10px; }
}
@media (max-width: 560px) {
  .topbar nav { display: none; }
  .wrap { padding: 18px 14px 80px; }
}

/* ---------- ARCO y auditoría ---------- */
.arco-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.arco-foot {
  margin-top: 22px; padding: 14px 16px; border: 1px dashed var(--line-2);
  border-radius: var(--radius); background: var(--panel-2); color: var(--muted);
  font-size: 13.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.status.pendiente { background: var(--mid-soft); color: var(--mid); }
.status.en_proceso { background: var(--primary-soft); color: var(--primary-ink); }
.status.resuelta { background: var(--hi-soft); color: var(--hi); }
.status.aprobada { background: var(--hi-soft); color: var(--hi); }
.status.rechazada { background: var(--lo-soft); color: var(--lo); }
.status.no_enviada { background: var(--panel-2); color: var(--muted); }

/* barra de aprobación en el detalle de la requisición */
.approval-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px;
}
.approval-bar .row-gap { display: flex; gap: 8px; flex-wrap: wrap; }
.audit-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.audit-table th, .audit-table td { text-align: left; padding: 12px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.audit-table th:first-child, .audit-table td:first-child { padding-left: 2px; }
.audit-table th { color: var(--muted); font-weight: 600; white-space: nowrap; }

/* ---------- Usuarios / Configuración ---------- */
.u-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.audit-table select { padding: 5px 8px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--panel); color: var(--text); font-size: 13px; }
.sw { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.audit-table td { vertical-align: middle; }

/* ---------- Candidatos: filtros + paginación ---------- */
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cand-filters { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.inline-search { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 200px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 0 12px; background: var(--panel); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.inline-search:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.inline-search .ic { color: var(--muted); }
.inline-search input { flex: 1; border: 0; background: transparent; padding: 10px 0; font-size: 14px; color: var(--text); outline: none; }
.cand-filters select { padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--panel); color: var(--text); font-size: 14px; }
.cand-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* ---------- Gráficas (tablero) ---------- */
.charts-grid { grid-template-columns: repeat(2, 1fr); }
.chart-card h3 { margin: 0 0 14px; font-size: 13px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.chart-card h3 .ic { color: var(--muted); }
.chart-wide { grid-column: 1 / -1; }
@media (max-width: 760px) { .charts-grid { grid-template-columns: 1fr; } .chart-wide { grid-column: auto; } }

.hbars { display: flex; flex-direction: column; gap: 9px; }
.hbar-row { display: grid; grid-template-columns: 130px 1fr 34px; align-items: center; gap: 10px; font-size: 13px; }
.hbar-label { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { background: var(--bg-2); border-radius: 6px; height: 12px; overflow: hidden; }
.hbar-track > i { display: block; height: 100%; width: 100%; background: var(--primary); border-radius: 6px; transform: scaleX(0); transform-origin: left; transition: transform .4s ease; }
.hbar-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.donut-wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.donut { width: 140px; height: 140px; flex-shrink: 0; }
.donut-num { font-size: 26px; font-weight: 700; fill: var(--text); }
.donut-lbl { font-size: 10px; fill: var(--muted); }
.donut-legend { display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.donut-legend span { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.donut-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.donut-legend b { color: var(--text); margin-left: auto; font-variant-numeric: tabular-nums; }

.trend { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.trend-bar { flex: 1; height: 100%; background: var(--primary); border-radius: 3px 3px 0 0; opacity: .85; transform-origin: bottom; transition: transform .4s ease, opacity var(--t-fast); }
.trend-bar:hover { opacity: 1; }
.trend-axis { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11.5px; color: var(--muted); }

/* ---------- Scorecards ---------- */
.sc-summary { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 6px 0 12px; }
.sc-avg b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.sc-avg small { color: var(--muted); margin-left: 4px; }
.sc-tally { display: flex; gap: 6px; flex-wrap: wrap; }
.sc-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.sc-item { border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; background: var(--panel-2); }
.sc-top { display: flex; align-items: center; gap: 8px; }
.sc-top .sc-prom { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.sc-del { margin-left: auto; background: none; border: 0; color: var(--muted); padding: 2px; }
.sc-del:hover { color: var(--lo); }
.sc-crits { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--muted); }
.sc-crit b { color: var(--text); }
.sc-comment { font-size: 13px; margin: 8px 0 0; }
.sc-form { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.sc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sc-field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.sc-field select, .sc-form textarea { padding: 7px 9px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--text); font-size: 13px; font-family: inherit; }

/* ---------- 2FA ---------- */
.mfa-qr { width: 180px; height: 180px; margin: 8px 0; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; }
.mfa-qr svg { width: 100%; height: 100%; display: block; }
.mfa-key { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.mfa-key code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; font-family: var(--mono); color: var(--text); user-select: all; }

/* ---------- Análisis con IA ---------- */
.ai-card .ai-resumen { font-size: 14px; line-height: 1.6; margin: 4px 0 0; }
.ai-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ai-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .ai-cols { grid-template-columns: 1fr; } }
.ai-list { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--text); }
.ai-list li { margin: 3px 0; }
.ai-just { font-size: 12px; margin: 14px 0 0; border-top: 1px solid var(--line); padding-top: 10px; }

/* ---------- Kanban ---------- */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 14px; align-items: start; }
.kan-col { flex: 0 0 240px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; transition: background-color var(--t-fast), outline-color var(--t-fast); outline: 2px solid transparent; }
.kan-col.over { background: var(--primary-soft); outline-color: var(--primary); }
.kan-head { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 2px 4px 10px; text-transform: uppercase; letter-spacing: .03em; }
.kan-count { background: var(--panel); border: 1px solid var(--line-2); color: var(--text); border-radius: 20px; padding: 1px 8px; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.kan-body { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.kan-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 11px; cursor: grab; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; transition: border-color var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast); }
.kan-card:hover { border-color: var(--primary); }
.kan-card:focus-visible { border-color: var(--primary); box-shadow: var(--ring); outline: none; }
.kan-card.dragging { opacity: .45; }
.kan-top { display: flex; align-items: center; gap: 9px; }
.kan-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kan-empty { color: var(--muted); font-size: 12.5px; text-align: center; padding: 12px 0; }
.score-badge.sm { width: 30px; height: 30px; font-size: 13px; border-width: 2px; flex-shrink: 0; }

/* ---------- Contenido enriquecido (render) ---------- */
.rich { line-height: 1.6; }
.rich > *:first-child { margin-top: 0; }
.rich > *:last-child { margin-bottom: 0; }
.rich h1 { font-size: 1.3em; margin: .8em 0 .4em; }
.rich h2 { font-size: 1.15em; margin: .8em 0 .4em; }
.rich h3 { font-size: 1.05em; margin: .7em 0 .3em; }
.rich p { margin: .5em 0; }
.rich ul, .rich ol { margin: .5em 0; padding-left: 1.5em; }
.rich li { margin: .2em 0; }
.rich a { color: var(--primary-ink); text-decoration: underline; }
.rich blockquote {
  margin: .7em 0; padding: .3em 0 .3em 1em;
  border-left: 3px solid var(--line-2); color: var(--muted);
}
.rich pre {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 12px; overflow: auto;
  font-family: var(--mono); font-size: .9em;
}

/* ---------- Editor enriquecido (Trix) ---------- */
trix-editor.rich-editor {
  min-height: 140px; border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); background: var(--panel); color: var(--text);
  padding: 10px 12px; font-size: 14px;
}
trix-editor.rich-editor:focus-visible,
trix-editor.rich-editor:focus { border-color: var(--primary); box-shadow: var(--ring); outline: none; }
trix-editor.rich-editor:empty:not(:focus)::before { color: var(--muted); }
trix-toolbar { margin-bottom: 6px; }
/* No admitimos adjuntos en la requisición: ocultamos esos controles. */
trix-toolbar .trix-button-group--file-tools { display: none; }
trix-toolbar .trix-button {
  background: var(--panel-2); border-bottom: none;
}
:root[data-theme="dark"] trix-toolbar .trix-button { filter: invert(1) hue-rotate(180deg); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) trix-toolbar .trix-button { filter: invert(1) hue-rotate(180deg); }
}

/* ---------- Login ---------- */
.login-body { min-height: 100vh; display: grid; place-items: center; background: var(--bg-2); padding: 24px; }
.login-wrap { width: 100%; max-width: 400px; }
.login-card { padding: 30px 28px; box-shadow: var(--shadow-lg); }
.login-brand { margin-bottom: 18px; }
.login-card h1 { font-size: 22px; margin: 0 0 4px; }
.login-card .muted { margin: 0 0 18px; font-size: 14px; }
.login-card .field { margin-bottom: 14px; }
.login-card label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.login-card input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); font-family: inherit; font-size: 15px;
  background: var(--panel); color: var(--text);
}
.login-card input:focus-visible { border-color: var(--primary); box-shadow: var(--ring); outline: none; }
.login-error {
  background: var(--lo-soft); color: var(--lo); border: 1px solid var(--lo);
  border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13.5px; margin-bottom: 14px;
}
.login-foot { margin: 16px 0 0; text-align: center; font-size: 13px; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
