@font-face { font-family: "Bricolage"; src: url("../fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Public"; src: url("../fonts/public-sans-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #f3f2f5; --surface: #fff; --surface-2: #faf9fb; --ink: #1d1724; --muted: #675e72;
  --line: #e1dde8; --line-strong: #c9c2d4;
  --malbec: #4b1d3f; --malbec-hover: #3a1530; --malbec-tint: #f1e6ee; --on-malbec: #fff;
  --accent-text: #4b1d3f;
  --ok: #1f6b45; --ok-tint: #dff1e7; --bad: #b3202c; --bad-tint: #fbe5e7; --warn: #7d5200; --warn-tint: #fcefcf; --info: #28567f; --info-tint: #e2edf7;
  --rail: #3a1530; --rail-ink: #f3e8f0; --rail-dim: #c9a9bf; --rail-hover: #4b1d3f; --rail-active: #5e2650;
  --r-lg: 18px; --r-md: 14px; --r: 10px; --r-sm: 7px;
  --font: Public, "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: Bricolage, "Segoe UI", system-ui, sans-serif;
  --focus: #9b4e86;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15111a; --surface: #1f1927; --surface-2: #251e2e; --ink: #f1edf5; --muted: #a99fb5;
    --line: #342b3f; --line-strong: #4b4059;
    --malbec: #8a3b72; --malbec-hover: #9d4a83; --malbec-tint: #35202f; --on-malbec: #fff; --accent-text: #e3b5d6;
    --ok: #55c28a; --ok-tint: #17301f; --bad: #ff7a85; --bad-tint: #3a1a1e; --warn: #f0c14b; --warn-tint: #382b0c; --info: #7db6e8; --info-tint: #16293b;
    --rail: #120d17; --rail-ink: #efe6f2; --rail-dim: #a58fb0; --rail-hover: #241a2c; --rail-active: #35202f;
    --focus: #d393c2;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(26px, 5vw, 34px); font-weight: 700; }
h2 { font-size: 21px; font-weight: 650; }
h3 { font-size: 17px; font-weight: 650; }
p { margin: 0 0 12px; }
a { color: var(--accent-text); }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.lead-sm { font-size: 16px; margin-bottom: 16px; }
.ic { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.loading { padding: 48px 0; text-align: center; color: var(--muted); }

/* ---------- botones y campos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 600 15px var(--font); cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn.primary { background: var(--malbec); border-color: var(--malbec); color: var(--on-malbec); }
.btn.primary:hover { background: var(--malbec-hover); border-color: var(--malbec-hover); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.ok { color: #0b1f14; } }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.danger { color: #2a0b0e; } }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent-text); }
.btn.ghost:hover { background: var(--malbec-tint); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: var(--malbec-tint); }
.field { display: block; margin: 0 0 14px; }
.field > span:first-child { display: block; font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.field small { display: block; color: var(--muted); font-weight: 400; margin-top: 4px; }
input:not([type=checkbox]):not([type=radio]), select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--malbec); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--malbec); margin: 0; flex: none; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 10px; font-weight: 500; cursor: pointer; }
.check small { display: block; color: var(--muted); font-weight: 400; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
@media (max-width: 560px) { .row2, .row3 { grid-template-columns: 1fr; } }
.pw { position: relative; display: block; }
.pw input { padding-right: 46px; }
.pw-toggle { position: absolute; right: 2px; top: 2px; width: 40px; height: 40px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.form-error { color: var(--bad); background: var(--bad-tint); border-radius: var(--r); padding: 10px 14px; font-weight: 500; margin: 0 0 14px; }
.notice { border-radius: var(--r); padding: 12px 16px; margin: 0 0 16px; background: var(--info-tint); color: var(--info); font-weight: 500; }
.notice.warn { background: var(--warn-tint); color: var(--warn); }
.notice.bad { background: var(--bad-tint); color: var(--bad); }
.notice.ok { background: var(--ok-tint); color: var(--ok); }

/* ---------- etiquetas ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--malbec-tint); color: var(--accent-text); white-space: nowrap; }
.chip.ok { background: var(--ok-tint); color: var(--ok); } .chip.bad { background: var(--bad-tint); color: var(--bad); }
.chip.warn { background: var(--warn-tint); color: var(--warn); } .chip.info { background: var(--info-tint); color: var(--info); }
.chip.mute { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

/* ---------- estructura ---------- */
.shell { min-height: 100vh; }
.view { padding: 18px 16px 110px; max-width: 1280px; margin: 0 auto; outline: none; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 17px; min-width: 0; }
.brand strong { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark { width: 22px; height: 22px; border-radius: 50% 50% 50% 4px; background: var(--malbec); flex: none; position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); }
.brand.big { font-size: 22px; margin-bottom: 22px; } .brand.big .brand-mark { width: 30px; height: 30px; } .brand.big .brand-mark::after { inset: 8px; }
.rail { display: none; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 2px 8px; border: 0; background: none; color: var(--muted); font: 600 12px var(--font); text-decoration: none; cursor: pointer; min-width: 0; }
.tabbar span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.tabbar a.active { color: var(--accent-text); }
.tabbar a.active .ic { stroke-width: 2.4; }
.sheet { position: fixed; inset: 0; z-index: 40; }
.sheet-back { position: absolute; inset: 0; background: rgba(20, 10, 25, .5); }
.sheet-body { position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 20px 20px 0 0; padding: 12px 12px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 2px; max-height: 80vh; overflow: auto; }
.sheet-body a, .sheet-body button { display: flex; align-items: center; gap: 14px; padding: 14px 12px; border-radius: 12px; color: var(--ink); text-decoration: none; font: 600 16px var(--font); border: 0; background: none; cursor: pointer; text-align: left; }
.sheet-body a.active { background: var(--malbec-tint); color: var(--accent-text); }
.sheet-out { color: var(--bad) !important; }

@media (min-width: 960px) {
  .topbar, .tabbar, .sheet { display: none; }
  .rail { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: 248px; background: var(--rail); color: var(--rail-ink); padding: 22px 14px 16px; z-index: 10; overflow-y: auto; }
  .rail .brand { color: #fff; padding: 0 8px 22px; font-size: 19px; } .rail .brand-mark { background: #d79ac4; } .rail .brand-mark::after { background: var(--rail); }
  .rail nav { display: grid; gap: 2px; align-content: start; flex: 1; }
  .rail nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--rail-dim); text-decoration: none; font-weight: 600; font-size: 15px; }
  .rail nav a:hover { background: var(--rail-hover); color: var(--rail-ink); }
  .rail nav a.active { background: var(--rail-active); color: #fff; }
  .rail-foot { border-top: 1px solid rgba(255, 255, 255, .12); padding: 14px 8px 0; margin-top: 14px; display: grid; gap: 10px; }
  .who { display: grid; line-height: 1.3; } .who strong { font-weight: 650; } .who span { color: var(--rail-dim); font-size: 13px; }
  .rail-out { display: flex; align-items: center; gap: 10px; border: 0; background: none; color: var(--rail-dim); font: 600 14px var(--font); cursor: pointer; padding: 6px 0; }
  .rail-out:hover { color: #fff; }
  .view { margin-left: 248px; max-width: none; padding: 34px 40px 80px; }
  .view > * { max-width: 1240px; }
}

/* ---------- contenedores ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; margin-bottom: 16px; }
.panel > h2, .panel > h3 { margin-bottom: 12px; }
.panel.flush { padding: 0; overflow: hidden; }
.cols { display: grid; gap: 16px; align-items: start; }
@media (min-width: 900px) { .cols.two { grid-template-columns: 1.7fr 1fr; } .cols.even { grid-template-columns: 1fr 1fr; } }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 16px; }
.toolbar .field { margin: 0; min-width: 150px; } .toolbar .field.grow { flex: 1; min-width: 200px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font: 600 15px var(--font); color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected=true] { color: var(--accent-text); border-bottom-color: var(--malbec); }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 10px; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .t { font-weight: 600; } .list .s { color: var(--muted); font-size: 14px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; }
.stat b { display: block; font: 700 28px/1.1 var(--display); } .stat span { color: var(--muted); font-size: 14px; }
.stat.warn b { color: var(--warn); } .stat.bad b { color: var(--bad); } .stat.ok b { color: var(--ok); }
.bar { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; background: var(--malbec); } .bar i.pend { background: var(--warn); opacity: .7; }

/* ---------- tablas ---------- */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: 15px; }
.t th { text-align: left; font-weight: 650; font-size: 13.5px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; background: var(--surface-2); }
.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t .num { text-align: right; white-space: nowrap; }
.t tr.click { cursor: pointer; } .t tr.click:hover td { background: var(--surface-2); }
.t tr.off td { color: var(--muted); }
.t tr.sat td { background: var(--surface-2); }
.t tfoot td, .t tr.total td { font-weight: 700; border-top: 2px solid var(--line-strong); background: var(--surface-2); }

/* ---------- fichar: el ticket ---------- */
.punch-wrap { max-width: 520px; margin: 0 auto; }
.ticket { filter: drop-shadow(0 1px 0 var(--line)); }
.ticket-top, .ticket-bot { background: var(--surface); padding: 22px 22px 18px; }
.ticket-top { border-radius: var(--r-lg) var(--r-lg) 0 0; border: 1px solid var(--line); border-bottom: 0;
  -webkit-mask: radial-gradient(circle 13px at 0 100%, #0000 97%, #000) left / 51% 100% no-repeat, radial-gradient(circle 13px at 100% 100%, #0000 97%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle 13px at 0 100%, #0000 97%, #000) left / 51% 100% no-repeat, radial-gradient(circle 13px at 100% 100%, #0000 97%, #000) right / 51% 100% no-repeat; }
.ticket-bot { border-radius: 0 0 var(--r-lg) var(--r-lg); border: 1px solid var(--line); border-top: 0; padding-top: 20px; position: relative;
  -webkit-mask: radial-gradient(circle 13px at 0 0, #0000 97%, #000) left / 51% 100% no-repeat, radial-gradient(circle 13px at 100% 0, #0000 97%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle 13px at 0 0, #0000 97%, #000) left / 51% 100% no-repeat, radial-gradient(circle 13px at 100% 0, #0000 97%, #000) right / 51% 100% no-repeat; }
.ticket-bot::before { content: ""; position: absolute; left: 20px; right: 20px; top: 0; border-top: 2px dashed var(--line-strong); }
.ticket-date { font: 600 16px var(--display); color: var(--muted); }
.ticket-where { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 14px; margin-top: 2px; }
.clock { font: 700 clamp(58px, 21vw, 96px)/1 var(--display); letter-spacing: -0.03em; margin: 10px 0 4px; color: var(--ink); }
.clock small { font-size: .42em; color: var(--muted); font-weight: 600; letter-spacing: 0; margin-left: 4px; }
.state-line { font-weight: 600; min-height: 26px; }
.state-line.in { color: var(--ok); } .state-line.out { color: var(--muted); }
.punch { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 84px; border: 0; border-radius: 16px; font: 700 23px var(--display); color: #fff; cursor: pointer; margin-top: 16px; transition: transform .1s, filter .15s; }
.punch.in { background: var(--ok); } .punch.out { background: var(--malbec); }
@media (prefers-color-scheme: dark) { .punch.in { color: #08210f; } .punch.out { color: #fff; } }
.punch:active:not(:disabled) { transform: scale(.985); }
.punch:disabled { filter: grayscale(.5) opacity(.7); cursor: progress; }
.today-plan { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 4px; }
.seg { display: inline-block; padding: 2px 9px; border-radius: 7px; background: var(--malbec-tint); color: var(--accent-text); font-weight: 650; font-size: 14.5px; }
.rec { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-weight: 500; }
.rec:first-child { border-top: 0; }
.done-flash { animation: flash .9s ease-out 1; }
@keyframes flash { from { box-shadow: 0 0 0 0 var(--ok); } to { box-shadow: 0 0 0 22px transparent; } }

/* ---------- tablero de turnos ---------- */
.weeknav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.weeknav .label { font: 650 18px var(--display); min-width: 190px; text-align: center; }
.board-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); max-height: calc(100vh - 230px); min-height: 200px; }
table.board { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 980px; }
.board th, .board td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; vertical-align: top; }
.board th:last-child, .board td:last-child { border-right: 0; }
.board thead th { position: sticky; top: 0; z-index: 3; background: var(--surface-2); padding: 9px 8px; text-align: center; font-weight: 650; font-size: 14px; }
.board thead th small { display: block; color: var(--muted); font-weight: 500; }
.board thead th.today { background: var(--malbec-tint); color: var(--accent-text); }
.board .who-cell { position: sticky; left: 0; z-index: 2; background: var(--surface); min-width: 180px; max-width: 220px; padding: 10px 12px; text-align: left; }
.board thead .who-cell { z-index: 4; background: var(--surface-2); }
.board .who-cell b { display: block; font-weight: 650; line-height: 1.25; } .board .who-cell span { color: var(--muted); font-size: 13px; }
.board .sum-cell { min-width: 112px; padding: 10px 10px; background: var(--surface-2); }
.board .sum-cell b { font: 700 20px var(--display); display: block; } .board .sum-cell span { color: var(--muted); font-size: 13px; display: block; }
.cell { display: flex; flex-direction: column; justify-content: center; gap: 2px; width: 100%; min-height: 78px; padding: 8px 8px; border: 0; background: transparent; color: inherit; font: inherit; text-align: center; cursor: pointer; }
.cell:hover { background: var(--surface-2); }
.cell .tm { font-weight: 650; font-size: 14px; line-height: 1.3; } .cell .hrs { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.cell.work { background: var(--malbec-tint); color: var(--accent-text); } .cell.work:hover { filter: brightness(.97); }
.cell.half { background: var(--warn-tint); color: var(--warn); }
.cell.franco { background: repeating-linear-gradient(135deg, transparent 0 7px, var(--line) 7px 8px); color: var(--muted); font-weight: 650; }
.cell.vacation { background: var(--ok-tint); color: var(--ok); font-weight: 650; }
.cell.cert { background: var(--info-tint); color: var(--info); font-weight: 650; }
.cell.empty { color: var(--line-strong); font-size: 22px; } .cell.empty:hover { color: var(--accent-text); }
.cell .real { font-size: 12px; font-weight: 600; opacity: .85; border-top: 1px dashed currentColor; margin-top: 3px; padding-top: 2px; }
.board tfoot td, .board tfoot th { position: sticky; bottom: 0; background: var(--surface-2); padding: 8px; text-align: center; font-weight: 650; z-index: 2; }
.warns { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; color: var(--warn); font-size: 13px; font-weight: 650; cursor: pointer; background: none; border: 0; padding: 0; }
.warns .ic { width: 16px; height: 16px; }
.segrow { display: grid; grid-template-columns: 1fr 1fr 36px; gap: 8px; align-items: end; margin-bottom: 8px; }
.segrow .field { margin: 0; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.presets button { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 5px 12px; font: 600 14px var(--font); cursor: pointer; color: var(--ink); }
.presets button:hover { background: var(--malbec-tint); }
.daytype { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 16px; }
@media (min-width: 560px) { .daytype { grid-template-columns: repeat(4, 1fr); } }
.daytype label { display: block; cursor: pointer; }
.daytype input { position: absolute; opacity: 0; pointer-events: none; }
.daytype span { display: block; text-align: center; padding: 10px 6px; border: 1px solid var(--line-strong); border-radius: var(--r); font-weight: 650; font-size: 14.5px; }
.daytype input:checked + span { background: var(--malbec); color: var(--on-malbec); border-color: var(--malbec); }
.daytype input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

/* turnos del empleado */
.dayrow { display: grid; grid-template-columns: 74px 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); }
.dayrow:first-child { border-top: 0; }
.dayrow .d { font: 650 17px var(--display); line-height: 1.1; } .dayrow .d small { display: block; font: 500 13px var(--font); color: var(--muted); }
.dayrow.today { background: var(--malbec-tint); }
.dayrow .tm { font-weight: 650; } .dayrow .hrs { font-weight: 700; font-family: var(--display); font-size: 18px; text-align: right; }

/* ---------- vacaciones ---------- */
.balance { display: grid; gap: 16px; }
.bal-main { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.bal-main b { font: 700 52px/1 var(--display); color: var(--accent-text); } .bal-main span { color: var(--muted); font-weight: 600; }
.bal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.bal-grid div { background: var(--surface-2); border-radius: var(--r); padding: 10px 6px; } .bal-grid b { display: block; font: 700 22px var(--display); } .bal-grid span { font-size: 13px; color: var(--muted); }
.req { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 12px; background: var(--surface); }
.req-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.req .when { font: 650 17px var(--display); }
.req .note { color: var(--muted); font-size: 14.5px; margin-top: 6px; }
.req .btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- informe ---------- */
.rep-head { display: none; }
.rep-sign { display: none; }
.flagtxt { font-size: 13px; font-weight: 600; }
.flagtxt.late { color: var(--warn); } .flagtxt.bad { color: var(--bad); } .flagtxt.mute { color: var(--muted); }
.punches div { white-space: nowrap; }

/* ---------- modales y avisos ---------- */
dialog.modal { border: 0; padding: 0; border-radius: 20px; background: var(--surface); color: var(--ink); width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 24px 80px rgba(20, 5, 25, .45); }
dialog.modal.wide { width: min(760px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(20, 10, 25, .55); }
dialog.modal[open] { display: flex; flex-direction: column; animation: pop .16s ease-out; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 12px 8px 22px; }
.modal-body { padding: 8px 22px 18px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@media (max-width: 600px) {
  dialog.modal { margin: auto 0 0; width: 100vw !important; max-width: 100vw; border-radius: 20px 20px 0 0; max-height: 92vh; }
  dialog.modal.wide { width: 100vw; }
}
#toasts { position: fixed; z-index: 100; left: 50%; transform: translateX(-50%); bottom: 88px; display: grid; gap: 8px; width: min(440px, calc(100vw - 24px)); pointer-events: none; }
@media (min-width: 960px) { #toasts { bottom: 28px; } }
.toast { background: #2b1d33; color: #fff; padding: 13px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 8px 28px rgba(0, 0, 0, .3); animation: pop .18s ease-out; }
.toast.bad { background: var(--bad); color: #fff; } .toast.ok { background: #1d5a3a; }
.toast.out { opacity: 0; transition: opacity .3s; }
@media (prefers-color-scheme: dark) { .toast.bad { color: #2a0b0e; } }

/* ---------- acceso ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px 16px; background: var(--bg); }
.auth-card { width: min(430px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 30px 26px 26px; }
.auth-card h1 { font-size: 28px; margin-bottom: 8px; } .auth-card .btn { margin-top: 6px; }

/* ---------- QR ---------- */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.qr-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; text-align: center; background: #fff; color: #1d1724; }
.qr-card > svg { width: 100%; max-width: 190px; height: auto; display: block; margin: 0 auto 8px; }
.qr-card b { display: block; font: 650 17px var(--display); } .qr-card > span { font-size: 12.5px; color: #675e72; word-break: break-all; }
.poster { display: none; }
.perm-grid { display: grid; gap: 4px 18px; }
@media (min-width: 560px) { .perm-grid { grid-template-columns: 1fr 1fr; } }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: 15px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- impresión (informes y carteles) ---------- */
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff !important; color: #000 !important; font-size: 11.5pt; }
  .rail, .topbar, .tabbar, .sheet, .toolbar, .page-head .actions, .tabs, #toasts, .no-print, .btn { display: none !important; }
  .view { margin: 0 !important; padding: 0 !important; max-width: none !important; }
  .panel { border: 0 !important; padding: 0 !important; }
  .rep-head { display: block; margin-bottom: 10px; } .rep-head h1 { font-size: 20pt; }
  .rep-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 56px; text-align: center; font-size: 10.5pt; } .rep-sign div { border-top: 1px solid #000; padding-top: 4px; }
  .t th { background: #eee !important; color: #000 !important; } .t td, .t th { padding: 4px 6px; border-bottom: 1px solid #bbb; font-size: 10pt; }
  .tablewrap { overflow: visible; } tr { break-inside: avoid; }
  .chip { border: 1px solid #999; background: #fff !important; color: #000 !important; }
  body.poster-mode .view, body.poster-mode .shell > * { display: none !important; }
  body.poster-mode .poster { display: block !important; text-align: center; padding-top: 18mm; }
  .poster h1 { font-size: 40pt; margin-bottom: 6mm; } .poster p { font-size: 18pt; } .poster svg { width: 120mm; height: 120mm; margin: 8mm auto; display: block; } .poster small { font-size: 11pt; word-break: break-all; }
}

@media print {
  @page board { size: A4 landscape; margin: 10mm; }
  .board-wrap { page: board; max-height: none !important; overflow: visible !important; }
}
