/* DanDiBoard - gemeinsamer Grundstil für das Grundgerüst und alle Apps. */
:root {
  color-scheme: light;
  --bg: #F3F5FA; --surface: #FFFFFF; --surface-2: #EEF1F8; --ink: #172036; --muted: #586179; --line: #D9DEEA;
  --brand: #30478D; --brand-strong: #22356F; --brand-tint: #E8ECF7; --on-brand: #FFFFFF;
  --up: #006300; --down: #B3261E; --warn-bg: #FFF4DC; --warn-ink: #6B4A00;
  --st-open-bg: #FFF4DC; --st-open: #6B4A00; --st-part-bg: #E8ECF7; --st-part: #22356F; --st-done-bg: #E3F4E3; --st-done: #006300; --st-un-bg: #FCE8E6; --st-un: #B3261E;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948; --s0: #9AA1B2;
  --grid: #E4E7F0; --axis: #AEB5C6;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #0E1322; --surface: #161D31; --surface-2: #1C2642; --ink: #E9ECF5; --muted: #A0A8BE; --line: #2A3350;
    --brand: #9DB0EE; --brand-strong: #C3CEF5; --brand-tint: #1C2642; --on-brand: #0E1322;
    --up: #4CC94C; --down: #F2857E; --warn-bg: #3A2E10; --warn-ink: #F5D88A;
    --st-open-bg: #3A2E10; --st-open: #F5D88A; --st-part-bg: #1C2642; --st-part: #C3CEF5; --st-done-bg: #123018; --st-done: #7FD87F; --st-un-bg: #3A1614; --st-un: #F2857E;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767; --s0: #6E768A;
    --grid: #232B44; --axis: #3C4665;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E1322; --surface: #161D31; --surface-2: #1C2642; --ink: #E9ECF5; --muted: #A0A8BE; --line: #2A3350;
  --brand: #9DB0EE; --brand-strong: #C3CEF5; --brand-tint: #1C2642; --on-brand: #0E1322;
  --up: #4CC94C; --down: #F2857E; --warn-bg: #3A2E10; --warn-ink: #F5D88A;
  --st-open-bg: #3A2E10; --st-open: #F5D88A; --st-part-bg: #1C2642; --st-part: #C3CEF5; --st-done-bg: #123018; --st-done: #7FD87F; --st-un-bg: #3A1614; --st-un: #F2857E;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767; --s0: #6E768A;
  --grid: #232B44; --axis: #3C4665;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.4 var(--font); }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }
code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Login und Zugänge */
.login-body { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 16px; }
.admin-card { max-width: 520px; }
.admin-card h2 { font-size: 15px; margin-top: 8px; }
.wordmark { font-size: 20px; font-weight: 700; color: var(--brand); letter-spacing: -.01em; }
.wordmark span { font-weight: 400; color: var(--muted); }
.login-card form { display: grid; gap: 14px; }
.login-card label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.login-card input:not([type=hidden]) { height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 16px; font-weight: 400; width: 100%; }
.btn-primary { height: 46px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--brand); color: var(--on-brand); font-weight: 600; }
.btn-primary:hover { background: var(--brand-strong); }
.btn-quiet { min-height: 36px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 8px; background: transparent; }
.notice { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.notice-error { background: var(--warn-bg); color: var(--warn-ink); font-weight: 600; }
.notice-ok { background: var(--st-done-bg); color: var(--st-done); }
.token { display: block; word-break: break-all; padding: 8px; margin-top: 4px; background: var(--surface-2); border-radius: 8px; user-select: all; }
.user-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.user-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }

/* Kopf */
.top { background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 10px; }
.top .wordmark { font-size: 17px; margin-right: auto; white-space: nowrap; }
.stand { font-size: 13px; color: var(--muted); white-space: nowrap; }
.stand.old { color: var(--warn-ink); background: var(--warn-bg); padding: 2px 8px; border-radius: 8px; font-weight: 600; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: transparent; flex: none; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { background: var(--surface-2); }


/* DanDiBoard */
.btn-link { display: grid; place-items: center; text-decoration: none; }
.top a.wordmark { text-decoration: none; margin-right: 0; }
.top-sub { color: var(--muted); font-size: 14px; white-space: nowrap; }
.top-gap { flex: 1; }
.top-link { font-size: 14px; color: var(--ink); text-decoration: none; padding: 8px 6px; border-radius: 8px; white-space: nowrap; }
.top-link:hover { background: var(--surface-2); }
a.icon-btn { color: inherit; }
.page { max-width: 960px; margin: 0 auto; padding: 20px 16px 32px; display: grid; gap: 16px; }
.page-narrow { max-width: 520px; }
.page-wide { max-width: 1100px; }
.page > *, .card > * { min-width: 0; }
.greeting { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tile { display: flex; gap: 14px; align-items: center; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; min-width: 0; }
.tile:hover { border-color: var(--brand); }
.tile-icon { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--brand-tint); color: var(--brand); }
.tile-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tile-text { display: grid; gap: 2px; min-width: 0; font-size: 13px; }
.tile-text b { font-size: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 10px; min-width: 0; }
.card h2, .section-head h2 { font-size: 16px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head a { font-size: 14px; }
.news { display: grid; gap: 10px; margin-top: 8px; }
.news-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.news-head { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.news-item ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; background: var(--brand-tint); color: var(--brand-strong); font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill-warn { background: var(--warn-bg); color: var(--warn-ink); }
.foot { max-width: 1100px; margin: 0 auto; padding: 0 16px 24px; color: var(--muted); font-size: 12px; text-align: center; }
.form-grid { display: grid; gap: 12px; }
.form-grid label { display: grid; gap: 4px; font-weight: 600; font-size: 14px; }
.form-grid input:not([type=hidden]):not([type=checkbox]), .role-form input { height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 16px; font-weight: 400; width: 100%; min-width: 0; }
.form-grid .btn-primary { justify-self: start; }
.form-inline { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: end; }
.check-row { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; grid-column: 1 / -1; }
.check-row legend { font-weight: 600; font-size: 14px; padding: 0 0 4px; }
.form-grid .check { display: flex; gap: 6px; align-items: center; font-weight: 400; min-height: 32px; }
.tabs-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tabs-nav { display: flex; gap: 4px; overflow-x: auto; }
.tabs-nav a { padding: 8px 14px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; white-space: nowrap; }
.tabs-nav a[aria-current="page"] { background: var(--brand); color: var(--on-brand); }
.table-scroll { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.matrix th, .matrix td { text-align: center; white-space: nowrap; }
.matrix th:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; white-space: normal; min-width: 150px; }
.matrix thead th { font-weight: 600; color: var(--muted); font-size: 13px; }
.matrix tbody th { font-weight: 500; }
.matrix input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--brand); }
.matrix input[type=checkbox]:disabled { opacity: .35; }
.matrix select { height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 0 6px; font-size: 14px; }
.app-row th, .app-row td { background: var(--surface-2); }
.matrix .app-row th:first-child { background: var(--surface-2); font-weight: 700; }
.sub-right { padding-left: 22px !important; font-weight: 400 !important; }
.swipe-hint { display: none; font-size: 13px; }
@media (max-width: 720px) { .swipe-hint { display: block; } }
.sub-right small { display: block; font-size: 12px; font-weight: 400; }
.row-actions { display: flex; justify-content: flex-end; gap: 8px; align-items: flex-start; }
.more-menu { position: relative; text-align: left; }
.more-menu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; }
.more-menu summary::-webkit-details-marker { display: none; }
.more-box { width: 240px; margin-top: 8px; display: grid; gap: 12px; background: var(--surface-2); border-radius: 12px; padding: 12px; white-space: normal; }
.btn-danger { color: var(--down); border-color: var(--down); }
.btn-quiet:disabled { opacity: .45; cursor: not-allowed; }
.js .nojs-only { display: none; }
.role-list { list-style: none; margin: 0; padding: 0; display: grid; }
.role-list li { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); justify-content: space-between; }
.role-form { display: flex; gap: 8px; align-items: center; flex: 1 1 240px; min-width: 0; }
.role-form input { flex: 1; max-width: 320px; height: 38px; }
.role-new { margin-top: 4px; }
.role-new .btn-primary { height: 42px; }
.role-new input { height: 42px; }
@media (max-width: 720px) {
  .top-sub, .top-neu { display: none; }
  .top .top-link { font-size: 13px; padding: 6px 4px; }
  .top-konto { max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
  .col-admin { display: none; }
  .matrix th:first-child { min-width: 130px; }
}

/* Startseite: Hinweisbalken, Widgets der Apps, Anordnen (ab 1.2.0) */
:root { --sig-rot-bg: #f6e3df; --sig-rot: #6e2c22; --sig-rot-linie: #8a3b2f; --sig-orange-bg: #fbe3cf; --sig-orange: #7a3d08; --sig-gelb-bg: #fbf1cf; --sig-gelb: #6a5208; }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) { --sig-rot-bg: #3a201b; --sig-rot: #f2b0a4; --sig-rot-linie: #a5574a; --sig-orange-bg: #3a2614; --sig-orange: #f3b37a; --sig-gelb-bg: #332b12; --sig-gelb: #e9cf7a; }
}
:root[data-theme="dark"] { --sig-rot-bg: #3a201b; --sig-rot: #f2b0a4; --sig-rot-linie: #a5574a; --sig-orange-bg: #3a2614; --sig-orange: #f3b37a; --sig-gelb-bg: #332b12; --sig-gelb: #e9cf7a; }
.hinweise { display: grid; gap: 10px; }
.hinweise:empty { display: none; }
.hinweis-balken { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; border-radius: 10px; padding: 12px 16px; font-size: 15px; border: 1px solid var(--line); background: var(--surface-2); }
.hinweis-balken.hb-rot { background: var(--sig-rot-bg); border-color: var(--sig-rot-linie); color: var(--sig-rot); }
.hinweis-balken.hb-orange { background: var(--sig-orange-bg); border-color: var(--sig-orange); color: var(--sig-orange); }
.hinweis-balken.hb-gelb { background: var(--sig-gelb-bg); border-color: var(--sig-gelb); color: var(--sig-gelb); }
.hb-text { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hb-text svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hinweis-balken b { font-weight: 600; }
.hinweis-balken a { color: inherit; font-size: 14px; font-weight: 600; white-space: nowrap; }
/* Alle Kacheln einer Reihe gleich hoch, alle Reihen gleich hoch */
.tiles { grid-auto-rows: 1fr; }
.widget { position: relative; min-width: 0; }
.widget > .tile { height: 100%; }
.tile-badge { margin-left: auto; align-self: flex-start; }
.widget-gross { grid-row: span 3; display: flex; flex-direction: column; background: var(--surface); border: 2px solid var(--brand); border-radius: var(--radius); }
.widget-gross > .tile { border: 0; background: transparent; padding-bottom: 6px; height: auto; }
.widget-inhalt { padding: 0 16px 16px; min-width: 0; }
.w-amazon { display: grid; gap: 12px; font-size: 14px; }
.w-zeile { font-size: 15px; }
.w-fristen { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.w-label { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.w-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.w-chip { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 6px; white-space: nowrap; }
.w-chip.rot { background: var(--sig-rot-bg); color: var(--sig-rot); }
.w-chip.orange { background: var(--sig-orange-bg); color: var(--sig-orange); }
.w-chip.gelb { background: var(--sig-gelb-bg); color: var(--sig-gelb); }
.w-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.w-warn { color: var(--sig-orange); font-weight: 600; }
.w-knopf { justify-self: start; height: 40px; padding: 0 16px; font-size: 14px; }
.w-stand { font-size: 12px; }
/* Kleine Kachel: Zahlen statt Beschreibung, so groß wie die übrigen Kacheln */
.tile-info { display: block; min-width: 0; }
.w-klein { display: grid; gap: 5px; min-width: 0; }
.w-z1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-z2 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.w-z2 .w-chip { font-size: 12px; padding: 2px 8px; }
/* Anordnen */
.anordnen-hilfe { font-size: 14px; margin-top: -8px; }
.widget-schieb { display: flex; justify-content: flex-end; gap: 6px; padding: 8px 8px 4px; }
.widget-schieb button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); display: grid; place-items: center; font-size: 15px; line-height: 1; }
.widget-schieb button:hover { border-color: var(--brand); color: var(--brand); }
.tiles.anordnen .widget { cursor: grab; touch-action: none; user-select: none; border-radius: var(--radius); outline: 2px dashed var(--line); outline-offset: 3px; }
.tiles.anordnen .widget > .tile, .tiles.anordnen .widget-inhalt { pointer-events: none; }
.tiles.anordnen .widget.zieht { cursor: grabbing; opacity: .65; outline-color: var(--brand); }
.anordnen-meldung { font-size: 13px; }
