/* =========================================================
   Comedor FUCHS — hoja de estilos
   Marca: azul #004E9E · azul oscuro #00305C · rojo #E3000F
   ========================================================= */
:root {
  --blue: #004E9E;
  --blue-d: #00305C;
  --blue-m: #0A5FB0;
  --blue-l: #CFE0F2;
  --blue-xl: #E8EFF8;
  --red: #E3000F;
  --ink: #1B2430;
  --ink-2: #3A4656;
  --muted: #5C6878;
  --line: #DCE3EE;
  --line-2: #EDF1F7;
  --bg: #F2F5FA;
  --card: #FFFFFF;
  --ok: #0E7C45;
  --ok-bg: #E3F4EA;
  --warn: #9A5B00;
  --warn-bg: #FFF2DB;
  --err: #C1121F;
  --err-bg: #FDE7E8;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0, 48, 92, .06), 0 4px 16px rgba(0, 48, 92, .06);
  --shadow-lg: 0 10px 40px rgba(0, 48, 92, .18);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
*, *::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(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 650; }
p { margin: 0 0 .75em; }
code { font-family: var(--mono); font-size: .9em; background: var(--line-2); padding: 1px 6px; border-radius: 6px; }
.i { flex: none; display: inline-block; vertical-align: middle; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: .92em; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.row-gap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
:focus-visible { outline: 3px solid rgba(0, 78, 158, .35); outline-offset: 2px; border-radius: 6px; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent; font: 600 14.5px var(--font); cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 2px 8px rgba(0, 78, 158, .25); }
.btn-primary:hover { background: var(--blue-m); }
.btn-ghost { background: var(--card); color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { border-color: #b9c6d8; background: #fafcff; }
.btn-light { background: #fff; color: var(--blue-d); }
.btn-ghost-light { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn-lg { height: 50px; font-size: 16px; padding: 0 24px; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn-block { width: 100%; }
.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(--ink); text-decoration: none; }
.icon-btn.ok { color: var(--ok); background: var(--ok-bg); }
.icon-btn.err { color: var(--err); background: var(--err-bg); }
.icon-btn.light { color: rgba(255, 255, 255, .85); }
.icon-btn.light:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.link { font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Formularios ---------- */
.form { display: grid; gap: 14px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 14px; }
legend { font-weight: 700; font-size: 15px; margin-bottom: 4px; padding: 0; color: var(--blue-d); }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { font-weight: 400; color: var(--muted); }
input, select, textarea { font: 15px var(--font); color: var(--ink); width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 78, 158, .15); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; accent-color: var(--blue); margin: 0; }
input[type=file] { padding: 8px; }
.hint { font-size: 12.5px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.col-2 { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.pw { position: relative; }
.pw input { padding-right: 76px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: var(--line-2); color: var(--ink-2); font: 600 12px var(--font); padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.code-input { font-family: var(--mono); letter-spacing: .25em; text-transform: uppercase; font-size: 18px; text-align: center; }
.field-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field-inline input, .field-inline select { width: auto; min-height: 40px; }
.field-inline.light { color: rgba(255, 255, 255, .85); }
.field-inline.light input { width: 80px; background: rgba(255, 255, 255, .95); }

/* ---------- Badges, alertas, avisos ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-err { background: var(--err-bg); color: var(--err); }
.badge-muted { background: var(--line-2); color: var(--muted); }
.badge-blue { background: var(--blue-xl); color: var(--blue); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pill { font-style: normal; margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 14px; }
.alert .i { margin-top: 1px; }
.alert-ok { background: var(--ok-bg); color: #0a5a33; }
.alert-err { background: var(--err-bg); color: #8e0d17; }
.alert-warn { background: var(--warn-bg); color: #6e4100; }
.alert-info { background: var(--blue-xl); color: var(--blue-d); }
.toast { position: fixed; z-index: 100; left: 50%; top: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; max-width: min(560px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500; animation: toast-in .35s cubic-bezier(.2, .9, .3, 1.2); cursor: pointer; transition: opacity .3s, transform .3s; }
.toast + .toast { top: 70px; }
.toast-ok .i { color: #5ee29a; }
.toast-err { background: #8e0d17; }
.toast-info .i { color: #8ec5ff; }
.toast.out { opacity: 0; transform: translate(-50%, -20px); pointer-events: none; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -16px); } }
.empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .i { color: #a8b6c9; margin-bottom: 4px; }
.empty b { color: var(--ink-2); font-size: 15px; }
.empty p { margin: 0; font-size: 13.5px; max-width: 320px; }
.code { font-family: var(--mono); background: var(--line-2); border-radius: 10px; padding: 12px 14px; overflow-x: auto; }
pre.code { white-space: pre; margin: 8px 0 12px; font-size: 13px; }
.center-msg { display: grid; justify-items: center; gap: 12px; text-align: center; max-width: 460px; margin: 12vh auto; padding: 24px; }
.center-msg .i { color: var(--blue); }

/* ---------- Avatar ---------- */
.avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--blue-d)); color: #fff; display: inline-grid; place-items: center; font-size: 13.5px; font-weight: 700; letter-spacing: .02em; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 34px; height: 34px; font-size: 12.5px; }
.avatar.lg { width: 72px; height: 72px; font-size: 24px; }
.avatar.xl { width: 96px; height: 96px; font-size: 32px; box-shadow: 0 0 0 5px #fff, var(--shadow); }

/* =========================================================
   ACCESO (login / activar)
   ========================================================= */
.layout-auth { background: #fff; }
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-art { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 0% 0%, #0A5FB0 0%, #004E9E 40%, #00305C 100%); color: #fff; }
.auth-art::before { content: ""; position: absolute; width: 900px; height: 900px; right: -420px; bottom: -480px; border-radius: 50%; border: 90px solid rgba(255, 255, 255, .06); }
.auth-art::after { content: ""; position: absolute; width: 420px; height: 420px; right: -120px; top: -160px; border-radius: 50%; border: 46px solid rgba(227, 0, 15, .55); clip-path: polygon(0 50%, 100% 50%, 100% 100%, 0 100%); transform: rotate(-28deg); }
.auth-art-inner { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; padding: 48px 56px; }
.auth-logo { width: 230px; }
.auth-claim { margin-top: auto; max-width: 440px; }
.auth-claim h2 { font-size: clamp(28px, 3vw, 40px); font-weight: 700; line-height: 1.12; letter-spacing: -.02em; }
.auth-claim p { margin-top: 14px; font-size: 17px; opacity: .85; }
.auth-tickets { display: flex; gap: 10px; margin-top: 36px; }
.auth-tickets span { width: 74px; height: 42px; border-radius: 8px; background: rgba(255, 255, 255, .14); position: relative; -webkit-mask: radial-gradient(circle 7px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 7px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat; mask: radial-gradient(circle 7px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 7px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat; }
.auth-tickets span:first-child { background: #fff; }
.auth-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-logo-sm { width: 150px; margin-bottom: 36px; }
.auth-title { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.auth-sub { color: var(--muted); margin: 6px 0 24px; }
.auth-links { margin-top: 22px; display: grid; gap: 8px; font-size: 14px; }
.auth-links a { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.auth-links span { color: var(--muted); font-size: 13px; }
.auth-foot { margin-top: 40px; font-size: 12.5px; color: var(--muted); }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-panel { justify-content: flex-start; padding-top: 48px; }
}
.install { max-width: 640px; margin: 0 auto; padding: 40px 16px 60px; }
.install h1 { font-size: 26px; margin-bottom: 20px; }
.install fieldset { background: var(--bg); border-radius: var(--radius); padding: 18px; margin-bottom: 4px; }

/* =========================================================
   PANEL RRHH
   ========================================================= */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--blue-d) 0%, #002447 100%); color: #fff; padding: 18px 14px; z-index: 40; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 20px; color: #fff; text-decoration: none !important; border-bottom: 1px solid rgba(255, 255, 255, .1); margin-bottom: 14px; }
.brand img { width: 52px; }
.brand span { display: grid; line-height: 1.2; }
.brand b { font-size: 16px; }
.brand small { font-size: 12px; opacity: .65; }
.sidebar nav { display: grid; gap: 2px; }
.sidebar nav a, .side-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: rgba(255, 255, 255, .78); font-weight: 550; font-size: 14.5px; text-decoration: none !important; transition: background .15s, color .15s; }
.sidebar nav a:hover, .side-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar nav a.active { background: #fff; color: var(--blue-d); box-shadow: 0 2px 10px rgba(0, 0, 0, .15); }
.sidebar nav a.active .i { color: var(--blue); }
.side-foot { margin-top: auto; display: grid; gap: 10px; }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid rgba(255, 255, 255, .1); }
.me > div { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.me b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { font-size: 12px; opacity: .65; }
.me .avatar { background: rgba(255, 255, 255, .15); }
.me .icon-btn { color: rgba(255, 255, 255, .7); }
.me .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: rgba(242, 245, 250, .88); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; }
.topbar h1 { font-size: 22px; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 8px; }
.menu-btn { display: none; }
.content { padding: 8px 28px 48px; max-width: 1280px; width: 100%; display: grid; gap: 18px; align-content: start; }
.scrim { display: none; }

.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.panel > h2 { margin-bottom: 14px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head p { margin: 2px 0 0; }
.panel-head.pad { padding: 18px 20px 4px; }
.panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-emp { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.kpis-sm { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 4px; }
.kpi { display: grid; gap: 2px; padding: 18px 20px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none !important; position: relative; overflow: hidden; }
.kpis-sm .kpi { padding: 14px 16px; box-shadow: none; background: var(--bg); }
.kpi-l { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi-n { font-size: 34px; font-weight: 750; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpis-sm .kpi-n { font-size: 24px; }
.kpi-s { font-size: 13px; color: var(--muted); }
.kpi-hero { background: linear-gradient(135deg, var(--blue) 0%, var(--blue-d) 100%); color: #fff; }
.kpi-hero .kpi-l, .kpi-hero .kpi-s { color: rgba(255, 255, 255, .8); }
.kpi-hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; border: 18px solid rgba(255, 255, 255, .08); }
.kpi-alert { box-shadow: inset 0 0 0 2px var(--red), var(--shadow); }
.kpi-alert .kpi-n { color: var(--red); }
a.kpi:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }

/* Gráfico de barras (una serie: azul FUCHS) */
.chart { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; height: 220px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; font-size: 11.5px; color: var(--muted); padding-bottom: 22px; font-variant-numeric: tabular-nums; }
.chart-y span { transform: translateY(-50%); }
.chart-y span:last-child { transform: translateY(50%); }
.chart-plot { position: relative; display: grid; grid-template-rows: minmax(0, 1fr) 22px; }
.chart-grid { position: absolute; inset: 0 0 22px 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-grid i { border-top: 1px solid var(--line-2); }
.chart-grid i:last-child { border-top: 1px solid var(--line); }
.chart-bars { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: end; height: 100%; }
.bar-slot { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; padding: 0 1px; outline: none; cursor: default; }
.bar { width: 100%; max-width: 18px; min-height: 0; background: var(--blue); border-radius: 4px 4px 0 0; transition: background .15s; }
.bar-slot.we .bar { background: #8FB3DA; }
.bar-slot.is-today .bar { background: var(--blue-d); }
.bar-slot:hover .bar, .bar-slot:focus .bar { background: var(--blue-m); }
.bar-slot:hover::before, .bar-slot:focus::before { content: ""; position: absolute; inset: 0; background: rgba(0, 78, 158, .06); border-radius: 6px; }
.bar-tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 12px; padding: 6px 10px; border-radius: 8px; white-space: nowrap; display: none; z-index: 5; box-shadow: var(--shadow-lg); pointer-events: none; text-align: center; }
.bar-tip b { display: block; font-size: 13px; }
.bar-slot:hover .bar-tip, .bar-slot:focus .bar-tip { display: block; bottom: auto; top: -46px; }
.bar-slot:first-child .bar-tip, .bar-slot:nth-child(2) .bar-tip { left: 0; transform: none; }
.bar-slot:last-child .bar-tip, .bar-slot:nth-last-child(2) .bar-tip { left: auto; right: 0; transform: none; }
.chart-x { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); font-size: 11px; color: var(--muted); padding-top: 6px; white-space: nowrap; }
.chart-x span { text-align: center; overflow: visible; }
.table-view { margin-top: 10px; font-size: 13px; }
.table-view summary { cursor: pointer; color: var(--blue); font-weight: 600; }
.table-view table { margin-top: 8px; max-height: 260px; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hbars li { display: grid; grid-template-columns: minmax(0, 120px) minmax(0, 1fr) 40px; align-items: center; gap: 10px; font-size: 13.5px; }
.hb-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.hb-track { height: 12px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.hb-bar { display: block; height: 100%; background: var(--blue); border-radius: 0 4px 4px 0; }
.hb-n { text-align: right; font-variant-numeric: tabular-nums; }

/* Listas */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.list li:last-child { border-bottom: 0; }
.list li > .grow { display: grid; line-height: 1.3; }
.list li > .grow small { font-size: 12.5px; }
.list.compact li { padding: 8px 0; }
.list li.is-void { opacity: .55; }
.list li.is-void b { text-decoration: line-through; }
.inline-actions { display: flex; gap: 6px; }

/* 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: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 12px 14px; background: #F8FAFD; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { font-weight: 700; background: #F8FAFD; border-top: 1px solid var(--line); }
.table.compact td, .table.compact th { padding: 8px 12px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .w-check { width: 44px; }
.table .w-act { width: 52px; text-align: right; }
.rows-link tbody tr { cursor: pointer; transition: background .1s; }
.rows-link tbody tr:hover, .table tbody tr:hover { background: #F8FAFD; }
.table tr.is-void td { color: var(--muted); }
.table tr.is-void td:not(:last-child) { text-decoration: line-through; text-decoration-color: rgba(92, 104, 120, .4); }
.table tr.is-muted td { color: var(--muted); }
.table tr.is-error td { background: #fff8f8; }
.cell-user { display: flex; align-items: center; gap: 12px; }
.cell-user > div { display: grid; line-height: 1.3; min-width: 0; }
.cell-user a { color: var(--ink); }
.tickets-pill { display: inline-grid; place-items: center; min-width: 36px; height: 28px; padding: 0 10px; border-radius: 8px; background: var(--blue-xl); color: var(--blue); font-weight: 700; font-variant-numeric: tabular-nums; }
.tickets-pill.low { background: var(--warn-bg); color: var(--warn); }
.tickets-pill.zero { background: var(--line-2); color: var(--muted); }
.quote { font-style: italic; color: var(--ink-2); }

/* Filtros, pestañas, paginación */
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filters select, .filters input[type=date], .filters input[type=month] { width: auto; min-height: 40px; }
.filters .btn { height: 40px; }
.filters-title { font-size: 20px; margin-left: 8px; }
.search { position: relative; flex: 1 1 260px; max-width: 420px; display: block; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 40px; min-height: 40px; border-radius: 999px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 8px 0 14px; border-radius: 999px; background: var(--blue-xl); color: var(--blue-d); font-size: 13.5px; }
.chip a { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; }
.chip a:hover { background: rgba(0, 78, 158, .12); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none !important; }
.tabs a.active { color: var(--blue); border-color: var(--blue); }
.tabs .pill { margin: 0; }
.pager { display: flex; gap: 4px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 8px; font-size: 13.5px; color: var(--ink-2); }
.pager a:hover { background: var(--line-2); text-decoration: none; }
.pager a.active { background: var(--blue); color: #fff; }
.bulk-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; background: #F8FAFD; border-bottom: 1px solid var(--line); }
.bulk-bar input:not([type=checkbox]) { min-height: 40px; flex: 1 1 200px; }
.bulk-bar .btn { height: 40px; }

/* Acciones rápidas, ficha de empleado */
.quick { display: grid; gap: 6px; }
.quick h2 { margin-bottom: 8px; }
.quick a, .action, .export, .menu-list a, .menu-list button { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 12px; color: var(--ink); text-decoration: none !important; transition: background .15s; }
.quick a:hover, .action:hover, .export:hover, .menu-list a:hover, .menu-list button:hover { background: var(--bg); }
.quick a > .i, .action > .i, .export > .i, .action label > .i { width: 40px; height: 40px; padding: 10px; border-radius: 11px; background: var(--blue-xl); color: var(--blue); }
.quick span, .action span, .export span { display: grid; line-height: 1.3; }
.quick small, .action small, .export small { color: var(--muted); font-size: 12.5px; }
.action-list { display: grid; gap: 2px; margin: -4px -8px 10px; }
.action-list form { margin: 0; }
button.action { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
button.action:disabled { opacity: .45; cursor: not-allowed; }
.action.danger > .i { background: var(--err-bg); color: var(--err); }
.action.danger b { color: var(--err); }
.foto-form label { display: flex; align-items: center; gap: 14px; cursor: pointer; width: 100%; }
.emp-hero { display: flex; align-items: center; gap: 18px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.emp-hero h2 { font-size: 22px; }
.emp-hero p { margin: 2px 0 0; }
.code-box { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 20px 22px; border-radius: var(--radius); background: linear-gradient(135deg, var(--blue) 0%, var(--blue-d) 100%); color: #fff; box-shadow: var(--shadow); }
.code-box > div:first-child { display: grid; gap: 4px; max-width: 640px; }
.code-box small { opacity: .85; font-size: 13px; }
.code-box .code { background: rgba(255, 255, 255, .14); color: #fff; font-size: 30px; letter-spacing: .18em; padding: 6px 14px; width: fit-content; font-weight: 700; }
.code-box b:not(.code) { font-size: 22px; }
.taco-form { display: grid; grid-template-columns: minmax(0, 1fr) 80px auto; gap: 8px; margin-bottom: 12px; }
.taco-form select, .taco-form input { min-height: 42px; }
.export-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.export { background: var(--card); box-shadow: var(--shadow); }
.export:hover { background: #fff; box-shadow: var(--shadow-lg); }
.assign-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 22px 24px; border-radius: var(--radius); background: linear-gradient(135deg, var(--blue) 0%, var(--blue-d) 100%); color: #fff; box-shadow: var(--shadow); margin-bottom: 18px; }
.assign-hero > div { flex: 1 1 220px; }
.assign-hero h2 { font-size: 26px; }
.assign-hero p { margin: 4px 0 0; opacity: .85; }
.dropzone { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 36px 16px; border: 2px dashed #b9c9de; border-radius: var(--radius); background: #F8FAFD; color: var(--muted); cursor: pointer; position: relative; transition: border-color .15s, background .15s; }
.dropzone:hover { border-color: var(--blue); background: var(--blue-xl); }
.dropzone .i { color: var(--blue); }
.dropzone b { color: var(--ink); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.bullets { padding-left: 18px; margin: 10px 0; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 10px; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }

@media (max-width: 1100px) {
  .grid-main, .grid-emp { grid-template-columns: minmax(0, 1fr); }
  .hide-md { display: none; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  .sidebar-open .sidebar { transform: none; }
  .sidebar-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0, 20, 40, .45); }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 19px; }
  .content { padding: 6px 16px 40px; }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-n { font-size: 26px; }
  .kpis-sm { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis-sm .kpi-n { font-size: 19px; }
  .panel { padding: 16px; }
  .chart { height: 180px; }
  .search { max-width: none; }
  .filters > * { flex: 1 1 auto; }
  .emp-hero { padding: 16px; gap: 14px; }
  .emp-hero .avatar.lg { width: 56px; height: 56px; font-size: 19px; }
  .emp-hero h2 { font-size: 18px; }
  .code-box .code { font-size: 24px; }
  .taco-form { grid-template-columns: minmax(0, 1fr) 70px; }
  .taco-form .btn { grid-column: 1 / -1; }
  .top-actions .btn { padding: 0 12px; }
  .table td, .table th { padding: 10px; }
  .assign-hero .btn { width: 100%; }
}

/* =========================================================
   APP DEL EMPLEADO (móvil primero)
   ========================================================= */
.layout-app { background: var(--bg); padding-bottom: calc(76px + var(--safe-b)); }
.app-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: rgba(255, 255, 255, .9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-2); }
.app-logo { width: 44px; }
.app-top-title { flex: 1; font-weight: 700; color: var(--blue-d); font-size: 15px; }
.chip-link { font-size: 12.5px; font-weight: 650; padding: 6px 12px; border-radius: 999px; background: var(--blue-xl); }
.app-avatar { text-decoration: none !important; }
.app-main { max-width: 520px; margin: 0 auto; padding: 18px 16px 24px; display: grid; gap: 16px; }
.app-h1 { font-size: 26px; font-weight: 750; letter-spacing: -.02em; margin: 4px 2px 0; }
.hello p { margin: 0; color: var(--muted); font-size: 14px; }
.hello h1 { font-size: 27px; font-weight: 750; letter-spacing: -.02em; }
.card { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card > h2 { margin-bottom: 12px; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + var(--safe-b)); }
.tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 0; font-size: 11.5px; font-weight: 600; color: var(--muted); text-decoration: none !important; border-radius: 12px; }
.tabbar a.active { color: var(--blue); }
.tabbar a.active .i { background: var(--blue-xl); border-radius: 999px; padding: 3px 14px; box-sizing: content-box; }
@media (min-width: 700px) {
  .tabbar { left: 50%; right: auto; bottom: 16px; transform: translateX(-50%); width: 440px; border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow-lg); padding-bottom: 6px; }
  .layout-app { padding-bottom: 110px; }
}

/* El ticket */
.ticket { position: relative; background: #fff; border-radius: 22px; box-shadow: 0 1px 2px rgba(0, 48, 92, .08), 0 18px 48px rgba(0, 48, 92, .16); overflow: hidden; }
.ticket::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 132px; background: radial-gradient(120% 140% at 0% 0%, #0A5FB0 0%, #004E9E 45%, #00305C 100%); }
.ticket::after { content: ""; position: absolute; right: -70px; top: -90px; width: 210px; height: 210px; border-radius: 50%; border: 22px solid rgba(227, 0, 15, .8); clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%); transform: rotate(-24deg); opacity: .85; }
.ticket-head { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 0; color: #fff; }
.ticket-head small { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em; opacity: .75; font-weight: 600; }
.ticket-head b { font-size: 18px; display: block; line-height: 1.25; }
.ticket-num { font-family: var(--mono); font-size: 13px; background: rgba(255, 255, 255, .16); padding: 4px 10px; border-radius: 8px; white-space: nowrap; }
.ticket-qr { position: relative; z-index: 1; width: min(272px, calc(100% - 48px)); aspect-ratio: 1; margin: 18px auto 0; padding: 4px; background: #fff; border-radius: 18px; box-shadow: 0 6px 24px rgba(0, 48, 92, .18); }
.ticket-qr canvas { width: 100%; height: 100%; display: block; border-radius: 14px; image-rendering: pixelated; }
.qr-overlay { position: absolute; inset: 0; border-radius: 18px; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 18px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.qr-overlay b { font-size: 19px; }
.qr-overlay small { color: var(--muted); }
.ticket-qr.is-done .qr-done { display: flex; cursor: pointer; animation: pop .4s cubic-bezier(.2, .9, .3, 1.3); }
.ticket-qr.is-empty:not(.is-done) .qr-empty { display: flex; }
.big-check { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--ok); color: #fff; box-shadow: 0 0 0 10px var(--ok-bg); margin-bottom: 8px; }
.big-check.warn { background: var(--warn); box-shadow: 0 0 0 10px var(--warn-bg); }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
.qr-timer { width: min(220px, 60%); height: 4px; margin: 14px auto 0; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.qr-timer span { display: block; height: 100%; width: 100%; background: var(--blue); border-radius: 4px; }
.qr-hint { display: block; margin: 8px 24px 0; font-size: 12px; color: var(--muted); text-align: center; }
.ticket-cut { position: relative; height: 28px; margin-top: 10px; }
.ticket-cut::before { content: ""; position: absolute; left: 22px; right: 22px; top: 50%; border-top: 2px dashed var(--line); }
.ticket-cut::after { content: ""; position: absolute; left: -14px; right: -14px; top: 0; height: 28px; background: radial-gradient(circle 14px at 0 50%, var(--bg) 98%, transparent) left / 50% 100% no-repeat, radial-gradient(circle 14px at 100% 50%, var(--bg) 98%, transparent) right / 50% 100% no-repeat; }
.ticket-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 20px 20px; }
.saldo { display: flex; align-items: center; gap: 10px; }
.saldo-n { font-size: 44px; font-weight: 800; letter-spacing: -.04em; color: var(--blue-d); line-height: 1; font-variant-numeric: tabular-nums; }
.saldo-l { font-size: 12.5px; line-height: 1.25; color: var(--muted); font-weight: 600; }
.today { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: var(--blue-xl); color: var(--blue); font-size: 13px; font-weight: 650; }
.today-done { background: var(--ok-bg); color: var(--ok); }
.taco-dots { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.taco-dots i { aspect-ratio: 1.6; border-radius: 5px; background: var(--blue); -webkit-mask: radial-gradient(circle 3px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 3px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat; mask: radial-gradient(circle 3px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 3px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat; }
.taco-dots i.used { background: var(--line); }
.notice { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--blue-xl); color: var(--blue-d); font-weight: 600; font-size: 14px; text-decoration: none !important; }
.notice span { flex: 1; }
.notice-warn { background: var(--warn-bg); color: #6e4100; }
.tip { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 12.5px; margin: 0; text-align: center; }
.taco-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.taco-row:last-child { border-bottom: 0; }
.taco-row .grow { display: grid; gap: 4px; }
.taco-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--blue-xl); color: var(--blue); }
.big-num { font-size: 26px; font-weight: 800; color: var(--blue-d); font-variant-numeric: tabular-nums; }
.progress { height: 6px; border-radius: 6px; background: var(--blue-xl); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--blue); border-radius: 6px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg-opt { position: relative; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; }
.seg-opt span { display: grid; gap: 2px; padding: 14px; border-radius: 14px; border: 2px solid var(--line); transition: border-color .15s, background .15s; }
.seg-opt small { color: var(--muted); font-size: 12.5px; }
.seg-opt input:checked + span { border-color: var(--blue); background: var(--blue-xl); }
.seg-opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(0, 78, 158, .25); }
.seg-opt.disabled { opacity: .5; cursor: not-allowed; }
.date-tile { width: 44px; height: 48px; border-radius: 12px; background: var(--blue-xl); color: var(--blue-d); display: grid; place-items: center; align-content: center; line-height: 1.05; flex: none; }
.date-tile b { font-size: 18px; }
.date-tile small { font-size: 10.5px; text-transform: uppercase; font-weight: 700; letter-spacing: .05em; opacity: .75; }
.profile { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 14px 0 4px; }
.profile h1 { font-size: 22px; margin-top: 12px; }
.profile p { margin: 0; }
.stats-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stats-2 > div { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 14px 16px; display: grid; }
.stats-2 b { font-size: 26px; font-weight: 800; color: var(--blue-d); }
.stats-2 small { color: var(--muted); font-size: 12.5px; }
.menu-list { padding: 8px; display: grid; }
.menu-list a, .menu-list button { border: 0; background: none; font: inherit; width: 100%; text-align: left; cursor: pointer; }
.menu-list span { flex: 1; font-weight: 600; }
.menu-list > * > .i:first-child { color: var(--blue); }
.menu-list .danger, .menu-list .danger > .i:first-child { color: var(--err); }
.help ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }

/* =========================================================
   CANTINA (pantalla oscura, a pantalla completa)
   ========================================================= */
.layout-cantina { background: #001B33; color: #fff; overscroll-behavior: none; }
.cz { position: fixed; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.cz-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); background: var(--blue-d); }
.cz-logo { width: 46px; }
.cz-title { flex: 1; display: grid; line-height: 1.2; min-width: 0; }
.cz-title b { font-size: 16px; }
.cz-title small { font-size: 12px; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cz-count { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .12); font-size: 18px; font-variant-numeric: tabular-nums; }
.cz-menu { position: relative; }
.cz-menu summary { list-style: none; }
.cz-menu summary::-webkit-details-marker { display: none; }
.cz-menu-pop { position: absolute; right: 0; top: 44px; z-index: 50; min-width: 220px; display: grid; gap: 2px; padding: 8px; background: #fff; color: var(--ink); border-radius: 14px; box-shadow: var(--shadow-lg); }
.cz-menu-pop > span { padding: 6px 10px; }
.cz-menu-pop a, .cz-menu-pop button { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; color: var(--ink); border: 0; background: none; font: inherit; font-size: 14px; cursor: pointer; text-align: left; text-decoration: none !important; }
.cz-menu-pop a:hover, .cz-menu-pop button:hover { background: var(--bg); }
.cz-view { display: none; min-height: 0; overflow-y: auto; }
.cz-view.active { display: flex; flex-direction: column; }
.cz-view[data-view=scan] { padding: 16px; align-items: center; justify-content: center; gap: 14px; overflow: hidden; }
.cz-cam { position: relative; width: min(100%, 460px, 62vh); aspect-ratio: 1; border-radius: 26px; overflow: hidden; background: #000; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 20px 60px rgba(0, 0, 0, .5); }
.cz-cam video { width: 100%; height: 100%; object-fit: cover; }
.cz-frame { position: absolute; inset: 14%; pointer-events: none; }
.cz-frame i { position: absolute; width: 44px; height: 44px; border: 5px solid #fff; border-radius: 4px; }
.cz-frame i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 18px; }
.cz-frame i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 18px; }
.cz-frame i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 18px; }
.cz-frame i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 18px; }
.cz-laser { position: absolute; left: 6%; right: 6%; height: 3px; top: 50%; background: var(--red); border-radius: 3px; box-shadow: 0 0 14px 2px rgba(227, 0, 15, .7); animation: laser 2.2s ease-in-out infinite; }
@keyframes laser { 0%, 100% { top: 8%; } 50% { top: 92%; } }
.cz-cam-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; background: radial-gradient(circle at 50% 40%, #0A3A6B, #001B33); }
.cz-cam-msg p { margin: 0; opacity: .85; max-width: 260px; }
.cz-cam-msg.loading { opacity: .6; pointer-events: none; }
.cz-hint { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; opacity: .85; }
.cz-cam-tools { display: flex; gap: 10px; }
.cz-tool { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); color: #fff; font: 600 14px var(--font); cursor: pointer; }
.cz-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 8px 12px calc(8px + var(--safe-b)); background: #00254A; border-top: 1px solid rgba(255, 255, 255, .08); }
.cz-tabs button { display: grid; justify-items: center; gap: 2px; padding: 8px 0; border: 0; border-radius: 14px; background: transparent; color: rgba(255, 255, 255, .6); font: 600 12.5px var(--font); cursor: pointer; }
.cz-tabs button.active { background: rgba(255, 255, 255, .12); color: #fff; }
.cz-pad { width: 100%; max-width: 640px; margin: 0 auto; padding: 16px; }
.cz-search { position: relative; display: block; }
.cz-search .i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.cz-search input { min-height: 56px; padding-left: 48px; font-size: 17px; border-radius: 16px; border: 0; }
.cz-note { font-size: 13px; opacity: .65; margin: 10px 4px 14px; }
.cz-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cz-list li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .07); }
.cz-list li .grow { display: grid; line-height: 1.3; }
.cz-list li small { font-size: 12.5px; opacity: .7; }
.cz-list li small.neg { color: #ff9aa2; opacity: 1; }
.cz-list .cz-empty { justify-content: center; opacity: .6; background: none; padding: 30px; }
.cz-time { font-family: var(--mono); font-size: 14px; opacity: .8; width: 46px; }
.cz-today-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.cz-today-head h2 { font-size: 22px; }
.cz-today-head span { opacity: .7; }
.cz-avatar { flex: none; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: rgba(255, 255, 255, .2); color: #fff; font-size: 34px; font-weight: 750; }
.cz-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cz-avatar.sm { width: 40px; height: 40px; font-size: 14px; background: rgba(255, 255, 255, .14); }
.cz-result { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.cz-result.cz-ok { background: #0B7A43; }
.cz-result.cz-warn { background: #B86E00; }
.cz-result.cz-err { background: #B3101D; }
@keyframes fade { from { opacity: 0; } }
.cz-result-card { width: 100%; max-width: 440px; display: grid; justify-items: center; gap: 14px; text-align: center; }
.cz-result-icon { width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .2); box-shadow: 0 0 0 14px rgba(255, 255, 255, .08); animation: pop .35s cubic-bezier(.2, .9, .3, 1.4); }
.cz-result-msg { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.cz-person { display: grid; justify-items: center; gap: 10px; padding: 18px; width: 100%; border-radius: 22px; background: rgba(0, 0, 0, .14); }
.cz-person > div:last-child { display: grid; }
.cz-person b { font-size: 24px; line-height: 1.2; }
.cz-person small { opacity: .85; font-size: 15px; }
.cz-saldo { font-size: 18px; padding: 8px 16px; border-radius: 999px; background: rgba(255, 255, 255, .16); }
.cz-saldo b { font-size: 22px; }
.cz-saldo.low { background: #fff; color: #8a5200; }
.cz-result-actions { display: flex; gap: 10px; margin-top: 6px; }
.cz-result-actions .btn { height: 52px; padding: 0 26px; font-size: 16px; }
.cz-result-timer { width: 60%; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .2); overflow: hidden; margin-top: 4px; }
.cz-result-timer span { display: block; height: 100%; width: 100%; background: #fff; }
@media (min-width: 900px) and (orientation: landscape) {
  .cz-cam { width: min(460px, 60vh); }
}

/* =========================================================
   IMPRESIÓN (cartas y tarjetas)
   ========================================================= */
.layout-print { background: #e9edf3; }
.print-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; background: #fff; box-shadow: var(--shadow); }
.letter { width: 210mm; min-height: 297mm; margin: 24px auto; padding: 22mm 20mm; background: #fff; box-shadow: var(--shadow); display: flex; flex-direction: column; page-break-after: always; break-after: page; }
.letter header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18mm; }
.letter header img { width: 58mm; }
.letter header span { text-align: right; font-size: 12px; color: var(--muted); }
.letter h1 { font-size: 26px; color: var(--blue-d); margin-bottom: 10mm; }
.letter p { font-size: 14.5px; }
.letter-grid { display: grid; grid-template-columns: 1fr auto; gap: 10mm; align-items: center; margin: 8mm 0; padding: 8mm; border-radius: 14px; background: var(--blue-xl); }
.letter-steps h2 { color: var(--blue-d); margin-bottom: 4mm; }
.letter-steps ol { margin: 0; padding-left: 20px; display: grid; gap: 10px; font-size: 14.5px; }
.letter-steps .code { font-size: 22px; letter-spacing: .15em; background: #fff; padding: 2px 10px; display: inline-block; }
.letter-qr { display: grid; justify-items: center; gap: 4px; }
.letter-qr canvas { width: 45mm; height: 45mm; background: #fff; border-radius: 8px; }
.letter footer { margin-top: auto; padding-top: 8mm; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.cards-sheet { width: 210mm; margin: 24px auto; padding: 12mm; background: #fff; display: grid; grid-template-columns: repeat(2, 85.6mm); gap: 6mm; justify-content: center; box-shadow: var(--shadow); }
.id-card { width: 85.6mm; height: 54mm; border-radius: 3.5mm; overflow: hidden; display: grid; grid-template-columns: 1fr 36mm; align-items: center; gap: 2mm; padding: 4mm; border: .3mm solid #c9d3e0; background: linear-gradient(135deg, #fff 55%, var(--blue-xl)); position: relative; break-inside: avoid; }
.id-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2mm; background: var(--blue); }
.id-card-l { display: grid; gap: 1.2mm; padding-left: 2mm; align-content: start; height: 100%; }
.id-logo { width: 30mm; margin-bottom: 3mm; }
.id-name { font-weight: 750; font-size: 12.5pt; line-height: 1.15; color: var(--blue-d); }
.id-meta { font-size: 8pt; color: var(--muted); }
.id-tag { margin-top: auto; font-size: 7pt; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; color: var(--red); }
.id-card canvas { width: 36mm; height: 36mm; }
@media print {
  @page { margin: 0; size: A4; }
  .no-print { display: none !important; }
  body.layout-print { background: #fff; }
  .letter { margin: 0; box-shadow: none; }
  .cards-sheet { margin: 0; box-shadow: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.qr-hint .i { margin: -2px 4px 0 0; }

/* ---------- QR fijo para guardar / imprimir ---------- */
.pass { background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 48, 92, .08), 0 18px 48px rgba(0, 48, 92, .16); }
.pass-head { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; background: linear-gradient(135deg, #0A5FB0, #00305C); color: #fff; overflow: hidden; }
.pass-head::after { content: ""; position: absolute; right: -60px; top: -80px; width: 180px; height: 180px; border-radius: 50%; border: 18px solid rgba(227, 0, 15, .85); clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%); transform: rotate(-24deg); }
.pass-head img { width: 120px; position: relative; z-index: 1; }
.pass-head span { position: relative; z-index: 1; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; opacity: .9; }
.pass-body { display: grid; justify-items: center; text-align: center; gap: 2px; padding: 18px 20px 22px; }
.pass-body > small { font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; }
.pass-body > b { font-size: 21px; color: var(--blue-d); }
.pass-meta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 6px 0 14px; }
.pass-meta span { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: var(--blue-xl); color: var(--blue-d); font-weight: 600; }
.pass canvas { width: min(240px, 70vw); height: auto; aspect-ratio: 1; image-rendering: pixelated; }
.pass-foot { margin-top: 12px; color: var(--muted); font-size: 12.5px; }
.save-btns { display: grid; gap: 10px; }
@media print {
  .layout-app .app-top, .layout-app .tabbar, .layout-app .save-btns, .layout-app .card, .layout-app .tip, .layout-app .app-main > p, .layout-app .toast { display: none !important; }
  .layout-app { background: #fff; padding: 0; }
  .layout-app .pass { width: 90mm; margin: 15mm auto; box-shadow: none; border: .3mm solid #c9d3e0; }
}
.fixed-note { display: flex; align-items: center; gap: 8px; margin: 0; min-height: 44px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--ok-bg); color: var(--ok); font-size: 13.5px; }
.baja-note { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warn-bg); color: #6e4100; font-size: 13.5px; }

/* ---------- Usuarios y accesos ---------- */
.role-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.role-card { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 18px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none !important; border: 2px solid transparent; transition: border-color .15s, transform .1s; }
.role-card:hover { transform: translateY(-1px); }
.role-card.active { border-color: var(--blue); }
.role-ico { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.role-admin .role-ico { background: #E9E5F7; color: #4B3A9C; }
.role-rrhh .role-ico { background: var(--blue-xl); color: var(--blue); }
.role-cantina .role-ico { background: var(--warn-bg); color: var(--warn); }
.role-txt { display: grid; gap: 3px; min-width: 0; }
.role-txt b { font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.role-txt em { font-style: normal; font-size: 12.5px; min-width: 24px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); display: inline-grid; place-items: center; }
.role-txt small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.role-lock { position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 650; color: var(--muted); }
.role-badge-admin { background: #E9E5F7; color: #4B3A9C; }
.role-badge-rrhh { background: var(--blue-xl); color: var(--blue); }
.role-badge-cantina { background: var(--warn-bg); color: var(--warn); }
.role-badge-empleado { background: var(--line-2); color: var(--muted); }
.tabs-inline { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs-inline a { padding: 6px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--muted); text-decoration: none !important; }
.tabs-inline a:hover { background: var(--line-2); }
.tabs-inline a.active { background: var(--blue); color: #fff; }
.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: grid; gap: 4px; padding: 16px; border: 2px solid var(--line); border-radius: 14px; height: 100%; transition: border-color .15s, background .15s; }
.choice span .i { color: var(--blue); margin-bottom: 4px; }
.choice small { color: var(--muted); font-size: 12.5px; }
.choice input:checked + span { border-color: var(--blue); background: var(--blue-xl); }
.choice input:focus-visible + span { box-shadow: 0 0 0 3px rgba(0, 78, 158, .25); }
.radio-list { display: grid; gap: 8px; margin-bottom: 4px; }
.radio-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.radio-row input { margin-top: 3px; }
.radio-row span { display: grid; }
.radio-row small { color: var(--muted); font-size: 12.5px; }
.radio-row:has(input:checked) { border-color: var(--blue); background: var(--blue-xl); }
.new-user .panel > h2 { margin-bottom: 14px; }
.new-user .seg { margin-bottom: 14px; }
.role-switch { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.role-switch .seg-opt span { padding: 10px 14px; }
.role-switch .btn { height: auto; min-height: 44px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.timeline li { display: flex; gap: 12px; align-items: flex-start; padding: 7px 0; }
.timeline li > div { display: grid; line-height: 1.3; }
.timeline b { font-size: 14px; font-weight: 600; }
.timeline small { font-size: 12.5px; }
.t-dot { flex: none; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--blue-l); box-shadow: 0 0 0 3px var(--blue-xl); }
.t-dot.warn { background: #F2B544; box-shadow: 0 0 0 3px var(--warn-bg); }
.device { display: flex; gap: 20px; align-items: flex-start; }
.device-qr { flex: none; padding: 8px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.device-qr canvas { display: block; width: 150px; height: 150px; image-rendering: pixelated; }
.device ol { margin: 8px 0 10px; padding-left: 18px; display: grid; gap: 6px; }
.mini-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.mini-stats span { padding: 6px 12px; border-radius: 10px; background: var(--bg); font-size: 13px; color: var(--muted); }
.mini-stats b { color: var(--ink); font-size: 15px; }
.action-details > summary { list-style: none; cursor: pointer; }
.action-details > summary::-webkit-details-marker { display: none; }
.action-details[open] > summary { background: var(--bg); }
.pad-form { padding: 6px 12px 14px 66px; gap: 10px; }
.quick-link { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 12px; background: var(--bg); color: var(--ink); text-decoration: none !important; margin-bottom: 10px; }
.quick-link:hover { background: var(--blue-xl); }
.quick-link > .i:first-child { color: var(--blue); }
.quick-link span { flex: 1; display: grid; }
.quick-link small { color: var(--muted); font-size: 12.5px; }
.fixed-note.neutral { background: var(--bg); color: var(--ink-2); }
@media (max-width: 900px) { .role-cards { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .device { flex-direction: column; align-items: center; text-align: left; }
  .pad-form { padding-left: 12px; }
  .role-switch .seg-opt { flex: 1 1 100%; }
}
