/* ==========================================================================
   FitTrack – Design-System
   Mobile-first, mit Sidebar-Layout ab 900px.
   ========================================================================== */

:root {
  --bg:            #0f1216;
  --bg-elev:       #161b22;
  --bg-elev-2:     #1d232c;
  --line:          #262d38;
  --line-soft:     #1e242d;
  --text:          #e8edf4;
  --text-dim:      #97a3b4;
  --text-faint:    #6b7688;

  --accent:        #4ade80;
  --accent-strong: #22c55e;
  --accent-ink:    #07130c;
  --accent-soft:   rgba(74, 222, 128, .14);

  --blue:   #60a5fa;
  --amber:  #fbbf24;
  --violet: #a78bfa;
  --rose:   #fb7185;
  --cyan:   #22d3ee;

  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);

  --nav-h: 62px;
  --sidebar-w: 236px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="light"] {
  --bg:            #f4f6f9;
  --bg-elev:       #ffffff;
  --bg-elev-2:     #eef1f6;
  --line:          #dde3ec;
  --line-soft:     #e8edf3;
  --text:          #131820;
  --text-dim:      #5a6676;
  --text-faint:    #8a94a3;
  --accent:        #16a34a;
  --accent-strong: #15803d;
  --accent-ink:    #ffffff;
  --accent-soft:   rgba(22, 163, 74, .12);
  --blue:   #2563eb;
  --amber:  #b45309;
  --violet: #7c3aed;
  --rose:   #e11d48;
  --cyan:   #0891b2;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 10px 26px -14px rgba(16,24,40,.28);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.015em; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; }
p  { margin: 0 0 .6em; }

.muted   { color: var(--text-dim); }
.faint   { color: var(--text-faint); }
.tiny    { font-size: .76rem; }
.small   { font-size: .84rem; }
.num     { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.mono    { font-family: var(--mono); }
.center  { text-align: center; }
.right   { text-align: right; }
.nowrap  { white-space: nowrap; }
.grow    { flex: 1 1 auto; min-width: 0; }
.hidden  { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ Layout */

.shell { display: flex; min-height: 100dvh; }

.sidebar { display: none; }

.main {
  flex: 1 1 auto;
  min-width: 0;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
}

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar .title { font-weight: 680; font-size: 1.08rem; letter-spacing: -.02em; }

.container { padding: 16px; max-width: 1240px; margin: 0 auto; }
.stack     { display: flex; flex-direction: column; gap: 14px; }
.row       { display: flex; align-items: center; gap: 10px; }
.row.wrap  { flex-wrap: wrap; }
.between   { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.grid { display: grid; gap: 14px; align-items: start; }
@media (min-width: 720px)  { .grid.g2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .grid.g3 { grid-template-columns: repeat(3, 1fr); }
                             .grid.g2-3 { grid-template-columns: 1.4fr 1fr; } }

/* --------------------------------------------------------- Bottom-Nav (Mobil) */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--bg-elev) 94%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; height: var(--nav-h); color: var(--text-faint);
  font-size: .68rem; font-weight: 560; letter-spacing: .01em;
  -webkit-tap-highlight-color: transparent;
}
.tabbar a svg { width: 21px; height: 21px; stroke-width: 1.9; }
.tabbar a.active { color: var(--accent); }

/* ------------------------------------------------------------------ Karten */

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 14px 16px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--line-soft);
}
.card-head h2, .card-head h3 { font-size: .95rem; }
.card-body { padding: 14px 16px; }
.card-foot { padding: 11px 16px; border-top: 1px solid var(--line-soft); }
.card + .card { margin-top: 14px; }

.section-title {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-faint); font-weight: 700; margin: 4px 0 2px;
}

/* --------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-elev-2); color: var(--text);
  font: inherit; font-weight: 600; font-size: .88rem;
  cursor: pointer; user-select: none;
  transition: background .14s, border-color .14s, transform .06s, opacity .14s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover  { border-color: color-mix(in srgb, var(--text-faint) 60%, var(--line)); }
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; stroke-width: 2; }

.btn-primary {
  background: var(--accent); color: var(--accent-ink);
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: var(--bg-elev-2); color: var(--text); border-color: transparent; }

.btn-danger { color: var(--rose); }
.btn-danger:hover { background: color-mix(in srgb, var(--rose) 14%, transparent); border-color: transparent; }

.btn-sm  { padding: 6px 11px; font-size: .8rem; border-radius: 8px; }
.btn-lg  { padding: 13px 20px; font-size: .95rem; width: 100%; }
.btn-icon { padding: 8px; width: 36px; height: 36px; border-radius: 9px; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
/* Auf großen Schirmen sollen Aktionsleisten nicht über die volle Breite laufen. */
@media (min-width: 720px) { .btn-row.compact .grow { flex: 0 0 auto; } }

/* Segment-Umschalter */
.segment {
  display: inline-flex; background: var(--bg-elev-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 3px; gap: 3px;
}
.segment button {
  border: 0; background: transparent; color: var(--text-dim);
  font: inherit; font-size: .82rem; font-weight: 600;
  padding: 6px 12px; border-radius: 7px; cursor: pointer;
}
.segment button.active { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow); }

/* ------------------------------------------------------------- Formulare */

label.lbl {
  display: block; font-size: .76rem; font-weight: 650;
  color: var(--text-dim); margin-bottom: 5px; letter-spacing: .01em;
}
input[type=text], input[type=number], input[type=password], input[type=date],
input[type=search], input[type=tel], select, textarea {
  width: 100%; padding: 10px 12px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; font-size: 16px; /* 16px verhindert Zoom beim Fokus auf iOS */
  transition: border-color .14s, box-shadow .14s;
  appearance: none; -webkit-appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2397a3b4' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 34px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder { color: var(--text-faint); }
textarea { min-height: 76px; resize: vertical; }

.field { margin-bottom: 12px; }
.field-row { display: flex; gap: 10px; }
.field-row > * { flex: 1 1 0; min-width: 0; }

.input-unit { position: relative; }
.input-unit input { padding-right: 42px; }
.input-unit span {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-faint); font-size: .82rem; pointer-events: none;
}

/* Zahlenfeld mit Plus/Minus: das Eingabefeld ist die Hauptsache, die Tasten
   sind nur eine Abkürzung. Der Wert lässt sich immer frei eintippen. */
.stepper { display: flex; align-items: stretch; gap: 6px; }
.stepper input { text-align: center; }
.stepper button {
  flex: 0 0 42px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-elev-2); color: var(--text-dim);
  font-size: 1.25rem; font-weight: 600; cursor: pointer; line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.stepper button:hover { color: var(--text); border-color: color-mix(in srgb, var(--text-faint) 60%, var(--line)); }
.stepper button:active { transform: scale(.94); }

input.big-input {
  height: 54px; font-size: 21px; font-weight: 700; letter-spacing: -.01em;
  padding: 0 8px; text-align: center;
}
input.big-input:focus { border-color: var(--accent); background: var(--bg-elev); }
input.big-input::selection { background: var(--accent-soft); }

/* ----------------------------------------------------------------- Chips */

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  background: var(--bg-elev-2); border: 1px solid var(--line);
  font-size: .82rem; font-weight: 570; color: var(--text);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip .x { color: var(--text-faint); font-size: 1rem; line-height: 1; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: .7rem; font-weight: 700; letter-spacing: .02em;
  background: var(--bg-elev-2); color: var(--text-dim); border: 1px solid var(--line);
}
.badge.ok   { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.warn { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); border-color: transparent; }
.badge.info { background: color-mix(in srgb, var(--blue) 16%, transparent); color: var(--blue); border-color: transparent; }

/* ------------------------------------------------------------- Fortschritt */

/* Zwei Spalten auf dem Smartphone, vier ab Tablet-Breite. */
.macro-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.macro-grid.g3 { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 560px) { .macro-grid { grid-template-columns: repeat(4, 1fr); } }
.macro {
  background: var(--bg-elev-2); border-radius: var(--radius-sm);
  padding: 10px 11px; border: 1px solid var(--line-soft);
}
.macro .k { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); font-weight: 700; }
.macro .v { font-size: 1.02rem; font-weight: 700; margin-top: 2px; }
.macro .g { font-size: .7rem; color: var(--text-faint); }

.bar { height: 6px; border-radius: 999px; background: var(--bg); overflow: hidden; margin-top: 7px; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .35s ease; }
.bar.over > i { background: var(--rose); }
.bar.c-blue > i   { background: var(--blue); }
.bar.c-amber > i  { background: var(--amber); }
.bar.c-violet > i { background: var(--violet); }

.ring-wrap { display: flex; align-items: center; gap: 16px; }
.ring { position: relative; width: 104px; height: 104px; flex: 0 0 auto; }
.ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring .track { stroke: var(--bg-elev-2); }
.ring .prog  { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .5s ease; }
.ring .prog.over { stroke: var(--rose); }
.ring .mid {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0;
}
.ring .mid b { font-size: 1.25rem; font-weight: 720; letter-spacing: -.03em; }
.ring .mid span { font-size: .66rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }

/* ---------------------------------------------------------------- Listen */

.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; border-bottom: 1px solid var(--line-soft);
}
.list-item:last-child { border-bottom: 0; }
.list-item .lead { font-weight: 600; }
.list-item .sub  { font-size: .78rem; color: var(--text-dim); }
.list-item.tap { cursor: pointer; }
.list-item.tap:hover { background: var(--bg-elev-2); }

table.tbl { width: 100%; border-collapse: collapse; font-size: .87rem; }
table.tbl th {
  text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-faint); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line);
}
table.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); }
table.tbl tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------------------------------------------------------- Übungskarte */

.ex-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); overflow: hidden; }
.ex-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 15px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.ex-head .name { font-weight: 650; font-size: .97rem; }
.ex-head .meta { font-size: .76rem; color: var(--text-dim); margin-top: 1px; }
.ex-head .chev { color: var(--text-faint); transition: transform .2s; flex: 0 0 auto; }
.ex-card.open .ex-head .chev { transform: rotate(180deg); }
.ex-body { display: none; padding: 0 15px 15px; }
.ex-card.open .ex-body { display: block; }
.ex-card.done { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

.sets-line { display: flex; gap: 6px; flex-wrap: wrap; }
.set-pill {
  font-size: .78rem; font-weight: 620; padding: 3px 8px; border-radius: 7px;
  background: var(--bg-elev-2); border: 1px solid var(--line-soft);
  font-variant-numeric: tabular-nums;
}
.set-pill.best { border-color: var(--accent); color: var(--accent); }

.hist-row {
  display: flex; align-items: baseline; gap: 10px; padding: 5px 0;
  font-size: .8rem; border-bottom: 1px dashed var(--line-soft);
}
.hist-row:last-child { border-bottom: 0; }
.hist-row .d { color: var(--text-faint); width: 66px; flex: 0 0 auto; font-size: .75rem; }

.target-hint {
  display: flex; align-items: center; gap: 8px;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--accent); border-radius: var(--radius-sm); padding: 8px 11px;
  font-size: .82rem; font-weight: 600; margin: 10px 0;
}

/* ------------------------------------------------------ Sheet / Dialog */

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.55);
  opacity: 0; pointer-events: none; transition: opacity .2s;
  backdrop-filter: blur(2px);
}
.sheet-backdrop.show { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 101;
  background: var(--bg-elev); border-top-left-radius: var(--radius-lg); border-top-right-radius: var(--radius-lg);
  border: 1px solid var(--line); border-bottom: 0;
  max-height: 92dvh; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .26s cubic-bezier(.32,.72,0,1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.sheet.show { transform: translateY(0); }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px 10px; border-bottom: 1px solid var(--line-soft);
}
.sheet-head h3 { font-size: 1rem; }
.sheet-body { padding: 14px 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet-foot { padding: 12px 16px; border-top: 1px solid var(--line-soft); display: flex; gap: 10px; }
.sheet-foot .btn { flex: 1; }
.grabber { width: 38px; height: 4px; border-radius: 999px; background: var(--line); margin: 8px auto 0; }

@media (min-width: 720px) {
  .sheet {
    left: 50%; right: auto; bottom: auto; top: 50%;
    transform: translate(-50%, -46%) scale(.97); opacity: 0;
    width: min(560px, 94vw); border-radius: var(--radius-lg); border-bottom: 1px solid var(--line);
    max-height: 86dvh; transition: transform .2s, opacity .2s;
  }
  .sheet.show { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  .grabber { display: none; }
}

/* ---------------------------------------------------------------- Toasts */

.toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px));
  z-index: 200; display: flex; flex-direction: column; gap: 8px;
  width: min(460px, calc(100vw - 32px)); pointer-events: none;
}
.toast {
  background: var(--bg-elev-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 14px;
  box-shadow: var(--shadow); font-size: .86rem; font-weight: 560;
  animation: toastIn .22s ease both; pointer-events: auto;
  display: flex; align-items: center; gap: 9px;
}
.toast.ok   { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.toast.err  { border-color: color-mix(in srgb, var(--rose) 55%, var(--line)); color: var(--rose); }
.toast.warn { border-color: color-mix(in srgb, var(--amber) 55%, var(--line)); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------- Sync-Statusband */

.syncbar {
  display: none; align-items: center; gap: 8px;
  padding: 7px 16px; font-size: .8rem; font-weight: 600;
  background: color-mix(in srgb, var(--amber) 16%, var(--bg)); color: var(--amber);
  border-bottom: 1px solid color-mix(in srgb, var(--amber) 30%, transparent);
}
.syncbar.show { display: flex; }
.syncbar.offline { background: color-mix(in srgb, var(--rose) 15%, var(--bg)); color: var(--rose); border-color: transparent; }
.spin { animation: spin 1s linear infinite; display: inline-flex; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ Datumsleiste */

.dateline { display: flex; align-items: center; gap: 8px; }
.dateline .d-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-elev); color: var(--text-dim);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.dateline .d-btn:hover { color: var(--text); }
.dateline .d-now {
  flex: 1; text-align: center; font-weight: 650; font-size: .95rem;
  padding: 8px 10px; border-radius: 10px; background: var(--bg-elev);
  border: 1px solid var(--line); cursor: pointer; position: relative;
}
.dateline .d-now input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 16px; }

/* ------------------------------------------------------------- Diagramme */

.chart-box { position: relative; width: 100%; height: 260px; }
.chart-box.tall { height: 340px; }
@media (max-width: 719px) { .chart-box { height: 220px; } .chart-box.tall { height: 260px; } }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--text-dim); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.empty {
  text-align: center; padding: 32px 16px; color: var(--text-faint);
}
.empty svg { width: 34px; height: 34px; opacity: .5; margin-bottom: 8px; }

/* --------------------------------------------------------- Scanner-Video */

#scanArea { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 4/3; }
#scanArea video { width: 100%; height: 100%; object-fit: cover; display: block; }
#scanArea .frame {
  position: absolute; inset: 18% 10%; border: 2px solid var(--accent);
  border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0,0,0,.35);
}

/* ------------------------------------------------------------ Desktop ab 900px */

@media (min-width: 900px) {
  body { font-size: 14.5px; }
  .tabbar { display: none; }
  .main { padding-bottom: 32px; }

  .sidebar {
    display: flex; flex-direction: column; gap: 4px;
    width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
    border-right: 1px solid var(--line); background: var(--bg-elev);
    padding: 16px 12px; position: sticky; top: 0; height: 100dvh; overflow-y: auto;
  }
  .sidebar .brand {
    display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px;
    font-weight: 750; font-size: 1.1rem; letter-spacing: -.02em;
  }
  .sidebar .brand .dot {
    width: 26px; height: 26px; border-radius: 8px; background: var(--accent);
    display: grid; place-items: center; color: var(--accent-ink);
  }
  .sidebar .brand .dot svg { width: 16px; height: 16px; }
  .sidebar a.nav {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 11px; border-radius: 9px; color: var(--text-dim);
    font-weight: 580; font-size: .9rem;
  }
  .sidebar a.nav svg { width: 18px; height: 18px; stroke-width: 1.9; flex: 0 0 auto; }
  .sidebar a.nav:hover { background: var(--bg-elev-2); color: var(--text); }
  .sidebar a.nav.active { background: var(--accent-soft); color: var(--accent); }
  .sidebar .sep { height: 1px; background: var(--line-soft); margin: 12px 8px; }
  .sidebar .foot { margin-top: auto; padding-top: 12px; }

  .topbar { padding: 14px 24px; }
  .container { padding: 20px 24px 40px; }
  .toasts { left: auto; right: 24px; bottom: 24px; transform: none; }
}

@media (min-width: 1400px) { .container { max-width: 1340px; } }

/* Druck: Auswertungen sauber aufs Papier */
@media print {
  .sidebar, .tabbar, .topbar, .btn, .toasts { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
}
