/* Dashboard "Heute-Cockpit" (public/js/pages/dashboard.js). Prefix dc-. Tokens only (theme.css), light + dark, mobile first,
   container queries inside the widgets; motion rules in motion.css (draw-in classes below only run on the first visit: .dc-first / .cb-anim). */
.dc { --dc-gap: 16px; --dc-r: 14px; --dc-pad: 18px; display: flex; flex-direction: column; gap: var(--dc-gap); }
.dc[data-density="compact"] { --dc-gap: 12px; --dc-pad: 14px; }
.dc [hidden] { display: none !important; }

/* ---------- hero band ---------- */
.dc-hero { position: relative; isolation: isolate; overflow: hidden; display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; min-height: 116px;
  padding: 18px 24px 20px; border-radius: 16px; color: #fff;
  background: radial-gradient(90% 160% at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent) 0%, transparent 52%),
    linear-gradient(110deg, rgba(11, 16, 32, .94) 0%, rgba(11, 16, 32, .72) 46%, rgba(11, 16, 32, .18) 100%), var(--logo-gradient); }
.dc-hero::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px); background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(100deg, transparent 8%, #000 45%, #000 80%, transparent); mask-image: linear-gradient(100deg, transparent 8%, #000 45%, #000 80%, transparent); }
.dc-hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--brand-400), var(--accent) 70%, transparent); opacity: .9; }
[data-mode="dark"] .dc-hero { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.dc-hero-main { min-width: 0; flex: 1; }
.dc-hero-date { font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .74); }
.dc-hero h1 { margin: 4px 0 0; font-size: 27px; line-height: 1.15; letter-spacing: -.02em; color: #fff; }
.dc-hero h1:focus { outline: none; }
.dc-hero-row { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; margin-top: 10px; }
.dc-hero-line { margin: 0; font-size: 14px; color: rgba(255, 255, 255, .86); max-width: 62ch; }
.dc-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.dc-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .1);
  color: #fff; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.dc-chip b { font-variant-numeric: tabular-nums; font-weight: 750; }
button.dc-chip:hover { background: rgba(255, 255, 255, .18); }
.dc-chip:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.dc-chip.late { background: color-mix(in srgb, #f87171 34%, transparent); border-color: color-mix(in srgb, #fca5a5 70%, transparent); }
.dc-chip.calm { cursor: default; color: rgba(255, 255, 255, .86); } .dc-chip.calm .icon { stroke: #6ee7b7; }
.dc-hero-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 12px; align-self: stretch; flex: none; }
.dc-hero-actions { display: flex; gap: 8px; }
.dc-btn-hero { background: #fff; color: var(--ink); border-color: #fff; } .dc-btn-hero:hover { background: #EEF0FF; border-color: #EEF0FF; }
.dc-btn-hero .icon { stroke: var(--brand-600); }
.dc-btn-ghost { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .26); } .dc-btn-ghost:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .4); }
.dc-btn-ghost .icon { stroke: #fff; }
.dc-hero .btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.dc-updated { font-size: 12px; color: rgba(255, 255, 255, .7); font-variant-numeric: tabular-nums; }
.dc-hero--skel { height: 132px; background: var(--surface-3); }
.dc-hero--skel::before, .dc-hero--skel::after { display: none; }

/* ---------- edit bar ---------- */
.dc-editbar { position: sticky; top: 56px; z-index: 12; display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--border)); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); font-size: var(--fs-sm); }
.dc-editbar-t { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text-2); } .dc-editbar-t .icon { stroke: var(--primary); flex: none; }
.dc-editbar-a { display: flex; gap: 8px; }

/* ---------- layout: bands (full | 8 + 4 columns), one column by order below 1024 px ---------- */
.dc-flow { display: flex; flex-direction: column; gap: var(--dc-gap); }
.dc-band--cols { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--dc-gap); align-items: start; }
.dc-col { display: flex; flex-direction: column; gap: var(--dc-gap); min-width: 0; }
.dc-col--main { grid-column: span 8; } .dc-col--side { grid-column: span 4; }
.dc-band.only-main .dc-col--main, .dc-band.only-side .dc-col--side { grid-column: 1 / -1; }
.dc-band.only-main .dc-col--side, .dc-band.only-side .dc-col--main { display: none; }
.dc-editing .dc-band.only-main .dc-col--main { grid-column: span 8; } .dc-editing .dc-band.only-side .dc-col--side { grid-column: span 4; }
.dc-editing .dc-band.only-main .dc-col--side, .dc-editing .dc-band.only-side .dc-col--main { display: flex; min-height: 120px; border: 2px dashed var(--border-strong); border-radius: var(--dc-r); }
@media (max-width: 1279px) { .dc-col--main { grid-column: span 7; } .dc-col--side { grid-column: span 5; } .dc-editing .dc-band.only-main .dc-col--main { grid-column: span 7; } .dc-editing .dc-band.only-side .dc-col--side { grid-column: span 5; } }
@media (max-width: 1023px) {
  .dc-band, .dc-col { display: contents !important; }
  .dc-w { order: var(--o, 0); }
}

/* ---------- widget card ---------- */
.dc-w { position: relative; min-width: 0; container-type: inline-size; background: var(--surface); border: 1px solid var(--border); border-radius: var(--dc-r); box-shadow: var(--shadow-sm); }
[data-mode="dark"] .dc-w { box-shadow: none; }
.dc-wh { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; padding: 14px var(--dc-pad); border-bottom: 1px solid var(--border); min-height: 60px; }
.dc-wi { width: 30px; height: 30px; display: grid; place-items: center; flex: none; border-radius: 9px; background: var(--primary-soft); }
.dc-wi .icon { width: 17px; height: 17px; stroke: var(--primary); }
.dc-wh h2 { font-size: 16px; font-weight: 680; letter-spacing: -.01em; margin: 0; }
.dc-wh h2:focus { outline: none; }
.dc-count { font-size: var(--fs-xs); color: var(--text-3); font-variant-numeric: tabular-nums; }
.dc-sub { font-size: var(--fs-xs); color: var(--text-3); flex-basis: 100%; margin: -2px 0 0 40px; }
.dc-link { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); font-weight: 600; min-height: 32px; }
.dc-wh > .dc-seg, .dc-chart-ctl { margin-left: auto; }
.dc-seg { padding: 2px; flex-wrap: nowrap; max-width: 100%; } .dc-seg button { min-width: 0; } .dc-seg button { height: 30px; padding: 0 10px; font-size: 12.5px; }
.dc-seg button .n { display: inline-grid; place-items: center; min-width: 18px; height: 17px; padding: 0 5px; margin-left: 2px; border-radius: 9px; background: var(--surface); color: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.dc-seg button[aria-pressed="true"] .n { background: var(--primary-soft); color: var(--primary); }
.dc-seg--sm button { padding: 0 8px; }
.dc-chart-ctl { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
/* custom range next to the period buttons (range picker without presets): quiet until chosen, then brand-tinted like a pressed segment */
.dc-rng { display: inline-flex; min-width: 0; }
.dc-rng .rng > .rng-btn { min-width: 0; height: 34px; font-size: 12.5px !important; }   /* a button, not a text field: no 16 px phone rule needed */
.dc-rng .rng-v small { display: none; }
.dc-rng.on .rng > .rng-btn { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background: var(--primary-soft); color: var(--nav-active-fg, var(--primary)); font-weight: 600; }
.dc-rng.on .rng-btn > .icon { color: var(--primary); }
.dc-wb { min-width: 0; }
.dc-ok { display: flex; align-items: center; gap: 10px; padding: 16px var(--dc-pad); color: var(--text-2); font-size: var(--fs-sm); }
.dc-ok .icon { stroke: var(--success); flex: none; }

/* edit mode */
.dc-edit { display: none; }
.dc-editing .dc-w { outline: 2px dashed color-mix(in srgb, var(--primary) 40%, transparent); outline-offset: 3px; }
.dc-editing .dc-edit { display: flex; align-items: center; gap: 2px; position: absolute; top: 10px; right: 10px; z-index: 4; padding: 3px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.dc-editing .dc-wb { pointer-events: none; max-height: 168px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.dc-editing .dc-wh > :not(.dc-wi):not(h2) { visibility: hidden; }
.dc-editing .dc-w.is-hidden { background: var(--surface-2); }
.dc-editing .dc-w.is-hidden > :not(.dc-edit) { opacity: .45; }
.dc-editing .dc-w.is-hidden .dc-wb { display: none; }
.dc-drag { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 8px; background: var(--primary-soft); cursor: grab; touch-action: none; }
.dc-drag .icon { stroke: var(--primary); } .dc-drag:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.dc-w.is-dragging { z-index: 20; cursor: grabbing; box-shadow: var(--shadow-lg); opacity: .97; }
.dc-dragging { user-select: none; }
.dc-dragging .dc-w:not(.is-dragging) { transition: none; }
.dc-edit [data-eye][aria-pressed="false"] .icon { stroke: var(--text-3); }
@media (pointer: coarse) { .dc-drag, .dc-edit .btn-icon { width: 44px; height: 44px; } }

/* ---------- inbox ("Braucht Aufmerksamkeit") ---------- */
.dc-grp { --sev: var(--text-3); --sev-bg: var(--neutral-bg); }
.dc-grp.sev-urgent, .dc-ii.sev-urgent { --sev: var(--danger); --sev-bg: var(--danger-bg); }
.dc-grp.sev-soon, .dc-ii.sev-soon { --sev: var(--warning); --sev-bg: var(--warning-bg); }
.dc-grp.sev-info, .dc-ii.sev-info { --sev: var(--info); --sev-bg: var(--info-bg); }
.dc-grp-h { display: flex; align-items: center; gap: 6px; padding: 12px var(--dc-pad) 6px; font-size: 13px; font-weight: 700; color: var(--sev); }
.dc-grp-h i { width: 8px; height: 8px; border-radius: 50%; background: var(--sev); box-shadow: 0 0 0 3px var(--sev-bg); }
.dc-grp-h .n { color: var(--text-3); font-weight: 550; font-variant-numeric: tabular-nums; }
.dc-iil { list-style: none; margin: 0; padding: 0; }
.dc-ii { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 11px var(--dc-pad) 11px calc(var(--dc-pad) - 3px);
  border-left: 3px solid var(--sev); border-top: 1px solid var(--border); background: var(--surface); }
.dc-iil > .dc-ii:first-child { border-top: 0; }
.dc-ii:hover { background: color-mix(in srgb, var(--sev-bg) 45%, var(--surface)); }
.dc-ii-ic { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--sev-bg); }
.dc-ii-ic .icon { width: 18px; height: 18px; stroke: var(--sev); }
.dc-ii-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dc-ii-txt b { font-size: 14px; font-weight: 650; color: var(--text); } .dc-ii-txt b a { color: inherit; }
.dc-ii-txt span { font-size: 13px; color: var(--text-3); }
.dc-ii-act { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.dc-more { display: flex; align-items: center; gap: 6px; width: 100%; padding: 12px var(--dc-pad); border: 0; border-top: 1px solid var(--border); background: transparent; color: var(--text-2);
  font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; border-radius: 0 0 var(--dc-r) var(--dc-r); min-height: 44px; }
.dc-more:hover { background: var(--surface-2); color: var(--text); }
@container (max-width: 520px) {
  .dc-ii { grid-template-columns: 36px minmax(0, 1fr); }
  .dc-ii-act { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; }
  .dc-ii-act [data-ii-menu] { margin-left: auto; }
}
.dc-allgood { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px var(--dc-pad) 28px; text-align: center; color: var(--text-3); font-size: var(--fs-sm); }
.dc-allgood svg { width: 52px; height: 52px; margin-bottom: 6px; }
.dc-allgood circle { fill: var(--success-bg); }
.dc-allgood path { fill: none; stroke: var(--success); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; animation: dc-check 560ms var(--ease-gentle) 160ms backwards; }
.dc-allgood b { color: var(--text); font-size: 15px; }
@keyframes dc-check { from { stroke-dashoffset: 40; } }

/* ---------- timeline ---------- */
.dc-tl { list-style: none; margin: 0; padding: 6px 0; position: relative; }
.dc-tl::before { content: ''; position: absolute; top: 0; bottom: 0; left: calc(var(--dc-pad) + 64px + 12px + 5px); width: 2px; background: var(--border); }
.dc-ev { --k: var(--primary); position: relative; display: grid; grid-template-columns: 64px 12px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px var(--dc-pad); }
.dc-ev.kind-return { --k: var(--st-returned); }
.dc-ev.late { --k: var(--danger); background: linear-gradient(90deg, color-mix(in srgb, var(--danger) 7%, transparent), transparent 70%); }
.dc-ev.done { --k: var(--success); }
.dc-ev-time { display: flex; flex-direction: column; line-height: 1.2; }
.dc-ev-time b { font-size: 16px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.dc-ev-time span { font-size: 10.5px; line-height: 1.15; font-weight: 650; color: var(--danger); overflow-wrap: anywhere; }
.dc-ev.late .dc-ev-time b { color: var(--danger); }
.dc-ev-dot { position: relative; z-index: 1; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--k); }
.dc-ev.done .dc-ev-dot { background: var(--k); }
.dc-ev.late .dc-ev-dot { background: var(--k); box-shadow: 0 0 0 4px var(--danger-bg); }
.dc-ev-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dc-ev-top { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.dc-ev-top > a { color: var(--text); max-width: 100%; }
.dc-kind { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--k); }
.dc-kind .icon { width: 13px; height: 13px; stroke: currentColor; }
.dc-ev-meta { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; font-size: var(--fs-xs); color: var(--text-3); }
.dc-addr { display: inline-flex; align-items: center; gap: 3px; }
.dc-ev.done .dc-ev-main { opacity: .7; }
.dc-now { position: relative; display: flex; align-items: center; height: 26px; padding-left: calc(var(--dc-pad) + 64px + 12px - 6px); }
.dc-now::before { content: ''; position: absolute; left: calc(var(--dc-pad) + 64px + 12px); right: var(--dc-pad); top: 50%; height: 2px; background: linear-gradient(90deg, var(--primary), transparent); }
.dc-now span { position: relative; padding: 2px 8px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dc-tl-grp { display: flex; align-items: center; gap: 6px; padding: 8px var(--dc-pad) 2px; font-size: 12px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; color: var(--danger); background: var(--surface); position: relative; }
.dc-tl-grp .icon { stroke: var(--danger); }
.dc-tl-none { padding: 18px var(--dc-pad); color: var(--text-3); font-size: var(--fs-sm); background: var(--surface); position: relative; }
.dc-done { border-top: 1px solid var(--border); }
.dc-done summary { display: flex; align-items: center; gap: 8px; padding: 10px var(--dc-pad); min-height: 44px; list-style: none; cursor: pointer; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.dc-done summary::-webkit-details-marker { display: none; }
.dc-done summary .icon:first-child { stroke: var(--success); }
.dc-done summary .n { font-size: 11px; padding: 1px 7px; border-radius: 9px; background: var(--surface-3); color: var(--text-3); }
.dc-done .dc-chev { margin-left: auto; transition: transform var(--dur-2) var(--ease-snappy); }
.dc-done[open] .dc-chev { transform: rotate(180deg); }
.dc-tomorrow { display: flex; align-items: center; gap: 8px; margin: 6px var(--dc-pad) var(--dc-pad); padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--border-strong);
  background: var(--surface-2); color: var(--text-2); font-size: var(--fs-sm); text-decoration: none !important; min-height: 44px; }
.dc-tomorrow > span { flex: 1; min-width: 0; } .dc-tomorrow b { color: var(--text); } .dc-tomorrow .icon:first-child { stroke: var(--warning); }
a.dc-tomorrow:hover { border-color: var(--primary); color: var(--text); }
.dc-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px var(--dc-pad); text-align: center; color: var(--text-3); font-size: var(--fs-sm); }
.dc-empty > .icon { width: 30px; height: 30px; stroke: var(--primary); }
.dc-empty b { color: var(--text); font-size: 15px; }
.dc-empty.small { padding: 14px; flex-direction: row; justify-content: center; } .dc-empty.small .icon { width: 18px; height: 18px; stroke: var(--success); }
@container (max-width: 600px) {
  .dc-ev { grid-template-columns: 50px 12px minmax(0, 1fr); }
  .dc-ev-act { grid-column: 3; justify-self: start; }
  .dc-tl::before { left: calc(var(--dc-pad) + 50px + 12px + 5px); }
  .dc-now { padding-left: calc(var(--dc-pad) + 50px + 12px - 6px); } .dc-now::before { left: calc(var(--dc-pad) + 50px + 12px); }
  .dc-wh > .dc-seg { margin-left: 0; width: 100%; display: flex; } .dc-wh > .dc-seg button { flex: 1; }
}

/* ---------- tasks ---------- */
.dc-tasks { list-style: none; margin: 0; padding: 4px 0; }
.dc-task { display: flex; align-items: center; gap: 12px; padding: 9px var(--dc-pad); }
.dc-task + .dc-task { border-top: 1px solid var(--border); }
.dc-check { position: relative; flex: none; width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 2px solid var(--border-strong); border-radius: 7px; background: var(--surface); cursor: pointer;
  transition: background var(--dur-2), border-color var(--dur-2), transform var(--dur-2) var(--ease-snappy); }
.dc-check::before { content: ''; position: absolute; inset: -10px; }
.dc-check .icon { width: 14px; height: 14px; stroke: #fff; stroke-width: 3; opacity: 0; transform: scale(.4); transition: opacity var(--dur-1), transform var(--dur-3) var(--ease-snappy); }
.dc-check:hover:not(:disabled) { border-color: var(--success); }
.dc-check[aria-checked="true"] { background: var(--success); border-color: var(--success); }
.dc-check[aria-checked="true"] .icon { opacity: 1; transform: none; }
.dc-check:active:not(:disabled) { transform: scale(.9); }
.dc-check:disabled { cursor: not-allowed; opacity: .5; }
[data-mode="dark"] .dc-check .icon { stroke: var(--ink); }
.dc-task-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dc-task-txt b { font-size: var(--fs-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color var(--dur-2); }
.dc-task-txt span { font-size: var(--fs-xs); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-task.is-done .dc-task-txt b { color: var(--text-3); text-decoration: line-through; }

/* ---------- KPI tiles + compact numbers ---------- */
.dc-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 14px var(--dc-pad) 0; list-style: none; margin: 0; }
.dc-tile-wrap { min-width: 0; display: flex; }
.dc-tile { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none !important; }
.dc-tile:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.dc-tile-h { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dc-ti { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--primary-soft); }
.dc-ti .icon { width: 16px; height: 16px; stroke: var(--primary); }
.dc-tile:hover .dc-ti .icon { transform: scale(1.08); transition: transform var(--dur-2) var(--ease-snappy); }
.dc-tlabel { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-tile-b { display: flex; align-items: flex-end; gap: 12px; min-height: 40px; }
.dc-val { font-size: 30px; font-weight: 750; letter-spacing: -.025em; line-height: 1.05; font-variant-numeric: tabular-nums; white-space: nowrap; font-family: var(--font-num); }
.dc-val.zero { color: var(--text-4); font-weight: 600; }
.dc-tile-f { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); border-top: 1px solid var(--border); padding-top: 8px; min-width: 0; }
.dc-tile-f > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dc-delta { flex: none; display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dc-delta.up { color: var(--success); background: var(--success-bg); } .dc-delta.down { color: var(--danger); background: var(--danger-bg); } .dc-delta.flat { color: var(--text-3); background: var(--neutral-bg); }
.dc-chart-sum .dc-delta { margin-left: 8px; vertical-align: 1px; }
.spark { position: relative; display: block; flex: 1; min-width: 56px; height: 36px; margin-bottom: 2px; touch-action: pan-y; }
.spark svg { display: block; width: 100%; height: 100%; overflow: visible; }
.spark-line { fill: none; stroke: var(--spark); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark-area { fill: color-mix(in srgb, var(--spark) 12%, transparent); }
.spark-dot { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--spark); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.spark-dot.hov { opacity: 0; transition: opacity var(--dur-1); }
.spark.on .spark-dot.hov { opacity: 1; } .spark.on .spark-dot.last { opacity: .25; }
.spark-tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); padding: 3px 7px; border-radius: 6px; background: var(--tip-bg); color: var(--tip-fg); font-size: 11px; font-weight: 600;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity var(--dur-1); z-index: 2; }
.spark.on .spark-tip { opacity: 1; }
.dc-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 12px var(--dc-pad) var(--dc-pad); }
.dc-num { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "l l" "v s"; align-items: baseline; gap: 2px 8px; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); color: var(--text); text-decoration: none !important; min-height: 44px; }
.dc-num:hover { background: var(--surface-3); }
.dc-num-l { grid-area: l; font-size: 12px; color: var(--text-3); font-weight: 550; }
.dc-num b { grid-area: v; font-size: 19px; font-weight: 720; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dc-num b.zero { color: var(--text-4); }
.dc-num-s { grid-area: s; font-size: 12px; color: var(--text-3); white-space: nowrap; }
@container (max-width: 860px) { .dc-tiles, .dc-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 560px) {
  .dc-tiles { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 80%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; overscroll-behavior-x: contain; }
  .dc-tiles::-webkit-scrollbar { display: none; }
  .dc-tile-wrap { scroll-snap-align: start; }
  .dc-sub { margin-left: 0; }
}

/* ---------- chart ---------- */
.dc-chart { padding: 12px var(--dc-pad) 10px; }
.dc-chart-sum { margin: 0 0 6px; font-size: var(--fs-sm); color: var(--text-2); } .dc-chart-sum b { font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.dc-combo { min-height: 200px; }
.dc-chart-foot { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; margin-top: 4px; font-size: var(--fs-xs); color: var(--text-3); }
.dc-chart-foot .btn { margin-left: auto; }
.dc-leg { display: inline-flex; align-items: center; gap: 6px; }
.dc-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.dc-leg i.bar { background: var(--c-1); } .dc-leg i.prev { width: 16px; height: 0; border-top: 2px dashed var(--text-3); border-radius: 0; }
.dc-leg i.we { background: color-mix(in srgb, var(--text-4) 22%, transparent); } .dc-leg i.today { background: color-mix(in srgb, var(--c-1) 30%, var(--surface)); box-shadow: inset 0 0 0 1.5px var(--c-1); }
.dc-table { margin-top: 10px; max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.dc-table .table { margin: 0; } .dc-table th { position: sticky; top: 0; background: var(--surface); }
.chart.combo { display: block; touch-action: pan-y; }
.chart.combo:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 8px; }
.cb-we { fill: color-mix(in srgb, var(--text-4) 10%, transparent); }
.cb-bar { fill: var(--c-1); transition: opacity var(--dur-1); }
.cb-bar.today { fill: color-mix(in srgb, var(--c-1) 32%, var(--surface)); stroke: var(--c-1); stroke-width: 1.5; }
.cb-active .cb-bar:not(.on) { opacity: .5; }
.cb-prev { fill: none; stroke: var(--text-3); stroke-width: 1.8; stroke-dasharray: 4 3; stroke-linejoin: round; pointer-events: none; }
.cb-hit { fill: transparent; }
.cb-cursor { stroke: var(--border-strong); stroke-width: 1; opacity: 0; pointer-events: none; }
.cb-active .cb-cursor { opacity: 1; }
.chart .cb-today { font-weight: 700; fill: var(--text); }
.cb-anim .cb-bar { transform-box: fill-box; transform-origin: 50% 100%; animation: cb-grow 640ms var(--ease-snappy) calc(var(--i, 0) * 10ms) backwards; }
.cb-anim .cb-reveal { transform-box: fill-box; transform-origin: 0 0; animation: cb-reveal 760ms var(--ease-gentle) 240ms backwards; }
@keyframes cb-grow { from { transform: scaleY(0); } }
@keyframes cb-reveal { from { transform: scaleX(0); } }

/* ---------- fleet ---------- */
.dc-fleet { display: flex; align-items: center; gap: 18px; padding: 16px var(--dc-pad) 8px; flex-wrap: wrap; justify-content: center; }
.dc-donut { position: relative; width: 148px; height: 148px; flex: none; }
.dc-donut-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-align: center; }
.dc-donut-c b { font-size: 28px; font-weight: 750; line-height: 32px; font-variant-numeric: tabular-nums; }
.dc-donut-c span { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-xs); color: var(--text-3); }
.dc-donut-c em { font-style: normal; font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.dc-donut-c em:empty { display: none; }
.dc-fleet[data-hl] .dc-donut-c span { color: var(--text); font-weight: 600; }
/* donut: arcs dim except the highlighted one (hover / focus / tap on an arc or a legend row), which pops out a little */
.dn { display: block; overflow: visible; }
.dn-track { stroke: var(--surface-3); }
.dn-seg { fill: none; cursor: pointer; outline: none; transform-box: view-box; transform-origin: 50% 50%;
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-snappy); }
.dc-fleet[data-hl] .dn-seg:not(.on) { opacity: .28; }
.dn-seg.on { transform: scale(1.045); }
.dc-donut:has(.dn-seg:focus-visible)::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; box-shadow: 0 0 0 2px var(--focus); pointer-events: none; }
.dc-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 2px; }
.dc-legend a { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 10px; border-radius: 8px; color: var(--text); font-size: var(--fs-sm); min-height: 36px; text-decoration: none !important;
  transition: background-color var(--dur-2) var(--ease-out), opacity var(--dur-2) var(--ease-out); }
.dc-legend a:hover, .dc-legend a.on { background: var(--surface-2); }
.dc-legend a:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.dc-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; transition: transform var(--dur-2) var(--ease-snappy), opacity var(--dur-2); }
.dc-legend a.on i { transform: scale(1.25); }
.dc-fleet[data-hl] .dc-legend a:not(.on) i { opacity: .35; }
.dc-legend span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .dc-legend b { min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; }
.dc-legend .m-arrow { width: 14px; height: 14px; margin-right: -2px; stroke: var(--text-3); opacity: 0; transition: opacity var(--dur-2), transform var(--dur-2) var(--ease-snappy); }
.dc-legend a:hover .m-arrow, .dc-legend a:focus-visible .m-arrow { opacity: 1; }
@media (hover: none) { .dc-legend .m-arrow { opacity: .7; } }
/* "Nächstes freies Fahrzeug": same row hover as the other dashboard rows (a shade darker), arrow nudges */
.dc-nextfree { display: flex; align-items: center; gap: 8px; margin: 4px var(--dc-pad) var(--dc-pad); padding: 10px 12px; border-radius: 10px; background: var(--success-bg); color: var(--text); font-size: var(--fs-sm); text-decoration: none !important; min-height: 44px;
  transition: background-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out); }
.dc-nextfree:hover { background: color-mix(in srgb, var(--success) 14%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success) 28%, transparent); }
.dc-nextfree:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.dc-nextfree > span { flex: 1; min-width: 0; } .dc-nextfree .icon:first-child { stroke: var(--success); } .dc-nextfree .m-arrow { stroke: var(--text-3); }
/* first visit: the arcs draw in one after the other (rotate + fade, transform/opacity only) */
.dc-first .dn-track { animation: m-fade var(--dur-3) var(--ease-out) backwards; }
.dc-first .dn-seg { animation: dn-in 720ms var(--ease-gentle) calc(140ms + var(--i, 0) * 110ms) backwards; }
@keyframes dn-in { from { opacity: 0; transform: rotate(-50deg) scale(.92); } }

/* ---------- utilisation by class ---------- */
.dc-bars { list-style: none; margin: 0; padding: 8px 0; }
.dc-bar { display: grid; grid-template-columns: minmax(96px, 34%) minmax(0, 1fr) 46px; gap: 12px; align-items: center; padding: 7px var(--dc-pad); color: var(--text); font-size: var(--fs-sm); text-decoration: none !important; min-height: 40px; }
a.dc-bar:hover { background: var(--surface-2); }
.dc-bar > b { text-align: right; font-variant-numeric: tabular-nums; }
.dc-bar-t { position: relative; height: 8px; border-radius: 4px; background: var(--surface-3); }
.dc-bar-f { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent-600), var(--primary)); transform-origin: 0 50%; }
.dc-bar-f.hi { background: linear-gradient(90deg, var(--primary), var(--brand-700)); } [data-mode="dark"] .dc-bar-f.hi { background: var(--primary); }
.dc-bar-f.lo { background: color-mix(in srgb, var(--primary) 45%, var(--surface-3)); }
.dc-target { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--text-2); }
.dc-foot-note { display: flex; align-items: center; gap: 8px; margin: 0; padding: 4px var(--dc-pad) 14px; font-size: var(--fs-xs); color: var(--text-3); }
.dc-target-key { width: 2px; height: 12px; background: var(--text-2); border-radius: 1px; flex: none; }
.dc-first .dc-bar-f { animation: dc-grow-x 620ms var(--ease-snappy) backwards; }
.dc-first li:nth-child(2) .dc-bar-f { animation-delay: 30ms; } .dc-first li:nth-child(3) .dc-bar-f { animation-delay: 60ms; } .dc-first li:nth-child(n+4) .dc-bar-f { animation-delay: 90ms; }
@keyframes dc-grow-x { from { transform: scaleX(0); } }
@container (max-width: 420px) { .dc-bar { grid-template-columns: minmax(0, 1fr) 46px; } .dc-bar-t { grid-column: 1 / -1; grid-row: 2; } }

/* ---------- deadlines ---------- */
.dc-dl { list-style: none; margin: 0; padding: 6px 0; }
.dc-dl a { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 7px var(--dc-pad); color: var(--text); font-size: var(--fs-sm); text-decoration: none !important; min-height: 44px; }
.dc-dl a:hover { background: var(--surface-2); }
.dc-dl-d { width: 40px; height: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 9px; background: var(--surface-3); line-height: 1.05; }
.dc-dl-d b { font-size: 15px; font-variant-numeric: tabular-nums; } .dc-dl-d span { font-size: 10px; text-transform: uppercase; color: var(--text-3); font-weight: 650; }
.dc-dl-d.err { background: var(--danger-bg); color: var(--danger); } .dc-dl-d.err span { color: var(--danger); }
.dc-dl-d.warn { background: var(--warning-bg); color: var(--warning); } .dc-dl-d.warn span { color: var(--warning); }

/* ---------- skeleton ---------- */
.dc-skel { padding: 18px; }

/* ---------- phones: compact hero, timeline / inbox first, KPI swipe row, 44 px targets ---------- */
@media (max-width: 720px) {
  .dc { --dc-gap: 12px; --dc-pad: 14px; }
  .dc-hero { flex-direction: column; gap: 10px; padding: 14px 16px 16px; min-height: 0; border-radius: 14px; }
  .dc-hero h1 { font-size: 21px; }
  .dc-hero-line { display: none; }
  .dc-hero-row { margin-top: 8px; }
  .dc-hero-side { flex-direction: row; align-items: center; align-self: stretch; }
  .dc-hero-actions { flex: 1; }
  .dc-hero-actions .btn { height: 44px; }
  .dc-hero-actions .dc-btn-hero { flex: 1; }
  .dc-hero-actions a.dc-btn-ghost span { display: none; } .dc-hero-actions a.dc-btn-ghost { width: 44px; padding: 0; }
  .dc-hero-actions .btn-icon { width: 44px; }
  .dc-chip { height: 36px; }
  .dc .btn-sm, .dc-seg button, .dc-link { min-height: 44px; }
  .dc-ii-act .btn-icon { width: 44px; }
  .dc-editbar { top: 52px; }
  .dc-wh { padding: 12px var(--dc-pad); }
}
@media (max-width: 380px) { .dc-hero-date { font-size: 11px; } .dc-chip { padding: 0 10px; } }
[data-motion="reduced"] .dn-seg.on, [data-motion="off"] .dn-seg.on, [data-motion="reduced"] .dc-legend a.on i, [data-motion="off"] .dc-legend a.on i { transform: none; }
