/* Klassenbuch — modern clean */
:root {
  --brand: #0f172a;
  --brand-hover: #1e293b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #dbeafe;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --border: #e5e7eb;
  --border-strong: #cbd5e1;
  --bg: #f8fafc;
  --panel: #fff;
  --success: #15803d; --success-bg: #dcfce7;
  --warn: #b45309;    --warn-bg: #fef3c7;
  --danger: #b91c1c;  --danger-bg: #fee2e2;
  --info: #1e40af;    --info-bg: #dbeafe;
  --sidebar-w: 260px;
  --radius: 6px;
  --radius-lg: 10px;
  --sans: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *:before, *:after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font: 15px/1.55 var(--sans); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3 { margin: 0 0 .5em; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; letter-spacing: -0.02em; }
h2 { font-size: 1.05rem; }
h3 { font-size: 1rem; }
p  { margin: 0 0 .8em; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--panel); width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
textarea { font-family: var(--sans); resize: vertical; min-height: 60px; }
button { cursor: pointer; }

.mono { font-family: var(--mono); font-size: .93em; }
.muted { color: var(--muted); }
.small { font-size: .87em; }
.danger { color: var(--danger); }
.warn { color: var(--warn); }
.success { color: var(--success); }
.ellipsis { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==== Sidebar ==== */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--panel); border-right: 1px solid var(--border);
  padding: 20px 14px; display: flex; flex-direction: column;
  overflow-y: auto;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 20px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.brand-mark {
  width: 36px; height: 36px; background: var(--brand); color: #fff;
  border-radius: 9px; display: grid; place-items: center; flex-shrink: 0;
}
.brand-text { line-height: 1.2; }
.brand-name { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.brand-sub { font-size: 12px; color: var(--muted); }

.sidebar nav { flex: 1; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 12px 6px; font-weight: 500; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 6px; margin-bottom: 2px;
  color: var(--text-2); text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: background .12s, color .12s;
}
.sidebar nav a:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.sidebar nav a.active { background: var(--accent-light); color: var(--accent); }
.sidebar nav a.active svg { color: var(--accent); }

.user-menu {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex; align-items: center; gap: 8px;
}
.user-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-weight: 600; font-size: 12px; letter-spacing: .5px;
  flex-shrink: 0;
}
.user-text { min-width: 0; }
.user-name { font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--muted); }
.logout { background: none; border: 0; color: var(--muted); padding: 6px; border-radius: 6px; }
.logout:hover { background: var(--bg); color: var(--danger); }

.menu-toggle {
  display: none; position: fixed; top: 12px; left: 12px; z-index: 50;
  background: var(--panel); border: 1px solid var(--border); border-radius: 6px;
  padding: 8px; color: var(--text);
}

/* ==== Main ==== */
main {
  min-height: 100vh;
}
.main-with-sidebar {
  padding: 32px 40px 80px;
  margin-left: var(--sidebar-w);
}
.main-public {
  padding: 40px 24px;
}

.page-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 20px;
  margin-bottom: 24px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.page-head h1 { margin-bottom: 2px; }
.page-head p.muted { margin: 4px 0 0; font-size: 14px; }
.eyebrow { font-size: 12px; font-weight: 500; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; margin-bottom: 4px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.breadcrumb a { color: var(--muted); }

/* ==== Buttons ==== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border: 1px solid transparent; border-radius: var(--radius);
  font-weight: 500; text-decoration: none;
  font-size: 14px;
  transition: background .12s, color .12s, border-color .12s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); color: #fff; }
.btn-outline { background: var(--panel); color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--bg); border-color: var(--brand); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: transparent; padding: 6px 10px; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-ghost.danger { color: var(--danger); }
.warn { color: var(--warn); }
.success { color: var(--success); }
.btn-ghost.danger:hover { background: var(--danger-bg); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.pill-btn { background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.pill-btn:hover { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }

/* ==== Flash ==== */
.flash { padding: 12px 14px; border-radius: var(--radius); margin-bottom: 16px; border-left: 3px solid; font-size: 14px; }
.flash-success { border-color: var(--success); background: var(--success-bg); color: #14532d; }
.flash-error   { border-color: var(--danger); background: var(--danger-bg); color: #7f1d1d; }
.flash-info    { border-color: var(--accent); background: var(--accent-light); color: #1e3a8a; }

/* ==== Panels ==== */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 22px; margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.panel-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.panel-head .link-more, .panel-head .muted { font-size: 12px; }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.empty.small { padding: 14px; }
.empty-panel { padding: 30px 24px; }

/* ==== Stats ==== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; }
.stat-value { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.stat-value.danger { color: var(--danger); }
.warn { color: var(--warn); }
.success { color: var(--success); }
.stat-value.warn { color: var(--warn); }
.success { color: var(--success); }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 6px; }

/* ==== Auth ==== */
.auth-wrap { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 24px; }
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 40px 32px; box-shadow: 0 4px 16px rgba(15,23,42,.04);
}
.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; background: var(--brand); color: #fff;
  border-radius: 12px; margin-bottom: 12px;
}
.auth-brand-title { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em; }
.auth-brand-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.auth-card form label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.auth-card form label input { font-size: 15px; }
.auth-hint { text-align: center; color: var(--muted); font-size: 12px; margin-top: 20px; }

/* ==== Tables ==== */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.table.clickable tbody tr { cursor: pointer; }
.table.clickable tbody tr:hover { background: var(--bg); }
.row-actions { text-align: right; white-space: nowrap; }
.row-arrow { color: var(--muted); font-size: 1.2em; text-align: right; }

/* ==== Filter Chips ==== */
.filter-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--panel);
  font-size: 13px; color: var(--text-2);
  text-decoration: none;
}
.chip:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.chip.active:hover { background: var(--brand-hover); color: #fff; }

/* ==== Row Form ==== */
.row-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row-form input, .row-form select { flex: 1; min-width: 140px; width: auto; }

/* ==== Klasse-Cards ==== */
.klasse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.klasse-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px 22px; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.klasse-card:hover { border-color: var(--accent); box-shadow: 0 4px 12px rgba(15,23,42,.06); transform: translateY(-1px); text-decoration: none; }
.klasse-card-head { display: flex; justify-content: space-between; align-items: baseline; }
.klasse-name { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; }
.klasse-jg { font-size: 12px; color: var(--muted); }
.klasse-stats { display: flex; gap: 6px; color: var(--muted); font-size: 13px; }
.klasse-action { color: var(--accent); font-weight: 500; font-size: 13px; display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); }

/* ==== Fach-Badge ==== */
.fach-badge {
  display: inline-block;
  padding: 2px 8px; border-radius: 4px;
  color: #fff; font-size: 11px; font-weight: 600;
  letter-spacing: .02em; text-transform: uppercase;
  min-width: 32px; text-align: center;
  vertical-align: middle;
}
.color-dot { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: middle; }

/* ==== Pills ==== */
.pill { display: inline-block; padding: 2px 8px; background: var(--accent-light); color: var(--accent); font-size: 11px; font-weight: 500; border-radius: 999px; }
.pill.success { background: var(--success-bg); color: var(--success); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.danger { background: var(--danger-bg); color: var(--danger); }
.pill.muted { background: #f1f5f9; color: var(--muted); }

/* ==== Stunden-Liste (Dashboard) ==== */
.stunden-list { display: flex; flex-direction: column; gap: 4px; }
.stunde-row {
  display: grid; grid-template-columns: 40px 100px 1fr auto;
  gap: 16px; align-items: center;
  padding: 12px 14px; border-radius: 8px;
  color: inherit; text-decoration: none;
  transition: background .12s;
}
.stunde-row:hover { background: var(--bg); text-decoration: none; }
.stunde-row.done { opacity: .8; }
.stunde-num { font-size: 1.1rem; font-weight: 700; color: var(--muted); text-align: center; }
.stunde-time { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.stunde-fach { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.stunde-fach-name { font-weight: 500; }
.stunde-klasse { color: var(--muted); font-size: 12px; }
.stunde-thema { color: var(--text-2); font-size: 13px; }
.stunde-thema.muted { color: var(--muted); font-style: italic; }

/* ==== Stundenplan ==== */
.stundenplan { overflow-x: auto; }
.stundenplan table { width: 100%; border-collapse: separate; border-spacing: 4px; min-width: 640px; }
.stundenplan th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px; text-align: center; }
.stundenplan td { padding: 0; background: var(--bg); border-radius: 6px; height: 60px; vertical-align: top; }
.stundenplan td.stunden-num { background: transparent; text-align: right; padding: 8px 12px 0 0; color: var(--muted); font-weight: 600; white-space: nowrap; }
.stundenplan td.stunden-num .muted { display: block; font-size: 10px; margin-top: 2px; }
.sp-cell {
  display: flex; flex-direction: column; justify-content: center;
  padding: 8px 10px; height: 100%;
  background: var(--panel); border-radius: 6px;
  text-decoration: none; color: var(--text);
  transition: transform .12s;
}
.sp-cell:hover { text-decoration: none; transform: scale(1.02); }
.sp-fach { font-weight: 600; font-size: 13px; }
.sp-klasse, .sp-lehrer { font-size: 11px; color: var(--muted); }
.sp-cell-admin {
  display: flex; flex-direction: column; padding: 8px 10px; height: 100%;
  background: var(--panel); border-radius: 6px; position: relative;
}
.sp-x { position: absolute; top: 3px; right: 4px; background: none; border: 0; color: var(--muted); font-size: 16px; padding: 0 4px; cursor: pointer; line-height: 1; }
.sp-x:hover { color: var(--danger); }
.sp-mine { outline: 2px solid var(--success); outline-offset: -2px; }
.sp-frei {
  width: 100%; height: 100%; min-height: 52px;
  background: transparent; border: 1px dashed var(--border-strong); border-radius: 6px;
  color: var(--muted); font-size: 12px; cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
}
.sp-frei:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.sp-abgeben {
  width: 100%; background: none; border: 0; color: var(--muted);
  font-size: 10px; cursor: pointer; padding: 2px;
}
.sp-abgeben:hover { color: var(--danger); text-decoration: underline; }

/* ==== Anwesenheit ==== */
.anw-legende {
  display: flex; flex-wrap: wrap; gap: 10px 16px;
  padding: 10px 12px; margin-bottom: 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  font-size: 12px; color: var(--text-2);
}
.lg-item { display: inline-flex; align-items: center; gap: 6px; }
.lg-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 5px;
  color: #fff; font-size: 11px; font-weight: 600;
}
.lg-anwesend     { background: var(--success); }
.lg-fehlend      { background: var(--danger); }
.lg-entschuldigt { background: var(--warn); }
.lg-verspaetet   { background: var(--warn); }
.lg-beurlaubt    { background: var(--info); }

.anw-quicks { display: flex; gap: 8px; margin-bottom: 12px; }
.anw-list { display: flex; flex-direction: column; gap: 4px; }
.anw-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; border-radius: 6px;
  background: var(--bg);
}
.anw-name { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.anw-nr {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: 10px; font-weight: 600;
}
.anw-right { display: flex; align-items: center; gap: 8px; }
.anw-choice { display: flex; gap: 3px; }
.anw-min input {
  width: 64px; padding: 4px 8px; font-size: 12px;
  border: 1px solid var(--warn); border-radius: 5px;
  background: var(--warn-bg); color: var(--warn); font-weight: 600;
  text-align: center;
}
.anw-min input:focus { box-shadow: 0 0 0 3px rgba(180,83,9,.15); border-color: var(--warn); }

/* Vertretung */
.vertretung-banner {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--warn-bg);
  border-left: 3px solid var(--warn);
  border-radius: 6px;
  color: var(--warn);
  font-size: 13px;
}
.vertreten-durch {
  display: inline-block;
  padding: 2px 8px;
  background: var(--warn-bg);
  color: var(--warn);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  margin-left: 4px;
}
.anw-opt {
  cursor: pointer; user-select: none;
  padding: 4px 10px; border-radius: 5px;
  background: var(--panel); border: 1px solid var(--border);
  color: var(--muted); font-size: 12px; font-weight: 600;
}
.anw-opt input { display: none; }
.anw-opt:hover { border-color: var(--border-strong); }
.anw-opt.active { color: #fff; }
.anw-anwesend.active     { background: var(--success); border-color: var(--success); }
.anw-fehlend.active      { background: var(--danger); border-color: var(--danger); }
.anw-entschuldigt.active { background: var(--warn); border-color: var(--warn); }
.anw-verspaetet.active   { background: var(--warn); border-color: var(--warn); }
.anw-beurlaubt.active    { background: var(--info); border-color: var(--info); }

/* ==== Two-Column Layout ==== */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.two-col > div { min-width: 0; }
.two-col-fixed { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.two-col-fixed > * { min-width: 0; }
.two-col-span { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 16px; border-top: 1px solid var(--border); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ==== Dialog ==== */
dialog.dialog {
  padding: 24px; border: 0; border-radius: 12px; max-width: 460px; width: 100%;
  box-shadow: 0 20px 40px rgba(15,23,42,.15);
}
dialog.dialog::backdrop { background: rgba(15,23,42,.4); }
dialog.dialog h3 { margin-bottom: 16px; }
dialog.dialog label { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 500; }
dialog.dialog label input, dialog.dialog label select { margin-top: 4px; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* ==== Details / Summary ==== */
details summary::marker { color: var(--muted); }

/* ==== Responsive ==== */
@media (max-width: 900px) {
  :root { --sidebar-w: 100%; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s;
    box-shadow: 0 0 40px rgba(15,23,42,.15);
  }
  .sidebar.open { transform: translateX(0); }
  .main-with-sidebar { margin-left: 0; padding: 60px 20px 60px; }
  .menu-toggle { display: block; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col, .two-col-fixed { grid-template-columns: 1fr; }
  .stunde-row { grid-template-columns: 30px 1fr auto; }
  .stunde-time { display: none; }
  .anw-row { flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media (max-width: 520px) {
  .stats-grid { grid-template-columns: 1fr; }
  .ellipsis { max-width: 200px; }
  .anw-opt { padding: 6px 10px; font-size: 13px; }
}

/* ==== Dashboard-spezifisch ==== */
.code-input {
  font-size: 28px !important;
  letter-spacing: 12px;
  text-align: center;
  font-family: var(--mono);
  font-weight: 600;
  padding: 14px !important;
}
.masked-mail {
  font-family: var(--mono);
  font-size: .95em;
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid var(--border);
  display: inline-block;
  margin: 4px 0;
}
.session-timer {
  display: flex; align-items: center; gap: 8px;
  margin: 0 8px 12px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
}
.session-timer.warning { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.session-timer #sessionCountdown { font-family: var(--mono); font-weight: 600; }
.service-list { list-style: none; padding: 0; margin: 0; }
.service-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.service-list li:last-child { border-bottom: 0; }
.svc-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.svc-dot.ok { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
.svc-dot.down { background: var(--danger); box-shadow: 0 0 0 3px rgba(185,28,28,.18); }
.svc-name { flex: 1; font-size: 14px; }
.timeout-form { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.timeout-form input[type=number] { width: 60px; padding: 4px 8px; font-size: 13px; text-align: center; }

/* ==== Kachel-Übersicht ==== */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.tile {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 26px 24px; text-decoration: none; color: var(--text);
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tile:hover { border-color: var(--accent); box-shadow: 0 6px 18px rgba(15,23,42,.07); transform: translateY(-2px); text-decoration: none; }
.tile-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--accent-light); color: var(--accent);
  display: grid; place-items: center; margin-bottom: 8px;
}
.tile-title { font-weight: 600; font-size: 15px; }
.tile-ext { color: var(--muted); font-size: 12px; }
.tile-desc { color: var(--muted); font-size: 13px; }

/* ==== Rechte-Checkboxen ==== */
.perms-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.perm-check {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-2); cursor: pointer;
  padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg);
}
.perm-check input { width: auto; margin: 0; accent-color: var(--accent); }
.perm-check:has(input:checked) { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }

/* ==== Rich Flash (Titel + Text + Icon) ==== */
.flash-rich {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  border-left-width: 3px;
  box-shadow: 0 2px 8px rgba(15,23,42,.04);
}
.flash-rich .flash-icon {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
}
.flash-info.flash-rich .flash-icon    { background: var(--accent-light); color: var(--accent); }
.flash-success.flash-rich .flash-icon { background: var(--success-bg); color: var(--success); }
.flash-error.flash-rich .flash-icon   { background: var(--danger-bg); color: var(--danger); }
.flash-body { flex: 1; min-width: 0; }
.flash-title { font-weight: 600; font-size: 15px; color: var(--text); margin-bottom: 2px; }
.flash-text { font-size: 13px; color: var(--muted); line-height: 1.5; }
.flash-info.flash-rich    { background: var(--panel); border-left-color: var(--accent); color: inherit; }
.flash-success.flash-rich { background: var(--panel); border-left-color: var(--success); color: inherit; }
.flash-error.flash-rich   { background: var(--panel); border-left-color: var(--danger); color: inherit; }

/* ==== Security-Flash: rot, kräftig, mit Glow ==== */
.flash-security.flash-rich {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1a0b0d 0%, #2b1113 100%);
  border: 1px solid #7f1d1d;
  border-left: 3px solid #ef4444;
  color: #fecaca;
  box-shadow: 0 8px 28px rgba(185,28,28,.28), inset 0 1px 0 rgba(255,255,255,.04);
  animation: securityIn .5s cubic-bezier(.16,1,.3,1) both;
}
.flash-security.flash-rich::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(420px 120px at 8% 0%, rgba(239,68,68,.18), transparent 70%);
  pointer-events: none;
}
.flash-security .flash-icon {
  background: rgba(239,68,68,.14);
  color: #f87171;
  border: 1px solid rgba(239,68,68,.35);
  box-shadow: 0 0 0 0 rgba(239,68,68,.5);
  animation: securityPulse 2.4s ease-out infinite;
}
.flash-security .flash-title {
  color: #fff;
  letter-spacing: -.01em;
  display: flex; align-items: center; gap: 8px;
}
.flash-security .flash-title::after {
  content: "SICHERHEIT";
  font-size: 9px; font-weight: 700; letter-spacing: .12em;
  color: #f87171; background: rgba(239,68,68,.14);
  border: 1px solid rgba(239,68,68,.3);
  padding: 2px 7px; border-radius: 999px;
}
.flash-security .flash-text { color: #fca5a5; }
@keyframes securityIn {
  from { opacity: 0; transform: translateY(-8px) scale(.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes securityPulse {
  0%   { box-shadow: 0 0 0 0 rgba(239,68,68,.5); }
  70%  { box-shadow: 0 0 0 12px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}
@media (prefers-reduced-motion: reduce) {
  .flash-security.flash-rich, .flash-security .flash-icon { animation: none; }
}

/* ==== Trusted-Device Checkbox ==== */
.trust-check {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 16px; padding: 12px 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; text-align: left;
}
.trust-check input { width: auto; margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }
.trust-check span { display: flex; flex-direction: column; gap: 2px; }
.trust-check strong { font-size: 14px; font-weight: 600; }
.trust-check small { font-size: 12px; color: var(--muted); line-height: 1.45; }
.trust-check:has(input:checked) { border-color: var(--accent); background: var(--accent-light); }

/* ==== Geräteliste ==== */
.device-list { list-style: none; padding: 0; margin: 0; }
.device-list li {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.device-list li:last-child { border-bottom: 0; }
.device-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: var(--bg); color: var(--muted);
  display: grid; place-items: center; border: 1px solid var(--border);
}
.device-info { flex: 1; min-width: 0; }
.device-label { font-weight: 500; display: flex; align-items: center; gap: 8px; }
.device-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ==== OTP-Segmenteingabe ==== */
.otp-label {
  text-align: center; font-size: 12px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px;
}
.otp-group {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  max-width: 320px;
  margin: 0 auto;
}
.otp-box {
  width: 100%;
  aspect-ratio: 3 / 4;
  min-width: 0;
  padding: 0;
  text-align: center;
  font-size: 24px; font-weight: 700;
  font-family: var(--mono);
  color: var(--text);
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #fafbfc);
  box-shadow: inset 0 1px 2px rgba(15,23,42,.03);
  transition: border-color .14s, box-shadow .14s, transform .1s, background .14s;
  caret-color: var(--accent);
}
.otp-box:hover { border-color: var(--muted); }
.otp-box:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--panel);
  box-shadow: 0 0 0 4px rgba(37,99,235,.16), 0 4px 10px rgba(37,99,235,.1);
  transform: translateY(-2px);
}
.otp-box:not(:placeholder-shown) {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--brand-hover);
}
@media (max-width: 420px) {
  .otp-group { gap: 6px; max-width: 100%; }
  .otp-box { font-size: 20px; border-radius: 10px; }
}

/* ==== Profil-Felder ==== */
.profile-head { display: flex; align-items: center; gap: 16px; padding-bottom: 4px; }
.profile-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 20px; letter-spacing: .5px;
  flex-shrink: 0; box-shadow: 0 2px 8px rgba(15,23,42,.12);
}
.row-2-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.row-2-cols label { display: block; }
.settings-divider {
  margin: 20px 0 12px; padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted);
}
.toggle-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; cursor: pointer;
}
.toggle-row input { width: auto; margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }
.toggle-row span { display: flex; flex-direction: column; gap: 1px; }
.toggle-row strong { font-size: 14px; font-weight: 600; }
.toggle-row small { font-size: 12px; color: var(--muted); line-height: 1.4; }
@media (max-width: 520px) { .row-2-cols { grid-template-columns: 1fr; } }

/* ==================================================================
   MOBILE-OPTIMIERUNG (durchgängig)
   ================================================================== */

/* Tabellen: horizontal scrollbar statt überlaufen */
.table { width: 100%; }
.panel > .table, .panel .table { display: table; }
@media (max-width: 760px) {
  /* Tabellen in scrollbaren Container zwingen */
  .table { min-width: 520px; }
  .panel:has(> .table),
  .panel:has(> table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* Falls Tabelle direkt im Panel: eigenen Scroll-Wrapper simulieren */
  table.table { display: block; overflow-x: auto; white-space: nowrap; }
  table.table thead, table.table tbody { display: table; width: 100%; min-width: 520px; }
}

@media (max-width: 640px) {
  .main-with-sidebar { padding: 64px 16px 48px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-head form.row-form { width: 100%; }
  h1 { font-size: 1.45rem; }

  /* Buttons in Zeilen umbrechen lassen */
  .row-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-start; }
  .row-actions form { display: inline-flex; }

  /* Formular-Zeilen untereinander */
  .row-form { flex-direction: column; align-items: stretch; }
  .row-form input, .row-form select, .row-form button { width: 100%; }

  /* Kacheln: eine Spalte */
  .tile-grid { grid-template-columns: 1fr; }

  /* Stats: zwei Spalten bleiben, aber kompakter */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 14px 16px; }
  .stat-value { font-size: 1.5rem; }

  /* Panels enger */
  .panel { padding: 16px; }

  /* Geräteliste: umbrechen */
  .device-list li { flex-wrap: wrap; }
  .device-info { flex-basis: calc(100% - 54px); }
  .device-list li form { margin-left: 54px; }

  /* Auth-Card volle Breite */
  .auth-card { padding: 24px 20px; }

  /* Timeout-Form umbrechen */
  .timeout-form { flex-wrap: wrap; }
}

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr; }
  .main-with-sidebar { padding: 60px 12px 40px; }
  .brand-name { font-size: 14px; }
}

/* Touch-Targets: Buttons/Links auf Mobil größer */
@media (hover: none) and (pointer: coarse) {
  .btn-sm { padding: 8px 12px; font-size: 13px; }
  .sidebar nav a { padding: 12px; }
  .logout { padding: 10px; }
}

/* Verhindere versehentliches Zoomen bei Input-Fokus (iOS): min 16px */
@media (max-width: 640px) {
  input, select, textarea { font-size: 16px; }
  .otp-box { font-size: 22px; }
  .code-input { font-size: 24px !important; }
}

/* Spalten auf kleinen Screens ausblenden */
@media (max-width: 640px) {
  .hide-sm { display: none !important; }
  table.table { min-width: 0; white-space: normal; }
  table.table thead, table.table tbody { min-width: 0; }
}

/* ==== Gesperrte Felder / Hinweis ==== */
.locked-hint {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px; margin-bottom: 4px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  font-size: 12px; color: var(--muted); line-height: 1.4;
}
.locked-hint svg { flex-shrink: 0; margin-top: 1px; }
input:disabled, textarea:disabled {
  background: #f1f5f9; color: var(--muted); cursor: not-allowed;
  border-color: var(--border);
}

/* ==== Kfz-Modul ==== */
.kfz-pie-wrap { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; padding: 8px 0; }
.kfz-pie {
  width: 170px; height: 170px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.kfz-pie-hole {
  width: 108px; height: 108px; border-radius: 50%; background: var(--panel);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.kfz-pie-total { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.kfz-pie-sub { color: var(--muted); font-size: 12px; }
.kfz-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; min-width: 180px; }
.kfz-legend li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.kfz-legend-name { font-weight: 600; }
.kfz-legend-val { color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.kfz-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: baseline; }
.kfz-info-list { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.kfz-info-list dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.kfz-info-list dd { margin: 4px 0 0; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .02em; }

/* Kfz: Balkendiagramm Tankkosten pro Monat */
.kfz-bars { display: flex; align-items: stretch; gap: 8px; padding: 6px 0 2px; }
.kfz-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.kfz-bar-val { font-size: 10px; color: var(--muted); height: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kfz-bar-track { height: 120px; width: 100%; max-width: 26px; display: flex; align-items: flex-end; background: var(--bg); border-radius: 6px; }
.kfz-bar { width: 100%; background: var(--accent); border-radius: 6px; min-height: 0; }
.kfz-bar-label { font-size: 11px; color: var(--muted); }

/* Kfz: Termine & Fristen */
.kfz-termine { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; }
.kfz-termine li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.kfz-termine li:last-child { border-bottom: none; padding-bottom: 0; }
.kfz-termine .kfz-termin-text { flex: 1; min-width: 0; }
.kfz-termine .kfz-termin-titel { font-weight: 600; font-size: 14px; }
.kfz-termine .muted { font-size: 12px; }
.kfz-alert { border-left: 3px solid var(--warn); margin-bottom: 20px; }

/* ==== Übersicht: Mini-Widgets ==== */
.widget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 20px; }
.widget {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 18px; display: block; color: inherit;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.widget:hover { border-color: var(--accent); box-shadow: 0 6px 18px rgba(15,23,42,.07); transform: translateY(-2px); text-decoration: none; }
.widget-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.widget-value { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
.widget-value.small { font-size: 1.02rem; }
.widget-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.widget-bars { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.widget-bar-track { height: 5px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.widget-bar { height: 100%; background: var(--accent); border-radius: 99px; }
.widget-bar.danger { background: var(--danger); }
.widget-list { list-style: none; margin: 2px 0 0; padding: 0; }
.widget-list li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.widget-list li:last-child { border-bottom: none; }
.widget-list-titel { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==== Finanzen: Kategorie-Verteilung ==== */
.fix-verteilung { display: flex; flex-direction: column; gap: 10px; }
.fix-vert-row { display: flex; align-items: center; gap: 12px; }
.fix-vert-name { width: 130px; flex-shrink: 0; font-size: 13px; font-weight: 600; }
.fix-vert-track { flex: 1; height: 10px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.fix-vert-bar { height: 100%; background: var(--accent); border-radius: 99px; }
.fix-vert-val { width: 150px; flex-shrink: 0; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ==== Aufgaben ==== */
.aufgaben-liste { list-style: none; margin: 0; padding: 0; }
.aufgaben-liste li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.aufgaben-liste li:last-child { border-bottom: none; }
.aufgabe-check { margin: 0; display: flex; }
.aufgabe-toggle {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong);
  background: var(--panel); padding: 0; flex-shrink: 0; font-size: 12px; line-height: 1;
  color: transparent; transition: border-color .12s, background .12s;
}
.aufgabe-toggle:hover { border-color: var(--success); }
.aufgabe-toggle.done { background: var(--success); border-color: var(--success); color: #fff; }
.aufgabe-titel { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.aufgaben-liste.erledigt .aufgabe-titel { color: var(--muted); text-decoration: line-through; font-weight: 400; }

/* Dokumente: Suche + Info */
.dok-suche { display: flex; align-items: center; gap: 8px; margin: 0; }
.dok-suche input { width: 200px; padding: 6px 10px; font-size: 13px; }
.dok-info { font-style: italic; font-family: Georgia, serif; font-weight: 700; width: 28px; }

/* Sidebar: Pfeil für externe Links */
.nav-ext { margin-left: auto; color: var(--muted); font-size: 12px; }

/* Eigene Module: Link- und Notizlisten */
.modul-links { list-style: none; margin: 0; padding: 0; }
.modul-links li { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.modul-links li:last-child { border-bottom: none; }
.modul-link-titel { font-weight: 600; font-size: 14px; }
.modul-links .ellipsis { flex: 1; max-width: none; }
.modul-notiz { flex: 1; min-width: 0; }

/* Übersicht: Favoriten-Sterne */
.tile-wrap { position: relative; }
.tile-wrap .tile { height: 100%; }
.tile-fav-form { position: absolute; top: 10px; right: 10px; margin: 0; z-index: 2; }
.tile-fav { background: none; border: 0; padding: 4px; color: var(--border-strong); display: flex; transition: color .12s, transform .12s; }
.tile-fav:hover { color: #f59e0b; transform: scale(1.15); }
.tile-fav.aktiv { color: #f59e0b; }
.tile-section { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 10px; }

/* Kategorie-Schnellform im Panel-Kopf */
.kat-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.kat-form input { width: 170px; padding: 5px 10px; font-size: 13px; }

/* ==== Darkmode (grau) ==== */
:root[data-theme="dark"] {
  --brand: #43474c;
  --brand-hover: #53575d;
  --accent: #a9b2bd;
  --accent-hover: #bcc4cd;
  --accent-light: #33373b;
  --text: #e6e8ea;
  --text-2: #c2c5c9;
  --muted: #94989d;
  --border: #34373a;
  --border-strong: #4a4e53;
  --bg: #1b1d1f;
  --panel: #242628;
  --success: #7fcf9a; --success-bg: #20302a;
  --warn: #d9a961;    --warn-bg: #322a1c;
  --danger: #e08380;  --danger-bg: #33201f;
  --info: #9fb4d8;    --info-bg: #262b33;
}
:root[data-theme="dark"] body { -webkit-font-smoothing: antialiased; }
:root[data-theme="dark"] .btn-primary { background: #55595f; color: #f0f1f3; }
:root[data-theme="dark"] .btn-primary:hover { background: #64686e; }
:root[data-theme="dark"] .brand-mark,
:root[data-theme="dark"] .user-avatar,
:root[data-theme="dark"] .profile-avatar { background: #55595f !important; }
:root[data-theme="dark"] input:focus,
:root[data-theme="dark"] select:focus,
:root[data-theme="dark"] textarea:focus { box-shadow: 0 0 0 3px rgba(169,178,189,.18); }
:root[data-theme="dark"] .pill.muted { background: #2e3134; color: var(--muted); }
:root[data-theme="dark"] .flash-success { color: #b9e4c5; }
:root[data-theme="dark"] .flash-error   { color: #f0c1bf; }
:root[data-theme="dark"] .flash-info    { color: #ccd6e4; }
:root[data-theme="dark"] .tile:hover,
:root[data-theme="dark"] .widget:hover { box-shadow: 0 6px 18px rgba(0,0,0,.35); }
:root[data-theme="dark"] .kfz-pie { filter: saturate(.75); }

/* Sidebar-Umschalter */
.theme-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 7px 10px; color: var(--text-2); font-size: 13px; margin-bottom: 10px;
  transition: background .12s, color .12s;
}
.theme-toggle:hover { background: var(--bg); color: var(--text); }
.theme-toggle .tt-sonne { display: none; }
:root[data-theme="dark"] .theme-toggle .tt-mond { display: none; }
:root[data-theme="dark"] .theme-toggle .tt-sonne { display: inline; }

/* Finanzen: Inline-Bearbeitung per Doppelklick */
td.editierbar { cursor: text; }
td.editierbar:hover { background: var(--bg); box-shadow: inset 0 -1px 0 var(--border-strong); }

/* Kontoauszug: Blätter-Navigation */
.seiten-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }

/* ============================================================
   Visual Refresh v2 — konsistenter Feinschliff
   ============================================================ */
:root {
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --shadow-md: 0 1px 3px rgba(15,23,42,.06), 0 8px 24px -8px rgba(15,23,42,.10);
}
:root[data-theme="dark"] {
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 1px 3px rgba(0,0,0,.35), 0 8px 24px -8px rgba(0,0,0,.5);
}

/* Flächen: weiche Tiefe statt harter Ränder */
.panel, .stat, .tile, .widget { box-shadow: var(--shadow-sm); }
.tile:hover, .widget:hover { box-shadow: var(--shadow-md); }

/* Buttons: einheitliche Radien, spürbares Feedback */
.btn { border-radius: var(--radius); }
.btn:active { transform: translateY(1px); }
.btn-primary { box-shadow: var(--shadow-sm); }

/* Fokus sichtbar machen — Tastatur-Navigation */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.btn:focus-visible, .tile:focus-visible, .widget:focus-visible { outline-offset: 1px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

/* Sidebar: aktiver Eintrag mit Indikator-Balken */
.sidebar nav a { position: relative; }
.sidebar nav a.active::before {
  content: ''; position: absolute; left: -14px; top: 7px; bottom: 7px; width: 3px;
  background: var(--accent); border-radius: 0 3px 3px 0;
}

/* Tabellen: ruhiger, mit Zeilen-Hover */
.table th { font-size: 11px; letter-spacing: .06em; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--bg); }
.table td { padding-top: 11px; padding-bottom: 11px; }

/* Panel-Köpfe dezenter */
.panel-head { border-bottom-color: var(--border); }
.panel-head h2 { letter-spacing: -0.01em; }

/* Statistik-Karten: Zahl atmet */
.stat-value { letter-spacing: -0.03em; }
.stat-label { line-height: 1.4; }

/* Formulare: gleiche Radien wie Buttons */
input, select, textarea { border-radius: var(--radius); }

/* Dialoge: weicher Auftritt */
dialog.dialog { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); border: 1px solid var(--border); }
dialog.dialog::backdrop { backdrop-filter: blur(2px); }

/* Flash-Meldungen: abgerundet + Schatten */
.flash { border-radius: var(--radius); box-shadow: var(--shadow-sm); }

/* Scrollbar dezent (WebKit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
::-webkit-scrollbar-track { background: transparent; }

/* Sanfte Übergänge überall dort, wo interagiert wird */
a, button, .tile, .widget, input, select { transition-duration: .12s; }

/* Reduzierte Bewegung respektieren */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Sperr-Verwaltung (sperrung.php) */
.lock-info { margin: 4px 0 20px; display: flex; flex-direction: column; gap: 0; }
.lock-info > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.lock-info > div:last-child { border-bottom: none; }
.lock-info dt { color: var(--muted); font-size: 13px; margin: 0; }
.lock-info dd { margin: 0; font-weight: 600; font-size: 14px; text-align: right; }
.lock-actions { margin-top: 4px; }

/* Benutzerliste: Sperr-Indikator */
.user-locked { display: inline-flex; vertical-align: middle; color: var(--danger); margin-right: 2px; }

/* ==== Drive ==== */
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 26px; text-align: center; color: var(--muted); transition: border-color .12s, background .12s; }
.dropzone.over { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }
.dropzone svg { margin-bottom: 8px; }
.dz-link { color: var(--accent); cursor: pointer; text-decoration: underline; }
.drive-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.drive-crumbs { font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.drive-crumbs .sep { color: var(--muted); }
.drive-mkdir { display: flex; gap: 6px; margin: 0; }
.drive-mkdir input { width: 160px; padding: 5px 10px; font-size: 13px; }
.file-actions { display: flex; flex-direction: column; }
.file-actions .btn-block { width: 100%; }

/* ==== Notizen ==== */
.notizen-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.notizen-liste { max-height: 75vh; overflow-y: auto; }
.notizen-items { list-style: none; margin: 0; padding: 0; }
.notizen-items li { border-bottom: 1px solid var(--border); }
.notizen-items li:last-child { border-bottom: none; }
.notizen-items a { display: block; padding: 10px 8px; border-radius: 6px; color: inherit; }
.notizen-items a:hover { background: var(--bg); text-decoration: none; }
.notizen-items li.aktiv a { background: var(--accent-light); }
.notiz-titel { font-weight: 600; font-size: 14px; }
.notiz-editor-top { display: flex; gap: 10px; margin-bottom: 12px; }
.notiz-editor textarea { font-family: var(--mono); font-size: 13px; line-height: 1.6; width: 100%; }
@media (max-width: 800px) { .notizen-layout { grid-template-columns: 1fr; } }

/* Markdown-Ausgabe */
.md-body { line-height: 1.7; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4 { margin: 1.1em 0 .4em; line-height: 1.3; }
.md-body h1 { font-size: 1.5rem; } .md-body h2 { font-size: 1.25rem; } .md-body h3 { font-size: 1.1rem; }
.md-body p { margin: 0 0 .8em; }
.md-body ul, .md-body ol { margin: 0 0 .8em 1.4em; }
.md-body li { margin: .2em 0; }
.md-body code { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-family: var(--mono); font-size: .9em; }
.md-body pre.md-code { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; overflow-x: auto; }
.md-body pre.md-code code { background: none; border: none; padding: 0; }
.md-body blockquote { border-left: 3px solid var(--border-strong); margin: 0 0 .8em; padding: 2px 14px; color: var(--muted); }
.md-body a { color: var(--accent); }
.md-body hr { border: none; border-top: 1px solid var(--border); margin: 1.2em 0; }
.drive-share.geteilt { color: var(--accent); }


/* Deaktiviertes (ausgegrautes) Eingabefeld, z. B. Mandant auf der Login-Seite */
.input-locked {
  background: var(--bg) !important;
  color: var(--muted) !important;
  cursor: not-allowed;
  font-family: var(--mono);
  -webkit-text-fill-color: var(--muted);
  opacity: 1;
}

/* Einstellungen: Akzentfarben-Swatches */
.accent-swatches { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.accent-swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; padding: 0; transition: transform .1s; }
.accent-swatch:hover { transform: scale(1.12); }
.accent-swatch.aktiv { border-color: var(--text); box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px currentColor; }

/* Tankpreise: Routen-Link */
.route-link { color: var(--accent); display: inline-flex; vertical-align: -2px; margin-left: 4px; padding: 2px; border-radius: 4px; transition: background .12s; }
.route-link:hover { background: var(--accent-light); }

/* Routen-Link: größeres Touch-Target auf Mobil, Symbol zuerst */
.route-link { margin-left: 0; margin-right: 6px; }
@media (hover: none) and (pointer: coarse) { .route-link { padding: 6px; } }
