/* ======================================================================
   Vollkonti — Schichtplanung, Zeitwirtschaft & Zeiterfassung
   Static prototype styling. No external fonts/CDNs — system sans only.
   ====================================================================== */

:root {
  color-scheme: light;
  --surface-1:     #fcfcfb;
  --surface-2:     #ffffff;
  --page-plane:    #f9f9f7;
  --text-primary:  #0b0b0b;
  --text-secondary:#52514e;
  --text-muted:    #898781;
  --gridline:      #e1e0d9;
  --baseline:      #c3c2b7;
  --border:        rgba(11,11,11,0.10);
  --border-strong: rgba(11,11,11,0.16);

  --series-1: #2a78d6; /* blue    */
  --series-2: #eb6834; /* orange  */
  --series-3: #1baf7a; /* aqua    */
  --series-4: #eda100; /* yellow  */
  --series-5: #e87ba4; /* magenta */
  --series-6: #008300; /* green   */
  --series-7: #4a3aa7; /* violet  */
  --series-8: #e34948; /* red     */

  --status-good:     #0ca30c;
  --status-warning:  #fab219;
  --status-serious:  #ec835a;
  --status-critical: #d03b3b;

  --seq-100:#cde2fb; --seq-200:#9ec5f4; --seq-300:#6da7ec; --seq-450:#2a78d6; --seq-600:#184f95;

  --success-text: #006300;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-1: 0 1px 2px rgba(11,11,11,0.06), 0 1px 1px rgba(11,11,11,0.04);
  --shadow-2: 0 8px 24px rgba(11,11,11,0.10), 0 2px 6px rgba(11,11,11,0.06);

  --sidebar-w: 240px;

  /* ---- Brand (Pyrum-inspired): deep navy + lime-green accent, theme-invariant ---- */
  --brand-ink: #0f1a22;
  --brand-ink-soft: #1b2a35;
  --brand-ink-line: rgba(255,255,255,0.09);
  --brand-accent: #c6f135;
  --brand-accent-strong: #aee01a;
  --brand-on-accent: #11210a;
  --brand-ink-text: #aab6c2;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-1:     #1a1a19;
  --surface-2:     #222221;
  --page-plane:    #0d0d0d;
  --text-primary:  #ffffff;
  --text-secondary:#c3c2b7;
  --text-muted:    #898781;
  --gridline:      #2c2c2a;
  --baseline:      #383835;
  --border:        rgba(255,255,255,0.10);
  --border-strong: rgba(255,255,255,0.18);

  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #9085e9;
  --series-8: #e66767;

  --success-text: #0ca30c;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-2: 0 8px 24px rgba(0,0,0,0.45);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page-plane);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}
body { transition: background .2s ease; }
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
svg { width: 1em; height: 1em; }

/* ---------- Shell layout ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--brand-ink);
  border-right: none;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display:flex; align-items:center; gap:10px; padding: 6px 10px 22px; }
.brand-mark {
  width: 32px; height:32px; border-radius: 7px;
  background: var(--brand-accent);
  color: var(--brand-on-accent); display:flex; align-items:center; justify-content:center;
  font-weight: 800; font-size: 16px;
}
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; color: #fff; }

.nav { display:flex; flex-direction:column; gap: 2px; flex: 1; }
.nav-item {
  display:flex; align-items:center; gap: 12px;
  padding: 10px 12px 10px 13px; border-radius: var(--radius-sm);
  border: none; border-left: 3px solid transparent; background: transparent; color: var(--brand-ink-text);
  text-align:left; font-size: 13.5px; font-weight: 600;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.nav-item svg { width:18px; height:18px; fill: currentColor; flex-shrink:0; }
.nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-item.is-active {
  background: color-mix(in srgb, var(--brand-accent) 15%, transparent);
  color: var(--brand-accent);
  border-left-color: var(--brand-accent);
}

.sidebar-foot { padding-top: 10px; border-top: 1px solid var(--brand-ink-line); }
.sidebar-foot .btn-ghost { color: var(--brand-ink-text); }
.sidebar-foot .btn-ghost:hover { background: rgba(255,255,255,0.07); color: #fff; }
.btn-ghost {
  display:flex; align-items:center; gap:8px;
  background:transparent; border: 1px solid transparent; color: var(--text-secondary);
  padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13px; font-weight:500;
  width:100%;
}
.btn-ghost svg { width:16px; height:16px; fill:currentColor; }
.btn-ghost:hover { background: var(--border); color: var(--text-primary); }

.main-col { flex:1; min-width:0; display:flex; flex-direction:column; }

.topbar {
  display:flex; align-items:center; gap: 10px;
  padding: 12px 24px; border-bottom: 1px solid var(--border);
  background: var(--surface-1); position: sticky; top:0; z-index: 20;
}
.view-title { font-size: 18px; margin:0; font-weight:700; letter-spacing:-0.01em; }
.topbar-spacer { flex:1; }
.live-clock { font-variant-numeric: tabular-nums; color: var(--text-secondary); font-size: 14px; margin-right: 4px; }
.icon-btn {
  width:36px; height:36px; border-radius: var(--radius-sm); border:1px solid var(--border);
  background: var(--surface-2); color: var(--text-secondary); display:flex; align-items:center; justify-content:center;
}
.icon-btn svg { width:18px; height:18px; fill:currentColor; }
.icon-btn:hover { color: var(--text-primary); border-color: var(--border-strong); }
.only-mobile { display:none; }

.user-chip { display:flex; align-items:center; gap:8px; margin-left: 4px; position:relative; }
.avatar {
  width:32px; height:32px; border-radius:50%;
  background: color-mix(in srgb, var(--series-1) 20%, var(--surface-2));
  color: var(--series-1); font-weight:700; font-size:12px;
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.avatar-xl { width:56px; height:56px; font-size:18px; }
#select-current-user {
  position:absolute; inset:0; opacity:0; cursor:pointer; width: 150px;
}

.content { padding: 22px 24px 48px; flex:1; }

.view { display:none; }
.view.is-active { display:block; animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity:0; transform: translateY(4px);} to {opacity:1; transform:none;} }

/* ---------- Generic building blocks ---------- */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  margin-bottom: 18px;
  padding: 18px;
}
.card-head { margin-bottom: 14px; display:flex; flex-direction:column; gap:2px; }
.card-head h2 { font-size: 15px; margin:0; font-weight:700; display:flex; align-items:center; gap:8px; }
.card-head h2::before { content:''; width:9px; height:9px; background: var(--brand-accent); border-radius:2px; flex-shrink:0; }
.card-head .muted { font-size: 12.5px; color: var(--text-muted); }
.card-head-row { display:flex; flex-direction:row; align-items:center; justify-content:space-between; gap: 12px; flex-wrap:wrap; }
.muted { color: var(--text-muted); }

.grid-2 { display:grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-2.align-start { align-items:start; }
@media (max-width: 980px) { .grid-2 { grid-template-columns: 1fr; } }

.kpi-row { display:grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 980px) { .kpi-row { grid-template-columns: repeat(2,1fr); } }
.kpi {
  background: var(--surface-1); border:1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 18px; box-shadow: var(--shadow-1);
}
.kpi-label { font-size:12.5px; color: var(--text-muted); font-weight:600; text-transform:uppercase; letter-spacing:.03em; }
.kpi-value { font-size: 28px; font-weight: 700; margin-top:6px; letter-spacing:-0.02em; }
.kpi-delta { font-size:12.5px; margin-top:4px; font-weight:600; }
.kpi-delta.good { color: var(--success-text); }
.kpi-delta.bad { color: var(--status-critical); }

.btn-primary, .btn-secondary, .btn-danger {
  border: none; border-radius: var(--radius-sm); padding: 9px 16px; font-weight:600; font-size: 13.5px;
}
.btn-primary { background: var(--brand-accent); color: var(--brand-on-accent); font-weight:800; }
.btn-primary:hover { background: var(--brand-accent-strong); }
.btn-secondary { background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-primary); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--status-critical); color:#fff; }
.btn-danger:hover { filter: brightness(1.07); }
.btn-primary:disabled, .btn-secondary:disabled, .btn-danger:disabled { opacity:.45; cursor:not-allowed; }
.btn-big { padding: 16px 10px; font-size: 15px; border-radius: var(--radius-md); }

.field-label { display:block; font-size: 12.5px; font-weight:600; color: var(--text-secondary); margin: 12px 0 6px; }
.input {
  width:100%; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text-primary);
}
.input-lg { padding: 14px 14px; font-size: 16px; border-radius: var(--radius-md); }

.table { font-size: 13.5px; }
.table th { text-align:left; color: var(--text-muted); font-weight:600; font-size:12px; text-transform:uppercase; letter-spacing:.02em; padding: 6px 10px; border-bottom: 1px solid var(--gridline); }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--gridline); }
.table tr:last-child td { border-bottom: none; }

.badge { display:inline-flex; align-items:center; gap:5px; padding: 3px 9px; border-radius: 999px; font-size:12px; font-weight:600; }
.badge-good { background: color-mix(in srgb, var(--status-good) 16%, transparent); color: var(--success-text); }
.badge-warning { background: color-mix(in srgb, var(--status-warning) 22%, transparent); color:#8a5a00; }
:root[data-theme="dark"] .badge-warning { color: var(--status-warning); }
.badge-critical { background: color-mix(in srgb, var(--status-critical) 16%, transparent); color: var(--status-critical); }
.badge-neutral { background: var(--border); color: var(--text-secondary); }
.badge-dot { width:7px; height:7px; border-radius:50%; background:currentColor; }

/* ---------- Dienstplan / roster ---------- */
.week-nav { display:flex; gap:8px; }
.legend { display:flex; flex-wrap:wrap; gap: 10px 16px; margin-bottom: 14px; font-size: 12.5px; color: var(--text-secondary); }
.legend-item { display:flex; align-items:center; gap:6px; }
.legend-swatch { width:12px; height:12px; border-radius:4px; flex-shrink:0; }

.roster-wrap { overflow-x:auto; }
.roster { min-width: 760px; }
.roster th { text-align:left; font-size:12px; color: var(--text-muted); font-weight:600; padding: 8px; border-bottom: 1px solid var(--gridline); white-space:nowrap; }
.roster th.today-col { color: var(--series-1); }
.roster td { padding: 6px; border-bottom: 1px solid var(--gridline); vertical-align: middle; }
.roster .emp-cell { display:flex; align-items:center; gap:8px; white-space:nowrap; font-size:13.5px; font-weight:600; }
.shift-cell {
  min-width: 96px; height: 52px; border-radius: var(--radius-sm);
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  border: 1px dashed var(--border-strong); background: var(--surface-2);
  font-size: 12px; font-weight:700; transition: transform .08s ease, box-shadow .08s ease;
}
.shift-cell:hover { transform: translateY(-1px); box-shadow: var(--shadow-1); }
.shift-cell .proj-tag { font-size: 10px; font-weight:600; opacity:.85; max-width:92px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.shift-cell.filled { border-style: solid; border-color: transparent; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset:0; background: rgba(11,11,11,0.45); display:none;
  align-items:center; justify-content:center; z-index: 100; padding: 20px;
}
.modal-backdrop.is-open { display:flex; }
.modal {
  background: var(--surface-1); border-radius: var(--radius-lg); width: 420px; max-width:100%;
  box-shadow: var(--shadow-2); max-height: 86vh; overflow-y:auto;
}
.modal-head { display:flex; align-items:center; justify-content:space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin:0; font-size:16px; }
.modal-body { padding: 4px 18px 10px; }
.modal-foot { padding: 14px 18px; border-top:1px solid var(--border); display:flex; justify-content:space-between; gap:10px; }

.shift-pick { display:grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 4px; }
.shift-opt {
  border: 2px solid var(--border); border-radius: var(--radius-sm); padding: 10px 6px; text-align:center;
  background: var(--surface-2); font-size: 12.5px; font-weight:700; display:flex; flex-direction:column; align-items:center; gap:4px;
}
.shift-opt .dot { width:14px; height:14px; border-radius:4px; }
.shift-opt.is-selected { border-color: var(--series-1); box-shadow: 0 0 0 3px color-mix(in srgb, var(--series-1) 20%, transparent); }

/* ---------- Zeiterfassung / clock ---------- */
.clock-body { text-align:center; }
.clock-status { display:flex; align-items:center; justify-content:center; gap:8px; font-weight:700; font-size: 14px; margin-bottom: 6px; }
.status-dot { width:10px; height:10px; border-radius:50%; background: var(--text-muted); }
.status-dot.on { background: var(--status-good); box-shadow: 0 0 0 4px color-mix(in srgb, var(--status-good) 20%, transparent); }
.status-dot.pause { background: var(--status-warning); box-shadow: 0 0 0 4px color-mix(in srgb, var(--status-warning) 20%, transparent); }
.clock-big-time { font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing:-0.02em; margin: 4px 0 2px; }
.clock-actions { display:grid; grid-template-columns: repeat(3,1fr); gap:10px; margin-top: 14px; }
.toast {
  margin-top: 14px; min-height: 20px; font-size: 13px; font-weight:600; color: var(--success-text);
  opacity:0; transition: opacity .25s ease;
}
.toast.show { opacity:1; }

#week-balance-bar .balance-row { display:flex; align-items:center; gap:10px; margin-bottom:8px; font-size:13px; }
#week-balance-bar .balance-track { flex:1; height:10px; border-radius:6px; background: var(--gridline); overflow:hidden; position:relative; }
#week-balance-bar .balance-fill { height:100%; border-radius:6px; background: var(--series-1); }

/* ---------- Zeitterminal (kiosk) ---------- */
.terminal-shell {
  background: linear-gradient(160deg, #0b1220, #10213a 60%, #0b1220);
  border-radius: var(--radius-lg); color:#fff; padding: 28px; min-height: 560px;
  position: relative; overflow:hidden; display:flex; flex-direction:column; align-items:center;
}
.terminal-shell.fullscreen {
  position: fixed; inset:0; z-index: 500; border-radius:0; min-height: 100vh;
}
.terminal-exit { position:absolute; top:18px; right:18px; background: rgba(255,255,255,0.12); color:#fff; border:none; padding:10px 14px; border-radius:10px; font-weight:600; display:none; }
.terminal-shell.fullscreen .terminal-exit { display:block; }
.terminal-clock { font-size: 56px; font-weight:700; font-variant-numeric: tabular-nums; margin-top: 10px; letter-spacing:-0.02em; }
.terminal-date { color: rgba(255,255,255,0.6); font-size:15px; margin-bottom: 18px; text-transform:capitalize; }
.terminal-screen { width:100%; max-width: 760px; flex:1; display:flex; flex-direction:column; }
.terminal-h { text-align:center; font-weight:700; font-size: 22px; margin: 6px 0 20px; }
.terminal-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: 14px; }
.terminal-emp {
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius-md);
  padding: 18px 10px; display:flex; flex-direction:column; align-items:center; gap:10px; color:#fff; font-weight:600; font-size:13.5px;
  transition: background .12s ease, transform .1s ease;
}
.terminal-emp:hover { background: rgba(255,255,255,0.14); transform: translateY(-2px); }
.terminal-emp .avatar { background: rgba(255,255,255,0.18); color:#fff; width:44px; height:44px; font-size:15px; }

.terminal-user-badge { display:flex; align-items:center; gap:14px; justify-content:center; margin-bottom: 6px; }
.terminal-user-name { font-size: 20px; font-weight:700; }
.terminal-user-status { font-size: 13.5px; color: rgba(255,255,255,0.65); }
.terminal-label { color: rgba(255,255,255,0.75); text-align:center; }
.terminal-select-wrap { display:flex; justify-content:center; }
#terminal-select-project { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.22); color:#fff; }
#terminal-select-project option { color:#111; }
.terminal-actions { display:grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-top: 18px; }
.terminal-btn {
  display:flex; flex-direction:column; align-items:center; gap:10px; border:none; border-radius: var(--radius-lg);
  padding: 26px 10px; font-size: 17px; font-weight:700; color:#fff;
}
.terminal-btn svg { width:30px; height:30px; fill:currentColor; }
.terminal-btn-go { background: linear-gradient(135deg, var(--status-good), #086d08); }
.terminal-btn-pause { background: linear-gradient(135deg, var(--status-warning), #b97d00); color:#2a1d00; }
.terminal-btn-stop { background: linear-gradient(135deg, var(--status-critical), #8a1f1f); }
.terminal-btn:active { transform: scale(0.97); }
.terminal-back { color: rgba(255,255,255,0.7); margin-top: 18px; align-self:center; background:transparent; }
.terminal-back:hover { color:#fff; background: rgba(255,255,255,0.08); }

.terminal-toast {
  position:absolute; bottom: 24px; left:50%; transform: translateX(-50%) translateY(10px);
  background: rgba(255,255,255,0.95); color:#111; padding: 12px 22px; border-radius: 999px;
  font-weight:700; font-size:14px; opacity:0; transition: all .25s ease; pointer-events:none;
  box-shadow: var(--shadow-2); white-space:nowrap;
}
.terminal-toast.show { opacity:1; transform: translateX(-50%) translateY(0); }

/* ---------- Projekte ---------- */
.project-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 16px; }
.project-card { background: var(--surface-1); border:1px solid var(--border); border-radius: var(--radius-lg); padding:16px 18px; box-shadow: var(--shadow-1); }
.project-top { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; margin-bottom:4px; }
.project-name { font-weight:700; font-size:14.5px; }
.project-customer { color: var(--text-muted); font-size:12.5px; margin-bottom: 12px; }
.project-progress-track { height:8px; border-radius:6px; background: var(--gridline); overflow:hidden; margin-bottom:6px; }
.project-progress-fill { height:100%; border-radius:6px; }
.project-meta { display:flex; justify-content:space-between; font-size:12.5px; color: var(--text-secondary); }

/* ---------- Projektkalkulation / Personalakte (master-detail layout) ---------- */
.calc-layout { display:grid; grid-template-columns: 260px 1fr; gap: 18px; align-items:start; }
@media (max-width: 980px) { .calc-layout { grid-template-columns: 1fr; } }
.calc-list { padding: 12px; position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow-y: auto; }
.calc-list-item {
  display:flex; align-items:center; gap:10px; width:100%; text-align:left;
  padding: 10px 10px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: transparent; color: var(--text-primary); font-size: 13.5px; font-weight:600; margin-bottom:2px;
}
.calc-list-item:hover { background: var(--border); }
.calc-list-item.is-active { background: color-mix(in srgb, var(--brand-accent) 18%, transparent); border-color: color-mix(in srgb, var(--brand-accent) 40%, transparent); }
.calc-list-item .sw { width:10px; height:10px; border-radius:3px; flex-shrink:0; }
.calc-list-item .sub { display:block; font-weight:500; color: var(--text-muted); font-size:11.5px; }
.calc-detail { min-width:0; }
.calc-empty { padding: 40px 20px; text-align:center; color: var(--text-muted); }

.kv-row { display:flex; justify-content:space-between; gap:10px; font-size:13px; padding:7px 0; border-bottom:1px solid var(--gridline); }
.kv-row:last-child { border-bottom:none; }
.kv-row .k { color: var(--text-muted); }
.kv-edit { width: 110px; text-align:right; padding:4px 8px; font-size:13px; }

.milestone-row { display:flex; align-items:center; gap:12px; padding: 10px 4px; border-bottom:1px solid var(--gridline); }
.milestone-row:last-child { border-bottom:none; }
.milestone-check {
  width:22px; height:22px; border-radius:50%; border:2px solid var(--border-strong); flex-shrink:0;
  display:flex; align-items:center; justify-content:center; font-size:12px; color:transparent; font-weight:800;
}
.milestone-check.done { background: var(--status-good); border-color: var(--status-good); color:#fff; }
.milestone-title { flex:1; font-size:13.5px; font-weight:600; }
.milestone-title.done { text-decoration: line-through; color: var(--text-muted); }
.milestone-due { font-size:12px; }
.add-milestone-row { display:grid; grid-template-columns: 1fr 150px auto; gap:8px; margin-top:12px; }
@media (max-width:620px) { .add-milestone-row { grid-template-columns: 1fr; } }

.hr-form-section { margin-bottom: 18px; }
.hr-form-section h3 { font-size:13px; text-transform:uppercase; letter-spacing:.04em; color: var(--text-muted); margin: 0 0 10px; font-weight:700; }
.hr-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width:620px) { .hr-grid { grid-template-columns: 1fr; } }
.hr-grid .span-2 { grid-column: 1 / -1; }
.doc-check-row { display:flex; align-items:center; gap:10px; padding:8px 2px; font-size:13.5px; }
.doc-check-row input { width:17px; height:17px; accent-color: var(--brand-accent-strong); }

/* ---------- Mitarbeiter ---------- */
.employee-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 16px; }
.employee-card { background: var(--surface-1); border:1px solid var(--border); border-radius: var(--radius-lg); padding:16px 18px; box-shadow: var(--shadow-1); display:flex; gap:14px; }
.employee-info { flex:1; min-width:0; }
.employee-name { font-weight:700; font-size:14.5px; }
.employee-role { color: var(--text-muted); font-size:12.5px; margin-bottom:10px; }
.employee-stats { display:flex; gap:16px; font-size:12.5px; }
.employee-stats b { display:block; font-size:15px; }

/* ---------- Charts (vanilla SVG / CSS) ---------- */
.bar-chart { display:flex; flex-direction:column; gap:10px; }
.bar-row { display:grid; grid-template-columns: 110px 1fr 56px; align-items:center; gap:10px; font-size:12.5px; }
.bar-row .label { color: var(--text-secondary); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bar-track { height: 14px; border-radius:7px; background: var(--gridline); position:relative; overflow:hidden; }
.bar-fill { height:100%; border-radius:7px; position:relative; }
.bar-value { text-align:right; font-variant-numeric: tabular-nums; color: var(--text-secondary); font-weight:600; }
.bar-overlay-target { position:absolute; top:-3px; bottom:-3px; width:2px; background: var(--text-primary); opacity:.5; }

.chart-tooltip {
  position: fixed; pointer-events:none; background: var(--text-primary); color: var(--page-plane);
  padding: 7px 10px; border-radius: 8px; font-size:12px; font-weight:600; z-index: 400;
  opacity:0; transition: opacity .1s ease; transform: translate(-50%, -115%); white-space:nowrap;
  box-shadow: var(--shadow-2);
}
.chart-tooltip.show { opacity:1; }

.donut-wrap { display:flex; align-items:center; gap: 22px; flex-wrap:wrap; }
.donut { width: 170px; height:170px; border-radius:50%; flex-shrink:0; position:relative; }
.donut-center { position:absolute; inset: 22%; background: var(--surface-1); border-radius:50%; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.donut-center b { font-size:19px; }
.donut-center span { font-size:11px; color: var(--text-muted); }
.donut-legend { display:flex; flex-direction:column; gap:8px; font-size:12.5px; flex:1; min-width:160px; }
.donut-legend-item { display:flex; align-items:center; gap:8px; justify-content:space-between; }
.donut-legend-item .sw-label { display:flex; align-items:center; gap:8px; }
.sw { width:11px; height:11px; border-radius:3px; flex-shrink:0; }

.sparkline-wrap { position:relative; }

/* ---------- App-Ansicht (phone preview) ---------- */
.phone-overlay {
  position:fixed; inset:0; background: rgba(11,11,11,0.55); display:none;
  align-items:center; justify-content:center; z-index: 300; flex-direction:column; gap:16px;
}
.phone-overlay.is-open { display:flex; }
.phone-frame {
  width: 320px; height: 660px; background: #0b0b0b; border-radius: 42px; padding: 12px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5); position:relative;
}
.phone-notch { position:absolute; top:12px; left:50%; transform:translateX(-50%); width:120px; height:22px; background:#0b0b0b; border-radius:0 0 14px 14px; z-index:5; }
.phone-screen { background: var(--page-plane); width:100%; height:100%; border-radius:30px; overflow:hidden; display:flex; flex-direction:column; }
.phone-topbar { display:flex; justify-content:space-between; padding: 14px 18px 6px; font-size:11px; font-weight:700; color: var(--text-primary); }
.phone-content { flex:1; overflow-y:auto; padding: 10px 14px 14px; }
.phone-tabbar { display:flex; border-top:1px solid var(--border); background: var(--surface-1); }
.phone-tab { flex:1; display:flex; flex-direction:column; align-items:center; gap:2px; padding:8px 0 10px; background:transparent; border:none; font-size:10px; color: var(--text-muted); font-weight:600; }
.phone-tab.is-active { color: var(--series-1); }
.phone-close { margin-top: 4px; }

.p-card { background: var(--surface-1); border:1px solid var(--border); border-radius: 16px; padding:14px; margin-bottom:12px; box-shadow: var(--shadow-1); }
.p-greeting { font-size:17px; font-weight:700; margin-bottom:2px; }
.p-sub { color: var(--text-muted); font-size:12px; margin-bottom: 10px; }
.p-big-time { font-size:34px; font-weight:700; text-align:center; font-variant-numeric: tabular-nums; margin: 6px 0; }
.p-clock-actions { display:grid; grid-template-columns: 1fr 1fr; gap:8px; margin-top:10px; }
.p-shift-row { display:flex; justify-content:space-between; align-items:center; padding:8px 0; border-bottom:1px solid var(--gridline); font-size:12.5px; }
.p-shift-row:last-child { border-bottom:none; }

/* ---------- Scrollbar polish (webkit) ---------- */
::-webkit-scrollbar { width:10px; height:10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius:6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .sidebar { position: fixed; left:0; top:0; z-index: 250; transform: translateX(-100%); transition: transform .18s ease; box-shadow: var(--shadow-2); }
  .sidebar.is-open { transform:none; }
  .only-mobile { display:flex; }
  .clock-actions, .kpi-row { grid-template-columns: repeat(2,1fr); }
  .terminal-actions { grid-template-columns: 1fr; }
}
