:root {
  --bg: #f5f6f8; --surface: #fff; --text: #1b2330; --muted: #5d6878; --line: #e2e6ec;
  --primary: #1f3a5f; --primary-ink: #fff; --accent: #f2b134;
  --ok: #1e7b4f; --ok-bg: #e3f4ea; --warn: #9a5b00; --warn-bg: #fff2d9; --crit: #b3261e; --crit-bg: #fde7e5;
  --info: #2c5d9a; --info-bg: #e6eef9;
  --radius: 10px; --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151b; --surface: #1a2029; --text: #e6e9ee; --muted: #9aa4b2; --line: #2b3340;
    --primary: #7fa7d8; --primary-ink: #0d1520; --ok: #6fd3a0; --ok-bg: #173226; --warn: #f2c26b; --warn-bg: #362a12;
    --crit: #ff8a80; --crit-bg: #3b1a18; --info: #9cc0f0; --info-bg: #1a2a40;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
h1 { font-size: 1.35rem; margin: 0 0 1rem; }
h2 { font-size: 1.05rem; margin: 1.5rem 0 .6rem; }
a { color: var(--primary); }
header { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; padding: .6rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 650; }
nav { display: flex; flex-wrap: wrap; gap: .25rem; flex: 1; }
nav a { text-decoration: none; color: var(--muted); padding: .35rem .6rem; border-radius: 6px; font-size: .92rem; }
nav a.active, nav a:hover { background: var(--bg); color: var(--text); }
nav .sep { width: 1px; background: var(--line); margin: .2rem .4rem; }
.who { display: flex; gap: .75rem; align-items: center; color: var(--muted); font-size: .9rem; }
main { max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem 4rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.big { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; }
.center { text-align: center; }
button, .btn { font: inherit; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: .5rem .9rem; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
button:hover, .btn:hover { border-color: var(--muted); }
button.primary, .btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
button.danger { color: var(--crit); border-color: var(--crit); }
button.ok { color: var(--ok); border-color: var(--ok); }
button.link { border: 0; background: none; padding: 0; color: var(--primary); text-decoration: underline; }
button:disabled { opacity: .5; cursor: not-allowed; }
.clock-actions { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: 1rem; }
.clock-actions button { justify-content: center; padding: 1.1rem .5rem; font-size: 1.1rem; font-weight: 600; }
.status { display: inline-block; padding: .2rem .6rem; border-radius: 99px; font-size: .85rem; font-weight: 600; }
.status.working { background: var(--ok-bg); color: var(--ok); }
.status.break { background: var(--warn-bg); color: var(--warn); }
.status.out { background: var(--bg); color: var(--muted); }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .2rem; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .45rem .6rem; width: 100%; }
textarea { min-height: 4.5rem; }
.field { margin-bottom: .75rem; }
.inline { display: inline-block; width: auto; }
.form-grid { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .5rem .55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--bg); }
tr.week td { background: var(--bg); font-weight: 600; }
tr.off td { color: var(--muted); }
.table-wrap { overflow-x: auto; }
.badge { display: inline-block; font-size: .75rem; padding: .1rem .45rem; border-radius: 6px; margin: 0 .25rem .2rem 0; font-weight: 600; }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.warning { background: var(--warn-bg); color: var(--warn); }
.badge.critical { background: var(--crit-bg); color: var(--crit); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.muted { background: var(--bg); color: var(--muted); }
.voided { text-decoration: line-through; color: var(--muted); }
.notice { border-left: 4px solid var(--warn); background: var(--warn-bg); padding: .6rem .8rem; border-radius: 6px; margin-bottom: 1rem; }
.notice.info { border-color: var(--info); background: var(--info-bg); }
.notice.crit { border-color: var(--crit); background: var(--crit-bg); }
.login { max-width: 380px; margin: 8vh auto; }
.kpi { display: flex; flex-direction: column; gap: .15rem; }
.kpi .v { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.sched { display: grid; grid-template-columns: 3.5rem repeat(4, minmax(0, 1fr)); gap: .35rem; align-items: center; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-top: .5rem; background: var(--bg); }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: .35rem 0; border-bottom: 1px dashed var(--line); }
#toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: .6rem 1rem; border-radius: 8px; box-shadow: var(--shadow); z-index: 10; max-width: 90vw; }
#toast.error { background: var(--crit); color: #fff; }
code { font-size: .8rem; word-break: break-all; }
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .big { font-size: 1.6rem; }
  header { position: static; padding: .5rem .75rem; }
  nav { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; }
  nav a { white-space: nowrap; }
  main { padding: 1rem .75rem 3rem; }
  .sched { grid-template-columns: 2.4rem repeat(4, minmax(0, 1fr)); gap: .25rem; }
  .sched input { padding: .45rem .15rem; text-align: center; font-variant-numeric: tabular-nums; }
  .sched input::-webkit-calendar-picker-indicator { display: none; }
}
@media print {
  header, .no-print, button { display: none !important; }
  .card { box-shadow: none; border: 0; }
  body { background: #fff; color: #000; }
}
