@font-face {
  font-family: "Archivo";
  src: url("/static/fonts/archivo.woff") format("woff");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
:root {
  --bg: #f5f6f2;
  --surface: #ffffff;
  --text: #16213b;
  --muted: #5c6475;
  --line: #dde1d9;
  --accent: #2443c9;
  --accent-ink: #ffffff;
  --work: #1f7a44;
  --break: #b86e00;
  --danger: #cf3a2e;
  --radius: 12px;
  font-family: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10172a;
    --surface: #18213a;
    --text: #e7ebf3;
    --muted: #a3abbd;
    --line: #2a3550;
    --accent: #7d96ff;
    --accent-ink: #0c1430;
    --work: #5fd08a;
    --break: #f2b65a;
    --danger: #ff7b6e;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; }
[hidden] { display: none !important; }
h1, h2 { margin: 0 0 12px; letter-spacing: -0.01em; }
h1 { font-size: 24px; }
h2 { font-size: 17px; }

.lic-banner { padding: 12px 20px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; border-bottom: 1px solid var(--line); }
.lic-banner.info { background: #e8f0fe; color: #1a3d8f; }
.lic-banner.warning { background: #fff1d6; color: #7a4500; }
.lic-banner.critical { background: #fde7e4; color: #8f1d12; }
.lic-banner span:empty { display: none; }
@media (prefers-color-scheme: dark) {
  .lic-banner.info { background: #16264a; color: #b7cbff; }
  .lic-banner.warning { background: #3a2a10; color: #f6c97a; }
  .lic-banner.critical { background: #3d1a17; color: #ffb3a8; }
}
.banner { background: var(--accent); color: var(--accent-ink); text-align: center; padding: 8px 16px; font-size: 14px; font-weight: 600; }

.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; }
.brand .dot { width: 22px; height: 22px; background: url('/static/favicon.svg') center / contain no-repeat; }
.brand { font-stretch: 85%; }
.timer { font-stretch: 75%; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }

/* Login */
.login { min-height: 90vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; }
.login-card .brand { margin-bottom: 8px; }

label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 500; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 15px; }
input, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.btn { font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 10px; padding: 9px 16px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.big { font-size: 18px; padding: 16px 28px; border-radius: 14px; min-width: 160px; }
.btn.work { background: var(--work); border-color: var(--work); color: #fff; }
.btn.pause { background: var(--break); border-color: var(--break); color: #1a1000; }
.btn.small { padding: 5px 10px; font-size: 13px; }

.error { color: var(--danger); min-height: 1em; margin: 0; font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; margin: 0; }

/* Layout */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; }
.tabs button { font: inherit; font-weight: 600; border: 0; background: transparent; color: var(--muted); padding: 8px 14px; border-radius: 10px; cursor: pointer; }
.tabs button.active { background: var(--bg); color: var(--text); }
.user { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.content { max-width: 860px; margin: 24px auto; padding: 0 16px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 24px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.row h2 { margin: 0; min-width: 150px; text-align: center; }

/* Stempeluhr */
.clock { text-align: center; padding: 32px 20px; }
.state { display: inline-block; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 12px; border-radius: 99px; background: var(--bg); color: var(--muted); }
.state.working { background: color-mix(in srgb, var(--work) 15%, transparent); color: var(--work); }
.state.break { background: color-mix(in srgb, var(--break) 18%, transparent); color: var(--break); }
.timer { font-size: clamp(48px, 12vw, 76px); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; margin: 12px 0 4px; }
.sub { color: var(--muted); }
.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 24px 0 8px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.timeline li:last-child { border-bottom: 0; }
.timeline .tag { font-weight: 600; }
.timeline .tag.work { color: var(--work); }
.timeline .tag.break { color: var(--break); }
.empty { color: var(--muted); }

/* Monat */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.stats div { background: var(--bg); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; }
.stats .k { font-size: 12px; color: var(--muted); }
.stats .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.table td { padding: 9px 6px; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.pill { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--bg); color: var(--muted); }
.pill.working { color: var(--work); }
.pill.break { color: var(--break); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }

@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
  .stats .v { font-size: 18px; }
  .table th:nth-child(2), .table td:nth-child(2), .table th:nth-child(3), .table td:nth-child(3) { display: none; }
  #tab-users .table th:nth-child(2), #tab-users .table td:nth-child(2) { display: none; }
}
