/* EDUSIFCOM · Sistema de gestión de capacitación.
   Diseño institucional sobrio con la identidad de EDUSIFCOM: azul marino del logo como color de marca, dorado solo como acento
   (elemento activo y foco), neutros con un leve tono verde, bordes finos en lugar de sombras,
   tipografía Source Sans 3 para la interfaz y Source Serif 4 para títulos.
   Modo oscuro: sigue al sistema y también a data-theme="dark"/"light" en la raíz. */

:root {
  /* Marca */
  --brand: #1a3a8f;
  --brand-deep: #13296b;
  --brand-ink: #0c1e5a;
  --brand-soft: #e6ecf8;
  --accent: #f1b908;
  --accent-soft: #fdf3d2;
  /* Neutros */
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --border: #dbe0ec;
  --border-strong: #c2cadc;
  --text: #161d33;
  --muted: #5b6480;
  --heading: #0c1e5a;
  --link: #1a3a8f;
  /* Estados */
  --ok: #1d7a4b; --ok-bg: #e2f2e8;
  --warn: #8a5a00; --warn-bg: #fbf1d9;
  --bad: #b3261e; --bad-bg: #fbe5e3;
  --info: #1f5f99; --info-bg: #e3edf8;
  /* Forma */
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-pop: 0 12px 32px rgba(12, 30, 90, .18);
  --font: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-title: "Source Serif 4", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-soft: #1b2752; --accent-soft: #3d3110;
    --bg: #0b1020; --surface: #121a30; --surface-2: #19223c; --border: #27324f; --border-strong: #36436a;
    --text: #e7eaf4; --muted: #a1a9c3; --heading: #f1f3fa; --link: #9db6f5;
    --ok: #74d3a0; --ok-bg: #173527; --warn: #f0c35a; --warn-bg: #3a3014; --bad: #ff978d; --bad-bg: #3d1d1a; --info: #8fc2f5; --info-bg: #182b3d;
    --shadow-pop: 0 12px 32px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand-soft: #1b2752; --accent-soft: #3d3110;
  --bg: #0b1020; --surface: #121a30; --surface-2: #19223c; --border: #27324f; --border-strong: #36436a;
  --text: #e7eaf4; --muted: #a1a9c3; --heading: #f1f3fa; --link: #9db6f5;
  --ok: #74d3a0; --ok-bg: #173527; --warn: #f0c35a; --warn-bg: #3a3014; --bad: #ff978d; --bad-bg: #3d1d1a; --info: #8fc2f5; --info-bg: #182b3d;
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 15px/1.5 var(--font); background: var(--bg); color: var(--text); }
h1, h2, h3, h4 { color: var(--heading); line-height: 1.25; margin: 0 0 .5em; text-wrap: balance; }
h1 { font: 600 1.6rem/1.2 var(--font-title); letter-spacing: -.01em; }
h2 { font-size: 1.15rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; margin-top: .4em; }
h4 { font-size: .9rem; font-weight: 600; margin: .9em 0 .3em; }
a { color: var(--link); text-underline-offset: 2px; }
code { font: .86em/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.pos { color: var(--ok); font-weight: 600; }
.neg { color: var(--bad); font-weight: 600; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; box-shadow: 0 0 0 4px var(--accent-soft); }

/* Iconos de línea */
.ico { width: 1.15em; height: 1.15em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 7px 14px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font: 600 .9rem/1.2 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-deep); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.btn-ghost-light { background: transparent; color: #d9e0f4; border-color: rgba(255,255,255,.25); }
.btn-ghost-light:hover { background: rgba(255,255,255,.08); color: #fff; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger-ghost { background: var(--surface); color: var(--bad); border-color: var(--bad); }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: .84rem; }
.btn-lg { min-height: 44px; padding: 10px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.icon-btn { background: none; border: 0; color: inherit; cursor: pointer; padding: 6px; display: inline-grid; place-items: center; font-size: 1.3rem; }

/* ---------- Acceso ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--surface); }
.auth-panel { background: var(--brand-ink); color: #dbe2f5; padding: 56px 40px 40px max(32px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; justify-content: center; gap: 14px;
  border-right: 4px solid var(--accent); }
.auth-logo { width: 112px; height: 112px; border-radius: 14px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255,255,255,.12); }
.auth-panel h1 { color: #fff; font-size: 1.9rem; max-width: 20ch; margin: 6px 0 0; }
.auth-panel .tagline { color: #bcc7e8; margin: 0; font-size: 1.05rem; }
.auth-points { list-style: none; padding: 18px 0 0; margin: 8px 0 0; border-top: 1px solid rgba(255,255,255,.14); display: grid; gap: 8px; max-width: 46ch; }
.auth-points li { padding-left: 18px; position: relative; color: #cfd7ef; }
.auth-points li::before { content: ""; position: absolute; left: 0; top: .6em; width: 7px; height: 7px; background: var(--accent); border-radius: 1px; }
.auth-card { padding: 48px max(32px, env(safe-area-inset-right, 0px)) 40px 32px; display: flex; flex-direction: column; justify-content: center; max-width: 480px; width: 100%; justify-self: center; }
.auth-heading { font: 600 1.35rem var(--font-title); margin-bottom: 18px; }
.auth-foot { margin: 16px 0 0; font-size: .9rem; color: var(--muted); }
.or { text-align: center; color: var(--muted); margin: 12px 0; font-size: .85rem; }
.test-accounts { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.test-accounts p { margin: 0 0 8px; font-size: .85rem; color: var(--muted); }
.test-list { display: grid; gap: 6px; }
.test-acc { display: grid; grid-template-columns: 112px 1fr; gap: 0 10px; align-items: center; text-align: left; padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.test-acc:hover { border-color: var(--brand); background: var(--brand-soft); }
.test-acc b { color: var(--heading); grid-row: span 2; font-weight: 600; }
.test-acc span { font-size: .88rem; } .test-acc code { font-size: .76rem; justify-self: start; background: none; padding: 0; color: var(--muted); }
@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; }
  .auth-panel { border-right: 0; border-bottom: 4px solid var(--accent); padding: 28px max(20px, env(safe-area-inset-right, 0px)) 24px max(20px, env(safe-area-inset-left, 0px)); flex-direction: row; flex-wrap: wrap; align-items: center; }
  .auth-logo { width: 64px; height: 64px; }
  .auth-panel h1 { font-size: 1.3rem; flex: 1; min-width: 180px; }
  .auth-panel .tagline, .auth-points { display: none; }
  .auth-card { padding: 28px max(20px, env(safe-area-inset-right, 0px)) 40px max(20px, env(safe-area-inset-left, 0px)); }
}

/* ---------- Formularios ---------- */
.form { text-align: left; }
.form label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .86rem; margin-bottom: 12px; color: var(--text); }
.form input:not([type=checkbox]):not([type=radio]), .form select, .form textarea, .filters input, .filters select {
  font: 400 .95rem var(--font); padding: 8px 10px; min-height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); width: 100%; min-width: 0; }
.form textarea { min-height: 0; line-height: 1.45; }
.form input[type=color] { padding: 2px; height: 38px; }
.form input:focus, .form select:focus, .form textarea:focus, .filters input:focus, .filters select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.form textarea[readonly], .form input[readonly] { background: var(--surface-2); color: var(--muted); }
.form label.check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; }
.form label.check input { margin-top: 3px; accent-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { grid-column: 1 / -1; margin: 12px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.form-msg { color: var(--bad); font-weight: 600; min-height: 1.2em; margin: 6px 0; }
.hint { font-size: .86rem; color: var(--muted); font-weight: 400; background: var(--surface-2); padding: 9px 12px; border-radius: var(--radius-sm); margin: 0 0 12px; }
small.hint { background: none; padding: 0; margin: 0; }
.pw-row { display: flex; gap: 6px; }
.cred { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; background: var(--surface-2); padding: 12px 14px; border-radius: var(--radius-sm); margin: 10px 0; }
.cred code { font-size: 1rem; background: none; }

/* ---------- Estructura ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex-shrink: 0; background: var(--brand-ink); color: #d5dcf0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 18px 16px 16px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand img { width: 46px; height: 46px; border-radius: 9px; object-fit: cover; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(255,255,255,.14); }
.brand strong { display: block; font: 600 1.05rem var(--font-title); color: #fff; }
.brand small { color: #a7b4dc; font-size: .78rem; }
.nav { padding: 10px 10px 16px; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.nav a { display: flex; gap: 11px; align-items: center; padding: 8px 12px; color: #cfd7ee; text-decoration: none; border-radius: var(--radius-sm); font-size: .92rem; font-weight: 500; position: relative; }
.nav a .ico { width: 18px; height: 18px; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: rgba(255,255,255,.1); color: #fff; font-weight: 600; }
.nav a.active::before { content: ""; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 2px 2px 0; background: var(--accent); }
.nav-sep { margin: 16px 12px 6px; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: #8d9bc8; }
.user-box { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.1); font-size: .85rem; }
.user-box strong { display: block; color: #fff; font-weight: 600; } .user-box small { color: #a7b4dc; }
.main { flex: 1; min-width: 0; }
.topbar { display: none; }
.view { padding: 28px max(32px, env(safe-area-inset-right, 0px)) 64px 32px; max-width: 1280px; margin: 0 auto; outline: none; }
.nav-backdrop { display: none; }
@media (max-width: 900px) {
  .sidebar { position: fixed; z-index: 50; left: 0; transform: translateX(-105%); transition: transform .2s; box-shadow: var(--shadow-pop); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: var(--brand-ink); color: #fff;
    padding: 8px max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px)); border-bottom: 3px solid var(--accent); }
  .topbar-title { font: 600 1.05rem var(--font-title); }
  .view { padding: 20px max(16px, env(safe-area-inset-right, 0px)) 56px max(16px, env(safe-area-inset-left, 0px)); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Encabezado de página ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px 20px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.page-head h1 { margin: 0; }
.page-head > div { min-width: 0; }
.page-head p.muted { margin: 6px 0 0; }
.eyebrow { margin: 0 0 4px; font-size: .76rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.actions, .toolbar, .row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar { margin: 12px 0 14px; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; font-size: .88rem; font-weight: 600; text-decoration: none; }

/* ---------- Superficies ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; min-width: 0; }
.card > h3:first-child, .card > h2:first-child { margin-top: 0; }
.card h3 { display: flex; align-items: center; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + * { margin-top: 18px; }
@media (max-width: 420px) { .grid-2 { grid-template-columns: 1fr; } }
.empty { color: var(--muted); text-align: center; padding: 22px 12px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); margin: 0 0 14px; }
.alert { background: var(--warn-bg); color: var(--text); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); padding: 10px 14px; border-radius: var(--radius-sm); margin: 0 0 14px; }
.alert.info { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.alert .ico { color: var(--muted); }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 7px 16px; margin: 0; }
.dl dt { font-weight: 600; color: var(--muted); font-size: .86rem; } .dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 45%, var(--border)); }

/* Indicadores */
/* Separadores como líneas de cada indicador: una fila incompleta no deja huecos de color. */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; min-width: 0; box-shadow: 1px 0 0 var(--border), 0 1px 0 var(--border); }
.stat span { font-size: .8rem; color: var(--muted); }
.stat strong { font-size: 1.4rem; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--heading); overflow-wrap: anywhere; }
.stat.warn strong { color: var(--warn); } .stat.good strong { color: var(--ok); }

/* Barras y progreso */
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(70px, 34%) 1fr auto; align-items: center; gap: 10px; font-size: .86rem; }
.bar-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.bar-track { height: 10px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--brand); min-width: 2px; }
.bar-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.progress, .mini-progress { display: block; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin: 8px 0; }
.progress > span, .mini-progress > span { display: block; height: 100%; background: var(--brand); }
.mini-progress { width: 90px; flex-shrink: 0; }

.list-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover strong { color: var(--brand); }
.list-item strong { display: block; font-weight: 600; } .list-item small { color: var(--muted); }

/* Insignias de estado */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: .76rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.b-on { background: var(--ok-bg); color: var(--ok); } .b-done { background: var(--surface-2); color: var(--heading); } .b-info { background: var(--info-bg); color: var(--info); }
.b-wait { background: var(--warn-bg); color: var(--warn); } .b-off { background: var(--bad-bg); color: var(--bad); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; }

/* Pestañas y chips */
.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 18px; scrollbar-width: thin; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: var(--radius-sm); padding: 5px 11px; font: 600 .84rem var(--font); cursor: pointer; }
.chip:hover { border-color: var(--brand); }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Filtros */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.filters > input, .filters > select { flex: 1 1 200px; width: auto; }
.f-inline { display: flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--muted); flex: 1 1 200px; }
.f-inline input { flex: 1; }
.filters input[type=checkbox] { width: auto; min-height: 0; flex: none; accent-color: var(--brand); }

/* Tablas */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 16px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { background: var(--surface-2); color: var(--muted); text-align: left; padding: 9px 12px; font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; border-bottom: 1px solid var(--border); }
.table th a { color: var(--link); text-transform: none; letter-spacing: 0; }
.table td { padding: 10px 12px; border-top: 1px solid var(--border); vertical-align: top; }
.table tbody tr:first-child td { border-top: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table .acts { text-align: right; white-space: nowrap; }
.table td strong { font-weight: 600; }
.grades input.grade { width: 74px; padding: 5px 7px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); font: inherit; background: var(--surface); color: var(--text); font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  .table:not(.grades):not(.plan-table) thead { display: none; }
  .table:not(.grades):not(.plan-table), .table:not(.grades):not(.plan-table) tbody, .table:not(.grades):not(.plan-table) tr, .table:not(.grades):not(.plan-table) td { display: block; width: 100%; }
  .table:not(.grades):not(.plan-table) tr { border-top: 1px solid var(--border); padding: 6px 0; }
  .table:not(.grades):not(.plan-table) td { border: 0; padding: 4px 12px; display: grid; grid-template-columns: 38% 1fr; gap: 8px; }
  .table:not(.grades):not(.plan-table) td::before { content: attr(data-label); font-weight: 600; color: var(--muted); font-size: .78rem; }
  .table:not(.grades):not(.plan-table) td.acts { text-align: left; display: block; }
  .table:not(.grades):not(.plan-table) td.acts::before { content: none; }
}

/* Tarjetas de cursos */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 16px; }
.course-card { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-decoration: none; color: inherit; min-width: 0; transition: border-color .15s; }
a.course-card:hover { border-color: var(--brand); }
.course-card > strong { font-size: 1.02rem; font-weight: 600; color: var(--heading); line-height: 1.3; }
.course-card small { color: var(--muted); }
.cc-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.cc-top small::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--area, var(--brand)); margin-right: 6px; vertical-align: 1px; }
.cc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 10px; margin-top: auto; font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.price { font-size: 1.05rem; font-weight: 700; color: var(--heading); font-variant-numeric: tabular-nums; }
.cert-card .ico-graduation { color: var(--brand); }

/* Asistencia */
.asis-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.asis-list { max-height: 46vh; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.asis-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--border); }
.asis-row:last-child { border-bottom: 0; }
.seg { display: inline-flex; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border-strong); flex-shrink: 0; }
.seg label { margin: 0 !important; cursor: pointer; }
.seg label + label span { border-left: 1px solid var(--border-strong); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 5px 11px; font-weight: 600; font-size: .85rem; }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: -2px; }
.seg-P input:checked + span { background: var(--ok); color: #fff; } .seg-T input:checked + span { background: var(--warn); color: #fff; }
.seg-J input:checked + span { background: var(--info); color: #fff; } .seg-A input:checked + span { background: var(--bad); color: #fff; }

/* Galería y documentos */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
.gallery figure { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.gallery img { width: 100%; height: 120px; object-fit: cover; display: block; }
.gallery figcaption { font-size: .8rem; padding: 6px 8px; }
.checklist { list-style: none; padding: 0; margin: 8px 0 14px; display: grid; gap: 4px; }
.checklist li { color: var(--muted); display: flex; gap: 8px; align-items: baseline; }
.checklist li.ok { color: var(--text); } .checklist li.ok .ico { color: var(--ok); }
.doc-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.doc-btns .btn { justify-content: flex-start; }
.announce { border-bottom: 1px solid var(--border); padding: 10px 0; } .announce:last-child { border-bottom: 0; } .announce p { margin: 4px 0 0; }
article.card.announce { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.img-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.img-field { display: flex; flex-direction: column; gap: 6px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 12px; font-weight: 600; font-size: .86rem; }
.img-field img { max-height: 80px; max-width: 100%; object-fit: contain; align-self: flex-start; background: #fff; border-radius: 4px; }

/* Reportes */
.report-layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.report-layout > section { min-width: 0; }
.report-nav { display: flex; flex-direction: column; gap: 1px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; position: sticky; top: 12px; }
.report-nav a { padding: 8px 10px; border-radius: var(--radius-sm); text-decoration: none; color: var(--text); font-size: .88rem; }
.report-nav a:hover { background: var(--surface-2); }
.report-nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
@media (max-width: 900px) { .report-layout { grid-template-columns: 1fr; } .report-nav { position: static; flex-direction: row; overflow-x: auto; } .report-nav a { white-space: nowrap; } }

/* Páginas públicas: verificación y matrícula */
.public { min-height: 100vh; background: var(--bg); }
.public-head { display: flex; align-items: center; gap: 12px; padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); background: var(--brand-ink); color: #fff; border-bottom: 3px solid var(--accent); font: 600 1.02rem var(--font-title); }
.public-head img { width: 42px; height: 42px; border-radius: 8px; }
.public-body { max-width: 760px; margin: 0 auto; padding: 28px max(16px, env(safe-area-inset-right, 0px)) 48px max(16px, env(safe-area-inset-left, 0px)); }
.public-body:has(.matricula) { max-width: 1120px; }
.verify .filters input { flex: 1 1 220px; }
.verify-result { display: flex; gap: 16px; align-items: flex-start; padding: 16px; border-radius: var(--radius); margin-top: 12px; border: 1px solid; }
.verify-result.ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.verify-result.bad { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.verify-result .big .ico, .mat-ok .big .ico { width: 44px; height: 44px; stroke-width: 1.5; }
.verify-result.ok .big { color: var(--ok); } .verify-result.bad .big { color: var(--bad); }
.verify-result h2 { margin: 0 0 6px; } .verify-result p { margin: 4px 0; }

.matricula { display: flex; flex-direction: column; gap: 18px; }
.mat-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 24px; border-radius: var(--radius); background: var(--brand-ink); color: #d5dcf0; }
.mat-hero h1 { color: #fff; margin: 4px 0 8px; } .mat-hero p { margin: 0; max-width: 64ch; } .mat-hero .eyebrow { color: var(--accent); }
.matricula .card { margin-bottom: 0; }
.matricula .card > h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.paso { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--brand); color: #fff; font: 700 .85rem var(--font); flex-shrink: 0; }
.mat-ok { text-align: center; max-width: 640px; margin: 0 auto; }
.mat-ok .big { color: var(--ok); }
.mat-ok .dl { text-align: left; margin: 16px auto; max-width: 460px; }
.mat-ok .row-actions { justify-content: center; }

/* Paralelos */
.par-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 18px; }
.par-bar > span { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-right: 6px; }
.par-bar .chip { text-decoration: none; display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1.2; padding: 6px 14px; }
.par-bar .chip small { font-weight: 400; font-size: .74rem; opacity: .85; }
.par-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; margin-bottom: 18px; }
.par-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.par-card header { display: flex; align-items: center; gap: 12px; }
.par-card header strong { font-weight: 600; }
.par-card header small { display: block; color: var(--muted); }
.par-letra { width: 38px; height: 38px; border-radius: var(--radius-sm); display: grid; place-items: center; font: 600 1.15rem var(--font-title); background: var(--brand-soft); color: var(--brand); flex-shrink: 0; }
.par-card .dl { font-size: .88rem; }
.par-card .mini-progress { display: inline-block; vertical-align: middle; margin: 0 0 0 8px; width: 70px; }
.par-tag { align-self: flex-start; font-size: .76rem; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: var(--brand-soft); color: var(--brand); }
.par-opciones { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.par-op { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: .88rem; }
.par-op > span:first-of-type { flex: 1; min-width: 0; }
.par-op small { display: block; color: var(--muted); font-size: .78rem; }
label.par-op { cursor: pointer; font-weight: 400; margin: 0 !important; flex-direction: row !important; }
label.par-op:hover { border-color: var(--border-strong); }
label.par-op:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
label.par-op.lleno { opacity: .55; cursor: not-allowed; }
.par-op input[type=radio] { accent-color: var(--brand); width: 17px; height: 17px; flex-shrink: 0; }

/* Plan de estudio */
.plan-table td { vertical-align: top; min-width: 110px; }
.plan-table td:first-child { min-width: 230px; }
.plan-table input, .plan-table textarea { width: 100%; font: inherit; font-size: .88rem; padding: 6px 8px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); margin-bottom: 4px; }
.plan-table input[type=number] { max-width: 80px; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); z-index: 5; }

/* Modal, avisos y visor de documentos */
.modal { border: 1px solid var(--border); border-radius: 10px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); }
.modal.modal-wide { width: min(920px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(8, 16, 46, .55); }
.modal-pad { padding: 22px 24px 18px; }
.modal-pad > h3:first-child { font: 600 1.2rem var(--font-title); margin: 0 28px 14px 0; }
.modal-x { position: absolute; top: 10px; right: 10px; background: none; border: 0; cursor: pointer; color: var(--muted); z-index: 2; padding: 6px; font-size: 1rem; display: grid; place-items: center; border-radius: var(--radius-sm); }
.modal-x:hover { background: var(--surface-2); color: var(--text); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 16px; position: sticky; bottom: -18px; background: var(--surface); padding: 12px 0 0; border-top: 1px solid var(--border); }
.confirm-msg { font-size: 1rem; margin: 6px 28px 8px 0; }
.toast { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%) translateY(140px); background: var(--brand-ink); color: #fff; padding: 10px 18px; border-radius: var(--radius-sm);
  font-weight: 500; box-shadow: var(--shadow-pop); transition: transform .25s; z-index: 1000; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast-error { background: var(--bad); }
.doc-visor { position: fixed; inset: 0; z-index: 900; display: flex; flex-direction: column; background: var(--bg); }
.doc-visor-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--brand-ink); color: #fff; border-bottom: 3px solid var(--accent);
  padding: calc(8px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px)); }
.doc-visor iframe { flex: 1; width: 100%; border: 0; background: #fff; }
body.visor-open { overflow: hidden; }

/* ---------- Trámites OCC / OEC ---------- */
.tr-progress-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tr-progress-head small { display: block; }
.tr-progress details { margin-top: 6px; font-size: .9rem; } .tr-progress summary { cursor: pointer; color: var(--link); font-weight: 600; }
.req-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 12px; margin-top: 8px; }
.req { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; min-width: 0; margin-top: 10px; }
.req-grid .req { margin-top: 0; }
.req.req-obs { border-color: color-mix(in srgb, var(--bad) 45%, var(--border)); background: color-mix(in srgb, var(--bad-bg) 45%, var(--surface)); }
.req-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.req-head strong { display: block; font-weight: 600; font-size: .92rem; } .req-head small { display: block; }
.req-nota { margin: 0; font-size: .86rem; color: var(--bad); }
.req-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.doc-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.doc-file { display: flex; align-items: center; gap: 8px; font-size: .86rem; min-width: 0; }
.doc-file small { white-space: nowrap; }
.linklike { background: none; border: 0; padding: 0; color: var(--link); font: inherit; cursor: pointer; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.linklike:hover { text-decoration: underline; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.thumbs figure { margin: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.thumbs img { width: 100%; height: 96px; object-fit: cover; display: block; cursor: zoom-in; }
.thumbs figcaption { font-size: .75rem; padding: 4px 6px; display: flex; justify-content: space-between; align-items: center; gap: 4px; overflow: hidden; }
.tr-inst { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.tr-inst:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.tr-inst-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.tr-cursos input, .tr-cursos select { width: 100%; font: inherit; font-size: .9rem; padding: 6px 8px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.tr-cursos td:first-child { min-width: 220px; } .tr-cursos input[type=number] { max-width: 90px; }
.tv-control { margin-bottom: 18px; }
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; margin-bottom: 12px; }
.msg { max-width: 80%; padding: 8px 12px; border-radius: var(--radius); background: var(--surface-2); }
.msg p { margin: 2px 0 0; } .msg small { color: var(--muted); font-size: .76rem; }
.msg-cli { align-self: flex-start; } .msg-adm { align-self: flex-end; background: var(--brand-soft); }
.pasos { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

/* ---------- Citas ---------- */
.ag-fechas, .ag-horas { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.ag-horas .chip { min-width: 72px; text-align: center; font-variant-numeric: tabular-nums; }
.ci-dia { margin: 18px 0 8px; font-size: .95rem; color: var(--muted); text-transform: capitalize; }
/* Botones de subida (label.btn) dentro de formularios: conservan el aspecto de botón. */
.form label.btn { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; margin: 0; font-weight: 600; font-size: .84rem; }
.form label.btn-primary { color: #fff; }
.form label.btn-ghost { color: var(--text); }
