:root {
  --ink: #0B1220; --ink-2: #1A2333; --ink-3: #2A3446;
  --bg: #F4F6FA; --card: #FFFFFF; --line: #E6EAF1; --line-2: #EEF1F6;
  --text: #0F172A; --muted: #64748B; --soft: #94A3B8;
  --primary: #1D4ED8; --primary-2: #2563EB; --primary-soft: #EAF0FF;
  --green: #0F9D6E; --green-soft: #E6F7F0; --amber: #B45309; --amber-soft: #FEF3E2;
  --red: #DC2626; --red-soft: #FDECEC; --blue-soft: #EAF0FF;
  --gold: #C9A227;
  --r: 14px; --r-lg: 20px;
  --sh: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
  --sh-lg: 0 24px 60px rgba(11, 18, 32, .22);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: ui-monospace, 'Cascadia Code', monospace; font-size: .92em; background: var(--line-2); padding: 1px 5px; border-radius: 5px; word-break: break-all; }
.ic { flex-shrink: 0; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; justify-content: center; margin: 10px 0 0; }
.center { text-align: center; justify-content: center; } .block { display: block; } .mt { margin-top: 18px; } .nowrap { white-space: nowrap; } .sp { flex: 1; }
.boot { display: grid; place-items: center; height: 100vh; } .boot img { width: 72px; opacity: .25; animation: pulse 1.2s infinite alternate; }
@keyframes pulse { to { opacity: .6; } }
.fade-in { animation: fade .28s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Botones y campos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 11px; border: 1px solid transparent; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .05s, border-color .15s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(29, 78, 216, .25); }
.btn.primary:hover:not(:disabled) { background: var(--primary-2); }
.btn.ghost { background: var(--card); border-color: var(--line); color: var(--text); }
.btn.ghost:hover:not(:disabled) { border-color: #CBD5E1; background: #FAFBFD; }
.btn.danger { background: var(--red); color: #fff; } .btn.danger.ghost { background: var(--card); color: var(--red); border-color: #F5C2C2; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; } .btn.xs { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 9px; }
.btn.big { height: 52px; font-size: 15.5px; border-radius: 14px; } .btn.block { display: flex; width: 100%; }
.btn + .btn { margin-left: 6px; } .btn.block + .btn.block { margin: 10px 0 0; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--line-2); color: var(--text); }
:focus-visible { outline: 3px solid rgba(37, 99, 235, .45); outline-offset: 2px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.field small { color: var(--muted); font-size: 11.5px; }
.field.inline { flex-direction: row; align-items: center; gap: 10px; }
input, select, textarea { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea { height: auto; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary-2); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
input[readonly] { background: var(--line-2); }
input.up { text-transform: uppercase; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; grid-column: 1 / -1; }
.check input { width: 18px; height: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .span2 { grid-column: 1 / -1; }
.money-in { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding-left: 14px; background: #fff; }
.money-in span { font-size: 22px; font-weight: 700; color: var(--soft); }
.money-in input { border: 0; height: 56px; font-size: 26px; font-weight: 800; box-shadow: none; }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.b-green { background: var(--green-soft); color: var(--green); } .b-amber { background: var(--amber-soft); color: var(--amber); }
.b-red { background: var(--red-soft); color: var(--red); } .b-blue { background: var(--blue-soft); color: var(--primary); } .b-gray { background: var(--line-2); color: var(--muted); }
.chip { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--primary-2); color: var(--primary); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.av { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, #DCE6FF, #EEF2FF); color: var(--primary); font-weight: 800; font-size: 13px; flex-shrink: 0; }
.av.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }
.av.lg { width: 76px; height: 76px; border-radius: 24px; font-size: 26px; }

/* ---------- Shell admin ---------- */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--ink); color: #CBD5E1; display: flex; flex-direction: column; padding: 18px 14px; gap: 14px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 6px; }
.brand-logo { width: 46px; height: auto; filter: invert(1); }
.brand b { display: block; color: #fff; font-size: 15px; letter-spacing: -.01em; } .brand span { font-size: 11.5px; color: #8A96AB; letter-spacing: .04em; text-transform: uppercase; }
.emp-sel { display: flex; flex-direction: column; gap: 6px; padding: 0 6px; }
.emp-sel span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #7D8AA0; font-weight: 700; }
.emp-sel select { background: var(--ink-2); border-color: var(--ink-3); color: #fff; height: 38px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 11px; font-weight: 600; color: #AEB9CB; transition: background .15s, color .15s; }
.side nav a:hover { background: var(--ink-2); color: #fff; }
.side nav a.on { background: linear-gradient(90deg, rgba(37, 99, 235, .3), rgba(37, 99, 235, .08)); color: #fff; box-shadow: inset 3px 0 0 #5B8CFF; }
.side nav a em { margin-left: auto; font-style: normal; background: #F59E0B; color: #1A1203; font-size: 11px; font-weight: 800; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; }
.side-app { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; border: 1px dashed var(--ink-3); color: #E2E8F0; font-weight: 600; margin-top: auto; }
.side-app:hover { border-color: #5B8CFF; color: #fff; }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--ink-2); }
.me .av { background: var(--ink-2); color: #fff; } .me b { display: block; color: #fff; font-size: 13px; } .me span { font-size: 11.5px; color: #7D8AA0; }
.me > div:nth-child(2) { flex: 1; min-width: 0; } .me .icon-btn { color: #8A96AB; } .me .icon-btn:hover { background: var(--ink-2); color: #fff; }
.main { min-width: 0; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 18px 32px; background: rgba(244, 246, 250, .86); backdrop-filter: blur(12px); border-bottom: 1px solid transparent; }
.top h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; } .top p { margin: 2px 0 0; color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.top-act { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.top-act .btn + .btn { margin: 0; }
.content { padding: 6px 32px 40px; display: flex; flex-direction: column; gap: 18px; }
.only-m { display: none; } .scrim { display: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--sh); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.card-h h3 { margin: 0; font-size: 15px; }
.grid-2 { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 12px; max-height: 340px; overflow-y: auto; }
.check.toggle { align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 14px; max-width: 640px; } .check.toggle b { display: block; } .check.toggle input { margin-top: 3px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--sh); display: flex; flex-direction: column; gap: 4px; }
.kpi span { color: var(--muted); font-size: 12.5px; font-weight: 600; } .kpi b { font-size: 22px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; } .kpi small { color: var(--muted); font-size: 12px; }
.kpi.k-blue { background: linear-gradient(135deg, #1D4ED8, #3B6CF6); border-color: transparent; color: #fff; } .kpi.k-blue span, .kpi.k-blue small { color: rgba(255, 255, 255, .78); }
.kpi.k-dark { background: var(--ink); color: #fff; border-color: transparent; } .kpi.k-dark span, .kpi.k-dark small { color: #8A96AB; }
.kpi.k-amber { border-color: #F8D9A8; background: #FFFBF3; }
.bars { display: flex; align-items: flex-end; gap: 12px; height: 220px; padding-top: 24px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.bar-v { width: 100%; max-width: 56px; margin-top: auto; background: linear-gradient(180deg, #4F7BFF, #1D4ED8); border-radius: 10px 10px 4px 4px; position: relative; transition: height .6s cubic-bezier(.2, .8, .2, 1); }
.bar-v span { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); font-size: 10.5px; font-weight: 700; color: var(--ink-3); white-space: nowrap; }
.bar:not(:last-child) .bar-v { background: linear-gradient(180deg, #BFD0FF, #9DB5FA); }
.bar small { font-size: 11.5px; color: var(--muted); }
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar { display: grid; grid-template-columns: 130px 1fr auto; gap: 12px; align-items: center; font-size: 13px; }
.hbar div { height: 10px; background: var(--line-2); border-radius: 6px; overflow: hidden; } .hbar i { display: block; height: 100%; background: linear-gradient(90deg, #1D4ED8, #60A5FA); border-radius: 6px; }
.hbar b { font-variant-numeric: tabular-nums; }
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 13px; border: 1px solid var(--line); transition: transform .12s, border-color .12s; }
.alert:hover { transform: translateX(2px); }
.alert div { flex: 1; min-width: 0; } .alert b { display: block; font-size: 13px; } .alert span { font-size: 12px; color: var(--muted); }
.a-red { background: #FFF7F7; border-color: #F7D4D4; } .a-red > .ic:first-child { color: var(--red); }
.a-amber { background: #FFFBF3; border-color: #F8E2BC; } .a-amber > .ic:first-child { color: var(--amber); }
.a-blue { background: #F6F9FF; border-color: #D9E4FF; } .a-blue > .ic:first-child { color: var(--primary); }
.periodo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.periodo div { background: var(--line-2); border-radius: 12px; padding: 12px; } .periodo span { display: block; font-size: 11.5px; color: var(--muted); } .periodo b { font-size: 14px; }
.checks p { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; color: var(--ink-3); } .checks .ic { color: var(--green); margin-top: 2px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 34px 10px; color: var(--soft); text-align: center; } .empty p { margin: 0; color: var(--muted); }
.callout { display: flex; gap: 14px; padding: 16px 18px; border-radius: var(--r-lg); background: linear-gradient(135deg, #FFF8EC, #FFF3DE); border: 1px solid #F6DDB0; color: #7A4A0B; }
.callout b { display: block; } .callout.mb { margin-bottom: 14px; } .callout span { font-size: 13px; }

/* ---------- Tablas ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.search { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 220px; height: 42px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; background: #fff; color: var(--soft); }
.search input { border: 0; height: 100%; padding: 0; box-shadow: none !important; }
.seg { display: inline-flex; background: var(--line-2); padding: 4px; border-radius: 12px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 34px; padding: 0 14px; border-radius: 9px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.seg.wide { display: flex; margin-bottom: 18px; } .seg.wide button { flex: 1; }
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: #FAFBFE; }
.tbl tfoot td { font-weight: 800; border-top: 2px solid var(--line); border-bottom: 0; }
.tbl.compact td { padding: 8px 12px; } .tbl .tot td { font-weight: 800; font-size: 15px; border-top: 2px solid var(--line); }
.tbl .r, .r { text-align: right; } .neg { color: var(--red); }
.tbl td.note { max-width: 260px; color: var(--muted); font-size: 12.5px; }
.tbl .btn + .btn, .tbl .btn + .icon-btn { margin-left: 4px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 190px; } .who b { display: block; font-size: 13.5px; } .who span { font-size: 12px; color: var(--muted); }
.inc { font-size: 12px; color: var(--muted); white-space: nowrap; }
small.block { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -6px -20px 18px; padding: 0 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 12px 12px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.tabs button.on { color: var(--primary); border-color: var(--primary); }
.tabs em { font-style: normal; background: #F59E0B; color: #1A1203; font-size: 11px; border-radius: 9px; padding: 0 6px; }
.legend { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Nómina ---------- */
.nom-list { display: flex; flex-direction: column; gap: 10px; }
.nom-card { display: flex; align-items: center; gap: 16px; padding: 16px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh); transition: border-color .15s, transform .12s; }
.nom-card:hover { border-color: #BFD0FF; transform: translateY(-1px); }
.nom-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--amber-soft); color: var(--amber); }
.nom-ic.timbrada { background: var(--green-soft); color: var(--green); }
.nom-main { flex: 1; min-width: 0; } .nom-main b { display: block; font-size: 15px; } .nom-main span { font-size: 12.5px; color: var(--muted); }
.nom-num { text-align: right; } .nom-num span { display: block; font-size: 11.5px; color: var(--muted); } .nom-num b { font-variant-numeric: tabular-nums; }
.checadas { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.chk { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; }
.selfie { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--line-2); flex-shrink: 0; }
.selfie.none { display: grid; place-items: center; color: var(--soft); }
.chk-b { flex: 1; min-width: 0; } .chk-b b { display: block; } .chk-b > span { font-size: 12.5px; color: var(--muted); }
.chk-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.sol-list { display: flex; flex-direction: column; gap: 10px; }
.sol { display: grid; grid-template-columns: 240px 1fr auto; gap: 18px; align-items: center; padding: 16px 20px; }
.sol-b b { display: block; } .sol-b span { color: var(--muted); font-size: 13px; } .sol-b p { margin: 4px 0; font-style: italic; color: var(--ink-3); } .sol-b small { color: var(--primary); font-size: 12px; }
.sol-a { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; } .sol-a small { color: var(--muted); font-size: 11.5px; } .sol-a:has(.btn) { flex-direction: row; }
.calc-grid { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start; }
.calc-in { display: flex; flex-direction: column; gap: 14px; } .calc-in .seg.wide { margin: 0; }
.calc-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.calc-hero div { padding: 16px; border-radius: 16px; background: linear-gradient(135deg, #1D4ED8, #3B6CF6); color: #fff; }
.calc-hero div + div { background: var(--ink); }
.calc-hero span { font-size: 12px; opacity: .8; } .calc-hero b { display: block; font-size: 26px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cr { display: flex; justify-content: space-between; padding: 9px 2px; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.cr span { color: var(--ink-3); } .cr.neg b { color: var(--red); } .cr.tot { border-bottom: 0; border-top: 2px solid var(--line); font-size: 15px; } .cr.tot b { font-weight: 800; }
h4 { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.chat { display: flex; flex-direction: column; height: calc(100vh - 150px); min-height: 460px; padding: 0; overflow: hidden; }
.chat-log { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 14px; background: linear-gradient(180deg, #FBFCFF, #fff); }
.msg { display: flex; gap: 10px; max-width: 760px; } .msg.yo { align-self: flex-end; }
.msg-ic { width: 30px; height: 30px; border-radius: 10px; background: linear-gradient(135deg, #1D4ED8, #7C9CFF); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.bubble { padding: 12px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: var(--sh); }
.msg.yo .bubble { background: var(--primary); color: #fff; border-color: transparent; border-bottom-right-radius: 6px; }
.msg.ia .bubble { border-top-left-radius: 6px; } .bubble ul { margin: 8px 0 4px; padding-left: 18px; } .bubble li { margin: 3px 0; } .bubble small { color: var(--muted); }
.sugs { display: flex; gap: 8px; padding: 12px 22px 0; overflow-x: auto; } .sugs .chip { flex-shrink: 0; }
.chat-in { display: flex; gap: 10px; padding: 14px 22px 18px; } .chat-in .btn { width: 46px; padding: 0; height: 44px; } .chat-in input { height: 44px; }
.emp-cards { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.emp-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: 16px; width: 100%; }
.emp-card > div:nth-child(2) { flex: 1; } .emp-card b { display: block; } .emp-card span { display: block; font-size: 12.5px; color: var(--muted); }
.emp-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.log { display: flex; flex-direction: column; max-height: 520px; overflow-y: auto; }
.log div { display: grid; grid-template-columns: 170px 180px 1fr; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.log time { color: var(--muted); }
.respaldo p { max-width: 560px; }
.ficha-h { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; } .ficha-h > div:nth-child(2) { flex: 1; } .ficha-h b { display: block; } .ficha-h span { color: var(--muted); font-size: 13px; }
.dl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.dl div { background: #fff; padding: 10px 12px; } .dl span { display: block; font-size: 11.5px; color: var(--muted); } .dl b { font-size: 13px; word-break: break-word; }
.mini-list { display: flex; flex-direction: column; gap: 6px; }
.mini { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); background: #fff; border-radius: 12px; cursor: pointer; text-align: left; }
.mini span { flex: 1; } .mini:hover { border-color: #BFD0FF; }

/* ---------- Modal y toasts ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(11, 18, 32, .45); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: fade .18s ease; }
.modal-wrap.out { opacity: 0; transition: opacity .18s; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 32px); background: #fff; border-radius: 22px; box-shadow: var(--sh-lg); display: flex; flex-direction: column; overflow: hidden; animation: pop .22s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.modal.sm { width: min(420px, 100%); } .modal.lg { width: min(780px, 100%); } .modal.xl { width: min(900px, 100%); } .modal.app { width: min(420px, 100%); }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 6px; } .modal-h h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.modal-b { padding: 12px 22px 18px; overflow-y: auto; }
.modal-f { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--line-2); background: #FBFCFE; }
.modal-f .btn + .btn { margin: 0; }
#toasts { position: fixed; z-index: 80; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: var(--sh-lg); font-weight: 600; font-size: 13.5px; animation: pop .25s ease; max-width: min(520px, calc(100vw - 32px)); }
.toast-ok .ic { color: #4ADE80; } .toast-error { background: #7F1D1D; } .toast-error .ic { color: #FCA5A5; }
.toast.out { opacity: 0; transform: translateY(8px); transition: .3s; }

/* ---------- Recibo ---------- */
.recibo { background: #fff; color: #0F172A; font-size: 12.5px; }
.rc-h { display: flex; gap: 16px; align-items: center; padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.rc-logo { width: 64px; height: auto; } .rc-h h3 { margin: 0; font-size: 16px; } .rc-h p { margin: 2px 0; color: var(--muted); font-size: 11.5px; }
.rc-h > div:nth-child(2) { flex: 1; } .rc-folio { text-align: right; } .rc-folio span { display: block; font-size: 11px; color: var(--muted); } .rc-folio b { font-size: 15px; }
.rc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 22px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.rc-grid span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); } .rc-grid b { font-weight: 600; }
.rc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 14px 0; }
.rc-cols table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.rc-cols th { text-align: left; background: var(--primary-soft); color: var(--primary); padding: 7px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.rc-cols th:last-child, .rc-cols td:last-child { text-align: right; } .rc-cols td { padding: 7px 10px; border-bottom: 1px solid var(--line-2); }
.rc-cols small { display: block; color: var(--muted); font-size: 10.5px; }
.rc-tot { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 10px; }
.rc-tot div { padding: 10px 14px; border-radius: 12px; background: var(--line-2); } .rc-tot span { display: block; font-size: 11px; color: var(--muted); } .rc-tot b { font-size: 16px; font-variant-numeric: tabular-nums; }
.rc-tot .neto { background: var(--ink); color: #fff; } .rc-tot .neto span { color: #9AA6BA; } .rc-tot .neto b { font-size: 20px; }
.rc-letra { text-align: center; font-weight: 700; letter-spacing: .02em; margin: 12px 0; font-size: 11.5px; }
.rc-cfdi { display: flex; gap: 16px; align-items: center; padding: 14px; border: 1px dashed #CBD5E1; border-radius: 14px; }
.rc-cfdi .qr svg { width: 116px; height: 116px; display: block; } .rc-cfdi .qr:empty { display: none; }
.rc-cfdi p { margin: 3px 0; font-size: 11.5px; } .rc-cfdi .warn { color: var(--amber); font-size: 10.5px; }
.rc-borrador { text-align: center; font-weight: 800; color: var(--amber); letter-spacing: .1em; padding: 10px; border: 2px dashed #F6DDB0; border-radius: 12px; }
.print-body { background: #fff; padding: 24px; } .print-body .recibo { max-width: 800px; margin: 0 auto; } .pb { page-break-after: always; height: 30px; }
@media print { .print-body { padding: 0; } @page { margin: 14mm; } }

/* ---------- Login ---------- */
.login { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.login-brand { position: relative; overflow: hidden; background: radial-gradient(1200px 600px at -10% -20%, #1E3A8A 0%, transparent 60%), radial-gradient(800px 500px at 120% 120%, #1D4ED8 0%, transparent 55%), var(--ink); color: #fff; padding: 56px 64px; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.login-brand::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: radial-gradient(circle at 30% 40%, #000, transparent 70%); pointer-events: none; }
.login-logo { width: 112px; filter: invert(1); margin-bottom: 10px; }
.login-brand h1 { font-size: 46px; line-height: 1.05; letter-spacing: -.035em; margin: 0; }
.login-brand h1 span { background: linear-gradient(90deg, #7FA5FF, #C7D7FF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-brand p { color: #B9C4D6; max-width: 480px; font-size: 15.5px; margin: 0; }
.login-brand ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 10px; } .login-brand li { display: flex; gap: 10px; align-items: center; color: #DCE4F2; font-weight: 500; } .login-brand li .ic { color: #7FA5FF; }
.login-brand small { position: absolute; bottom: 26px; left: 64px; color: #5E6B82; letter-spacing: .06em; text-transform: uppercase; font-size: 11px; }
.login-panel { display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: min(420px, 100%); display: flex; flex-direction: column; gap: 14px; }
.login-card h2 { margin: 0; font-size: 26px; letter-spacing: -.02em; } .login-card > p { margin: -8px 0 4px; }
.users { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow-y: auto; padding-right: 4px; }
.users h5 { margin: 10px 0 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--soft); }
.user { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); background: #fff; border-radius: 14px; cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s; }
.user:hover { border-color: #9DB5FA; box-shadow: 0 4px 14px rgba(29, 78, 216, .08); } .user b { display: block; font-size: 13.5px; } .user span { font-size: 12px; color: var(--muted); }
.pin-box { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pin-box[hidden], .users[hidden], .search[hidden] { display: none; }
#pinWho { display: flex; align-items: center; gap: 12px; margin: 0; } #pinWho b { display: block; } #pinWho span { font-size: 12px; color: var(--muted); }
.pin-dots { display: flex; gap: 12px; height: 16px; } .pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #CBD5E1; transition: .15s; } .pin-dots i.on { background: var(--primary); border-color: var(--primary); transform: scale(1.1); }
.shake { animation: shake .35s; } @keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.pin-native { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.keypad { display: grid; grid-template-columns: repeat(3, 76px); gap: 12px; }
.keypad button { height: 62px; border-radius: 18px; border: 1px solid var(--line); background: #fff; font-size: 22px; font-weight: 700; cursor: pointer; display: grid; place-items: center; transition: background .12s, transform .05s; }
.keypad button:hover { background: #F6F8FC; } .keypad button:active { transform: scale(.96); } .keypad .ok { background: var(--primary); color: #fff; border-color: transparent; }

/* ---------- App colaborador ---------- */
.phone-stage { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; background: radial-gradient(900px 500px at 50% -10%, #DCE6FF, transparent 70%), var(--bg); }
.preview-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; }
.preview-bar label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; } .preview-bar select { width: auto; height: 34px; }
.phone { width: 390px; height: min(844px, calc(100vh - 100px)); min-height: 640px; border-radius: 48px; background: #0B1220; padding: 12px; box-shadow: 0 40px 80px rgba(11, 18, 32, .28), inset 0 0 0 2px #2A3446; }
.phone-screen { position: relative; height: 100%; border-radius: 38px; overflow: hidden; background: #F3F5FA; display: flex; flex-direction: column; }
.app-body { flex: 1; overflow-y: auto; padding: 0 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.tabbar { display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 8px 6px calc(10px + env(safe-area-inset-bottom)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--soft); padding: 4px 0; }
.tabbar a.on { color: var(--primary); }
.app-hero { margin: 0 -16px; padding: 22px 22px 70px; background: radial-gradient(500px 220px at 90% 0%, #2F5BEA, transparent 70%), linear-gradient(160deg, #0B1220, #16213A); color: #fff; }
.app-top { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: #AFC0DD; font-weight: 600; margin-bottom: 18px; }
.app-logo { width: 34px; filter: invert(1); }
.app-hero p { margin: 0; color: #C7D2E6; font-size: 15px; } .app-hero h2 { margin: 2px 0; font-size: 46px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; } .app-hero small { color: #8FA0BD; display: block; } .app-hero small::first-letter { text-transform: uppercase; }
.app-card { background: #fff; border-radius: 20px; padding: 16px; box-shadow: 0 2px 10px rgba(15, 23, 42, .05); border: 1px solid var(--line-2); }
.check-card { margin-top: -58px; position: relative; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 14px 34px rgba(11, 18, 32, .12); }
.check-row { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.check-row div + div { border-left: 1px solid var(--line-2); } .check-row span { display: block; font-size: 11.5px; color: var(--muted); } .check-row b { font-size: 19px; font-variant-numeric: tabular-nums; } .check-row .badge { margin-top: 4px; height: 20px; font-size: 10px; }
.check-card .tiny { margin: -4px 0 0; }
.done { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border-radius: 14px; background: var(--green-soft); color: var(--green); font-weight: 700; }
.last-pay { display: flex; align-items: center; justify-content: space-between; background: linear-gradient(135deg, #1D4ED8, #3B6CF6); color: #fff; border: 0; }
.last-pay span { font-size: 12px; opacity: .8; } .last-pay b { display: block; font-size: 28px; letter-spacing: -.02em; } .last-pay small { opacity: .8; }
.app-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat .stat-txt, .vac .stat-txt { font-size: 16px; letter-spacing: 0; } .stat span { font-size: 12px; color: var(--muted); font-weight: 600; } .stat b { display: block; font-size: 26px; letter-spacing: -.02em; } .stat small { color: var(--muted); font-size: 11.5px; }
.app-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.app-act { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border-radius: 20px; background: #fff; border: 1px solid var(--line-2); cursor: pointer; text-align: left; font-weight: 700; font-size: 13px; color: var(--ink); }
.app-act .ic { color: var(--primary); background: var(--primary-soft); border-radius: 12px; padding: 8px; width: 40px; height: 40px; }
.app-act em { position: absolute; top: 12px; right: 12px; font-style: normal; background: #F59E0B; color: #1A1203; font-size: 11px; border-radius: 9px; padding: 1px 7px; }
.app-act:disabled { opacity: .5; }
.app-head { display: flex; align-items: center; gap: 8px; padding-top: 18px; } .app-head h3 { margin: 0; font-size: 22px; letter-spacing: -.02em; flex: 1; }
.total-año span { font-size: 12px; color: var(--muted); } .total-año b { display: block; font-size: 28px; letter-spacing: -.02em; }
.app-list { display: flex; flex-direction: column; gap: 8px; }
.app-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border-radius: 16px; border: 1px solid var(--line-2); }
.app-row > div:nth-child(2) { flex: 1; min-width: 0; } .app-row b { display: block; font-size: 13.5px; } .app-row span { font-size: 12px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-row strong { font-variant-numeric: tabular-nums; }
.ar-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.app-empty { text-align: center; color: var(--muted); padding: 30px 10px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.app-recibo { background: #fff; border-radius: 18px; padding: 14px; overflow-x: auto; }
.app-recibo .rc-h { flex-wrap: wrap; } .app-recibo .rc-grid, .app-recibo .rc-cols { grid-template-columns: 1fr; } .app-recibo .rc-tot { grid-template-columns: 1fr 1fr; } .app-recibo .rc-tot .neto { grid-column: 1 / -1; }
.app-recibo .rc-cfdi { flex-direction: column; text-align: center; } .app-recibo .rc-folio { text-align: left; }
.app-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .app-btns .btn + .btn { margin: 0; }
.vac { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; } .vac span { font-size: 11px; color: var(--muted); display: block; } .vac b { font-size: 24px; }
.vac div:first-child b { color: var(--primary); }
.app-profile { text-align: center; padding-top: 26px; display: flex; flex-direction: column; align-items: center; } .app-profile h3 { margin: 12px 0 2px; font-size: 20px; } .app-profile p { margin: 0; color: var(--muted); }
.dl1 { display: flex; flex-direction: column; padding: 4px 16px; } .dl1 div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); } .dl1 div:last-child { border: 0; } .dl1 span { color: var(--muted); font-size: 13px; } .dl1 b { font-size: 13px; text-align: right; word-break: break-all; }
.cam { position: relative; aspect-ratio: 1; border-radius: 20px; overflow: hidden; background: #0B1220; margin-bottom: 12px; }
.cam video, .cam img { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; } .cam [hidden] { display: none; }
.cam-msg { position: absolute; inset: 0; display: grid; place-items: center; color: #CBD5E1; text-align: center; padding: 20px; font-weight: 600; }
#fileWrap[hidden] { display: none; } #fileWrap { margin-bottom: 12px; }
.gps { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--line-2); color: var(--ink-3); font-size: 13px; font-weight: 600; }
.gps.ok { background: var(--green-soft); color: var(--green); } .gps.bad { background: var(--amber-soft); color: var(--amber); }
.dias-calc { margin: 4px 0 12px; color: var(--primary); font-weight: 700; font-size: 13px; }
.modal.app .modal-f .btn.block { width: 100%; } .modal.app .form-grid { margin: 10px 0; }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) { .grid-2, .grid-3, .calc-grid { grid-template-columns: 1fr; } .dl { grid-template-columns: repeat(2, 1fr); } .sol { grid-template-columns: 1fr; } .sol-a { align-items: flex-start; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; left: 0; width: 280px; transform: translateX(-100%); transition: transform .25s ease; }
  .menu-open .side { transform: none; } .menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(11, 18, 32, .45); }
  .only-m { display: inline-grid; } .hide-m { display: none; }
  .top { padding: 14px 16px; flex-wrap: wrap; } .top h1 { font-size: 19px; } .top-act { width: 100%; justify-content: flex-start; }
  .content { padding: 4px 16px 32px; }
  .card { padding: 16px; } .table-wrap { margin: 0 -16px; padding: 0 16px; } .tabs { margin: -4px -16px 16px; }
  .form-grid { grid-template-columns: 1fr; } .periodo { grid-template-columns: 1fr 1fr; }
  .login { grid-template-columns: 1fr; } .login-brand { padding: 36px 24px 48px; } .login-brand h1 { font-size: 32px; } .login-brand ul, .login-brand small { display: none; }
  .nom-card { flex-wrap: wrap; padding: 14px 16px; } .nom-main { flex-basis: calc(100% - 60px); }
  .hbar { grid-template-columns: 100px 1fr auto; } .log div { grid-template-columns: 1fr; gap: 2px; }
  .rc-grid, .rc-cols { grid-template-columns: 1fr; } .rc-tot { grid-template-columns: 1fr 1fr; } .rc-tot .neto { grid-column: 1 / -1; }
  .modal-wrap { padding: 0; align-items: end; } .modal { width: 100% !important; max-height: 92vh; border-radius: 22px 22px 0 0; }
}
@media (max-width: 520px) {
  .phone-stage { padding: 0; justify-content: flex-start; } .phone { width: 100%; height: 100dvh; min-height: 0; border-radius: 0; padding: 0; box-shadow: none; } .phone-screen { border-radius: 0; }
  .preview-bar { padding: 8px; } .kpis { grid-template-columns: 1fr 1fr; } .kpi b { font-size: 18px; }
  .keypad { grid-template-columns: repeat(3, 68px); } .checadas { grid-template-columns: 1fr; }
}
