/* Stundio – Designsystem: Stempelviolett, Tinte, Bricolage Grotesque + Instrument Sans.
   Schriften von Bunny Fonts (EU, ohne Tracking); ohne Netz greifen die Systemschriften. */
@import url("https://fonts.bunny.net/css?family=bricolage-grotesque:500,700,800|instrument-sans:400,500,600,700&display=swap");
:root {
  --bg: #f6f5fb;
  --surface: #ffffff;
  --surface-2: #f0eef8;
  --ink: #161433;
  --ink-2: #4f4c6b;
  --ink-3: #85829f;
  --line: #e3e0ef;
  --accent: #4A2FE0;
  --accent-2: #3A22C4;
  --accent-soft: #ECE8FF;
  --work: #12a160;
  --work-soft: #e3f6ec;
  --pause: #e8920c;
  --pause-soft: #fdf1dc;
  --off: #8c8ca0;
  --off-soft: #efeff4;
  --danger: #e0334a;
  --danger-soft: #fde7ea;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(20, 20, 40, .04), 0 6px 24px rgba(20, 20, 40, .06);
  --font: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --display: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e13; --surface: #17171f; --surface-2: #20202a; --ink: #f2f2f7; --ink-2: #a9a9bc;
    --ink-3: #74748a; --line: #2a2a36; --accent: #9C8BFF; --accent-2: #B3A6FF; --accent-soft: #25204A;
    --work: #2fc47f; --work-soft: #13301f; --pause: #f5a623; --pause-soft: #33270f; --off-soft: #23232d;
    --danger: #ff5a70; --danger-soft: #3a1820; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 28px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.02em; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: 28px; font-weight: 750; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 650; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--ink-2); }
.tiny { font-size: 12px; color: var(--ink-3); }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* ---------- Layout App ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: 240px; flex: none; background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.side .brand { margin: 0 8px 22px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 550; margin-bottom: 2px; }
.side nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.side nav a.on { background: var(--accent-soft); color: var(--accent); }
.side nav .sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 18px 12px 6px; font-weight: 650; }
.side .foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.main { flex: 1; min-width: 0; padding: 28px 32px 80px; max-width: 1180px; }
.topline { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.topline h1 { margin: 0; }
.mob-top, .tabbar { display: none; }

.brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 780; font-size: 19px; letter-spacing: -.03em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .logo { width: 30px; height: 30px; display: grid; place-items: center; color: var(--accent); }
.brand { font-weight: 800; letter-spacing: -.045em; }
.brand .logo svg { width: 28px; height: 28px; }

/* ---------- Komponenten ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.card h2 { margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }

.btn { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 14px/1 var(--font); padding: 11px 16px; border-radius: 12px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .08s, background .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(91, 76, 245, .3); }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 7px 11px; font-size: 13px; border-radius: 9px; }
.btn.lg { padding: 15px 22px; font-size: 16px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--off-soft); color: var(--ink-2); white-space: nowrap; }
.pill.work { background: var(--work-soft); color: var(--work); }
.pill.pause { background: var(--pause-soft); color: var(--pause); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.dot.live { animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 6px transparent; } }

label { display: block; font-weight: 600; font-size: 13px; color: var(--ink-2); margin-bottom: 5px; }
input, select, textarea { width: 100%; font: 15px var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; outline: none; transition: border .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox] { width: auto; accent-color: var(--accent); transform: scale(1.15); }
.check { display: flex; gap: 9px; align-items: center; font-weight: 500; color: var(--ink); font-size: 14px; }
.field { margin-bottom: 14px; }
.fields { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.tbl-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
td.r, th.r { text-align: right; }
tr.weekend td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
tr.today td { background: var(--accent-soft); }
.pos { color: var(--work); } .neg { color: var(--danger); }

.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 550; background: var(--accent-soft); color: var(--accent); }
.flash.ok { background: var(--work-soft); color: var(--work); }
.flash.error { background: var(--danger-soft); color: var(--danger); }
.flash.warn { background: var(--pause-soft); color: var(--pause); }

.stat { padding: 18px; }
.stat .k { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.stat .v { font: 750 30px/1.1 var(--display); letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .v.work { color: var(--work); } .stat .v.pause { color: var(--pause); }

.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; flex: none; background: var(--accent); }
.person { display: flex; gap: 11px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person .meta { flex: 1; min-width: 0; }
.person .meta b { display: block; font-weight: 650; }
.empty { color: var(--ink-3); padding: 14px 0; font-size: 14px; }

.seg { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 11px; gap: 2px; }
.seg a { padding: 6px 12px; border-radius: 9px; color: var(--ink-2); font-weight: 600; font-size: 13px; }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); text-decoration: none; }
.seg a:hover { text-decoration: none; }

/* ---------- Stempeln ---------- */
.clock-card { text-align: center; padding: 30px 20px; }
.state-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 99px; font-weight: 700; font-size: 14px; }
.state-badge.off { background: var(--off-soft); color: var(--ink-2); }
.state-badge.work { background: var(--work-soft); color: var(--work); }
.state-badge.break { background: var(--pause-soft); color: var(--pause); }
.big-timer { font: 750 64px/1 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin: 18px 0 6px; }
.big-timer.over { color: var(--danger); }
.actions { display: grid; gap: 10px; margin-top: 22px; }
.actions .btn { padding: 18px; font-size: 17px; border-radius: 16px; }
.btn.work { background: var(--work); border-color: var(--work); color: #fff; box-shadow: 0 6px 18px rgba(18, 161, 96, .3); }
.btn.out { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.btn.pause { background: var(--pause); border-color: var(--pause); color: #fff; box-shadow: 0 6px 18px rgba(232, 146, 12, .28); }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.timeline li:last-child { border: 0; }
.timeline .t { font-family: var(--mono); font-weight: 600; width: 48px; }
.weekbars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 120px; }
.weekbars .b { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; font-size: 12px; color: var(--ink-3); }
.weekbars .b i { width: 100%; max-width: 34px; background: var(--accent-soft); border-radius: 8px 8px 4px 4px; min-height: 4px; }
.weekbars .b.today i { background: var(--accent); }
.weekbars .b.today { color: var(--accent); font-weight: 700; }

.kpi-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kpi-item:last-child { border: 0; }
.kpi-item .e { font-size: 24px; }
.kpi-item .n { flex: 1; font-weight: 600; }
.kpi-item .v { font: 750 22px var(--display); min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }
.round { width: 38px; height: 38px; border-radius: 50%; padding: 0; font-size: 20px; }

/* ---------- Plan ---------- */
.plan { min-width: 860px; table-layout: fixed; }
.plan th, .plan td { padding: 6px; border: 1px solid var(--line); }
.plan th { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--ink-2); text-align: center; background: var(--surface-2); }
.plan td.name { width: 170px; font-weight: 600; font-size: 14px; }
.plan td.cell { cursor: pointer; height: 58px; text-align: center; vertical-align: middle; transition: background .12s; }
.plan td.cell:hover { background: var(--accent-soft); }
.shift { display: block; border-radius: 9px; padding: 6px 4px; font-size: 12.5px; font-weight: 650; line-height: 1.25; }
.shift.arbeit { background: var(--accent-soft); color: var(--accent); }
.shift.ferien { background: #e2f3ff; color: #1677c7; }
.shift.krank { background: var(--danger-soft); color: var(--danger); }
.shift.schule { background: var(--pause-soft); color: var(--pause); }
.shift.frei { background: var(--off-soft); color: var(--ink-3); }
.shift small { display: block; font-weight: 500; color: inherit; opacity: .8; font-size: 11px; }
.plan .today-col { box-shadow: inset 0 3px 0 var(--accent); }
.legend { display: flex; gap: 8px; flex-wrap: wrap; }

dialog { border: 0; border-radius: 20px; padding: 0; width: min(440px, 94vw); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
dialog::backdrop { background: rgba(15, 15, 30, .45); backdrop-filter: blur(3px); }
dialog .dlg { padding: 22px; }

/* ---------- Add-ons ---------- */
.addon { display: flex; flex-direction: column; gap: 10px; }
.addon .ic { font-size: 30px; width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; background: var(--surface-2); }
.addon.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.addon .price { font-weight: 700; color: var(--ink); }
.copy { display: flex; gap: 8px; }
.copy input { font-family: var(--mono); font-size: 13px; background: var(--surface-2); }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 10% -10%, var(--accent-soft), transparent 60%), var(--bg); }
.auth .card { width: min(420px, 100%); padding: 32px; }

/* ---------- Mobil ---------- */
@media (max-width: 900px) {
  .side { display: none; }
  .main { padding: 16px 16px 110px; }
  .mob-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; padding-top: max(12px, env(safe-area-inset-top)); }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding: 6px 4px max(6px, env(safe-area-inset-bottom)); z-index: 20; overflow-x: auto; }
  .tabbar a { flex: 1; min-width: 64px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--ink-3); padding: 5px 2px; }
  .tabbar a .i { font-size: 20px; line-height: 1.1; }
  .tabbar a.on { color: var(--accent); }
  .tabbar a:hover { text-decoration: none; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .g4.keep2, .g3.keep2 { grid-template-columns: 1fr 1fr; }
  .big-timer { font-size: 54px; }
  h1 { font-size: 24px; }
  .tbl-wrap { margin: 0 -20px; }
  .hide-m { display: none; }
}
@media print {
  .side, .mob-top, .tabbar, .noprint { display: none !important; }
  body { background: #fff; color: #000; }
  .main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
}
