/* DARU-Patrol · Leitstand. Anthrazit-Navigation, helle Arbeitsfläche, Petrol für Planung, DARU-Rot nur für Abweichungen. */
:root {
  --ink: #1d1d1b;
  --ink-2: #2a2c2b;
  --ink-3: #3a3d3c;
  --paper: #f4f6f6;
  --surface: #ffffff;
  --line: #e1e6e7;
  --line-2: #cfd7d8;
  --muted: #5d6869;
  --faint: #8c9798;
  --petrol: #008f9f;
  --petrol-600: #007886;
  --petrol-050: #e6f4f5;
  --petrol-100: #cbe9ec;
  --red: #db3c2e;
  --red-050: #fcebe9;
  --amber: #b47300;
  --amber-050: #fdf3df;
  --green: #2f8a4a;
  --green-050: #e5f3e9;
  --drive: #a6b0b1;
  --shadow: 0 1px 2px rgba(29, 29, 27, .05), 0 6px 20px -8px rgba(29, 29, 27, .12);
  --radius: 12px;
  --f-display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --f-body: "Noto Sans", Arial, Helvetica, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 14px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--petrol); outline-offset: 2px; }
.mono, .num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* Shell: Menü oben wie in SequriX (Symbol + Beschriftung), darunter Titelleiste mit Zurück-Pfeil */
.topnav { background: var(--ink); color: #fff; display: flex; align-items: center; gap: 24px; padding: 10px 24px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.logo svg { width: 38px; height: 38px; color: var(--petrol); flex: none; }
.logo .logo-cp { fill: #e8eceb; }
.logo .logo-dot { fill: var(--red); }
.logo-t { font: 600 26px/1 var(--f-display); letter-spacing: .02em; color: #fff; display: flex; flex-direction: column; white-space: nowrap; }
.logo-t b { font-weight: 700; }
.logo-t small { font: 500 11px/1.4 var(--f-body); letter-spacing: .06em; color: #aab4b4; text-transform: uppercase; margin-top: 2px; }
.menu { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.menu a { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 84px; padding: 4px 10px 6px; white-space: nowrap; text-decoration: none; color: #e3e8e8; font: 700 11px/1.1 var(--f-body); letter-spacing: .06em; text-transform: uppercase; text-align: center; border-bottom: 3px solid transparent; transition: color .15s; }
.menu a i { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); transition: background .15s, transform .15s; }
.menu a svg { width: 24px; height: 24px; fill: #fff; }
.menu a:hover i { background: rgba(255, 255, 255, .2); transform: translateY(-1px); }
.menu a.on { color: #fff; border-bottom-color: var(--red); }
.menu a.on i { background: var(--petrol); }
.firms { flex: none; }
.seg { display: flex; background: var(--ink-2); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { flex: 1; border: 0; background: transparent; color: #b9c2c2; padding: 6px 8px; border-radius: 6px; font: 600 12px/1 var(--f-mono); cursor: pointer; }
.seg button.on { background: var(--petrol); color: #fff; }

.subbar { background: var(--petrol-600); color: #fff; display: flex; align-items: center; gap: 14px; padding: 8px 24px; flex-wrap: wrap; }
.backbtn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--red); display: grid; place-items: center; cursor: pointer; flex: none; }
.backbtn svg { width: 20px; height: 20px; fill: #fff; }
.crumbs { display: flex; align-items: baseline; gap: 12px; min-width: 0; flex: 1; flex-wrap: wrap; }
.crumbs h1 { margin: 0; font: 600 24px/1.1 var(--f-display); letter-spacing: .01em; }
.crumbs .sub { color: #d6eef0; font-size: 13px; }
.crumbs a.back { color: #d6eef0; font-size: 13px; }
.subbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.subbar .pill { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .22); color: #fff; }

.page { padding: 24px; display: flex; flex-direction: column; gap: 20px; max-width: 1600px; width: 100%; margin: 0 auto; }

/* Seiten mit Suchbereich links (wie SequriX) */
.layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.panel { background: #e9eeee; border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; position: sticky; top: 16px; }
.panel section { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.panel section + section { border-top: 1px solid var(--line-2); }
.panel h3 { margin: 0; font: 700 16px/1 var(--f-display); text-transform: uppercase; letter-spacing: .03em; padding-left: 10px; border-left: 3px solid var(--red); }
.panel .field label { color: var(--ink); }
.panel .btn { justify-content: center; }
.pane { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.dl { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; }

/* Bausteine */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2 { margin: 0; font: 700 20px/1.1 var(--f-display); text-transform: uppercase; letter-spacing: .02em; }
.card-head .hint { color: var(--muted); font-size: 12.5px; }
.card-body { padding: 18px 20px; }
.eyebrow { font: 600 11px/1 var(--f-body); letter-spacing: .14em; text-transform: uppercase; color: var(--petrol); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); }

.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--petrol); background: var(--petrol); color: #fff; padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--petrol-600); border-color: var(--petrol-600); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--ink); background: var(--surface); }
.btn.quiet { background: transparent; color: var(--muted); border-color: transparent; }
.btn.quiet:hover { color: var(--ink); background: var(--paper); }
.btn.danger { background: var(--surface); color: var(--red); border-color: var(--red-050); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: default; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; font: 600 11px/1.4 var(--f-body); white-space: nowrap; background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.pill.petrol { background: var(--petrol-050); color: var(--petrol-600); border-color: var(--petrol-100); }
.pill.red { background: var(--red-050); color: var(--red); border-color: #f6cfca; }
.pill.amber { background: var(--amber-050); color: var(--amber); border-color: #f3dfb5; }
.pill.green { background: var(--green-050); color: var(--green); border-color: #c8e5d0; }
.pill.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

/* KPI */
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.kpi .v { font: 700 40px/1 var(--f-display); letter-spacing: .01em; }
.kpi .l { color: var(--muted); font-size: 13px; }
.kpi .d { font: 600 12px/1.2 var(--f-mono); }
.kpi.alert .v { color: var(--red); }
.kpi.good .v { color: var(--petrol); }

/* Tabellen */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font: 600 11px/1.2 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfb; white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #f8fafa; }
.tbl tr.late td { background: var(--red-050); }
.tbl tr.warn td { background: #fffaf0; }
.tbl .obj b { display: block; font-weight: 600; }
.tbl .obj span { color: var(--muted); font-size: 12px; }

/* Plan-Raster */
.plan-wrap { overflow: auto; max-height: calc(100vh - 290px); border-top: 1px solid var(--line); }
table.plan { border-collapse: separate; border-spacing: 0; font: 600 12px/1 var(--f-mono); }
.plan th, .plan td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; min-width: 38px; height: 40px; padding: 0; }
.plan thead th { position: sticky; top: 0; z-index: 2; background: #fafbfb; font: 600 10.5px/1.25 var(--f-mono); color: var(--muted); padding: 6px 2px; }
.plan thead th.we { background: var(--petrol-050); color: var(--petrol-600); }
.plan thead th.today { box-shadow: inset 0 -3px 0 var(--red); color: var(--ink); }
.plan thead th.kw { font-size: 10px; color: var(--faint); height: auto; padding: 4px 2px; border-bottom: 0; }
.plan .lbl { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; min-width: 250px; padding: 6px 14px; font: 600 13px/1.25 var(--f-body); white-space: nowrap; }
.plan thead th.lbl { z-index: 3; background: #fafbfb; }
.plan .lbl small { display: block; font: 400 11.5px/1.3 var(--f-body); color: var(--muted); }
.plan .lbl .fc { font: 700 10.5px/1 var(--f-mono); color: var(--petrol-600); background: var(--petrol-050); padding: 2px 5px; border-radius: 4px; margin-right: 6px; }
.plan .grp td { background: #fafbfb; text-align: left; font: 600 11px/1 var(--f-body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); height: 30px; padding: 0 14px; position: sticky; left: 0; }
.cell { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 39px; cursor: pointer; color: var(--petrol-600); border: 0; background: transparent; font: inherit; text-decoration: none; }
.cell:hover { background: var(--petrol-050); }
.cell.hint { background: var(--amber-050); color: var(--amber); }
.cell.late { background: var(--red-050); color: var(--red); }
.cell.manual { box-shadow: inset 0 0 0 2px var(--ink); }
.cell.past { opacity: .45; }
.cell.none { color: var(--line-2); cursor: default; }
.cell.none:hover { background: transparent; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; padding: 12px 20px; font-size: 12px; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -3px; margin-right: 6px; border: 1px solid var(--line); }

/* Formulare */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font: 600 11.5px/1.2 var(--f-body); color: var(--muted); letter-spacing: .02em; }
.inp, select.inp { border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; background: var(--surface); min-width: 0; width: 100%; }
.inp:focus { border-color: var(--petrol); outline: none; box-shadow: 0 0 0 3px var(--petrol-050); }
.inp.sm { padding: 5px 8px; font-size: 13px; }
.inp.time { width: 104px; font-family: var(--f-mono); }
.inp.num { width: 70px; font-family: var(--f-mono); }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.daygrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.daybox { border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 8px; display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.daybox.on { border-color: var(--petrol); background: var(--petrol-050); }
.daybox .dn { display: flex; justify-content: space-between; align-items: center; font: 700 15px/1 var(--f-display); text-transform: uppercase; }
.daybox .inp.time { width: 100%; padding: 5px 6px; font-size: 12.5px; }
.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.daychips { display: flex; gap: 3px; }
.daychips label { width: 26px; height: 24px; display: grid; place-items: center; border-radius: 5px; border: 1px solid var(--line-2); font: 600 10.5px/1 var(--f-body); cursor: pointer; user-select: none; color: var(--muted); }
.daychips input { position: absolute; opacity: 0; pointer-events: none; }
.daychips input:checked + span { color: #fff; }
.daychips label:has(input:checked) { background: var(--petrol); border-color: var(--petrol); color: #fff; }

/* Muster-Karten */
.pcard { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; text-decoration: none; transition: border-color .15s, transform .15s; }
.pcard:hover { border-color: var(--petrol); transform: translateY(-1px); }
.pcard h3 { margin: 0; font: 700 21px/1.1 var(--f-display); text-transform: uppercase; }
.weekstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.weekstrip span { text-align: center; font: 600 10px/1.3 var(--f-mono); padding: 5px 0; border-radius: 4px; background: var(--paper); color: var(--faint); }
.weekstrip span.on { background: var(--petrol-050); color: var(--petrol-600); }
.weekstrip span b { display: block; font: 600 10px/1 var(--f-body); }

/* Rollierende Wochen */
.weeks { display: grid; grid-template-columns: repeat(11, minmax(62px, 1fr)); gap: 6px; }
.wk { border: 1px solid var(--line); border-radius: 8px; padding: 8px 4px; text-align: center; font: 600 11.5px/1.35 var(--f-mono); }
.wk small { display: block; font: 400 10px/1.3 var(--f-mono); color: var(--muted); }
.wk.past { background: var(--paper); color: var(--faint); }
.wk.now { border: 2px solid var(--ink); }
.wk.gen { background: var(--petrol-050); border-color: var(--petrol-100); color: var(--petrol-600); }
.wk.next { border-style: dashed; color: var(--faint); }

/* Tour / Coach */
.tour-head { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.tour-head > div { background: var(--surface); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.tour-head .v { font: 700 26px/1 var(--f-display); }
.tour-head .l { font-size: 12px; color: var(--muted); }
.tour-head .v.red { color: var(--red); }
.sugg { display: flex; flex-direction: column; gap: 12px; }
.sg { border: 1px solid var(--line); border-left: 4px solid var(--petrol); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.sg.move { border-left-color: var(--ink); }
.sg.dur { border-left-color: var(--amber); }
.sg h4 { margin: 0; font-size: 14.5px; }
.sg p { margin: 0; font-size: 13px; color: var(--muted); }
.sg .gain { font: 600 12px/1.4 var(--f-mono); color: var(--green); }
.sg .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font: 700 20px/1.2 var(--f-display); text-transform: uppercase; margin-bottom: 6px; }

.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 140px; gap: 12px; align-items: center; font-size: 12.5px; }
.bar { display: flex; height: 20px; border-radius: 5px; overflow: hidden; background: var(--paper); }
.bar span { height: 100%; }
.bar .b-d { background: var(--drive); }
.bar .b-w { background: var(--petrol); }
.bar .b-i { background: #e7b04a; }
.bar .b-f { background: var(--green-050); }
.bar .b-o { background: var(--red); }
.bar-row .res { font: 600 11.5px/1.35 var(--f-mono); color: var(--muted); }

.map { width: 100%; height: auto; display: block; background: #f7f9f9; border-radius: 10px; }
.map .route { fill: none; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.map .route.cur { stroke: var(--drive); stroke-dasharray: 5 5; }
.map .route.best { stroke: var(--petrol); }
.map text { font: 600 10px var(--f-mono); fill: var(--ink); }

/* Modal & Toast */
.modal-back { position: fixed; inset: 0; background: rgba(29, 29, 27, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: 14px; box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .35); width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.modal .mh { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal .mh h3 { margin: 0; font: 700 22px/1.1 var(--f-display); text-transform: uppercase; }
.modal .mb { padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.modal .mf { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; }
.radio:has(input:checked) { border-color: var(--petrol); background: var(--petrol-050); }
.radio input { margin-top: 3px; accent-color: var(--petrol); }
.radio b { display: block; }
.toast { position: fixed; right: 24px; bottom: 24px; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow); z-index: 60; max-width: 420px; font-size: 13.5px; }

@media (max-width: 1200px) {
  .g-main { grid-template-columns: minmax(0, 1fr); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tour-head { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .topnav { flex-wrap: wrap; padding: 8px 12px; gap: 8px; position: static; }
  .menu { order: 3; flex: 1 1 100%; margin-left: 0; }
  .menu a { min-width: 0; padding: 4px 8px 6px; font-size: 10px; }
  .menu a i { width: 40px; height: 40px; }
  .firms { margin-left: auto; }
  .subbar { position: static; padding: 8px 12px; }
  .page { padding: 16px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .panel { position: static; }
  .g2, .g3, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .daygrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tour-head { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bar-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .dl { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .dl dd { margin-bottom: 8px; }
}
@media (max-width: 560px) {
  .g4 { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
