/* ============================================================
   Bautagebuch – Design System
   Ruhig & hochwertig · Blau-Akzent · Source-Familie
   Light/Dark via prefers-color-scheme
   Siehe DESIGN.md für die verbindlichen Tokens.
   ============================================================ */

/* ── Schriften (lokal, woff2) ───────────────────────────── */
@font-face {
  font-family: "Source Sans 3"; font-style: normal; font-weight: 400;
  font-display: swap; src: url("/static/fonts/source-sans-3-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3"; font-style: italic; font-weight: 400;
  font-display: swap; src: url("/static/fonts/source-sans-3-latin-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3"; font-style: normal; font-weight: 600;
  font-display: swap; src: url("/static/fonts/source-sans-3-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Source Code Pro"; font-style: normal; font-weight: 400;
  font-display: swap; src: url("/static/fonts/source-code-pro-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Source Code Pro"; font-style: normal; font-weight: 500;
  font-display: swap; src: url("/static/fonts/source-code-pro-latin-500-normal.woff2") format("woff2");
}

:root {
  /* Flächen */
  --bg:            #f4f6f8;
  --surface:       #ffffff;
  --surface-2:     #eceff3;
  --border:        #e4e7ec;
  --border-strong: #d2d7de;

  /* Text */
  --ink:   #1a1f26;
  --ink-2: #545b65;
  --ink-3: #87909b;

  /* Sidebar (tiefes Navy-Slate) */
  --side-bg:    #16202e;
  --side-ink:   #e8ecf2;
  --side-ink-2: rgba(232,236,242,.60);
  --side-hover: rgba(255,255,255,.06);
  --side-active:rgba(120,170,230,.18);

  /* Akzent: tiefes, ruhiges Blau */
  --accent:        #2e6fb8;
  --accent-ink:    #ffffff;
  --accent-strong: #1f5a9e;
  --accent-quiet:  #e7f0fa;
  --accent-line:   #bbd5ee;
  --link:          #1f5a9e;

  --danger: #c0392b;

  /* Status (Lebenszyklus) */
  --st-offen-bg:#fbece9;          --st-offen-ink:#a8412f;          --st-offen-dot:#c0493a;
  --st-kommuniziert-bg:#eef0f3;   --st-kommuniziert-ink:#4b5563;   --st-kommuniziert-dot:#8b95a3;
  --st-zugesagt-bg:#e7f0fa;       --st-zugesagt-ink:#1f5a9e;       --st-zugesagt-dot:#2e6fb8;
  --st-abgeschlossen-bg:#e8f1ea;  --st-abgeschlossen-ink:#2f6b43;  --st-abgeschlossen-dot:#3c7a4e;

  /* Kategorie-Punkte */
  --cat-mangel:#c0493a; --cat-verzoegerung:#c08a2a; --cat-aenderung:#6d5bc2;
  --cat-lieferung:#2f8f9a; --cat-fortschritt:#3c7a4e; --cat-notiz:#8b95a3;

  --radius:    12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --shadow:    0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.05);
  --shadow-md: 0 6px 20px rgba(16,24,40,.10);

  --font-sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Source Code Pro", ui-monospace, "SF Mono", Menlo, monospace;

  --ease: cubic-bezier(.22,1,.36,1);

  /* z-index-Skala */
  --z-sticky: 10;
  --z-overlay: 100;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:            #11161c;
    --surface:       #1a212a;
    --surface-2:     #222b36;
    --border:        #2a333f;
    --border-strong: #38434f;

    --ink:   #e6e9ed;
    --ink-2: #aeb6c0;
    --ink-3: #828b96;

    --side-bg:    #0d141c;
    --side-ink:   #e6e9ed;
    --side-ink-2: rgba(230,233,237,.55);
    --side-hover: rgba(255,255,255,.05);
    --side-active:rgba(120,170,230,.20);

    --accent:        #3d82ce;
    --accent-ink:    #08121e;
    --accent-strong: #6fa8e0;
    --accent-quiet:  #16263a;
    --accent-line:   #2e486a;
    --link:          #6fa8e0;

    --danger: #e0695c;

    --st-offen-bg:#2e1a16;          --st-offen-ink:#e59182;          --st-offen-dot:#d9745f;
    --st-kommuniziert-bg:#232b36;   --st-kommuniziert-ink:#aeb6c0;   --st-kommuniziert-dot:#6b7585;
    --st-zugesagt-bg:#14263b;       --st-zugesagt-ink:#7fb1e6;       --st-zugesagt-dot:#3d82ce;
    --st-abgeschlossen-bg:#14271b;  --st-abgeschlossen-ink:#82c295;  --st-abgeschlossen-dot:#4e9a66;

    --cat-mangel:#d9745f; --cat-verzoegerung:#d6a24a; --cat-aenderung:#9183da;
    --cat-lieferung:#4fa9b4; --cat-fortschritt:#5fa876; --cat-notiz:#828b96;

    --shadow:    0 1px 2px rgba(0,0,0,.3);
    --shadow-md: 0 8px 24px rgba(0,0,0,.45);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 15px;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

code, .mono { font-family: var(--font-mono); }

/* ── Layout ─────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

nav {
  width: 240px; flex-shrink: 0;
  background: var(--side-bg); color: var(--side-ink);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}

.brand { padding: 20px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-eyebrow {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--side-ink-2); margin-bottom: 5px;
}
.brand-eyebrow svg { width: 14px; height: 14px; }
.brand-project { font-size: 16px; font-weight: 600; color: var(--side-ink); line-height: 1.3; }

.nav-links { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-links a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--side-ink-2); font-size: 14px; font-weight: 500; min-height: 40px;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.nav-links a svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-links a:hover { background: var(--side-hover); color: var(--side-ink); text-decoration: none; }
.nav-links a.active { background: var(--side-active); color: #fff; }

.nav-dates { margin-top: 6px; padding: 12px 10px; border-top: 1px solid rgba(255,255,255,.07); }
.nav-dates-label {
  font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--side-ink-2); padding: 0 11px 8px;
}
.date-list { list-style: none; display: flex; flex-direction: column; gap: 1px; }
.date-list a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 11px; border-radius: var(--radius-sm);
  color: var(--side-ink-2); font-size: 13px; font-weight: 500; min-height: 40px;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.date-list a:hover { background: var(--side-hover); color: var(--side-ink); text-decoration: none; }
.date-list a.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.date-count { background: rgba(255,255,255,.16); border-radius: var(--radius-pill); padding: 1px 8px; font-size: 11px; font-weight: 600; }
.date-list a.active .date-count { background: rgba(0,0,0,.18); }

.date-jump { display: flex; gap: 6px; padding: 4px 11px 12px; }
.date-jump input[type=date] {
  flex: 1; min-width: 0; padding: 7px 9px; font-size: 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font-family: inherit;
}
.date-jump button {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  padding: 0 11px; border: none; border-radius: var(--radius-sm); cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
}
.date-jump button svg { width: 16px; height: 16px; }
.date-jump button:active { transform: scale(.96); }

.month-group { border-radius: var(--radius-sm); }
.month-group > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 11px; border-radius: var(--radius-sm);
  color: var(--side-ink-2); font-size: 13px; font-weight: 500; min-height: 40px;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.month-group > summary::-webkit-details-marker { display: none; }
.month-group > summary > span:first-child { flex: 1; }
.month-group > summary::after {
  content: ""; width: 6px; height: 6px; flex-shrink: 0;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s var(--ease);
}
.month-group[open] > summary::after { transform: rotate(45deg); }
.month-group > summary:hover { background: var(--side-hover); color: var(--side-ink); }
.month-group[open] > summary { color: var(--side-ink); }
.month-group .date-list { padding: 2px 0 6px; }

.nav-foot { margin-top: auto; padding: 12px 10px; border-top: 1px solid rgba(255,255,255,.07); }
.nav-foot a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--side-ink-2); font-size: 14px; font-weight: 500;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.nav-foot a svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-foot a:hover { background: var(--side-hover); color: var(--side-ink); text-decoration: none; }

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

/* ── Topbar ─────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.topbar h1 { font-size: 18px; font-weight: 600; line-height: 1.2; }
.topbar-sub { font-size: 13px; color: var(--ink-3); margin-top: 1px; }

.search-field {
  display: flex; align-items: center; gap: 7px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0 10px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-quiet); }
.search-field svg { width: 15px; height: 15px; color: var(--ink-3); flex-shrink: 0; }
.search-field input { border: none; background: none; padding: 8px 0; font-size: 13px; color: var(--ink); width: 150px; outline: none; }

.content { padding: 28px; max-width: 1000px; width: 100%; }
.page-title { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.page-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .count { font-size: 13px; color: var(--ink-3); }

/* ── Tagesselektor: Monatskalender ───────────────────────── */
.dayselect {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; margin-bottom: 36px;
}
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-title { font-size: 15px; font-weight: 600; }
.cal-nav {
  width: 34px; height: 34px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-2); font-size: 18px; line-height: 1;
}
.cal-nav:hover { border-color: var(--accent); color: var(--accent-strong); text-decoration: none; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd { text-align: center; font-size: 11px; font-weight: 600; color: var(--ink-3); padding-bottom: 4px; }
.cal-day {
  display: flex; align-items: center; justify-content: center; min-height: 38px;
  border-radius: var(--radius-sm); font-size: 13px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border);
}
.cal-day:hover { text-decoration: none; border-color: var(--accent); }
.cal-day.out { color: var(--ink-3); opacity: .4; background: transparent; border-color: transparent; }
.cal-day.has { font-weight: 700; background: var(--accent-quiet); border-color: var(--accent-line); color: var(--accent-strong); }
.cal-day.today { border-color: var(--ink-3); }
.cal-day.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.cal-legend { margin-top: 12px; font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.cal-legend-mark {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; padding: 0 5px; font-size: 12px; font-weight: 700;
  background: var(--accent-quiet); border: 1px solid var(--accent-line);
  color: var(--accent-strong); border-radius: var(--radius-sm);
}

/* ── Detailansicht des gewählten Tages ───────────────────── */
.daydetail { border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 22px 24px; background: transparent; }
.daydetail-head {
  display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap;
  padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--border-strong);
}
.daydetail-datum { font-size: 21px; font-weight: 600; line-height: 1.2; }
.inline-status { margin-top: 12px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); flex-wrap: wrap; }

/* ── Wetterleiste ───────────────────────────── */
.weather {
  display: flex; align-items: center; gap: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 18px; margin-bottom: 20px; flex-wrap: wrap;
}
.weather-lead { display: flex; align-items: center; gap: 12px; padding-right: 18px; }
.weather-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-quiet); border-radius: 50%; color: var(--accent);
}
.weather-icon svg { width: 22px; height: 22px; }
.weather-main { font-size: 14px; font-weight: 600; }
.weather-place { font-size: 12px; color: var(--ink-3); }
.weather-stats { display: flex; gap: 0; flex-wrap: wrap; }
.weather-stat { display: flex; flex-direction: column; padding: 0 18px; border-left: 1px solid var(--border); }
.weather-stat-label { font-size: 11px; color: var(--ink-3); }
.weather-stat-val { font-size: 14px; font-weight: 600; }

/* ── Karte (eine Sprache für Einträge UND Kategorie-Vorgänge) ── */
.day-section { display: flex; flex-direction: column; gap: 12px; }

.card,
.entry {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px;
}
.entry { transition: box-shadow .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease); }
.entry:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-1px); }
.entry.is-auto { border-style: dashed; }

.card-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }

.entry-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; flex-wrap: wrap; }
.entry-meta { font-size: 12px; color: var(--ink-3); }
.entry-meta.mono { font-family: var(--font-mono); font-size: 11.5px; }
.entry-corrected {
  margin-left: auto; font-size: 11px; font-weight: 600;
  color: var(--accent-strong); background: var(--accent-quiet);
  padding: 2px 8px; border-radius: var(--radius-pill);
}
.entry-text { font-size: 14px; line-height: 1.6; color: var(--ink); }
.entry-text.transcript { color: var(--ink-2); font-style: italic; }

.foto-thumb {
  display: block; width: 100%; max-height: 360px; object-fit: cover;
  border-radius: var(--radius-sm); margin-bottom: 10px; background: var(--surface-2);
}
.audio-player {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 10px 12px; margin-bottom: 10px;
}
.audio-player audio { width: 100%; height: 34px; }
.video-player { display: block; width: 100%; max-height: 420px; border-radius: var(--radius-sm); margin-bottom: 10px; background: #000; }

.entry-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { font-size: 12px; font-weight: 500; color: var(--link); background: var(--accent-quiet); padding: 2px 9px; border-radius: var(--radius-pill); }
.entry-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Kategorie-Badge (Punkt trägt die Farbe) ───────────────── */
.cat-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: var(--radius-pill);
  background: var(--surface-2); color: var(--ink-2);
}
/* Punktfarbe wird inline aus der (editierbaren) Kategorie-Farbe gesetzt. */
.cat-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; background: var(--cat-notiz); }

/* Medientyp als ruhige Meta-Angabe (Icon + Text), nicht farbig */
.type-meta { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-3); }
.type-meta svg { width: 14px; height: 14px; }

/* ── Status-Pille ─────────────────────────────────────────── */
/* Textfarbe (= Punkt) wird inline aus der editierbaren Status-Farbe gesetzt. */
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-pill);
  background: var(--surface-2); color: var(--ink-2);
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }

/* ── Buttons ──────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; min-height: 40px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  font-size: 14px; font-weight: 600; font-family: inherit;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .08s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); text-decoration: none; }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--ink); }
.btn-outline:hover { background: var(--surface-2); text-decoration: none; }
.btn-sm { padding: 6px 12px; min-height: 34px; font-size: 13px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 86%, black); text-decoration: none; }

.danger-box {
  border: 1px solid var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 16px;
}
.danger-box strong { color: var(--danger); }
.danger-box ul { margin: 8px 0 0 18px; font-size: 14px; line-height: 1.6; color: var(--ink); }
.delete-summary {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 16px;
}
.delete-summary img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.delete-actions { display: flex; gap: 10px; align-items: center; }

/* ── Filter-Chips ─────────────────────────────────────────── */
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 500; padding: 6px 13px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong); color: var(--ink-2); background: var(--surface);
}
.chip-link:hover { text-decoration: none; background: var(--surface-2); }
.chip-link.active { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chip-count { font-size: 11px; opacity: .8; }

/* ── Kategorien-Hub ───────────────────────────────────────── */
.kat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.kat-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; color: var(--ink);
  transition: box-shadow .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.kat-card:hover { text-decoration: none; box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-1px); }
.kat-card-head { display: flex; align-items: center; justify-content: space-between; }
.kat-card-arrow { width: 16px; height: 16px; color: var(--ink-3); }
.kat-card-num { font-size: 30px; font-weight: 600; line-height: 1; }
.kat-card-foot { font-size: 12px; }
.kat-card-clear { color: var(--ink-3); }

/* ── Betroffene Gewerke ───────────────────────────────────── */
.gewerke-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.gewerke-line .lbl { font-size: 12px; color: var(--ink-3); }
.gewerk-chip { font-size: 12px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--border); padding: 2px 9px; border-radius: var(--radius-pill); }

/* ── Eigenschaften-Block (beschriftet, unter dem Text) ────── */
.props { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.prop { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 13px; line-height: 1.5; }
.prop-label { flex-shrink: 0; width: 132px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.prop-val { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--ink); }
@media (max-width: 480px) {
  .prop { flex-direction: column; gap: 3px; }
  .prop-label { width: auto; }
}

/* ── Auswertung: Datentabelle mit Spaltenfiltern ──────────── */
.aw-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.aw-reset { font-size: 13px; font-weight: 500; color: var(--ink-2); background: none; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.aw-reset:hover { color: var(--accent-strong); }

.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.data-table th { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border-strong); background: var(--surface-2); position: relative; vertical-align: middle; }
.data-table thead th:first-child { border-top-left-radius: var(--radius); }
.data-table thead th:last-child { border-top-right-radius: var(--radius); }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table td.col-datum { white-space: nowrap; font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); }
.data-table .muted { color: var(--ink-3); }
.data-table .gewerk-chip { display: inline-block; margin: 1px 3px 1px 0; }
.aw-textlink { color: var(--ink); }
.aw-textlink:hover { color: var(--accent-strong); }

.th-inner { display: flex; align-items: center; gap: 6px; }
.th-inner > span { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.col-filter { position: relative; line-height: 0; }
.col-filter > summary { list-style: none; cursor: pointer; display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 6px; color: var(--ink-3); }
.col-filter > summary::-webkit-details-marker { display: none; }
.col-filter > summary:hover { background: var(--border); color: var(--ink); }
.col-filter[data-active="1"] > summary { color: var(--accent-strong); background: var(--accent-quiet); }
.col-filter > summary svg { width: 13px; height: 13px; }
.col-panel {
  position: absolute; top: 28px; left: 0; z-index: var(--z-overlay);
  min-width: 190px; max-height: 280px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md); padding: 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.col-filter.align-right .col-panel { left: auto; right: 0; }
.col-panel label {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 5px 7px;
  font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none;
  color: var(--ink); border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.col-panel label:hover { background: var(--surface-2); }
.col-panel label input { accent-color: var(--accent); margin: 0; flex-shrink: 0; }
.col-panel input[type=text] { width: 100%; min-height: 36px; }

.aw-empty { text-align: center; color: var(--ink-3); padding: 36px 20px; }

@media (max-width: 700px) {
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 8px 7px; }
  .col-panel { min-width: 160px; }
}

/* ── Einstellungen ────────────────────────────────────────── */
.cfg-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--border); }
.cfg-row:last-of-type { border-bottom: none; }
.cfg-row.inaktiv { opacity: .55; }
.cfg-row input[type=text] { width: auto; flex: 1; min-width: 140px; }
.cfg-row input[type=color] { width: 42px; min-width: 42px; height: 40px; padding: 2px; cursor: pointer; }
.cfg-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); font-weight: 500; white-space: nowrap; margin: 0; }
.cfg-check input { accent-color: var(--accent); margin: 0; }
.cfg-actions { display: flex; gap: 4px; align-items: center; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex-shrink: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--accent); color: var(--accent-strong); }
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.cfg-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border-strong); }
.cfg-add input[type=text] { width: auto; flex: 1; min-width: 160px; }

/* ── Mängel/Kategorie-Vorgang: Fuß mit Inline-Status ───────── */
.mass-line { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.mangel-foot {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
}
.status-form { display: flex; gap: 8px; align-items: center; }
.status-form select { width: auto; padding: 8px 10px; min-height: 40px; }
.foot-spacer { margin-left: auto; }

/* ── Maßnahmen-/Tag-Auswahl ───────────────────────────────── */
.check-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.check-pill {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
  padding: 8px 14px; font-size: 13px; cursor: pointer; user-select: none;
  background: var(--surface); color: var(--ink); min-height: 40px;
}
.check-pill:has(input:checked) { border-color: var(--accent); background: var(--accent-quiet); color: var(--accent-strong); }
.check-pill input { accent-color: var(--accent); margin: 0; }
.mangel-block { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 14px; }

/* ── Formulare ────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 160px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
input[type=text], input[type=password], input[type=date], input[type=number], input[type=file], textarea, select {
  width: 100%; padding: 10px 12px; min-height: 40px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit;
  background: var(--surface); color: var(--ink);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-quiet); }
input::placeholder { color: var(--ink-3); }
.help-text { font-size: 13px; color: var(--ink-3); margin: 6px 0 14px; }

.option-group { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 16px; }
.option-group legend { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0 6px; }
.radio-row { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--ink); margin-bottom: 8px; cursor: pointer; }
.radio-row:last-child { margin-bottom: 0; }
.radio-row input[type=radio] { margin-top: 3px; flex-shrink: 0; accent-color: var(--accent); }

/* ── Detail / Änderungshistorie ────────────────── */
.detail-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-3); margin-bottom: 16px; }
.hash-line { font-size: 12px; color: var(--ink-3); margin-top: 14px; word-break: break-all; }
.hash-line code { font-family: var(--font-mono); background: var(--surface-2); padding: 2px 6px; border-radius: 4px; }
.history { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.history-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.history-item { font-size: 13px; color: var(--ink-2); padding: 8px 12px; background: var(--surface-2); border-radius: var(--radius-sm); margin-bottom: 6px; }
.history-item time { color: var(--ink-3); font-weight: 600; margin-right: 8px; font-family: var(--font-mono); }

/* ── Day-Chips (Export) ─────────────────────── */
.chip-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; list-style: none; }
.chip { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 4px 12px; font-size: 13px; color: var(--ink-2); }
.chip span { color: var(--ink-3); }

/* ── Empty State ──────────────────────────── */
.empty { text-align: center; color: var(--ink-3); padding: 56px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty svg { width: 40px; height: 40px; color: var(--border-strong); }

/* ── Utilities ────────────────────────────── */
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--ink-2); margin-bottom: 16px; }
.back-link svg { width: 16px; height: 16px; }
.mt1 { margin-top: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Entrance Motion ───────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.entry, .weather, .card { animation: rise .4s var(--ease) both; }
.day-section .entry:nth-child(2) { animation-delay: .05s; }
.day-section .entry:nth-child(3) { animation-delay: .1s; }
.day-section .entry:nth-child(4) { animation-delay: .15s; }
.day-section .entry:nth-child(n+5) { animation-delay: .2s; }

/* ── Mobile ─────────────────────────────────── */
.menu-toggle { display: none; }

@media (max-width: 820px) {
  .layout { flex-direction: column; }
  nav {
    width: 100%; height: auto; position: static;
    flex-direction: row; flex-wrap: wrap; align-items: center; padding: 0 14px;
  }
  .brand { border-bottom: none; padding: 12px 4px; flex: 1; }
  .brand-project { font-size: 15px; }
  .nav-links { flex-direction: row; padding: 8px 0; gap: 2px; order: 3; width: 100%; overflow-x: auto; border-top: 1px solid rgba(255,255,255,.07); }
  .nav-links a { white-space: nowrap; }
  .nav-dates { order: 4; width: 100%; margin-top: 0; padding: 10px 0 12px; }
  .date-list { flex-direction: row; flex-wrap: wrap; }
  .nav-foot { margin-top: 0; order: 5; width: 100%; }
  .content { padding: 18px 16px; }
  .topbar { padding: 12px 16px; }
  .weather-stat:first-of-type { border-left: none; padding-left: 0; }
}

@media (max-width: 480px) {
  .weather-lead { width: 100%; padding-right: 0; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
  .weather-stat { padding: 0 14px 0 0; border-left: none; }
}

/* ── Login ──────────────────────────────────── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 380px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  padding: 36px 32px; text-align: center; animation: rise .4s var(--ease) both;
}
.login-logo {
  width: 52px; height: 52px; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-quiet); border-radius: 50%; color: var(--accent);
}
.login-logo svg { width: 26px; height: 26px; }
.login-card h1 { font-size: 24px; font-weight: 600; margin-bottom: 6px; }
.login-sub { font-size: 15px; color: var(--ink-2); margin-bottom: 26px; }
.login-error { background: var(--st-offen-bg); color: var(--st-offen-ink); font-size: 13px; padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 18px; }
.login-card form { text-align: left; }
.login-card .btn { width: 100%; margin-top: 10px; }

/* ── Reduced Motion ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
