:root {
  --bg: #f4f6f3;
  --card: #ffffff;
  --ink: #17251c;
  --muted: #66746b;
  --line: #dde3de;
  --green: #1f6b43;
  --green-soft: #e3efe7;
  --red: #b3261e;
  --red-soft: #fbe9e7;
  --amber: #8a5a00;
  --amber-soft: #fdf1d8;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
main { margin: 0 auto; padding: 24px 16px 48px; }
body.narrow main { max-width: 460px; }
body.wide main { max-width: 1100px; }
a { color: var(--green); }
h1 { font-size: 1.6rem; margin: .1em 0 .3em; line-height: 1.2; }
h2 { font-size: 1.15rem; margin: 2em 0 .7em; }
h3 { font-size: 1rem; margin: 0 0 .8em; }
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; color: var(--green); font-weight: 700; margin: 0; }
.eyebrow a { text-decoration: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card.quiet { background: transparent; border-style: dashed; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.alert { background: var(--amber-soft); color: var(--amber); border-radius: 10px; padding: 12px 14px; }

label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .95rem; }
label.inline { flex-direction: row; align-items: center; font-weight: normal; }
input, select, textarea {
  font: inherit; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); width: 100%;
}
label.inline input { width: auto; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; font-size: .95rem; margin-bottom: 8px; }

.btn { display: inline-block; font: inherit; font-weight: 600; padding: 10px 16px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; text-align: center; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.big { padding: 16px; font-size: 1.1rem; }
.btn.ghost { background: transparent; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--green); text-decoration: underline; cursor: pointer; }
.linkbtn.danger { color: var(--red); }

/* scan-sider */
.mark { width: 72px; height: 72px; border-radius: 50%; margin: 6px auto 12px; display: grid; place-items: center; font-size: 36px; color: #fff; }
.mark.in { background: var(--green); }
.mark.out { background: var(--ink); }
.big-line { font-size: 1.25rem; font-weight: 700; margin: 0; }
.clock { font-size: 2rem; font-weight: 700; margin: .2em 0 .4em; font-variant-numeric: tabular-nums; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0; }
.facts dt { font-size: .8rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; font-size: 1.1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip { font-weight: normal; }
.chip span { display: inline-block; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; }
.chip input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }
details summary { cursor: pointer; color: var(--green); font-weight: 600; }
form.card.quiet { margin-top: 16px; }
.who { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 20px; font-size: .9rem; color: var(--muted); }

/* admin */
.top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.brand { font-weight: 800; }
.brand span { font-weight: 400; color: var(--muted); }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { text-decoration: none; color: var(--ink); padding: 7px 12px; border-radius: 8px; font-size: .95rem; }
nav a.on { background: var(--green-soft); color: var(--green); font-weight: 600; }
nav a.out { color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; }
.kpi .v { font-size: 1.9rem; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .v.small { font-size: 1.3rem; padding: .2em 0; }
.kpi .k { color: var(--muted); font-size: .85rem; }
.kpi.warn { background: var(--red-soft); border-color: #f2c9c4; }
.kpi.warn .v { color: var(--red); }

.live { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.live li { background: var(--green-soft); border-radius: 10px; padding: 10px 14px; }

.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td a { text-decoration: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.late { color: var(--red); font-weight: 600; }
tr.inactive td { opacity: .55; }
.actions { white-space: nowrap; text-align: right; }
.actions > * { margin-left: 10px; display: inline; }
.actions form { display: inline; }
.tag { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--ink); white-space: nowrap; }
.tag.open { background: var(--green-soft); color: var(--green); }
.tag.forgotten { background: var(--amber-soft); color: var(--amber); }

.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-top: 24px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.bar .fill { width: 100%; max-width: 34px; background: var(--green); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar .n { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar .l { font-size: .75rem; color: var(--muted); }
.bars.hours { gap: 3px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters select, .filters input { width: auto; }

.split { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
