/* Farben wie im Zugang-Dashboard: Dunkelblau #16213e, Einsatzrot, Gelb, Grün */
:root {
  --bg: #16213e;
  --surface: #1b2a4e;
  --surface-2: #20315a;
  --border: #2f3f69;
  --text: #f0f0f0;
  --muted: #9ca3af;
  --accent: #d62828;
  --accent-soft: #ffcf33;
  --red: #d62828;
  --yellow: #ffcf33;
  --green: #3ddc84;
}
[data-bs-theme="dark"] {
  --bs-body-bg: #16213e;
  --bs-body-color: #f0f0f0;
  --bs-secondary-color: #9ca3af;
  --bs-border-color: #2f3f69;
  --bs-tertiary-bg: #1b2a4e;
  --bs-secondary-bg: #20315a;
}
html { background-color: var(--bg); overflow-x: clip; }
body {
  background: var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh; font-size: .95rem; overflow-x: clip; max-width: 100vw;
}
img { max-width: 100%; height: auto; }
.card { --bs-card-bg: var(--surface); --bs-card-border-color: var(--border); --bs-card-cap-bg: transparent; }
.text-muted { color: var(--muted) !important; }
a { color: #8fb4ff; }

.btn-primary { --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-color: #fff; --bs-btn-hover-bg: #e03434; --bs-btn-hover-border-color: #e03434; --bs-btn-hover-color: #fff; --bs-btn-active-bg: #b81f1f; --bs-btn-active-border-color: #b81f1f; --bs-btn-active-color: #fff; --bs-btn-disabled-bg: var(--accent); --bs-btn-disabled-border-color: var(--accent); }
.bg-primary { background-color: var(--accent) !important; }
.btn-outline-secondary { --bs-btn-color: #c7cfdf; --bs-btn-border-color: #3d4f7e; --bs-btn-hover-bg: #26386a; --bs-btn-hover-border-color: #54689b; --bs-btn-hover-color: #fff; --bs-btn-active-bg: #2d4075; --bs-btn-active-border-color: #54689b; --bs-btn-active-color: #fff; --bs-btn-disabled-color: #7480a0; --bs-btn-disabled-border-color: #2f3f69; }

.navbar { background-color: #111418 !important; padding-top: env(safe-area-inset-top, 0); padding-bottom: 0; border-bottom: 3px solid var(--red); }
.navbar-brand { letter-spacing: .03em; }
.brand-logo-wrap { width: 44px; height: 44px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(145deg, #d32f2f, #b71c1c); border-radius: 9px; box-shadow: 0 3px 8px rgba(0,0,0,.35); }
.brand-logo { width: 33px; height: auto; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.navbar-brand > div { min-width: 0; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; font-size: 1rem; color: #fff; line-height: 1.2; }
.brand-sub { font-size: .72rem; color: rgba(255,255,255,.5); letter-spacing: .04em; }
.container-xl { overflow-x: clip; }
@media (max-width: 575px) { .container-xl { padding-left: .85rem; padding-right: .85rem; } h1.h3 { font-size: 1.1rem; } }

.vehicle-card { transition: transform .15s, box-shadow .15s, border-color .15s; }
.vehicle-card:hover { transform: translateY(-3px); box-shadow: 0 .5rem 1.2rem rgba(0,0,0,.35) !important; border-color: var(--yellow) !important; }
.group-stripe { position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: .375rem .375rem 0 0; pointer-events: none; z-index: 1; }
.new-vehicle-card { border: 2px dashed var(--border); transition: border-color .15s, background .15s; border-radius: .5rem; min-height: 130px; }
.new-vehicle-card:hover { border-color: var(--yellow); background: rgba(255,207,51,.07) !important; }
.section-card { border-top: 3px solid transparent; }
.checkpoint-item { border-left: 3px solid var(--yellow) !important; }
details summary { cursor: pointer; user-select: none; }
details[open] summary { margin-bottom: .75rem; }

/* Co-Pilot */
.tabular { font-variant-numeric: tabular-nums; }
.cockpit-wrap { position: sticky; top: 0; z-index: 20; margin: -1.5rem 0 .75rem; padding: .75rem 0 .5rem; background: var(--bg); }
.cockpit { background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid var(--muted); border-radius: .75rem; padding: .65rem .85rem .8rem; box-shadow: 0 .4rem 1rem rgba(0,0,0,.35); transition: border-color .3s; }
.cockpit.st-ok { border-left-color: var(--green); }
.cockpit.st-ok .status-big { color: var(--green); }
.cockpit.st-warn { border-left-color: var(--yellow); }
.cockpit.st-warn .status-big { color: var(--yellow); }
.cockpit.st-bad { border-left-color: var(--red); }
.cockpit.st-bad .status-big { color: #ff6b6b; }
.cockpit.end-warn { border-color: var(--red); }
.cp-top { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; font-size: .85rem; }
.cp-name { flex: 1; min-width: 0; font-weight: 600; color: var(--text); }
.cp-anchor { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .75rem; white-space: nowrap; }
.cp-anchor input { width: 6.4rem; padding: .1rem .3rem; }
.cp-main { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.clock { font-size: 2.1rem; font-weight: 700; line-height: 1; letter-spacing: .01em; }
.clock small { font-size: 1.1rem; color: var(--muted); font-weight: 600; }
.cp-status { flex: 1; min-width: 0; text-align: center; }
.cp-lbl { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--muted); }
.status-big { font-size: 1.3rem; font-weight: 700; line-height: 1.1; }
.status-timer { font-size: 1.6rem; font-weight: 700; line-height: 1; min-width: 3.4rem; text-align: right; }
.cp-sub { font-size: .78rem; color: var(--muted); margin: .35rem 0 .5rem; line-height: 1.25; }
.seg-bar { position: relative; display: flex; gap: 2px; height: 8px; }
.seg-bar i { display: block; background: rgba(255,255,255,.12); border-radius: 2px; }
.seg-bar i.done { background: rgba(61,220,132,.5); }
.seg-bar i.cur { background: var(--yellow); }
.seg-bar .plan { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #fff; display: none; }

.run-item.cur { border-color: var(--red) !important; box-shadow: 0 0 0 1px var(--red); border-top-width: 3px; }
.run-item.hidden-done { display: none; }
.run-head { display: grid; grid-template-columns: 4.3rem 1fr auto; gap: .75rem; align-items: center; width: 100%; text-align: left; background: none; border: 0; padding: .75rem 1rem; color: inherit; }
.run-when { font-size: 1.25rem; font-weight: 700; line-height: 1; white-space: nowrap; }
.run-when small { display: block; font-size: .72rem; font-weight: 400; color: var(--muted); margin-top: 3px; }
.run-when .was { text-decoration: line-through; }
.run-when .was:empty { display: none; }
.run-title { font-weight: 600; min-width: 0; overflow-wrap: break-word; hyphens: auto; }
.run-item.cur .run-title { font-size: 1.15rem; }
.run-body { display: none; border-top: 1px solid var(--border); padding: .75rem 1rem 1rem; }
.run-item.open .run-body { display: block; }
.plan-hint { display: none; padding: 0 1rem .5rem; font-size: .78rem; color: var(--muted); }
.plan-hint.on { display: block; }
.next-lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--muted); margin: .5rem 0 -.25rem; }
.item-notiz { white-space: pre-line; color: #d8dce6; }
.part-head { margin: .75rem 0 .25rem; display: flex; flex-direction: column; }
.part-head span { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--muted); }
.part-head strong { font-size: 1.2rem; line-height: 1.2; }
.part-notes { list-style: none; margin: .25rem 0 0; padding: 0; font-size: 1.05rem; }
.part-notes li { padding: .2rem 0 .2rem 1.1rem; position: relative; }
.part-notes li::before { content: ""; position: absolute; left: .15rem; top: .85rem; width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); }
.part-notes li.l2 { margin-left: 1.25rem; font-size: .95rem; color: var(--muted); }
.part-notes li.l2::before { background: #6b7ba3; }
.save-state { font-size: .72rem; color: var(--muted); min-height: 1em; }

.badge-info { background: rgba(255,207,51,.12); color: var(--yellow); border: 1px solid rgba(255,207,51,.35); font-weight: 600; }
.title-icon { color: var(--yellow); }
#next { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cp-lbl { white-space: nowrap; }
@media (max-width: 575px) {
  .cp-name { display: none; }
  .cp-top { justify-content: space-between; }
  #next { font-size: 1rem; }
  .status-big { font-size: 1.1rem; }
  .clock { font-size: 1.8rem; }
  .status-timer { font-size: 1.35rem; }
  .run-item.cur .run-title { font-size: 1.05rem; }
}
@media print { .navbar, .btn, .alert.d-print-none { display: none !important; } body { background: #fff; color: #000; font-size: 11pt; } .card { box-shadow: none !important; border: 1px solid #ccc !important; } }

/* Cockpit und aktiver Punkt als ein roter Rahmen */
.cockpit-wrap:has(.cockpit.fused) { margin-bottom: 0; padding-bottom: 0; }
.cockpit.fused { border-color: var(--red); border-left-width: 1px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-width: 0; box-shadow: none; }
.run-item.cur.fused { border-top-left-radius: 0; border-top-right-radius: 0; border-top-width: 0; }
