/* ============================================================
   CEO-Seiten: gemeinsame Design-Tokens und Bausteine
   (nach mobile.css laden). Farben tragen Bedeutung:
   primary = Aktion/unterwegs, good = erledigt, warn = bald faellig, bad = Problem.
   Kein Lila/Violett.
   ============================================================ */
:root {
  --ff-bg: #101922;
  --ff-surface: #1c2632;
  --ff-surface-2: #0f172a;
  --ff-line: #1e293b;
  --ff-line-2: #334155;
  --ff-ink: #e2e8f0;
  --ff-ink-2: #94a3b8;
  --ff-ink-3: #64748b;
  --ff-primary: #137fec;
  --ff-good: #22c55e;
  --ff-warn: #f59e0b;
  --ff-bad: #ef4444;
  --ff-accent: #ffb020; /* Signalfarbe der App */
  --ff-radius: .75rem;
  --ff-radius-sm: .5rem;
}

/* Fokus sichtbar fuer Tastatur */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--ff-primary);
  outline-offset: 2px;
}

/* Eingabefelder im Dark Theme: das Tailwind-Forms-Plugin wird von der CDN NACH den Seiten-Styles
   eingefuegt und faerbt [type=...] weiss - hier mit hoeherer Spezifitaet (0,1,1) zurueck. */
input.inp, select.inp, textarea.inp { background-color: var(--ff-surface-2); color: var(--ff-ink); border-color: var(--ff-line-2); }

/* Bausteine */
.ff-card { background: var(--ff-surface); border: 1px solid var(--ff-line); border-radius: var(--ff-radius); min-width: 0; }
.ff-pill { display: inline-flex; align-items: center; gap: .25rem; border-radius: 999px; font-size: .72rem; font-weight: 700;
  padding: .1rem .55rem; white-space: nowrap; }
.ff-pill--good { color: var(--ff-good); background: rgb(34 197 94 / .12); }
.ff-pill--warn { color: var(--ff-warn); background: rgb(245 158 11 / .12); }
.ff-pill--bad { color: var(--ff-bad); background: rgb(239 68 68 / .12); }
.ff-pill--info { color: #60a5fa; background: rgb(59 130 246 / .14); }
.ff-pill--mute { color: var(--ff-ink-2); background: rgb(148 163 184 / .12); }
.ff-empty { padding: 3rem 1rem; text-align: center; color: var(--ff-ink-2); }

/* Meldungen (FF.toast) */
#ff-toasts { position: fixed; right: 1.5rem; top: 1.25rem; z-index: 900; display: flex; flex-direction: column;
  gap: .5rem; align-items: flex-end; pointer-events: none; }
.ff-toast { pointer-events: auto; display: flex; align-items: center; gap: .5rem; max-width: 26rem; padding: .65rem .9rem;
  border-radius: var(--ff-radius-sm); font-size: .875rem; font-weight: 500; color: #fff; background: #1e293b;
  border: 1px solid var(--ff-line-2); box-shadow: 0 10px 30px rgb(0 0 0 / .35); transition: opacity .25s, transform .25s; }
.ff-toast .material-symbols-outlined { font-size: 20px; }
.ff-toast--success .material-symbols-outlined { color: var(--ff-good); }
.ff-toast--error { border-color: rgb(239 68 68 / .5); }
.ff-toast--error .material-symbols-outlined { color: var(--ff-bad); }
.ff-toast--warn .material-symbols-outlined { color: var(--ff-warn); }
.ff-toast--info .material-symbols-outlined { color: #60a5fa; }
.ff-toast--out { opacity: 0; transform: translateY(-6px); }

/* Fahrzeug-Marker wie in der App (Dispo-Karte): farbiger Kreis mit LKW + Kennzeichen-Label */
.rm-truck { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 92px; height: 54px;
  cursor: pointer; }
.rm-truck.stale { opacity: .5; }
.rm-truck.dim { opacity: .15; }
.rm-truck__dot { box-sizing: content-box; width: 18px; height: 18px; padding: 4px; border: 2px solid #fff; border-radius: 50%;
  background: var(--c); }
.rm-truck__dot .material-symbols-outlined { display: block; font-size: 18px; line-height: 18px; width: 18px; height: 18px;
  color: #fff; font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20; }
.rm-truck__label { max-width: 92px; box-sizing: border-box; padding: 1px 4px; border-radius: 4px;
  background: rgba(13, 21, 32, .9); color: #e2e2e9; font: 700 10px/1.17 Roboto, Inter, system-ui, sans-serif;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-truck.sel .rm-truck__dot { box-shadow: 0 0 0 3px var(--ff-accent); }

@media (max-width: 1023px) {
  #ff-toasts { left: 1rem; right: 1rem; align-items: stretch;
    top: calc(var(--mobile-header-height, 56px) + var(--safe-top, 0px) + .5rem); }
  .ff-toast { max-width: none; }

  /* Seiten mit <body class="... flex">: der mobile Kopf (sidebar.js) wird sonst eine Spalte neben <main>
     und schiebt den Inhalt aus dem Bild (lohn, finanzen, dokumente, fuhrpark, ...). */
  body.flex { display: block !important; }
  main.flex-1, main { min-width: 0; width: 100%; }

  /* Kopfzeilen umbrechen statt die Seite zu verbreitern */
  main > header, .page-header { flex-wrap: wrap; row-gap: .75rem; }

  /* Tailwind-CDN wird nach mobile.css eingefuegt -> hier mit hoeherer Spezifitaet */
  body .px-8, body .px-6 { padding-left: 1rem; padding-right: 1rem; }
  body .p-8 { padding: 1rem; }

  /* Dialoge/Drawer (Tailwind z-50/z-[60]) muessen ueber der unteren Navigation (z 500) liegen,
     sonst sind ihre Speichern-Knoepfe auf dem Handy nicht klickbar */
  .fixed.z-50, .fixed.z-\[60\] { z-index: 700; }

  /* Kompakte Tabellen-Selects (Planer) nicht auf 44px aufblasen */
  select.kfz-sel { min-height: 36px; }
}
