/* GestionTemps — stylesheet
   Palette: cool paper, deep ink, Swiss-railway red reserved for the punch action.
   Durations use tabular figures. One radius scale: 6px controls, 14px panels. */

@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/ibm-plex-sans-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/ibm-plex-sans-latin-ext-400-normal.woff2') format('woff2'); unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/ibm-plex-sans-latin-ext-500-normal.woff2') format('woff2'); unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/ibm-plex-sans-latin-ext-600-normal.woff2') format('woff2'); unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  --paper: #F6F7F4; --surface: #FFFFFF; --surface-2: #EEF0F3;
  --ink: #1B1F2A; --ink-2: #5B6473; --ink-3: #8A93A1;
  --line: #DDE1E6; --line-2: #EBEEF2;
  --red: #D52B1E; --red-hover: #BC2317; --on-red: #FFFFFF;
  --green: #2E7D4F; --green-bg: #E4F1E8;
  --amber: #B7791F; --amber-bg: #FBF1DC;
  --rose: #B3261E; --rose-bg: #FBE7E5;
  --blue: #3B5BDB; --blue-bg: #E8ECFB;
  --focus: #3B5BDB;
  --radius: 6px; --radius-lg: 14px;
  --nav-h: 64px; --side-w: 236px;
  --shadow: 0 1px 2px rgba(27,31,42,.06), 0 8px 24px -12px rgba(27,31,42,.18);
  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14171F; --surface: #1D212B; --surface-2: #262B37;
    --ink: #E8EAEE; --ink-2: #A3AAB7; --ink-3: #6F7786;
    --line: #2F3542; --line-2: #262B37;
    --red: #E5392B; --red-hover: #D52B1E;
    --green: #5CB37E; --green-bg: #1B2F23;
    --amber: #D9A24A; --amber-bg: #332A17;
    --rose: #E06A62; --rose-bg: #3A1F1D;
    --blue: #7D93F2; --blue-bg: #1F2640;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #14171F; --surface: #1D212B; --surface-2: #262B37;
  --ink: #E8EAEE; --ink-2: #A3AAB7; --ink-3: #6F7786;
  --line: #2F3542; --line-2: #262B37;
  --red: #E5392B; --red-hover: #D52B1E;
  --green: #5CB37E; --green-bg: #1B2F23;
  --amber: #D9A24A; --amber-bg: #332A17;
  --rose: #E06A62; --rose-bg: #3A1F1D;
  --blue: #7D93F2; --blue-bg: #1F2640;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.45 var(--font); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; min-height: 100vh; min-height: 100dvh; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 24px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
p { margin: 0 0 .6em; }
a { color: var(--blue); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
.num, .tnum, td.num, .time { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }
.muted { color: var(--ink-2); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.pos { color: var(--green); } .neg { color: var(--amber); } .bad { color: var(--rose); }
.right { text-align: right; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

/* ---------- layout ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 16px; }
.topbar .brand { font-weight: 600; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.topbar .brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.topbar .grow { flex: 1; }
.main { flex: 1; padding: 16px 16px calc(var(--nav-h) + 20px); width: 100%; max-width: 1180px; margin: 0 auto; }
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; height: var(--nav-h); background: var(--surface); border-top: 1px solid var(--line); display: flex; z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-2); font-size: 11px; font-weight: 500; text-decoration: none; position: relative; }
.bottomnav a.active { color: var(--ink); }
.bottomnav a.active::before { content: ''; position: absolute; top: 0; width: 28px; height: 2px; background: var(--red); border-radius: 0 0 2px 2px; }
.bottomnav svg { width: 22px; height: 22px; }
.sidenav { display: none; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: var(--on-red); font-size: 11px; font-weight: 600; }
.bottomnav .badge { position: absolute; top: 8px; right: calc(50% - 22px); }

@media (min-width: 900px) {
  .app { flex-direction: row; }
  .topbar { display: none; }
  .bottomnav { display: none; }
  .sidenav { display: flex; flex-direction: column; width: var(--side-w); flex: none; position: sticky; top: 0; height: 100dvh; border-right: 1px solid var(--line); padding: 20px 14px; gap: 2px; background: var(--paper); }
  .sidenav .brand { font-weight: 600; font-size: 17px; padding: 4px 10px 18px; display: flex; align-items: center; gap: 10px; }
  .sidenav .brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--red); }
  .sidenav .section { font-size: 12px; color: var(--ink-3); padding: 14px 10px 4px; }
  .sidenav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); color: var(--ink-2); font-weight: 500; text-decoration: none; }
  .sidenav a:hover { background: var(--surface-2); color: var(--ink); }
  .sidenav a.active { background: var(--surface); color: var(--ink); box-shadow: inset 2px 0 0 var(--red); }
  .sidenav svg { width: 18px; height: 18px; flex: none; }
  .sidenav .badge { margin-left: auto; }
  .sidenav .foot { margin-top: auto; padding: 10px; font-size: 13px; color: var(--ink-2); border-top: 1px solid var(--line); }
  .sidenav .foot strong { display: block; color: var(--ink); font-weight: 500; }
  .main { padding: 28px 32px 40px; }
}

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--ink-2); margin-top: 2px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 500; cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.primary:hover { opacity: .92; }
.btn.red { background: var(--red); color: var(--on-red); border-color: var(--red); }
.btn.red:hover { background: var(--red-hover); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--rose); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.xs { padding: 3px 8px; font-size: 12px; }
.btn.block { width: 100%; }
.btn svg { width: 16px; height: 16px; }
.btn-group { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.btn-group button { border: 0; background: var(--surface); padding: 7px 12px; cursor: pointer; font-weight: 500; color: var(--ink-2); }
.btn-group button + button { border-left: 1px solid var(--line); }
.btn-group button.active { background: var(--ink); color: var(--paper); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > label, .label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--ink-3); }
.input, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="time"], input[type="search"], input[type="tel"], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); min-height: 40px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }
textarea { resize: vertical; min-height: 72px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.row { display: flex; gap: 12px; flex-wrap: wrap; } .row > * { flex: 1; min-width: 140px; }
.row.tight { gap: 8px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.error-text { color: var(--rose); font-size: 13px; }
.days-pick { display: flex; gap: 4px; }
.days-pick button { flex: 1; padding: 7px 0; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); cursor: pointer; font-weight: 500; color: var(--ink-2); }
.days-pick button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- panels, lists, tables ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; }
.panel + .panel, .section + .section { margin-top: 16px; }
.panel h2, .panel h3 { margin-bottom: 12px; }
.panel.flat { background: transparent; border: 0; padding: 0; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-2 .span { grid-column: 1 / -1; } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.stat { padding: 14px 16px; border-right: 1px solid var(--line-2); }
.stat:last-child { border-right: 0; }
.stat .v { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.stat .l { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--ink-2); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: var(--surface-2); }
tr.weekend td { color: var(--ink-3); }
tr.total td { font-weight: 600; border-top: 1px solid var(--line); }
th.num, td.num { text-align: right; }
.list { display: flex; flex-direction: column; }
.list > .item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.list > .item:last-child { border-bottom: 0; }
.list .item .body { flex: 1; min-width: 0; }
.list .item .title { font-weight: 500; }
.list .item .meta { font-size: 13px; color: var(--ink-2); }
.empty { padding: 28px 16px; text-align: center; color: var(--ink-2); }
.empty strong { display: block; color: var(--ink); font-weight: 500; margin-bottom: 4px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip.green { background: var(--green-bg); color: var(--green); } .chip.amber { background: var(--amber-bg); color: var(--amber); }
.chip.rose { background: var(--rose-bg); color: var(--rose); } .chip.blue { background: var(--blue-bg); color: var(--blue); }
.chip.ink { background: var(--ink); color: var(--paper); }
.chip .sw { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; vertical-align: middle; margin-right: 6px; }
.notice { padding: 10px 14px; border-radius: var(--radius); font-size: 14px; border: 1px solid var(--line); background: var(--surface); }
.notice.warn { background: var(--amber-bg); border-color: transparent; color: var(--amber); }
.notice.error { background: var(--rose-bg); border-color: transparent; color: var(--rose); }
.notice.ok { background: var(--green-bg); border-color: transparent; color: var(--green); }
.notice.info { background: var(--blue-bg); border-color: transparent; color: var(--blue); }
.bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--green); border-radius: 3px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--red); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--ink-2); } .kv dd { margin: 0; }

/* ---------- punch (home) ---------- */
.home { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .home { grid-template-columns: minmax(0, 420px) 1fr; align-items: start; } }
.clock { text-align: center; padding: 10px 0 0; }
.clock .now { font-size: 44px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.clock .now small { font-size: 20px; color: var(--ink-3); font-weight: 500; }
.clock .date { color: var(--ink-2); margin-top: 6px; }
.punch-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 16px 0 8px; }
.punch { position: relative; width: 236px; height: 236px; border-radius: 50%; border: 0; background: var(--surface); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--ink); box-shadow: var(--shadow); transition: transform .12s ease; -webkit-tap-highlight-color: transparent; }
.punch:active { transform: scale(.98); }
.punch:disabled { cursor: default; opacity: .7; }
.punch svg.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.punch svg.ring .track { stroke: var(--line); }
.punch svg.ring .prog { stroke: var(--green); transition: stroke-dashoffset .6s ease; }
.punch svg.ring .over { stroke: var(--amber); }
.punch .hand { position: absolute; inset: 0; animation: sweep 60s linear infinite; }
.punch .hand::after { content: ''; position: absolute; top: 2px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px var(--surface); }
@keyframes sweep { to { transform: rotate(360deg); } }
.punch .verb { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.punch .big { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.punch .big.red { color: var(--red); }
.punch .since { font-size: 13px; color: var(--ink-2); }
.punch.in { box-shadow: var(--shadow), 0 0 0 1px var(--red) inset; }
.punch.pending { animation: none; }
.punch-state { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.punch-state .st { font-weight: 600; font-size: 17px; }
.punch-state .st .live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-right: 6px; vertical-align: 1px; }
.balances { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.balances > div { padding: 14px 16px; }
.balances > div + div { border-left: 1px solid var(--line-2); }
.balances .v { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.balances .l { font-size: 12px; color: var(--ink-2); }
.today-line { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.today-line .bar { flex: 1; }
.punches-today { display: flex; flex-wrap: wrap; gap: 6px; }
.punches-today .p { padding: 6px 10px; border-radius: var(--radius); background: var(--surface-2); font-size: 14px; display: flex; gap: 6px; align-items: center; }
.punches-today .p.in::before { content: '→'; color: var(--green); font-weight: 600; }
.punches-today .p.out::before { content: '←'; color: var(--ink-3); font-weight: 600; }
.punches-today .p.outside { outline: 1px solid var(--amber); }
.geo-line { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; justify-content: center; }
.geo-line.ok { color: var(--green); } .geo-line.bad { color: var(--amber); }

@media (prefers-reduced-motion: reduce) { .punch .hand { animation: none; } .punch svg.ring .prog { transition: none; } .punch { transition: none; } }

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-month { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.cal-month .dow { padding: 8px 6px; font-size: 12px; color: var(--ink-2); text-align: center; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal-cell { min-height: 72px; padding: 6px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); cursor: pointer; display: flex; flex-direction: column; gap: 3px; position: relative; background: var(--surface); }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell:hover { background: var(--surface-2); }
.cal-cell.other { opacity: .35; } .cal-cell.weekend { background: color-mix(in srgb, var(--surface-2) 50%, var(--surface)); }
.cal-cell.today .d { background: var(--red); color: var(--on-red); }
.cal-cell.future .delta { opacity: .5; }
.cal-cell .d { font-size: 13px; font-weight: 500; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-cell .delta { font-size: 12px; font-weight: 600; }
.cal-cell .tag { font-size: 11px; padding: 1px 5px; border-radius: 3px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-cell .tag.hol { background: var(--blue-bg); color: var(--blue); }
.cal-cell .tag.abs { color: #fff; }
.cal-cell .tag.flag { background: var(--amber-bg); color: var(--amber); }
.cal-cell .wk { font-size: 11px; color: var(--ink-3); }
.cal-cell .dots { display: flex; gap: 2px; }
.cal-cell .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3); }
@media (max-width: 600px) {
  .cal-cell { min-height: 56px; padding: 4px; }
  .cal-cell .tag { display: none; }
  .cal-cell .delta { font-size: 11px; }
}
.cal-week { display: grid; grid-template-columns: 48px repeat(7, 1fr); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.cal-week .corner, .cal-week .dayhead { border-bottom: 1px solid var(--line); padding: 8px 4px; font-size: 12px; text-align: center; color: var(--ink-2); background: var(--surface-2); }
.cal-week .dayhead strong { display: block; font-size: 15px; color: var(--ink); }
.cal-week .dayhead.today strong { color: var(--red); }
.cal-week .hours { position: relative; border-right: 1px solid var(--line-2); }
.cal-week .hours div { height: 28px; font-size: 11px; color: var(--ink-3); text-align: right; padding-right: 4px; transform: translateY(-7px); }
.cal-week .daycol { position: relative; border-right: 1px solid var(--line-2); background: repeating-linear-gradient(to bottom, transparent 0, transparent 27px, var(--line-2) 27px, var(--line-2) 28px); cursor: pointer; }
.cal-week .daycol:last-child { border-right: 0; }
.cal-week .seg { position: absolute; left: 3px; right: 3px; border-radius: 4px; background: var(--green); opacity: .85; color: #fff; font-size: 11px; padding: 2px 4px; overflow: hidden; }
.cal-week .seg.open { background: var(--red); }
.cal-week .seg.abs { opacity: .6; }
.cal-week .seg.cred { background: var(--blue); }
.cal-week .daysum { position: sticky; bottom: 0; font-size: 12px; text-align: center; padding: 4px; background: var(--surface); border-top: 1px solid var(--line-2); }
@media (max-width: 700px) { .cal-week { grid-template-columns: 36px repeat(7, 1fr); } .cal-week .seg { font-size: 9px; padding: 1px 2px; } }
.timeline { position: relative; padding-left: 70px; }
.timeline .tick { position: relative; height: 40px; border-top: 1px solid var(--line-2); }
.timeline .tick span { position: absolute; left: -70px; top: -9px; width: 60px; text-align: right; font-size: 12px; color: var(--ink-3); }
.timeline .seg { position: absolute; left: 70px; right: 0; border-radius: var(--radius); background: var(--green-bg); border-left: 3px solid var(--green); padding: 4px 8px; font-size: 13px; color: var(--ink); }
.timeline .seg.open { background: var(--rose-bg); border-left-color: var(--red); }
.day-punches .pr { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.day-punches .pr:last-child { border-bottom: 0; }
.day-punches .t { font-weight: 600; width: 52px; }
.day-punches .ty { width: 56px; font-size: 13px; color: var(--ink-2); }
.day-punches .ty.in { color: var(--green); }
.day-punches .src { font-size: 12px; color: var(--ink-3); flex: 1; }

/* ---------- modal, toasts ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20, 23, 31, .45); z-index: 100; display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.modal { background: var(--surface); width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); box-shadow: var(--shadow); }
.modal.wide { max-width: 860px; }
.modal h2 { margin-bottom: 14px; }
.modal .close { position: absolute; right: 12px; top: 12px; }
@media (min-width: 700px) { .modal-bg { align-items: center; padding: 20px; } .modal { border-radius: var(--radius-lg); padding: 24px; } }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 12px); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
@media (min-width: 900px) { .toasts { bottom: 20px; } }
.toast { pointer-events: auto; padding: 10px 14px; border-radius: var(--radius); background: var(--ink); color: var(--paper); font-size: 14px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; }
.toast.success { background: var(--green); color: #fff; } .toast.error { background: var(--rose); color: #fff; }
.toast button { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; opacity: .8; font-size: 16px; }
.offline-bar { background: var(--amber); color: #fff; text-align: center; font-size: 13px; padding: 5px 10px; font-weight: 500; }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login .card { width: 100%; max-width: 380px; }
.login .brand { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.login .brand .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--red); }
.login .tag { color: var(--ink-2); margin-bottom: 26px; }

/* ---------- map ---------- */
.map { height: 320px; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; z-index: 0; }
.map.tall { height: 440px; }
.leaflet-container { font: inherit; background: var(--surface-2); }
:root[data-theme="dark"] .leaflet-tile, :root:not([data-theme="light"]) .leaflet-tile { filter: none; }

/* ---------- print ---------- */
@media print {
  .sidenav, .topbar, .bottomnav, .toolbar, .no-print, .toasts, .offline-bar { display: none !important; }
  body { background: #fff; color: #000; font-size: 12px; }
  .main { padding: 0; max-width: none; }
  .panel { border: 0; padding: 0; break-inside: avoid; }
  table { font-size: 11px; } td, th { padding: 4px 6px; }
  a { color: inherit; }
  .print-only { display: block !important; }
  .sig-row { display: flex !important; gap: 60px; margin-top: 30px; }
}
.print-only { display: none; }
