/* ============ Control RH — hoja de estilos ============ */
:root {
  --bg: #f4f6fa; --surface: #ffffff; --surface-2: #f8fafc; --ink: #0f1b2d; --ink-2: #3b4a60; --muted: #6b7a90; --line: #e4e9f1; --line-2: #d3dbe7;
  --brand: #2358e6; --brand-ink: #ffffff; --brand-soft: #e8efff; --brand-line: #c6d6ff;
  --green: #0f9d6b; --green-soft: #e3f6ee; --amber: #c27803; --amber-soft: #fff3da; --red: #d63a3a; --red-soft: #fdeaea; --blue: #2358e6; --blue-soft: #e8efff; --violet: #7a4fe0; --violet-soft: #f0eafd; --teal: #0a8f87; --teal-soft: #dff5f3; --gray-soft: #eef1f6;
  --c-vac: #14a89d; --c-abj: #f0a329; --c-abi: #e0504f; --c-per: #8b63e8;
  --side: #0c1829; --side-2: #14243b; --side-ink: #a9b8cf; --side-active: #1b3357;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 4px 14px rgba(15, 27, 45, .05); --shadow-lg: 0 20px 60px rgba(8, 17, 32, .28);
  --r: 12px; --r-sm: 8px; --focus: 0 0 0 3px rgba(35, 88, 230, .22);
  --font: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
[data-theme=dark] {
  --bg: #0a121f; --surface: #101c2e; --surface-2: #14233a; --ink: #e8eef8; --ink-2: #b6c3d8; --muted: #8393ab; --line: #1d2d46; --line-2: #2a3d5c;
  --brand: #5b8cff; --brand-ink: #07132b; --brand-soft: #172c55; --brand-line: #284a8f;
  --green: #35c690; --green-soft: #0f3226; --amber: #f2b441; --amber-soft: #3a2b0c; --red: #f06b6b; --red-soft: #3b1618; --blue: #5b8cff; --blue-soft: #172c55; --violet: #a68bf5; --violet-soft: #2a1f4f; --teal: #3fd0c5; --teal-soft: #0d3431; --gray-soft: #1a2940;
  --side: #070e19; --side-2: #0d1828; --side-active: #16294a; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
body.modal-open { overflow: hidden; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.015em; }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.ico { flex: none; vertical-align: middle; }
.grow { flex: 1; } .muted { color: var(--muted); } .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .92em; } .nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; font-weight: 600; } .pos { color: var(--green); } .neg { color: var(--red); } .charge { color: var(--violet); }
.only-mobile { display: none; } [hidden] { display: none !important; }
.sub { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 1px; } .sub.inline { display: inline; } .sub.warn { color: var(--amber); }
.clip { display: block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); } .clip.wide { max-width: 420px; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 9px; border: 1px solid transparent; font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: .15s; text-decoration: none !important; }
.btn:focus-visible, .icon-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn.primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 1px 2px rgba(35, 88, 230, .35); } .btn.primary:hover { filter: brightness(1.08); }
.btn.secondary { background: var(--surface); border-color: var(--line-2); color: var(--ink); } .btn.secondary:hover { background: var(--surface-2); border-color: var(--muted); }
.btn.ghost { background: transparent; color: var(--ink-2); } .btn.ghost:hover { background: var(--gray-soft); }
.btn.danger { background: var(--red); color: #fff; } .btn.success { background: var(--green); color: #fff; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; } .btn.xs { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; } .btn.lg { height: 46px; font-size: 15px; } .btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--ink-2); transition: .15s; } .icon-btn:hover:not(:disabled) { background: var(--gray-soft); color: var(--ink); } .icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.ok:hover { background: var(--green-soft); color: var(--green); } .icon-btn.bad:hover { background: var(--red-soft); color: var(--red); }

/* ---------- Autenticación ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 46%) 1fr; }
.auth-brand { background: radial-gradient(1200px 600px at 0% 0%, #1d4fd8 0%, transparent 60%), radial-gradient(800px 500px at 100% 100%, #0a8f87 0%, transparent 55%), #0a1626; color: #dfe8f8; padding: 44px 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-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 75%); pointer-events: none; }
.auth-brand > * { position: relative; z-index: 1; }
.brand-lg { display: flex; align-items: center; gap: 12px; font-size: 20px; letter-spacing: -.02em; } .brand-lg b { color: #fff; }
.logo { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: linear-gradient(145deg, #3b74ff, #1c46c9); color: #fff; box-shadow: 0 6px 18px rgba(35, 88, 230, .45), inset 0 1px 0 rgba(255, 255, 255, .25); }
.auth-hero h1 { font-size: 38px; line-height: 1.12; color: #fff; max-width: 460px; letter-spacing: -.03em; } .auth-hero h1 em { font-style: normal; background: linear-gradient(90deg, #7fb0ff, #5ee0d3); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-hero p { color: #b3c3de; font-size: 15.5px; max-width: 440px; margin: 16px 0 26px; }
.auth-hero ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; } .auth-hero li { display: flex; gap: 12px; align-items: center; color: #d2def2; } .auth-hero li .ico { color: #7fb0ff; background: rgba(255, 255, 255, .08); padding: 8px; width: 36px; height: 36px; border-radius: 10px; }
.auth-brand small { color: #7d90b0; }
.auth-main { display: grid; place-items: center; padding: 32px; background: var(--bg); }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 34px; box-shadow: var(--shadow-lg); display: grid; gap: 16px; } .auth-card.wide { width: min(560px, 100%); }
.auth-card h2 { font-size: 24px; } .auth-card .sub { margin: -8px 0 4px; font-size: 14px; }
.auth-foot { display: flex; gap: 6px; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; margin: 0; }
.pw { position: relative; } .pw input { padding-right: 42px; } .pw .icon-btn { position: absolute; right: 4px; top: 4px; }
.warn-note { display: flex; gap: 8px; align-items: center; color: var(--amber); font-size: 12.5px; margin: 0; }

/* ---------- Estructura ---------- */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30; }
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 18px 16px; } .brand b { color: #fff; font-size: 16px; display: block; letter-spacing: -.01em; } .brand small { display: block; color: #6f84a6; font-size: 11.5px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand .logo { width: 36px; height: 36px; border-radius: 10px; }
.side nav { flex: 1; overflow: auto; padding: 4px 12px 12px; }
.nav-group { margin-top: 14px; } .nav-group > span { display: block; font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: #566b8d; padding: 0 10px 6px; font-weight: 700; }
.nav-group a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: var(--side-ink); font-weight: 500; margin-bottom: 2px; text-decoration: none; transition: .12s; position: relative; }
.nav-group a:hover { background: var(--side-2); color: #fff; } .nav-group a.active { background: var(--side-active); color: #fff; } .nav-group a.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #5b8cff; }
.nav-count { margin-left: auto; display: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; font-style: normal; font-size: 11.5px; font-weight: 700; place-items: center; color: #1b1203; }
.nav-count.on { display: grid; } .nav-count.amber { background: #f2b441; } .nav-count.red { background: #f27c7c; }
.side-user { border-top: 1px solid #16253c; padding: 14px; display: grid; gap: 10px; background: var(--side-2); }
.who { display: flex; gap: 10px; align-items: center; min-width: 0; } .who b { color: #fff; display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .who small { color: #7388a8; font-size: 11.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who > div { min-width: 0; }
.side-actions { display: flex; gap: 4px; } .side-actions .icon-btn { color: #8ea2c2; flex: 1; width: auto; } .side-actions .icon-btn:hover { background: var(--side-active) !important; color: #fff !important; }
.scrim { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: 62px; display: flex; align-items: center; gap: 16px; padding: 0 32px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.gsearch { position: relative; width: min(440px, 100%); } .gsearch > span { position: absolute; left: 12px; top: 10px; color: var(--muted); pointer-events: none; }
.gsearch input { width: 100%; height: 38px; padding: 0 12px 0 36px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); outline: none; } .gsearch input:focus { border-color: var(--brand); box-shadow: var(--focus); }
.gres { position: absolute; top: 44px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; }
.gres a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; } .gres a:hover { background: var(--gray-soft); } .gres b { display: block; font-size: 13.5px; } .gres small { color: var(--muted); } .gres .none { padding: 12px; color: var(--muted); text-align: center; }
.today { text-align: right; line-height: 1.25; } .today b { display: block; text-transform: capitalize; font-size: 13px; } .today span { color: var(--muted); font-size: 12px; }
.view { padding: 28px 32px 64px; max-width: 1480px; width: 100%; outline: none; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; } .page-head p { margin: 4px 0 0; color: var(--muted); } .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .actions-row { display: flex; gap: 8px; margin-bottom: 14px; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 14px; color: var(--muted); font-weight: 500; } .back:hover { color: var(--ink); text-decoration: none; }

/* ---------- Tarjetas, estadísticas ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 20px; }
.card.flush { overflow: hidden; } .card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 0; } .card-head h3 { font-size: 15px; display: flex; gap: 8px; align-items: center; } .card-head p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.card-body { padding: 16px 20px 20px; } .card.flush .card-head { padding-bottom: 14px; } .card-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); border-radius: 0 0 var(--r) var(--r); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } .grid-2.wide-left { grid-template-columns: 1.5fr 1fr; } .grid-2 > .card { margin-bottom: 20px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 20px; } .stats.compact { margin-bottom: 16px; }
.stat { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); color: var(--ink); transition: .15s; } a.stat:hover { text-decoration: none; transform: translateY(-1px); border-color: var(--line-2); }
.stat-ico { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.stat.blue .stat-ico { background: var(--blue-soft); color: var(--blue); } .stat.teal .stat-ico { background: var(--teal-soft); color: var(--teal); } .stat.amber .stat-ico { background: var(--amber-soft); color: var(--amber); } .stat.red .stat-ico { background: var(--red-soft); color: var(--red); } .stat.violet .stat-ico { background: var(--violet-soft); color: var(--violet); } .stat.green .stat-ico { background: var(--green-soft); color: var(--green); }
.stat-body { min-width: 0; } .stat-label { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; } .stat strong { display: block; font-size: 26px; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; } .stat small { color: var(--muted); font-size: 12px; display: block; }
.stats.compact .stat { padding: 13px 16px; } .stats.compact .stat strong { font-size: 22px; }
.count-pill { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--gray-soft); color: var(--ink-2); font-size: 11.5px; font-weight: 700; }
.tabs .count-pill { margin-left: 4px; } .tabs .on .count-pill { background: var(--brand); color: var(--brand-ink); }

/* ---------- Listas, gráficos ---------- */
.list { list-style: none; margin: 0; padding: 0; } .list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); } .list li:last-child { border-bottom: 0; padding-bottom: 0; } .list li:first-child { padding-top: 0; }
.li-main { display: flex; gap: 11px; align-items: center; min-width: 0; } .li-main small, .li-side small { display: block; color: var(--muted); font-size: 12px; } .li-side { text-align: right; flex: none; } .li-side .badge { margin-bottom: 2px; }
.li-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.alerts .al { align-items: flex-start; justify-content: flex-start; } .al-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; } .al.red .al-dot { background: var(--red); } .al.amber .al-dot { background: var(--amber); } .al.blue .al-dot { background: var(--blue); } .al.green .al-dot { background: var(--green); }
.al small { display: block; color: var(--ink-2); font-size: 12.5px; } .more-note { margin: 10px 0 0; color: var(--muted); font-size: 12.5px; }
.chart { width: 100%; height: auto; display: block; } .chart .gl { stroke: var(--line); stroke-width: 1; } .chart .gt { fill: var(--muted); font-size: 11px; } .chart .gv { fill: var(--ink-2); font-size: 11px; font-weight: 700; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; color: var(--ink-2); font-size: 12.5px; } .legend span { display: inline-flex; align-items: center; gap: 6px; } .legend i { width: 10px; height: 10px; border-radius: 3px; }
.hbars { display: grid; gap: 12px; } .hbars > div { display: grid; grid-template-columns: 150px 1fr 30px; gap: 12px; align-items: center; font-size: 13px; } .hbars .bar { height: 10px; background: var(--gray-soft); border-radius: 5px; overflow: hidden; } .hbars .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--c-per), #b399f2); border-radius: 5px; } .hbars b { text-align: right; }

/* ---------- Insignias, avatares ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; height: 22px; border-radius: 11px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--green-soft); color: var(--green); } .badge.amber { background: var(--amber-soft); color: var(--amber); } .badge.red { background: var(--red-soft); color: var(--red); } .badge.blue { background: var(--blue-soft); color: var(--blue); } .badge.gray { background: var(--gray-soft); color: var(--muted); } .badge.violet { background: var(--violet-soft); color: var(--violet); } .badge.teal { background: var(--teal-soft); color: var(--teal); }
.avatar { --s: 34px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; display: inline-grid; place-items: center; font-weight: 700; font-size: calc(var(--s) * .36); color: hsl(var(--h) 55% 28%); background: hsl(var(--h) 70% 90%); }
[data-theme=dark] .avatar { color: hsl(var(--h) 80% 85%); background: hsl(var(--h) 45% 24%); }
.emp-cell { display: flex; gap: 11px; align-items: center; min-width: 0; } .emp-cell small { display: block; color: var(--muted); font-size: 12px; } .emp-link { color: var(--ink); font-weight: 600; display: block; } .emp-link:hover { color: var(--brand); text-decoration: none; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th { position: sticky; top: 0; text-align: left; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none; }
.grid th[data-sort] { cursor: pointer; } .grid th[data-sort]:hover, .grid th.sorted { color: var(--ink); } .grid th .sort { font-style: normal; font-size: 9px; margin-left: 5px; color: var(--brand); }
.grid td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; } .grid tbody tr:last-child td { border-bottom: 0; } .grid tr.clickable { cursor: pointer; } .grid tbody tr:hover { background: var(--surface-2); }
.grid .right, .grid th.right { text-align: right; } .grid td b { font-weight: 600; } .grid tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line-2); }
.selcol { width: 44px; padding-right: 0 !important; }
.row-actions { display: inline-flex; gap: 2px; }
.balance { display: inline-flex; align-items: baseline; gap: 4px; padding: 3px 10px; border-radius: 8px; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; } .balance small { font-size: 11px; font-weight: 500; opacity: .8; }
.balance.green { background: var(--green-soft); color: var(--green); } .balance.amber { background: var(--amber-soft); color: var(--amber); } .balance.red { background: var(--red-soft); color: var(--red); } .balance.gray { background: var(--gray-soft); color: var(--muted); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; flex-wrap: wrap; gap: 10px; background: var(--surface); }
.pg { display: flex; gap: 4px; align-items: center; } .pg select { height: 32px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); padding: 0 8px; margin-right: 8px; }
.pnum { min-width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; font-weight: 600; color: var(--ink-2); } .pnum:hover { background: var(--gray-soft); } .pnum.on { background: var(--brand); color: var(--brand-ink); } .dots { padding: 0 4px; }
.empty { display: grid; place-items: center; text-align: center; gap: 6px; padding: 48px 24px; color: var(--muted); } .empty .ico { color: var(--line-2); margin-bottom: 6px; } .empty strong { color: var(--ink); font-size: 15px; } .empty p { margin: 0; max-width: 420px; }
.kardex .kico { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; margin-right: 10px; vertical-align: middle; }
.kico.green { background: var(--green-soft); color: var(--green); } .kico.blue { background: var(--blue-soft); color: var(--blue); } .kico.teal { background: var(--teal-soft); color: var(--teal); } .kico.red { background: var(--red-soft); color: var(--red); } .kico.gray { background: var(--gray-soft); color: var(--muted); }
.mini-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13px; } .mini-table th, .mini-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; } .mini-table th { color: var(--muted); font-size: 11.5px; text-transform: uppercase; } .mini-table .r { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Filtros y pestañas ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.search { position: relative; flex: 1 1 260px; min-width: 220px; } .search .ico { position: absolute; left: 12px; top: 11px; color: var(--muted); } .search input { width: 100%; height: 38px; padding: 0 12px 0 36px; }
.ftr { display: grid; gap: 4px; } .ftr > span { font-size: 11.5px; font-weight: 600; color: var(--muted); } .ftr select, .ftr input { height: 38px; min-width: 130px; padding: 0 10px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; } .tabs button { background: none; border: 0; padding: 11px 16px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; align-items: center; } .tabs button:hover { color: var(--ink); } .tabs button.on { color: var(--brand); border-color: var(--brand); }
.bulk { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: var(--r); margin-bottom: 14px; color: var(--ink); }
.pend-box { border-color: var(--amber); } .pend-box .card-head p { color: var(--amber); }

/* ---------- Formularios ---------- */
input, select, textarea { background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px; padding: 0 12px; height: 38px; width: 100%; outline: none; transition: .12s; color: var(--ink); }
textarea { height: auto; padding: 9px 12px; resize: vertical; min-height: 72px; } select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238393ab' stroke-width='2.5' 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 12px center; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: var(--focus); } input:disabled, select:disabled { background: var(--gray-soft); color: var(--muted); cursor: not-allowed; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; } input[type=date], input[type=time] { min-width: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } .form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .span-2 { grid-column: span 2; } .span-all { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; align-content: start; min-width: 0; } .field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); } .req { color: var(--red); font-style: normal; margin-left: 3px; } .hint { color: var(--muted); font-size: 12px; font-weight: 400; } .hint-p { color: var(--muted); margin: -4px 0 12px; }
.readout { height: 38px; display: flex; align-items: center; padding: 0 12px; border-radius: 9px; background: var(--gray-soft); font-weight: 600; text-transform: capitalize; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 13.5px; font-weight: 500; line-height: 1.35; } .check input { position: absolute; opacity: 0; width: 0; height: 0; } .check small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; margin-top: 2px; }
.check .box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); background: var(--surface); display: grid; place-items: center; color: transparent; flex: none; margin-top: 0; transition: .12s; } .check input:checked + .box { background: var(--brand); border-color: var(--brand); color: #fff; } .check input:focus-visible + .box { box-shadow: var(--focus); } .check.mini .box { width: 18px; height: 18px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--gray-soft); border-radius: 10px; padding: 3px; gap: 3px; height: 38px; } .seg label { margin: 0; } .seg input { position: absolute; opacity: 0; } .seg span { display: grid; place-items: center; height: 32px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; transition: .12s; } .seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); } .seg input:focus-visible + span { box-shadow: var(--focus); }
.info-box { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; padding: 12px 16px; background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: 10px; margin-top: 4px; } .info-box > div span { display: block; font-size: 11.5px; color: var(--muted); } .info-box > div b { font-size: 20px; font-variant-numeric: tabular-nums; } .info-box b.neg { color: var(--red); } .info-box small { color: var(--ink-2); font-size: 12.5px; flex-basis: 100%; } .info-box.bad { background: var(--red-soft); border-color: var(--red); } .info-box.muted { background: var(--gray-soft); border-color: var(--line); color: var(--muted); }
.warn-box { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--amber-soft); color: var(--ink); border: 1px solid var(--amber); margin-bottom: 18px; font-size: 13px; } .warn-box .ico { color: var(--amber); margin-top: 2px; }
.sect { display: grid; gap: 2px; padding-top: 6px; border-top: 1px dashed var(--line-2); } .sect b { display: flex; gap: 8px; align-items: center; } .sect small { color: var(--muted); }
.form-error { display: flex; gap: 8px; align-items: flex-start; background: var(--red-soft); color: var(--red); border: 1px solid var(--red); padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; } .form-error .ico { margin-top: 2px; }
.only-d, .only-h, .only-c { display: none; } .mode-h .only-h, .mode-d .only-d, .show-c .only-c { display: block; }
.confirm-msg { margin: 0 0 12px; color: var(--ink-2); line-height: 1.55; }

/* ---------- Modales y avisos ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8, 16, 30, .55); backdrop-filter: blur(3px); z-index: 100; display: grid; place-items: start center; padding: 6vh 16px; overflow-y: auto; opacity: 0; transition: opacity .16s; } .modal-backdrop.in { opacity: 1; }
.modal { width: 100%; max-width: 640px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); transform: translateY(10px) scale(.985); transition: .18s; } .modal-backdrop.in .modal { transform: none; } .modal.sm { max-width: 460px; } .modal.lg { max-width: 780px; }
.modal-head { display: flex; justify-content: space-between; gap: 12px; padding: 20px 22px 0; } .modal-head h2 { font-size: 18px; } .modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.modal-body { padding: 18px 22px 8px; } .modal-foot { display: flex; align-items: center; gap: 8px; padding: 16px 22px 20px; }
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 10px; }
.toast { display: flex; gap: 10px; align-items: center; background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 11px; box-shadow: var(--shadow-lg); max-width: 420px; transform: translateY(12px); opacity: 0; transition: .22s; } .toast.in { transform: none; opacity: 1; } .toast.ok .ico { color: #4ade80; } .toast.error .ico { color: #f87171; } .toast.warn .ico { color: #fbbf24; }

/* ---------- Ficha de empleado ---------- */
.emp-head { display: flex; justify-content: space-between; gap: 20px; padding: 22px; flex-wrap: wrap; } .eh-main { display: flex; gap: 18px; align-items: center; } .emp-head h1 { font-size: 22px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .emp-head p { margin: 3px 0 8px; color: var(--ink-2); }
.eh-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 13px; } .eh-meta span { display: inline-flex; gap: 6px; align-items: center; }
.bal-grid { display: grid; grid-template-columns: 1.35fr repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.bal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); } .bal span { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; } .bal strong { display: block; font-size: 28px; letter-spacing: -.02em; margin: 2px 0; font-variant-numeric: tabular-nums; } .bal strong small { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 5px; } .bal > small { color: var(--muted); font-size: 12px; }
.bal.main { color: #fff; border: 0; } .bal.main span, .bal.main small, .bal.main strong small { color: rgba(255, 255, 255, .85); } .bal.main strong { font-size: 40px; } .bal.main.green { background: linear-gradient(135deg, #0b8a62, #0fa874); } .bal.main.amber { background: linear-gradient(135deg, #b46b02, #d88a0e); } .bal.main.red { background: linear-gradient(135deg, #b32727, #d63a3a); } .bal.main.gray { background: linear-gradient(135deg, #566b8d, #6f84a6); }
.meter { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .25); margin: 10px 0 8px; overflow: hidden; } .meter i { display: block; height: 100%; background: #fff; border-radius: 4px; } .bal.warn { border-color: var(--amber); }
.ficha { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 22px; } .ficha h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; } .kv { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); } .kv span { color: var(--muted); } .notes { margin: 0 0 16px; white-space: pre-wrap; color: var(--ink-2); }

/* ---------- Calendario ---------- */
.cal-bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; } .cal-nav { display: flex; align-items: center; gap: 6px; } .cal-nav h2 { font-size: 20px; min-width: 190px; text-align: center; text-transform: capitalize; } .cal-filters { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 16px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); cursor: pointer; user-select: none; } .chip input { display: none; } .chip i { width: 9px; height: 9px; border-radius: 3px; background: var(--c, var(--brand)); opacity: .4; } .chip.on { color: var(--ink); border-color: var(--c, var(--brand-line)); } .chip.on i { opacity: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; } .chips .chip.on { background: var(--brand-soft); border-color: var(--brand-line); } .chips.rm .chip button { border: 0; background: none; padding: 0; display: grid; color: var(--muted); } .chips.rm .chip button:hover { color: var(--red); }
.cal-card { padding: 14px; } .cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; } .cal-dow { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 6px 0; }
.cal-cell { min-height: 112px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; cursor: pointer; background: var(--surface); transition: .12s; } .cal-cell:hover { border-color: var(--brand); box-shadow: var(--shadow); } .cal-cell.blank { border: 0; background: none; cursor: default; box-shadow: none; } .cal-cell.off { background: var(--surface-2); } .cal-cell.hol { background: var(--amber-soft); } .cal-cell.today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.cal-d { display: flex; justify-content: space-between; gap: 4px; margin-bottom: 4px; } .cal-d b { font-size: 13px; } .cal-cell.today .cal-d b { background: var(--brand); color: var(--brand-ink); border-radius: 12px; padding: 0 7px; } .cal-d em { font-style: normal; font-size: 10.5px; color: var(--amber); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev { display: grid; gap: 3px; } .ev { font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; } .ev.vacacion { background: var(--c-vac); } .ev.ausencia-j { background: var(--c-abj); color: #3a2503; } .ev.ausencia-i { background: var(--c-abi); } .ev.permiso { background: var(--c-per); } .ev.pend { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .35) 0 4px, transparent 4px 8px); } .ev.more { background: var(--gray-soft); color: var(--muted); }

/* ---------- Reportes ---------- */
.rep-layout { display: grid; grid-template-columns: 330px 1fr; gap: 22px; align-items: start; } .rep-list { display: grid; gap: 8px; position: sticky; top: 82px; }
.rep-list button { display: flex; gap: 12px; text-align: left; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; transition: .12s; } .rep-list button:hover { border-color: var(--line-2); } .rep-list button.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); } .rep-list b { display: block; font-size: 13.5px; } .rep-list small { color: var(--muted); font-size: 12px; line-height: 1.35; display: block; margin-top: 2px; } .ri { width: 36px; height: 36px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--gray-soft); color: var(--brand); } .rep-list .on .ri { background: var(--brand); color: var(--brand-ink); }
.rep-form { padding: 18px 20px; } .rep-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 16px; } .rep-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rep-out { background: #e7ebf2; border-radius: var(--r); padding: 22px; } [data-theme=dark] .rep-out { background: #0b1626; } .rep-out .empty { padding: 40px; }
.sheet { background: #fff; color: #111827; max-width: 1000px; margin: 0 auto; padding: 38px 44px; box-shadow: 0 4px 24px rgba(15, 27, 45, .14); border-radius: 4px; font-size: 12.5px; }
.sh-head { display: flex; justify-content: space-between; gap: 24px; border-bottom: 2.5px solid #1f3a8a; padding-bottom: 14px; align-items: flex-end; } .sh-co b { display: block; font-size: 17px; color: #1f3a8a; } .sh-co small { display: block; color: #6b7280; font-size: 11px; } .sh-title { text-align: right; } .sh-title h1 { font-size: 20px; letter-spacing: -.01em; } .sh-title p { margin: 3px 0 0; color: #4b5563; }
.sh-meta { display: flex; flex-wrap: wrap; gap: 4px 20px; padding: 10px 0 4px; color: #4b5563; font-size: 11.5px; }
.sh-h { font-size: 13px; margin: 18px 0 8px; color: #1f3a8a; text-transform: uppercase; letter-spacing: .05em; } .sh-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 12px 0 4px; } .sh-kpis div { border: 1px solid #d1d5db; border-radius: 6px; padding: 8px 12px; } .sh-kpis span { display: block; font-size: 10.5px; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; } .sh-kpis b { font-size: 17px; }
.sh-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 11.5px; } .sh-table th { background: #eef2fb; color: #1f2a44; text-align: left; padding: 6px 8px; border-bottom: 1.5px solid #1f3a8a; font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; } .sh-table td { padding: 5px 8px; border-bottom: 1px solid #e5e7eb; } .sh-table tbody tr:nth-child(even) td { background: #f9fafb; } .sh-table .right { text-align: right; font-variant-numeric: tabular-nums; } .sh-table tfoot td { font-weight: 700; border-top: 1.5px solid #1f3a8a; background: #eef2fb; }
.sh-empty { color: #6b7280; padding: 16px 0; font-style: italic; } .sh-notes { margin-top: 14px; color: #4b5563; font-size: 11px; font-style: italic; }
.sh-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; margin-top: 58px; } .sh-sign div { text-align: center; } .sh-sign i { display: block; border-top: 1px solid #111827; margin-bottom: 6px; } .sh-sign span { font-size: 11px; color: #374151; } .sh-sign small { color: #6b7280; }
.sh-foot { margin-top: 30px; padding-top: 8px; border-top: 1px solid #e5e7eb; text-align: center; color: #9ca3af; font-size: 10px; }
#print-root { display: none; }

/* ---------- Históricos, configuración, usuarios ---------- */
.snap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; } .snap { padding: 20px; display: grid; gap: 6px; margin: 0; } .snap h3 { font-size: 16px; } .snap p { margin: 0; color: var(--ink-2); } .snap small { color: var(--muted); font-size: 12px; } .snap small.note { font-style: italic; }
.snap-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 4px; } .snap-kv { display: flex; gap: 14px; flex-wrap: wrap; font-weight: 600; font-size: 13px; padding: 6px 0; } .snap-actions { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.role-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 20px; } .role { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 4px; } .role small { color: var(--muted); font-size: 12px; line-height: 1.4; } .role span { color: var(--brand); font-weight: 600; font-size: 12px; }
.cfg { max-width: 980px; } .sub-h { margin: 22px 0 8px; font-size: 14px; } .cfg .card-body > .sub-h:first-of-type { margin-top: 4px; }
.tier { display: flex; gap: 14px; align-items: flex-end; margin-bottom: 10px; } .tier label { display: grid; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); flex: 1; max-width: 220px; }
.add-row { display: flex; gap: 8px; } .add-row input { flex: 1; } hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------- Adaptación ---------- */
@media (max-width: 1180px) { .bal-grid { grid-template-columns: repeat(2, 1fr); } .bal.main { grid-column: 1 / -1; } .rep-layout { grid-template-columns: 1fr; } .rep-list { position: static; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } .grid-2, .grid-2.wide-left { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; } .side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-100%); transition: .22s; } .side.open { transform: none; box-shadow: var(--shadow-lg); } .side.open + .scrim { display: block; position: fixed; inset: 0; background: rgba(8, 16, 30, .5); z-index: 25; }
  .only-mobile { display: grid; } .topbar { padding: 0 16px; } .today { display: none; } .view { padding: 20px 16px 48px; } .auth { grid-template-columns: 1fr; } .auth-brand { display: none; }
  .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } .ficha { grid-template-columns: 1fr; } .cal-cell { min-height: 74px; } .ev { font-size: 10px; padding: 1px 4px; } .cal-d em { display: none; }
}
@media (max-width: 560px) { .bal-grid { grid-template-columns: 1fr; } .stats { grid-template-columns: 1fr 1fr; } .stat { flex-direction: column; align-items: flex-start; } .filters .ftr { flex: 1 1 130px; } .hbars > div { grid-template-columns: 100px 1fr 24px; } }

/* ---------- Impresión ---------- */
@page { size: A4; margin: 13mm 11mm; @bottom-center { content: "Página " counter(page) " de " counter(pages); font: 9px sans-serif; color: #6b7280; } }
@media print {
  html, body { background: #fff !important; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block; }
  .sheet { box-shadow: none; max-width: none; padding: 0; border-radius: 0; font-size: 11px; }
  .sh-table { font-size: 10px; } .sh-table thead { display: table-header-group; } .sh-table tr { break-inside: avoid; } .sh-h { break-after: avoid; } .sh-sign { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Multi-empresa ---------- */
.co-switch { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 4px 0 12px; border: 1px solid var(--brand-line); background: var(--brand-soft); color: var(--brand); border-radius: 10px; } .co-switch select { border: 0; background-color: transparent; height: 36px; font-weight: 600; color: var(--ink); min-width: 170px; max-width: 260px; box-shadow: none !important; }
.co-tag { display: inline-block; padding: 2px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; color: hsl(var(--h) 55% 28%); background: hsl(var(--h) 70% 91%); white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
[data-theme=dark] .co-tag { color: hsl(var(--h) 80% 85%); background: hsl(var(--h) 45% 24%); }
@media (max-width: 900px) { .co-switch select { min-width: 110px; } }

/* ---------- Ajustes de densidad ---------- */
.grid td, .grid th { padding-left: 12px; padding-right: 12px; }
.grid .emp-link, .grid .emp-cell small { white-space: nowrap; }
.grid .emp-cell small { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.co-tag { max-width: 170px; }
.rep-layout { grid-template-columns: 330px minmax(0, 1fr); } .rep-out { overflow-x: auto; } .sheet { min-width: 640px; } .sh-table td { vertical-align: top; }
@media (max-width: 1180px) { .rep-layout { grid-template-columns: minmax(0, 1fr); } }

.sh-table td { white-space: nowrap; } .sh-table td.w { white-space: normal; min-width: 180px; }
.co-tag { max-width: 135px; }
@media print { .sh-table td { white-space: normal; } .sh-table td.w { min-width: 0; } }

/* ---------- Menú lateral plegable ---------- */
.shell { transition: grid-template-columns .2s; } .shell.collapsed { grid-template-columns: 0 1fr; } .shell.collapsed .side { visibility: hidden; transform: translateX(-100%); }
.side { transition: transform .2s, visibility .2s; }
@media (max-width: 900px) { .shell.collapsed { grid-template-columns: 1fr; } .shell.collapsed .side { visibility: visible; transform: translateX(-100%); } .shell.collapsed .side.open { transform: none; } }
.seg label { position: relative; display: block; } .seg input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }

/* ---------- Estado de sincronización ---------- */
.sync { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px; border-radius: 13px; font-size: 12px; font-weight: 600; background: var(--gray-soft); color: var(--muted); white-space: nowrap; }
.sync i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; } .sync.ok { color: var(--green); background: var(--green-soft); } .sync.saving { color: var(--amber); background: var(--amber-soft); } .sync.saving i { animation: pulse 1s infinite; } .sync.offline, .sync.error { color: var(--red); background: var(--red-soft); }
@keyframes pulse { 50% { opacity: .3; } }
@media (max-width: 900px) {
  .gsearch { flex: 1 1 60px; min-width: 0; } .co-switch { flex: 0 1 auto; min-width: 0; } .co-switch select { min-width: 0; max-width: 120px; }
  .sync { font-size: 0; width: 26px; padding: 0; justify-content: center; gap: 0; } .topbar { gap: 8px; } .topbar .grow { display: none; }
}
