/* ══════════════════════════════════════════════════════════════════════
   Concentrado HGZ No. 2 — Sistema de diseño (compartido con Comedor HGZ 2)
   Institucional sobrio: verde IMSS + neutros, tipografía Inter.
   ══════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Marca */
  --brand-900: #00352d;
  --brand-800: #004a3f;
  --brand-700: #00594d;
  --brand-600: #006657;
  --brand-500: #1a7a6b;
  --brand-100: #d5ebe6;
  --brand-50:  #ecf6f3;
  --gold-600:  #9a7445;
  --gold-500:  #b38e5d;
  --gold-100:  #f3eadc;

  /* Neutros */
  --bg:        #f4f6f5;
  --surface:   #ffffff;
  --surface-2: #f8faf9;
  --line:      #e2e7e5;
  --line-2:    #cfd6d3;
  --text:      #17201d;
  --text-2:    #4a5752;
  --text-3:    #6e7b76;

  /* Estados */
  --ok:        #1f7a4d;
  --ok-bg:     #e5f4ec;
  --warn:      #a35a00;
  --warn-bg:   #fdf1df;
  --danger:    #b42318;
  --danger-bg: #fdecea;
  --info:      #1d5fa8;
  --info-bg:   #e7f0fb;

  /* Alimentos (paleta categórica) */
  --c-desayuno: #c27c0e;
  --c-comida:   #006657;
  --c-cena:     #3b4fa3;
  --c-fuera:    #7a8580;

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 40, 33, .06);
  --shadow:    0 1px 2px rgba(16, 40, 33, .05), 0 4px 16px -6px rgba(16, 40, 33, .12);
  --shadow-lg: 0 12px 40px -12px rgba(16, 40, 33, .28);
  --ring:      0 0 0 3px rgba(0, 102, 87, .22);

  --sidebar-w: 248px;
  --topbar-h:  60px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
.hide { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 24px; height: 24px; }

/* ── Estructura ───────────────────────────────────────────────────────── */
.shell { min-height: 100vh; display: flex; }

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--brand-900);
  color: #d8e9e4;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-mark {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--surface); display: grid; place-items: center; flex: none;
  color: var(--brand-600);
}
.brand-mark .ic { width: 22px; height: 22px; }
.brand-txt b { display: block; color: #fff; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.brand-txt span { font-size: 12px; color: #9fc4ba; }

.nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #7fa89d; padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: #cfe3dd; font-weight: 500; font-size: 14.5px;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: var(--brand-600); color: #fff; box-shadow: inset 3px 0 0 var(--gold-500); }
.nav a .ic { opacity: .9; }

.sidebar .me {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 14px 16px; display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand-600); color: #fff; font-weight: 700; font-size: 14px;
  display: grid; place-items: center; flex: none;
}
.sidebar .me .who { min-width: 0; flex: 1; }
.sidebar .me .who b { display: block; color: #fff; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .me .who span { font-size: 12px; color: #9fc4ba; }
.sidebar .me a { color: #9fc4ba; padding: 8px; border-radius: 8px; display: grid; }
.sidebar .me a:hover { background: rgba(255,255,255,.08); color: #fff; }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 30;
}
.topbar .crumb { font-size: 13px; color: var(--text-3); }
.topbar .spacer { flex: 1; }
.topbar .today { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.topbar .mobile-brand { display: none; }
.topbar [data-open-sidebar] { display: none; }

.content { padding: 28px; max-width: 1280px; width: 100%; margin: 0 auto; flex: 1; }
.content.narrow { max-width: 760px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 24px; font-weight: 700; }
.page-head p { color: var(--text-2); margin-top: 4px; font-size: 14.5px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.footer { padding: 16px 28px 24px; font-size: 12px; color: var(--text-3); text-align: center; }

/* Navegación inferior (móvil) */
.bottomnav { display: none; }

/* ── Tarjetas ─────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.card-head h2, .card-head h3 { font-size: 15.5px; font-weight: 650; }
.card-head .sub { font-size: 13px; color: var(--text-3); }
.card-body { padding: 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; }

/* ── KPI ──────────────────────────────────────────────────────────────── */
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 16px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.kpi .k-label { font-size: 13px; color: var(--text-2); font-weight: 550; display: flex; align-items: center; gap: 8px; }
.kpi .k-value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .k-foot { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.kpi .k-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.kpi.live { border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-50), var(--shadow-sm); }
.kpi.live::after {
  content: "En curso"; position: absolute; top: 14px; right: 14px;
  font-size: 11px; font-weight: 650; color: var(--brand-700); background: var(--brand-50);
  padding: 2px 8px; border-radius: 999px;
}

/* ── Botones ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  text-decoration: none !important;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn-primary:hover { background: var(--brand-700); border-color: var(--brand-700); }
.btn-gold { background: var(--gold-500); border-color: var(--gold-500); color: #fff; }
.btn-gold:hover { background: var(--gold-600); border-color: var(--gold-600); }
.btn-danger { background: var(--surface); border-color: #f0b7b1; color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #8f1c13; }
.btn-warn { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(0,0,0,.04); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 52px; padding: 0 22px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }

/* ── Formularios ──────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: 14px; }
.label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.help { font-size: 12.5px; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 90px; padding: 10px 12px; }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a5752' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-600); box-shadow: var(--ring); }
.input:disabled, .select:disabled { background: var(--surface-2); color: var(--text-3); }
.input-lg { height: 52px; font-size: 17px; border-radius: 12px; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group > .ic { position: absolute; left: 12px; color: var(--text-3); pointer-events: none; }
.input-group > .ic + .input { padding-left: 40px; }
.input-group > .btn-addon ~ .input, .input-group > .input:has(+ .btn-addon) { padding-right: 46px; }
.input-group > .btn-addon { position: absolute; right: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand-600); }

/* Interruptor */
.switch { position: relative; display: inline-flex; align-items: flex-start; gap: 12px; cursor: pointer; line-height: 1.4; }
.switch .track { margin-top: 1px; }
.switch input { position: absolute; opacity: 0; }
.switch .track { flex: none; width: 40px; height: 22px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked + .track { background: var(--brand-600); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }

/* Control segmentado */
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; font-weight: 600; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ── Avisos ───────────────────────────────────────────────────────────── */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: 14px; border: 1px solid transparent; }
.alert .ic { margin-top: 1px; }
.alert b { font-weight: 650; }
.alert-ok { background: var(--ok-bg); color: #145c39; border-color: #bfe3cf; }
.alert-warn { background: var(--warn-bg); color: #7a4300; border-color: #f4d29e; }
.alert-danger { background: var(--danger-bg); color: #8f1c13; border-color: #f4c2bd; }
.alert-info { background: var(--info-bg); color: #164a83; border-color: #c4d9f2; }

/* ── Insignias ────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line);
}
.badge-ok { background: var(--ok-bg); color: var(--ok); border-color: #bfe3cf; }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: #f4d29e; }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: #f4c2bd; }
.badge-info { background: var(--info-bg); color: var(--info); border-color: #c4d9f2; }
.badge-brand { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-100); }
.badge-gold { background: var(--gold-100); color: #7a5a30; border-color: #e6d5bb; }
.badge .sw { width: 8px; height: 8px; border-radius: 2px; border: 1px solid rgba(0,0,0,.15); }
.meal-DESAYUNO { --c: var(--c-desayuno); }
.meal-COMIDA { --c: var(--c-comida); }
.meal-CENA { --c: var(--c-cena); }
.meal-FUERA { --c: var(--c-fuera); }
.badge-meal { background: color-mix(in srgb, var(--c) 10%, white); color: var(--c); border-color: color-mix(in srgb, var(--c) 28%, white); }

/* ── Tablas ───────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .04em;
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafcfb; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .nowrap { white-space: nowrap; }
.table tr.anulado td { color: var(--text-3); text-decoration: line-through; }
.table tr.anulado td.keep { text-decoration: none; }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line); }
.cell-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-person .pname { font-weight: 600; }
.cell-person .pmeta { font-size: 12.5px; color: var(--text-3); }
.thumb { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--brand-50); flex: none; border: 1px solid var(--line); }
.thumb-ph { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; flex: none; font-weight: 700; font-size: 13px; }

.empty { text-align: center; padding: 40px 20px; color: var(--text-3); }
.empty .ic { width: 36px; height: 36px; margin: 0 auto 10px; color: var(--line-2); }
.empty b { display: block; color: var(--text-2); font-weight: 600; margin-bottom: 2px; }

/* Paginación */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-3); flex-wrap: wrap; }
.pager .row { gap: 6px; }

/* Barras */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 8px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; height: 100%; justify-content: flex-end; }
.bars .bar i { display: block; width: 100%; max-width: 34px; background: var(--brand-600); border-radius: 5px 5px 2px 2px; min-height: 2px; position: relative; }
.bars .bar.today i { background: var(--gold-500); }
.bars .bar span { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.bars .bar i[data-v]:hover::after { content: attr(data-v); position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -4px); background: var(--text); color: #fff; font-size: 11px; font-style: normal; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }

.meter { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.meter > i { display: block; height: 100%; background: var(--c, var(--brand-600)); border-radius: 999px; }

/* ── Diálogo / Toast ──────────────────────────────────────────────────── */
dialog.modal {
  border: 0; padding: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: min(440px, calc(100vw - 32px)); color: var(--text);
}
dialog.modal::backdrop { background: rgba(10, 30, 25, .45); backdrop-filter: blur(2px); }
.modal .m-body { padding: 22px 22px 8px; }
.modal .m-body h3 { font-size: 17px; margin-bottom: 6px; }
.modal .m-body p { color: var(--text-2); font-size: 14.5px; }
.modal .m-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px 20px; }

.toasts { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px;
  min-width: 280px; max-width: 420px; padding: 12px 14px; border-radius: 12px;
  background: var(--text); color: #fff; box-shadow: var(--shadow-lg); font-size: 14px;
  animation: toast-in .2s ease-out;
}
.toast .ic { flex: none; }
.toast.ok .ic { color: #6ee7a8; }
.toast.err .ic { color: #fca5a0; }
.toast.warn .ic { color: #fcd27a; }
.toast .t-msg { flex: 1; }
.toast button { background: rgba(255,255,255,.12); border: 0; color: #fff; padding: 6px 10px; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 13px; }
.toast button:hover { background: rgba(255,255,255,.22); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

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

/* ── Login ────────────────────────────────────────────────────────────── */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.auth-aside {
  background: var(--brand-900);
  background-image:
    radial-gradient(1200px 500px at -10% 110%, rgba(179,142,93,.22), transparent 60%),
    radial-gradient(900px 600px at 110% -10%, rgba(26,122,107,.55), transparent 60%);
  color: #e3f0ec; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-aside::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: linear-gradient(180deg, transparent, #000 40%, #000 70%, transparent);
  pointer-events: none;
}
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside .eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-500); font-weight: 650; }
.auth-aside h2 { font-size: 38px; line-height: 1.12; color: #fff; font-weight: 700; margin-top: 14px; letter-spacing: -.02em; max-width: 14ch; }
.auth-aside .lead { margin-top: 16px; font-size: 16px; color: #b7d3cb; max-width: 42ch; }
.auth-feats { display: grid; gap: 14px; margin-top: 36px; }
.auth-feats div { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; color: #cfe3dd; }
.auth-feats .ic { color: var(--gold-500); margin-top: 1px; }
.auth-aside .foot { font-size: 12.5px; color: #8fb5aa; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--surface); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .logo { width: 210px; margin-bottom: 28px; }
.auth-card h1 { font-size: 24px; font-weight: 700; }
.auth-card .sub { color: var(--text-2); margin: 6px 0 24px; font-size: 14.5px; }

/* ── Registrar (escáner) ──────────────────────────────────────────────── */
.scan-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.scanner {
  background: #0d1714; border-radius: var(--radius-lg); overflow: hidden; position: relative;
  aspect-ratio: 1 / 1; display: grid; place-items: center; color: #9fc4ba;
  box-shadow: var(--shadow);
}
.scanner #reader { width: 100%; height: 100%; }
.scanner #reader video { width: 100% !important; height: 100% !important; object-fit: cover; }
.scanner #reader img[alt="Info icon"], .scanner #reader img[alt="Camera based scan"] { display: none !important; }
/* La librería dibuja su propio recuadro (desalineado con object-fit); se usa solo el marco propio */
.scanner #reader #qr-shaded-region { display: none !important; }
.scanner #reader { position: relative; }
.scanner .frame { position: absolute; inset: 18%; pointer-events: none; }
.scanner .frame i { position: absolute; width: 34px; height: 34px; border-color: #fff; border-style: solid; border-width: 0; opacity: .95; }
.scanner .frame i:nth-child(1) { top: 0; left: 0; border-top-width: 4px; border-left-width: 4px; border-top-left-radius: 12px; }
.scanner .frame i:nth-child(2) { top: 0; right: 0; border-top-width: 4px; border-right-width: 4px; border-top-right-radius: 12px; }
.scanner .frame i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 4px; border-left-width: 4px; border-bottom-left-radius: 12px; }
.scanner .frame i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 4px; border-right-width: 4px; border-bottom-right-radius: 12px; }
.scanner .laser { position: absolute; left: 20%; right: 20%; height: 2px; background: linear-gradient(90deg, transparent, var(--gold-500), transparent); top: 50%; animation: laser 2.2s ease-in-out infinite; pointer-events: none; }
@keyframes laser { 0%,100% { top: 22%; } 50% { top: 78%; } }
.scanner .overlay-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; background: #0d1714; z-index: 2; }
.scanner .overlay-msg .ic { width: 40px; height: 40px; margin: 0 auto 10px; }
.scanner .tools { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; justify-content: space-between; gap: 8px; z-index: 3; }
.scanner .tools .btn { background: rgba(13,23,20,.7); border-color: rgba(255,255,255,.18); color: #fff; backdrop-filter: blur(6px); }

.person {
  display: flex; gap: 16px; align-items: center;
}
.person .photo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; background: var(--brand-50); border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--brand-100); flex: none; }
.person .photo-ph { width: 96px; height: 96px; border-radius: 50%; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; font-size: 30px; font-weight: 700; flex: none; }
.person .pn { font-size: 20px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.person .pm { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.person .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.toggles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.toggle {
  border: 2px solid var(--line); background: var(--surface); border-radius: 14px;
  padding: 16px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-weight: 650; font-size: 14.5px; color: var(--text-2); cursor: pointer;
  transition: all .15s;
}
.toggle .ic { width: 26px; height: 26px; }
.toggle:hover { border-color: var(--line-2); }
.toggle[aria-pressed="true"] { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 9%, white); color: var(--tc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc) 15%, transparent); }
.toggle.t-ing { --tc: #1f7a4d; }
.toggle.t-rac { --tc: #1d5fa8; }
.toggle.t-sin { --tc: #b42318; }

.history { display: flex; flex-direction: column; gap: 8px; }
.history .h-item { display: flex; align-items: center; gap: 10px; font-size: 13.5px; padding: 8px 12px; background: var(--surface-2); border-radius: 10px; border: 1px solid var(--line); }

/* ── Alta / credencial ────────────────────────────────────────────────── */
.photo-box {
  aspect-ratio: 3 / 4; background: var(--surface-2); border: 2px dashed var(--line-2); border-radius: var(--radius);
  display: grid; place-items: center; overflow: hidden; position: relative; color: var(--text-3); text-align: center;
}
.photo-box:has(img:not(.hide)) { border-style: solid; }
.photo-box img, .photo-box video { width: 100%; height: 100%; object-fit: cover; }
.photo-box .ph .ic { width: 36px; height: 36px; margin: 0 auto 8px; }
.cred-preview { max-width: 260px; border-radius: 12px; box-shadow: var(--shadow); border: 1px solid var(--line); }

.steps { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.steps .st { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-3); }
.steps .st i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); font-style: normal; font-size: 12px; }
.steps .st.on { color: var(--brand-700); }
.steps .st.on i { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }
.steps .st.done i { background: var(--brand-100); color: var(--brand-700); border-color: var(--brand-100); }
.steps .sep { width: 24px; height: 1px; background: var(--line-2); align-self: center; }

.log { background: #0d1714; color: #cfe3dd; border-radius: var(--radius); padding: 14px; font: 12.5px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; height: 260px; overflow: auto; white-space: pre-wrap; }
.progress { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.progress > i { display: block; height: 100%; width: 0; background: var(--brand-600); transition: width .2s; }

.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; font-weight: 550; }

/* ── Responsivo ───────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(10,30,25,.4); z-index: 35; display: none; }
  .sidebar.open + .scrim { display: block; }
  .main { margin-left: 0; }
  .topbar { padding: 0 12px 0 8px; }
  .topbar [data-open-sidebar] { display: inline-flex; }
  .topbar .mobile-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
  .topbar .crumb, .topbar .today { display: none; }
  .content { padding: 18px 16px 96px; }
  .footer { padding-bottom: 96px; }
  .page-head h1 { font-size: 21px; }
  .scan-layout { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: auto; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-aside { display: none; }
  .toasts { left: 16px; right: 16px; bottom: 84px; align-items: stretch; }
  .toast { min-width: 0; max-width: none; }

  .bottomnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px -8px rgba(16,40,33,.15);
  }
  .bottomnav a, .bottomnav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 11px; font-weight: 600; color: var(--text-3); padding: 6px 2px; border-radius: 10px;
    background: none; border: 0; cursor: pointer; text-decoration: none;
  }
  .bottomnav .ic { width: 22px; height: 22px; }
  .bottomnav a.active { color: var(--brand-600); }
  .bottomnav a.primary { color: #fff; }
  .bottomnav a.primary .ic-wrap { background: var(--brand-600); width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; margin-top: -22px; box-shadow: 0 6px 16px -4px rgba(0,102,87,.5); border: 3px solid var(--surface); }
  .bottomnav a.primary > span:last-child { color: var(--brand-600); }
}

@media (max-width: 560px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .k-value { font-size: 24px; }
  .kpi.live::after { display: none; }
  .card-head, .card-body { padding-left: 16px; padding-right: 16px; }
  .person .photo, .person .photo-ph { width: 76px; height: 76px; }
  .person .pn { font-size: 18px; }
  .hide-sm { display: none !important; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
}

@media print {
  .sidebar, .topbar, .bottomnav, .footer, .no-print { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; font-size: 11px; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
}

/* Foto + datos (alta y ficha de trabajador) */
.grid-photo { grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 560px) {
  .grid-photo { grid-template-columns: minmax(0, 1fr); }
  .grid-photo .photo-box { max-width: 220px; margin: 0 auto; }
}
.hide-desktop-inline { display: none; }
@media (max-width: 560px) { .hide-desktop-inline { display: inline; } }

/* ══════════════════════════════════════════════════════════════════════
   Ajustes responsivos (celular y tablet)
   ══════════════════════════════════════════════════════════════════════ */
.show-m { display: none; }
.kpis-auto { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.btn-wrap { white-space: normal; line-height: 1.15; min-width: 0; text-align: center; }
.topbar .mobile-brand { min-width: 0; }
.scanner { max-width: min(100%, 72vh); margin-inline: auto; width: 100%; }

@media (max-width: 900px) {
  .topbar .mobile-brand { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; flex: 1; }
  .topbar .spacer { display: none; }
  /* Evita el zoom automático de iOS al enfocar campos */
  .input, .select, .textarea { font-size: 16px; }
  .grid-main > aside, .grid-main > .stack { min-width: 0; }
}

@media (max-width: 640px) {
  .show-m { display: revert; }
  .hide-m { display: none !important; }

  /* Tablas convertidas en tarjetas */
  .t-cards thead { display: none; }
  .t-cards, .t-cards tbody { display: block; width: 100%; }
  .t-cards tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px; row-gap: 4px; align-items: start;
    padding: 12px 16px; border-bottom: 1px solid var(--line);
  }
  .t-cards tbody tr:last-child { border-bottom: 0; }
  .t-cards td { display: block; padding: 0 !important; border: 0 !important; min-width: 0 !important; width: auto !important; text-align: left; }
  .t-cards tbody tr:hover td { background: none; }
  .t-cards td.c-lead { grid-column: 1; font-size: 12.5px; color: var(--text-3); font-weight: 600; }
  .t-cards td.c-lead .show-m { display: inline; margin-left: 6px; font-weight: 500; }
  .t-cards td.c-main, .t-cards td.c-sub, .t-cards td.c-span { grid-column: 1; }
  .t-cards td.c-sub { margin-top: 4px; }
  .t-cards td.c-sub { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
  .t-cards td.c-sub > .show-m { display: contents; }
  .t-cards td.c-act { grid-column: 2; grid-row: 1 / span 4; align-self: center; }
  .t-cards td.c-none { display: none; }
  .t-cards td[colspan] { grid-column: 1 / -1; }
  .t-cards tr.anulado td.c-main { text-decoration: line-through; color: var(--text-3); }

  /* Tablas de resumen más compactas */
  .table { font-size: 13.5px; }
  .table th, .table td { padding: 9px 10px; }
  .table th { font-size: 11px; }

  /* Filtros en cuadrícula */
  .filters { display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px; }
  .filters > .input-group { grid-column: 1 / -1; min-width: 0 !important; }
  .filters > .select { width: 100% !important; min-width: 0 !important; }
  .filters > .btn { width: 100%; }
  .filtro-rep { display: grid !important; grid-template-columns: 1fr; gap: 12px !important; }
  .filtro-rep > .field { margin: 0; }
  .filtro-rep .segmented { display: flex; }
  .filtro-rep .segmented button { flex: 1; }
  .filtro-rep > .btn { width: 100%; }
  .filtro-rep > .field[data-m="rango"]:not(.hide) { display: flex; }

  .card-head { flex-wrap: wrap; }
  .card-head > .input-group { flex: 1 1 100% !important; min-width: 0 !important; }
  .card-foot.row-between > * { flex: 1 1 auto; }
  .page-head { margin-bottom: 16px; }
  .page-head .actions { flex-wrap: nowrap; }
  .log { height: 180px; }
  .pager { padding: 12px 16px; }
  .steps .sep { width: 12px; }
}

@media (max-width: 560px) {
  .kpis-auto { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .kpis-auto .kpi { padding: 12px; }
  .kpis-auto .k-value { font-size: 20px; }
  .kpis-auto .k-label { font-size: 12px; }
  .kpis-auto .k-foot { display: none; }
  .kpi .k-foot { font-size: 12px; }
  .toggle { padding: 14px 6px; font-size: 14px; }
  .person { gap: 12px; }
  .bars { gap: 3px; }
  .bars .bar span { font-size: 10px; }
  .content { padding-left: 12px; padding-right: 12px; }
}

@media (max-width: 380px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .k-value { font-size: 22px; }
  .btn-lg { height: 48px; font-size: 15px; padding: 0 14px; }
  .bottomnav a, .bottomnav button { font-size: 10.5px; }
}

/* Teléfono horizontal o tablet: el escáner junto al panel del trabajador */
@media (min-width: 641px) and (max-width: 900px) {
  .scan-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi .k-value { font-size: 24px; }
}

@media (max-width: 1100px) {
  .hide-md { display: none !important; }
  .hide-tab { display: none !important; }
}
@media (max-width: 380px) {
  .page-head .actions { flex-wrap: wrap; }
  .page-head .actions .btn { flex: 1 1 100%; }
  .card-head > .btn { flex: none; }
}

/* ══════════════════════════════════════════════════════════════════════
   Concentrado HGZ 2 — componentes propios
   ══════════════════════════════════════════════════════════════════════ */
.brand-mark img { width: 26px; height: auto; }
.sidebar .me .who-link { display: block; padding: 0; color: inherit; text-decoration: none; }
.sidebar .me .who-link:hover { background: none; }
.content.wide { max-width: 1480px; }

.auth-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.auth-logo img { width: 52px; height: auto; }
.auth-logo b { display: block; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.auth-logo span { font-size: 13px; color: var(--text-3); }

/* Pestañas como enlaces (reutiliza .segmented) */
.segmented a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 8px; font-weight: 600; font-size: 13.5px; color: var(--text-2); text-decoration: none; }
.segmented a:hover { color: var(--text); background: rgba(0,0,0,.03); }
.segmented a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented .ic { width: 16px; height: 16px; }

/* Rejilla de formularios en línea */
.fgrid { display: grid; gap: 12px 14px; align-items: end; }
.fgrid .field + .field { margin-top: 0; }
.fgrid-cap { grid-template-columns: minmax(150px, 1fr) minmax(240px, 2.2fr) minmax(150px, .9fr) minmax(120px, .8fr) auto; }
.fgrid-cap.con-doc { grid-template-columns: minmax(140px, .9fr) minmax(220px, 2fr) minmax(200px, 1.3fr) minmax(150px, .9fr) minmax(110px, .7fr) auto; }
.fgrid-fil { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.fgrid .actions-end { display: flex; gap: 8px; justify-content: flex-end; align-items: flex-end; flex-wrap: wrap; }
.range { display: flex; align-items: center; gap: 6px; }
.range .input { min-width: 0; }
.range span { color: var(--text-3); font-size: 13px; }
.static-val { height: 42px; display: flex; align-items: center; padding: 0 12px; border: 1px dashed var(--line-2); border-radius: 10px; color: var(--text-2); background: var(--surface-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.status-line { min-height: 20px; font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.status-line.ok { color: var(--ok); }
.status-line.warn { color: var(--warn); }
.status-line.err { color: var(--danger); }
.status-line .ic { width: 16px; height: 16px; }
.input.is-found { border-color: #9fd3b8; background: #f6fbf8; }
.input[readonly] { background: var(--surface-2); color: var(--text-2); }
.kbd { display: inline-block; font: 600 11px/1 var(--font); padding: 3px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--text-2); }

/* Resumen de la consulta */
.summary { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.summary .s-item { font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.summary .s-item b { color: var(--text); font-variant-numeric: tabular-nums; }
.summary .s-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--text-3)); }

/* Barra de acciones masivas */
.bulkbar { display: none; align-items: center; gap: 10px; padding: 10px 20px; background: var(--brand-50); border-bottom: 1px solid var(--brand-100); position: sticky; top: var(--topbar-h); z-index: 5; flex-wrap: wrap; }
.bulkbar.on { display: flex; }
.bulkbar .b-count { font-weight: 650; color: var(--brand-700); margin-right: auto; }

/* Tabla densa para listados largos */
.table-dense { font-size: 13.5px; }
.table-dense td { padding: 8px 12px; }
.table-dense th { padding: 9px 12px; }
.table .chk { width: 40px; text-align: center; }
.table .chk input { width: 16px; height: 16px; accent-color: var(--brand-600); vertical-align: middle; }
.table tr.sel td { background: #f3f9f7; }
.table .pname { font-weight: 600; }
.table td.c-nombre { min-width: 220px; }
.table .sub2 { font-size: 12px; color: var(--text-3); }
.table .clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-scroll { max-height: calc(100vh - 260px); overflow: auto; }
.table-scroll .table th { top: 0; z-index: 2; }

/* Seguimiento: recibido → trabajado → archivado */
.track { display: inline-flex; gap: 3px; white-space: nowrap; }
.st {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px 0 6px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text-3);
  font: 600 11.5px/1 var(--font); cursor: pointer; white-space: nowrap; transition: all .12s;
}
.st .ic { width: 14px; height: 14px; stroke-width: 2.4; opacity: .35; }
.st:hover:not(:disabled) { border-color: var(--brand-500); color: var(--brand-700); }
.st.on { background: var(--c, var(--ok)); border-color: var(--c, var(--ok)); color: #fff; }
.st.on .ic { opacity: 1; }
.st:disabled { cursor: default; opacity: .55; }
.st.on:disabled { opacity: .8; }
.st.busy { opacity: .5; pointer-events: none; }
.st-recibido { --c: #1d5fa8; }
.st-trabajado { --c: #1f7a4d; }
.st-archivado { --c: #9a7445; }

/* KPI como enlace */
a.kpi { color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; display: block; }
a.kpi:hover { border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-50), var(--shadow-sm); }
.kpi.k-warn .k-value { color: var(--warn); }
.kpi.k-ok .k-value { color: var(--ok); }
.kpi.k-sm { padding: 12px 14px; }
.kpi.k-sm .k-value { font-size: 24px; margin-top: 2px; }
.tipo-head { display: flex; align-items: center; gap: 10px; }
.tipo-head .t-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; flex: none; }
.progress-3 { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.progress-3 i { display: block; height: 100%; }

/* Diálogos más amplios */
dialog.modal.modal-lg { width: min(880px, calc(100vw - 32px)); }
dialog.modal.modal-md { width: min(560px, calc(100vw - 32px)); }
.modal .m-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal .m-head h3 { font-size: 17px; }
.modal .m-scroll { max-height: calc(100vh - 200px); overflow: auto; padding: 18px 22px; }
.modal .m-actions.bordered { border-top: 1px solid var(--line); padding-top: 14px; }

/* TXT Manuales */
.folio-box { height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 10px; background: var(--brand-50); border: 1px solid var(--brand-100); color: var(--brand-700); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .01em; white-space: nowrap; }
.folio-box .ic { width: 18px; height: 18px; }
.workers { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.worker .card-head .w-tag { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-600); }
.worker .search { display: flex; gap: 8px; }
.worker .search .input { flex: 1; }
.worker .w-state { margin-top: 8px; }
.worker .w-fields { margin-top: 14px; }
.worker.found .w-fields .input:not([readonly]) { background: #fbfdfc; }
.worker .w-save { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.aviso-motivo { margin-top: 10px; }
.aviso-motivo .check { margin-top: 10px; font-weight: 600; }
.sticky-actions { position: sticky; bottom: 0; z-index: 6; margin-top: 16px; padding: 12px 16px; background: rgba(255,255,255,.94); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 -6px 20px -12px rgba(16,40,33,.25); display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.sticky-actions .sa-info { margin-right: auto; font-size: 13px; color: var(--text-3); }

/* Historial */
.hist-head { display: flex; gap: 16px; align-items: center; }
.hist-head .avatar-lg { width: 56px; height: 56px; border-radius: 16px; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; font-weight: 700; font-size: 20px; flex: none; }

/* Bitácora */
.bit-det { font-size: 12.5px; color: var(--text-2); }
.bit-det code { font: 12px ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--surface-2); border: 1px solid var(--line); padding: 0 4px; border-radius: 4px; }

@media (max-width: 1200px) {
  .fgrid-cap, .fgrid-cap.con-doc { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fgrid-fil { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fgrid-fil > * { grid-column: auto !important; }
  .fgrid-fil .actions-end { grid-column: 1 / -1 !important; }
}
@media (max-width: 900px) {
  .workers { grid-template-columns: minmax(0, 1fr); }
  .fgrid-cap, .fgrid-cap.con-doc { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  .bulkbar, .sticky-actions { display: none !important; }
}
.alert a { color: inherit; font-weight: 650; text-decoration: underline; }
