/* ───────────────────────── Filmset – Produktion ─────────────────────────
   Ruhig und sachlich wie eine Dispo: Graphit, Weiss, feine Linien.
   Ein einziger Akzent (Stahlblau) für Links und Fokus.
   Geist für die Oberfläche, Courier nur für Szenenköpfe wie im Drehbuch. */

@font-face { font-family: "Geist"; src: url("fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; src: url("fonts/geist-ext.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02AF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Courier Prime"; src: url("fonts/courierprime-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("fonts/courierprime-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --graphite: #1a2230;
  --graphite-2: #242e3d;
  --graphite-line: rgba(255,255,255,.08);
  --bg: #f5f6f8;
  --surface: #ffffff;
  --line: #e3e6eb;
  --line-strong: #cfd4dc;
  --text: #161b24;
  --text-2: #3b4452;
  --muted: #6a7381;
  --accent: #2b5c8a;
  --accent-soft: #eaf0f6;
  --danger: #b3261e;
  --ok: #1e7a52;
  --warn: #a15c07;

  --ui: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --script: "Courier Prime", "Courier New", Courier, monospace;

  --r: 6px;
  --r-l: 8px;
  --side: 240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--ui); font-size: 15px; line-height: 1.5;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-feature-settings: "ss01";
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.015em; }
h1 { font-size: 1.6rem; letter-spacing: -.025em; }
.h3, h2.h3 { font-size: .95rem; font-weight: 600; letter-spacing: -.005em; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); color: var(--text); padding: 8px 12px; z-index: 100; border-radius: var(--r); }
.skip:focus { left: 8px; }
.late { color: var(--danger); font-weight: 500; }
.top-gap { margin-top: 14px; }
.top-space { margin-top: 28px; }

/* ───────── Gerüst ───────── */
.app { display: flex; min-height: 100vh; }
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side); z-index: 40;
  background: var(--graphite); color: #c9d0da; display: flex; flex-direction: column;
  overflow-y: auto; overscroll-behavior: contain;
}
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 14px 12px 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; min-width: 0; }
.brand:hover { text-decoration: none; }
.mark {
  flex: none; width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center;
  background: #fff; color: var(--graphite); font-weight: 700; font-size: .95rem;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: .95rem; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: #8893a3; font-size: .75rem; }
.side-close { display: none; }
.side-search { padding: 4px 12px 8px; }
.side-search input {
  width: 100%; background: var(--graphite-2); border: 1px solid transparent; color: #fff; border-radius: var(--r);
  padding: 7px 10px; font: inherit; font-size: .85rem;
}
.side-search input::placeholder { color: #7c8797; }
.side-search input:focus { border-color: #4b5a70; outline: none; box-shadow: none; background: var(--graphite-2); }
.nav { padding: 2px 8px 16px; flex: 1; }
.nav a, .side-foot a, .side-foot .link {
  display: block; padding: 6px 10px; border-radius: var(--r); color: #b9c1cc; font-size: .9rem;
}
.nav a:hover, .side-foot a:hover, .side-foot .link:hover { background: rgba(255,255,255,.05); color: #fff; text-decoration: none; }
.nav a.on, .side-foot a.on { background: rgba(255,255,255,.1); color: #fff; font-weight: 500; }
.nav-group { margin-top: 16px; }
.nav-title { display: block; padding: 0 10px 4px; font-size: .75rem; color: #737e8e; }
.side-foot { border-top: 1px solid var(--graphite-line); padding: 10px 8px 16px; }
.side-foot form { margin: 0; }
.link { background: none; border: 0; font: inherit; cursor: pointer; text-align: left; width: 100%; }

.main-wrap { flex: 1; margin-left: var(--side); min-width: 0; }
.topbar { display: none; }
.main { max-width: 1200px; padding: 30px clamp(16px, 3vw, 40px) 80px; margin: 0 auto; }
.scrim { display: none; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.intro { color: var(--muted); max-width: 70ch; margin: 4px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs { margin: 0 0 6px; font-size: .85rem; }
.crumbs a { color: var(--muted); }
.crumbs a::before { content: "‹ "; }

/* ───────── Buttons ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: .875rem; font-weight: 500; line-height: 1.2;
  padding: 8px 14px; border-radius: var(--r); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: #f3f4f6; text-decoration: none; color: var(--text); }
.btn-primary { background: var(--graphite); border-color: var(--graphite); color: #fff; }
.btn-primary:hover { background: #2c3749; border-color: #2c3749; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: #eceef1; }
.btn-danger { color: var(--danger); border-color: #e9c5c2; background: var(--surface); }
.btn-danger:hover { background: #fcf1f0; color: var(--danger); }
.btn-small { padding: 5px 10px; font-size: .8rem; }
.btn-block { width: 100%; padding: 10px; }
.icon-btn { background: none; border: 0; color: inherit; padding: 8px; cursor: pointer; border-radius: var(--r); font-size: 1rem; line-height: 1; }

/* ───────── Flächen ───────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 20px; margin-bottom: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.card-head a { font-size: .85rem; }
.flash { padding: 10px 14px; border-radius: var(--r); margin-bottom: 14px; border: 1px solid #bfe0cf; background: #f0f8f4; color: #134e35; font-size: .9rem; }
.flash-err { border-color: #efc7c3; background: #fdf3f2; color: #7d1a14; }

/* ───────── Formulare ───────── */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .field .label, .label { font-size: .8rem; font-weight: 500; color: var(--text-2); }
.req { color: var(--danger); }
input, select, textarea {
  font: inherit; font-size: .95rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r); padding: 8px 10px; width: 100%; min-width: 0;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(43,92,138,.12); }
input[type="color"] { padding: 3px; height: 38px; width: 70px; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--graphite); flex: none; margin: 2px 0 0; }
.help { color: var(--muted); font-size: .78rem; }
.affix { display: flex; }
.affix span { padding: 8px 10px; background: #f3f4f6; border: 1px solid var(--line-strong); border-right: 0; border-radius: var(--r) 0 0 var(--r); font-size: .85rem; color: var(--muted); }
.affix input { border-radius: 0 var(--r) var(--r) 0; }
.check { display: flex; gap: 9px; align-items: flex-start; cursor: pointer; font-size: .9rem; }
.check.disabled { opacity: .5; cursor: not-allowed; }
.check.strong { font-weight: 500; margin-bottom: 12px; }
.field-check { justify-content: flex-end; padding-bottom: 9px; }
.grid-form { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px 18px; }
.w-s { grid-column: span 2; } .w-m { grid-column: span 3; } .w-l { grid-column: span 6; }
.form-card { padding: 24px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-l { display: flex; flex-direction: column; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; padding: 0; margin-bottom: 10px; font-size: .95rem; }
.files-edit { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }

.multi { border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); }
.multi-filter { border: 0; border-bottom: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0; }
.multi-filter:focus { box-shadow: none; }
.multi-list { max-height: 240px; overflow-y: auto; padding: 8px 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; }
.multi-list.tall { max-height: 360px; grid-template-columns: 1fr; }
.multi-list p { grid-column: 1 / -1; margin: 4px 0; }

.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 1px dashed var(--line-strong); border-radius: var(--r-l); padding: 24px 16px; text-align: center; cursor: pointer;
  background: #fafbfc; transition: border-color .12s, background .12s; margin-bottom: 6px; font-size: .9rem; color: var(--text-2);
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-compact { padding: 14px; }
.dz-list { font-size: .8rem; }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-bottom: 14px; }
.thumb-edit { display: flex; flex-direction: column; gap: 6px; font-size: .78rem; border: 1px solid var(--line); border-radius: var(--r); padding: 6px; }
.thumb-edit img { aspect-ratio: 4/3; object-fit: cover; border-radius: 4px; width: 100%; }
.thumb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.thumb-edit .doc-badge { aspect-ratio: 4/3; width: 100%; height: auto; }

/* ───────── Toolbar, Filter, Tabs ───────── */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 16px; }
.tb-search { flex: 1 1 240px; max-width: 340px; margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 4px; }
.pill { display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; border-radius: var(--r); color: var(--text-2); font-size: .85rem; border: 1px solid transparent; }
.pill:hover { background: #eceef1; text-decoration: none; }
.pill span { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.pill.on { background: var(--surface); border-color: var(--line-strong); color: var(--text); font-weight: 500; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; margin-left: auto; background: var(--surface); }
.seg a { padding: 5px 11px; font-size: .8rem; color: var(--muted); }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg a.on { background: #eef0f3; color: var(--text); font-weight: 500; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); border-bottom-color: var(--graphite); font-weight: 500; }

/* ───────── Tabellen ───────── */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: .9rem; }
.list th { text-align: left; font-weight: 500; font-size: .78rem; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.list td { padding: 10px 14px; border-bottom: 1px solid #eef0f3; vertical-align: top; }
.list tbody tr:last-child td { border-bottom: 0; }
.list tbody tr { position: relative; }
.list tbody tr:hover { background: #fafbfc; }
.row-link { font-weight: 500; color: var(--text); }
.row-link::after { content: ""; position: absolute; inset: 0; }
.list td a:not(.row-link) { position: relative; z-index: 1; }
.td-files { text-align: right; font-size: .78rem; white-space: nowrap; }
.th-files { width: 1%; }

/* ───────── Status ───────── */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px 1px 7px; border-radius: 4px; font-size: .78rem; font-weight: 500; white-space: nowrap; background: #f1f2f4; color: var(--text-2); border: 1px solid #e6e8ec; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c, #9aa3af); }
.tone-1 { --c: #9aa3af; } .tone-2 { --c: #2b5c8a; } .tone-3 { --c: #1e7a52; }
.tone-4 { --c: #c28a12; } .tone-5 { --c: #6d4c9f; } .tone-6 { --c: #b3261e; }
.tone-bg-1 { background: #c3c9d1; } .tone-bg-2 { background: #2b5c8a; } .tone-bg-3 { background: #1e7a52; }
.tone-bg-4 { background: #c28a12; } .tone-bg-5 { background: #6d4c9f; } .tone-bg-6 { background: #b3261e; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 4px; background: #f1f2f4; border: 1px solid #e6e8ec; color: var(--text); font-size: .85rem; }
a.chip:hover { border-color: var(--line-strong); text-decoration: none; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 4px; background: #f1f2f4; color: var(--text-2); font-size: .78rem; font-variant-numeric: tabular-nums; }
.tag-warn { background: #fdf4e7; color: var(--warn); }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 4px; vertical-align: middle; border: 1px solid rgba(0,0,0,.1); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

/* Drehbuch-Konvention */
.slug { font-family: var(--script); font-weight: 700; font-size: 1rem; margin: -12px 0 20px; color: var(--text-2); }
.slug-sm { font-family: var(--script); font-weight: 700; font-size: .88rem; }

/* ───────── Kacheln ───────── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.cards-group { grid-column: 1 / -1; font-size: .9rem; font-weight: 600; margin: 14px 0 -4px; color: var(--text-2); }
.cards-group:first-child { margin-top: 0; }
.tile { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; color: var(--text); }
.tile:hover { border-color: var(--line-strong); text-decoration: none; box-shadow: 0 4px 14px -8px rgba(22,27,36,.25); }
.tile-img { aspect-ratio: 16/9; background: #eef0f3; display: block; overflow: hidden; border-bottom: 1px solid var(--line); }
.tile-img img { width: 100%; height: 100%; object-fit: cover; }
.tile-ph { display: flex; height: 100%; align-items: center; justify-content: center; color: #9aa3af; font-size: .8rem; }
.tile-body { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 6px; }
.tile-body strong { font-weight: 500; }
.tile-sub { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .8rem; color: var(--muted); }

/* ───────── Detailansicht ───────── */
.view-grid { display: grid; gap: 18px; }
.view-grid.has-media { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: start; }
.view-grid > .card { margin: 0; }
.details { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; }
.d-row { min-width: 0; }
.d-wide { grid-column: 1 / -1; }
.details dt { font-size: .78rem; color: var(--muted); margin-bottom: 2px; }
.details dd { margin: 0; overflow-wrap: anywhere; }
.prose { line-height: 1.6; }
.meta { margin: 18px 0 0; font-size: .78rem; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gallery a { display: block; border-radius: var(--r); overflow: hidden; background: #eef0f3; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.gallery a:hover img { opacity: .92; }
.gallery .g-first { grid-column: 1 / -1; }
.gallery .g-first img { aspect-ratio: 16/10; }
#dateien { margin-top: 18px; }
.doc-list { list-style: none; padding: 0; margin: 0 0 14px; }
.doc-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #eef0f3; flex-wrap: wrap; }
.doc-list li a:first-of-type { flex: 1; min-width: 150px; font-weight: 500; }
.doc-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 26px; padding: 0 6px; border-radius: 4px; background: #eef0f3; color: var(--text-2); font-size: .68rem; font-weight: 600; border: 1px solid var(--line); }
.upload-inline { margin: 0; }
.share-box { margin-top: 20px; padding: 12px 14px; border-radius: var(--r); background: #f7f8fa; border: 1px solid var(--line); }
.copy-row { display: flex; gap: 8px; margin-top: 6px; }
.copy-row input { font-size: .82rem; }
.related { margin: 26px 0 0; }
.rel-list { display: flex; flex-wrap: wrap; gap: 8px; }
.rel-item { display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); color: var(--text); font-size: .88rem; }
.rel-item img { width: 40px; height: 30px; object-fit: cover; border-radius: 3px; margin-left: -6px; }
.rel-item:hover { border-color: var(--line-strong); text-decoration: none; }
.danger-zone { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); }
.empty { text-align: center; padding: 52px 20px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-l); color: var(--muted); }

/* ───────── Übersicht ───────── */
.next-day { display: grid; grid-template-columns: minmax(0, 1fr) auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); margin-bottom: 18px; overflow: hidden; }
.nd-main { padding: 22px 24px; border-left: 3px solid var(--graphite); }
.nd-label { color: var(--muted); font-size: .85rem; margin: 0 0 4px; }
.nd-date { font-size: 1.55rem; font-weight: 600; letter-spacing: -.025em; margin: 0 0 4px; }
.nd-place { color: var(--text-2); margin: 0 0 16px; }
.nd-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.nd-facts { display: grid; grid-template-columns: repeat(5, auto); margin: 0; border-left: 1px solid var(--line); background: #fafbfc; }
.nd-facts > div { padding: 22px 22px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 92px; }
.nd-facts > div:last-child { border-right: 0; }
.nd-facts dt { font-size: .78rem; color: var(--muted); }
.nd-facts dd { margin: 0; font-size: 1.45rem; font-weight: 600; letter-spacing: -.02em; }
.nd-facts dd small { font-size: .78rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.nd-call dd { color: var(--accent); }
.dash-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.day-list { list-style: none; margin: 4px 0 10px; padding: 0; }
.day-list a { display: grid; grid-template-columns: 8.5em 1fr auto; gap: 10px; padding: 8px 0; border-bottom: 1px solid #eef0f3; color: var(--text); }
.day-list a:hover { text-decoration: none; }
.day-list a:hover span:nth-child(2) { color: var(--accent); }
.day-date { font-weight: 500; font-variant-numeric: tabular-nums; }
.big-stat { color: var(--muted); margin-bottom: 10px; }
.big-stat strong { font-size: 1.6rem; color: var(--text); margin-right: 4px; font-weight: 600; letter-spacing: -.02em; }
.stack-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; background: #eef0f3; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 10px 0 0; color: var(--muted); font-size: .8rem; }
.meter { height: 8px; border-radius: 4px; background: #eef0f3; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--graphite); }
.meter span.over { background: var(--danger); }
.task-list { list-style: none; padding: 0; margin: 0; }
.task-list li { display: flex; flex-direction: column; padding: 7px 0; border-bottom: 1px solid #eef0f3; }
.task-list li:last-child { border-bottom: 0; }
.task-list a { color: var(--text); font-weight: 500; }
.quick { margin-top: 6px; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.quick-grid a { display: flex; flex-direction: column; padding: 14px 16px; color: var(--muted); font-size: .8rem; border-right: 1px solid #eef0f3; border-bottom: 1px solid #eef0f3; margin: 0 -1px -1px 0; }
.quick-grid a:hover { background: #fafbfc; text-decoration: none; }
.quick-grid strong { font-size: 1.3rem; color: var(--text); font-weight: 600; }

/* ───────── Budget ───────── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpis > div { display: flex; flex-direction: column; gap: 2px; }
.kpis strong { font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; }
.kpis .neg strong { color: var(--danger); }
.kpis .pos strong { color: var(--ok); }
.cat-bars { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.cat-row { display: grid; grid-template-columns: minmax(120px, 13em) 1fr auto; gap: 12px; align-items: center; font-size: .85rem; }
.cat-track { position: relative; height: 14px; }
.bar-plan, .bar-real { position: absolute; left: 0; border-radius: 2px; }
.bar-plan { top: 0; height: 14px; background: #e6e9ee; }
.bar-real { top: 4px; height: 6px; background: var(--graphite); }
.bar-real.over { background: var(--danger); }
.cat-val { color: var(--muted); white-space: nowrap; }
.lg { display: inline-block; width: 14px; height: 8px; border-radius: 2px; margin-right: -8px; }
.lg-plan { background: #e6e9ee; } .lg-real { background: var(--graphite); }

/* ───────── Team informieren ───────── */
.day-pick { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.day-pick select { width: auto; min-width: 280px; }
.send-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.send-panel { position: sticky; top: 20px; margin: 0; }
.send-panel .field { margin-bottom: 12px; }
.recips { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); }
.recips-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fafbfc; border-radius: var(--r-l) var(--r-l) 0 0; font-size: .9rem; flex-wrap: wrap; }
.recip { padding: 14px 16px; border-bottom: 1px solid #eef0f3; display: grid; gap: 8px; }
.recip:last-child { border-bottom: 0; }
.recip.no-mail .recip-name strong { color: var(--text-2); }
.recip-main { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.recip-name { display: flex; flex-direction: column; }
.recip-name .muted { font-size: .82rem; }
.recip-call strong { font-size: 1.05rem; }
.recip-meta { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 25px; }
.recip-preview, .recip-actions, .recip-tasks { margin-left: 25px; }
.recip-preview summary { cursor: pointer; font-size: .85rem; color: var(--accent); width: max-content; }
.mail-preview { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; max-height: 560px; overflow-y: auto; }
.recip-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-left: 17px; align-items: center; }
.recip-tasks { margin-top: 0; margin-bottom: 0; padding-left: 16px; font-size: .9rem; }
.msg-grid { margin-bottom: 20px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 18px; align-items: start; }
.msg-grid .card { margin: 0; }
.msg-grid .card .field { margin-bottom: 14px; }
.team-picks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pill-check { position: relative; cursor: pointer; }
.pill-check input { position: absolute; opacity: 0; }
.pill-check span { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: var(--r); border: 1px solid var(--line-strong); font-size: .85rem; background: var(--surface); }
.pill-check small { color: var(--muted); margin-left: 6px; }
.pill-check input:checked + span { background: var(--graphite); color: #fff; border-color: var(--graphite); }
.pill-check input:checked + span small { color: #aeb6c2; }
.pill-check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.msg-history { list-style: none; padding: 0; margin: 0; }
.msg-history li { border-bottom: 1px solid #eef0f3; padding: 9px 0; }
.msg-history li:last-child { border-bottom: 0; }
.msg-history summary { cursor: pointer; }

/* ───────── Einstellungen ───────── */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.user-list { list-style: none; padding: 0; margin: 0 0 14px; }
.user-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #eef0f3; }
.user-list form { margin: 0; }
details > summary.btn { list-style: none; }
details > summary.btn::-webkit-details-marker { display: none; }

/* ───────── Login & Einrichtung ───────── */
.login-body { min-height: 100vh; background: var(--bg); display: flex; }
.login { margin: auto; width: 100%; max-width: 400px; padding: 24px 16px; }
.login.install { max-width: 540px; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: 0 12px 32px -18px rgba(22,27,36,.25); }
.login-inner { padding: 30px 30px 32px; }
.login-kicker { color: var(--muted); margin: 0 0 4px; font-size: .85rem; }
.login h1 { font-size: 1.5rem; margin-bottom: 22px; }
.checks { list-style: none; padding: 12px 14px; margin: 0 0 20px; background: #f7f8fa; border: 1px solid var(--line); border-radius: var(--r); font-size: .82rem; columns: 2; column-gap: 20px; }
.checks li { break-inside: avoid; padding: 2px 0; }
.checks .ok { color: var(--ok); } .checks .bad { color: var(--danger); font-weight: 600; } .checks .warn { color: var(--muted); }

/* ───────── Lightbox ───────── */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(12,15,20,.95); display: flex; align-items: center; justify-content: center; padding: 50px 60px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox button { position: absolute; background: rgba(255,255,255,.08); color: #fff; border: 0; width: 42px; height: 42px; border-radius: 50%; font-size: 1.3rem; cursor: pointer; }
.lightbox button:hover { background: rgba(255,255,255,.16); }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
.lb-cap { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; color: #aeb6c2; font-size: .8rem; margin: 0; }

/* ───────── Tagesdispo ───────── */
.sheet-body { background: #e9ecf0; }
.sheet-tools { max-width: 880px; margin: 20px auto 0; display: flex; gap: 8px; justify-content: flex-end; padding: 0 16px; flex-wrap: wrap; }
.sheet { max-width: 880px; margin: 14px auto 40px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; padding-bottom: 20px; }
.sheet > section, .sheet-foot { padding: 0 32px; margin-top: 24px; }
.sheet h2 { font-size: .8rem; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--text); padding-bottom: 5px; margin-bottom: 10px; letter-spacing: 0; }
.sheet h2 .muted { font-weight: 400; }
.sheet-head { background: var(--graphite); color: #fff; }
.sheet-title { display: flex; justify-content: space-between; gap: 20px; padding: 24px 32px; flex-wrap: wrap; }
.sheet-film { color: #9aa4b2; margin: 0; font-size: .85rem; }
.sheet-title h1 { font-size: 1.5rem; margin: 2px 0 2px; }
.sheet-date { font-weight: 500; margin: 0; color: #dfe3e9; }
.sheet-times { display: grid; grid-template-columns: repeat(4, auto); gap: 0; margin: 0; align-self: flex-end; }
.sheet-times div { padding: 2px 16px; border-left: 1px solid rgba(255,255,255,.14); }
.sheet-times dt { font-size: .75rem; color: #9aa4b2; }
.sheet-times dd { margin: 0; font-weight: 600; font-size: 1.25rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.sheet-times .call dd { font-size: 1.5rem; }
.sheet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.sheet-grid ul { padding-left: 18px; margin: 0; }
.sheet-emergency p { font-weight: 500; }
.pre { white-space: normal; }
.sheet-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.sheet-table th, .sheet-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #eef0f3; vertical-align: top; }
.sheet-table thead th { font-size: .75rem; color: var(--muted); font-weight: 500; }
.sheet-table.script td strong { font-family: var(--script); }
.sheet-table .sc-nr { font-weight: 600; width: 3em; font-variant-numeric: tabular-nums; }
.sc-desc { color: var(--muted); font-size: .85rem; }
.team-row th { background: #f5f6f8; font-size: .8rem; font-weight: 600; padding-top: 8px; }
.sheet-foot { font-size: .78rem; }

/* ───────── Responsive ───────── */
@media (max-width: 1080px) {
  .view-grid.has-media, .msg-grid, .settings-grid, .send-layout { grid-template-columns: 1fr; }
  .view-grid.has-media .media { order: -1; }
  .send-panel { position: static; }
  .next-day { grid-template-columns: 1fr; }
  .nd-facts { border-left: 0; border-top: 1px solid var(--line); grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 900px) {
  .side { transform: translateX(-100%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; width: min(84vw, 290px); }
  .nav-open .side { transform: none; visibility: visible; transition: transform .22s ease; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(12,15,20,.4); z-index: 30; }
  .side-close { display: block; color: #fff; }
  .main-wrap { margin-left: 0; }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 20; background: var(--graphite); color: #fff; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); }
  .topbar-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .main { padding-top: 22px; }
  .dash-cols { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid-form { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .w-s { grid-column: span 1; } .w-m, .w-l { grid-column: span 2; }
  .card, .form-card { padding: 16px; }
  .seg { margin-left: 0; }
  .tb-search { max-width: none; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn-primary { flex: 1; }
  .table-wrap { background: transparent; border: 0; overflow: visible; }
  table.list, .list tbody, .list tr, .list td { display: block; }
  .list thead { display: none; }
  .list tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); margin-bottom: 8px; padding: 10px 14px; }
  .list td { border: 0; padding: 3px 0; display: flex; gap: 10px; }
  .list td:empty { display: none; }
  .list td::before { content: attr(data-label); flex: 0 0 38%; color: var(--muted); font-size: .78rem; padding-top: 2px; }
  .list td:first-child { font-size: 1rem; padding-bottom: 6px; }
  .list td:first-child::before { display: none; }
  .td-files { justify-content: flex-start; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile-body { padding: 9px 10px 11px; }
  .day-list a { grid-template-columns: 1fr auto; }
  .day-list a span:nth-child(2) { grid-column: 1 / -1; grid-row: 2; color: var(--muted); }
  .cat-row { grid-template-columns: 1fr auto; }
  .cat-track { grid-column: 1 / -1; grid-row: 2; }
  .nd-main { padding: 18px; }
  .nd-facts { grid-template-columns: repeat(3, 1fr); }
  .nd-facts > div { padding: 12px 14px; border-bottom: 1px solid var(--line); min-width: 0; }
  .nd-facts dd { font-size: 1.2rem; }
  .day-pick select { min-width: 0; width: 100%; }
  .recip-meta, .recip-preview, .recip-tasks { margin-left: 0; padding-left: 0; }
  .recip-tasks { padding-left: 16px; }
  .recip-actions { margin-left: -8px; }
  .checks { columns: 1; }
  .sheet > section, .sheet-foot { padding: 0 16px; }
  .sheet-title { padding: 18px 16px; }
  .sheet-times { grid-template-columns: repeat(2, 1fr); width: 100%; }
  .sheet-times div { padding: 6px 0; border: 0; }
  .lightbox { padding: 50px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  @page { margin: 12mm; }
  body, .sheet-body { background: #fff; font-size: 10.5pt; }
  .no-print, .sheet-tools { display: none !important; }
  .sheet { border: 0; margin: 0; max-width: none; border-radius: 0; }
  .sheet-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sheet > section, .sheet-foot { padding: 0; }
  .sheet-title { padding: 14px 16px; }
  .sheet-table tr { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
