/* Gemeinsame Bausteine (docs/07_design_system.md), uebernommen aus dem Mockup.
   Sichtspezifisches steht in leitstand.css / kunde.css / techniker.css. */
@import url("/static/tokens.css");

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--ground);
}
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; margin: 0; line-height: 1.1; letter-spacing: -0.005em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue-light); outline-offset: 2px; }
.nur-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.mono { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}
.gedaempft { color: var(--muted); }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.crit-text { color: var(--crit); }

/* ---------------------------------------------------------------- Marke */
.marke { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.marke-icon { color: var(--blue-light); flex: none; }
.marke-text { display: flex; flex-direction: column; line-height: 1.05; }
.marke-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: 0.01em; }
.marke-punkt { color: var(--blue-light); }
.marke-unter { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--on-navy-muted); margin-top: 3px; }

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--touch); padding: 0 18px;
  border-radius: var(--r-sm); border: 1px solid transparent;
  font-weight: 700; font-size: 15px; line-height: 1.15; text-align: center; text-decoration: none;
  background: var(--surface); color: var(--text);
}
.btn-primaer { background: var(--blue); color: #fff; }
.btn-primaer:hover { background: var(--blue-dark); color: #fff; }
.btn-sekundaer { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn-sekundaer:hover { border-color: var(--text); color: var(--text); }
.btn-krit { background: var(--crit); color: #fff; }
.btn-krit:hover { background: var(--crit-text); color: #fff; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { background: var(--ok-text); color: #fff; }
.btn-dunkel { background: var(--navy); color: #fff; }
.btn-dunkel:hover { background: var(--navy-2); color: #fff; }
.btn-auf-navy { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.btn-auf-navy:hover { border-color: #fff; color: #fff; }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--disabled-bg); color: var(--off-fg); border-color: transparent; cursor: not-allowed; }
.btn-gross { min-height: 54px; font-size: 16px; }
.btn-klein { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn-voll { width: 100%; }
.btn-link { background: none; border: 0; padding: 0; min-height: auto; color: var(--blue); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ---------------------------------------------------------------- Pills & Badges */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 7px; border-radius: var(--r-xs); white-space: nowrap;
}
.pill-ok { background: var(--ok-tint); color: var(--ok-text); }
.pill-warn { background: var(--warn-tint); color: var(--warn-text); }
.pill-crit { background: var(--crit-tint); color: var(--crit-text); }
.pill-info, .pill-blue { background: var(--blue-tint); color: var(--blue-dark); }
.pill-teal { background: var(--auto-bg); color: var(--auto-fg); }
.pill-neutral { background: var(--disabled-bg); color: var(--muted); }
.pill-voll { background: var(--blue); color: #fff; }

.modus { display: inline-flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.modus-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border-radius: var(--r-sm); border: 1px solid;
  font-weight: 700; font-size: 13.5px;
}
.modus-kunde { background: var(--kunde-bg); color: var(--kunde-fg); border-color: var(--kunde-line); }
.modus-automatik { background: var(--auto-bg); color: var(--auto-fg); border-color: var(--auto-line); }
.modus-techniker { background: var(--tech-bg); color: var(--tech-fg); border-color: var(--tech-line); }
.modus-unter { font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------------- Selbstdiagnose-Matrix */
.matrix { display: inline-flex; gap: 3px; }
.matrix-feld { width: 13px; height: 18px; border-radius: 2px; background: var(--diag-none); }
.matrix-klein { gap: 2px; }
.matrix-klein .matrix-feld { width: 10px; height: 14px; }
.stufe-ok { background: var(--diag-green); }
.stufe-warn { background: var(--diag-yellow); }
.stufe-crit { background: var(--diag-red); }
.stufe-none { background: var(--diag-none); }
.stufe-aktiv { background: var(--blue); animation: blinken 0.9s infinite; }

/* ---------------------------------------------------------------- Segmente */
.segmente { display: flex; gap: 3px; }
.segment { flex: 1; height: 6px; border-radius: 1px; background: var(--diag-none); }
.seg-ok { background: var(--ok-bar); }
.seg-aktiv { background: var(--blue); }
.seg-hell { background: var(--blue-light); }
.seg-fehler { background: var(--diag-red); }
.seg-warn { background: var(--diag-yellow); }
.segmente-dunkel .segment { background: rgba(255, 255, 255, 0.16); }
.segmente-dunkel .seg-ok { background: var(--ok-bar); }
.segmente-dunkel .seg-hell { background: var(--blue-light); }
.segmente-dunkel .seg-fehler { background: var(--diag-red); }
.segmente-dunkel .seg-warn { background: var(--diag-yellow); }

/* ---------------------------------------------------------------- Karte */
.karte { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }

/* ---------------------------------------------------------------- Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 100;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: min(520px, calc(100vw - 32px));
  background: var(--navy); color: #fff; font-weight: 600; font-size: 14.5px;
  padding: 12px 18px; border-radius: var(--r-sm); border-left: 4px solid var(--ok-bar);
  box-shadow: 0 16px 36px -16px rgba(10, 37, 64, 0.6);
  transition: opacity 0.18s, transform 0.18s;
}
.toast.sichtbar { opacity: 1; transform: translate(-50%, 0); }
.toast-warn { border-left-color: var(--warn-bar); }
.toast-crit { border-left-color: var(--crit); }
.toast-info { border-left-color: var(--blue-light); }

/* ---------------------------------------------------------------- Handy-Rahmen (mobile Sichten) */
body.mobil { background: #dde4ee; }
.telefon {
  position: relative;
  display: flex; flex-direction: column;
  width: 100%; min-height: 100dvh;
  background: var(--ground);
  overflow: hidden;
}
@media (min-width: 560px) {
  body.mobil { display: grid; place-items: center; min-height: 100dvh; padding: 32px 16px 56px; }
  .telefon {
    width: 390px; height: 844px; min-height: 0;
    border-radius: 22px; border: 10px solid var(--navy);
    box-shadow: 0 30px 60px -30px rgba(10, 37, 64, 0.6);
  }
  /* Sheets, Toasts u. Ae. bleiben im Rahmen */
  .telefon .im-rahmen { position: absolute; }
}
.telefon-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }

/* ---------------------------------------------------------------- Animationen */
@keyframes blinken { 50% { opacity: 0.35; } }
@keyframes puls { 0% { box-shadow: 0 0 0 0 rgba(63, 191, 132, 0.6); } 70% { box-shadow: 0 0 0 7px rgba(63, 191, 132, 0); } 100% { box-shadow: 0 0 0 0 rgba(63, 191, 132, 0); } }
@keyframes drehen { to { transform: rotate(360deg); } }
.drehend { animation: drehen 0.9s linear infinite; }
.live-punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--ok-bar); animation: puls 1.6s infinite; flex: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------------------------------------------------------------- Fotos */
.foto-leiste { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.foto-kachel { position: relative; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: var(--disabled-bg); flex: none; }
.foto-kachel img { display: block; width: 100%; height: 100%; object-fit: cover; }
.foto-weg {
  position: absolute; top: 3px; right: 3px; width: 26px; height: 26px; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 50%;
  background: rgba(10, 37, 64, 0.8); color: #fff;
}

/* ---------------------------------------------------------------- Dialoge (<dialog>) */
dialog { border: 0; padding: 0; border-radius: var(--r-md); box-shadow: 0 24px 60px -20px rgba(10, 37, 64, 0.55); color: var(--text); max-width: calc(100vw - 32px); }
dialog::backdrop { background: rgba(10, 37, 64, 0.45); }
form.inline { display: inline; margin: 0; }
label.laedt { opacity: 0.6; pointer-events: none; }
