/* AutomateDesk Portal – PX Theme v1 wie DriveDesk (frontend/src/index.css + tailwind.config.ts @ 904ad9e1):
   gleiche Farb-Tokens (HSL-Kanäle), Radien (Karten 16 px, Knöpfe 12 px, Chips 10 px), Schriften (Instrument Sans, Zahlen/Codes
   IBM Plex Mono), Knopfhöhe 40 px bzw. 48 px am Handy, Tiefpetrol-Kopfzeile wie die DriveDesk-Seitenleiste.
   Titel in TT Firs Neue wie DriveDesk (Freigabe Kevin 20.10.2026, static/fonts/LIZENZ-TT-Firs-Neue.txt). `:root` = Hell, `.dark` = Dunkel. */
@font-face { font-family: "Instrument Sans"; font-weight: 400; font-display: swap; src: url("/static/fonts/instrument-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 500; font-display: swap; src: url("/static/fonts/instrument-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 600; font-display: swap; src: url("/static/fonts/instrument-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 700; font-display: swap; src: url("/static/fonts/instrument-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("/static/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("/static/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "TT Firs Neue"; font-weight: 600; font-display: swap; src: url("/static/fonts/TTFirsNeue-DmBd.woff2") format("woff2"); }
@font-face { font-family: "TT Firs Neue"; font-weight: 700; font-display: swap; src: url("/static/fonts/TTFirsNeue-Bd.woff2") format("woff2"); }
:root {
  --background: 36 15% 94%;
  --foreground: 30 13% 9%;
  --card: 0 0% 100%;
  --card-foreground: 30 13% 9%;
  --primary: 183 100% 37%;
  --primary-foreground: 187 54% 12%;
  --secondary: 34 14% 90%;
  --secondary-foreground: 30 13% 9%;
  --muted: 36 19% 95%;
  --muted-foreground: 28 8% 39%;
  --destructive: 9 72% 44%;
  --border: 33 13% 86%;
  --input: 33 12% 82%;
  --ring: 183 100% 28%;
  --sidebar: 187 54% 12%;
  --sidebar-foreground: 0 7% 97%;
  --sidebar-muted: 188 25% 71%;
  --sidebar-active: 187 44% 22%;
  --link: 183 100% 23%;
  --px-icon-accent: #00737A;
  --warn: 35 92% 33%;
  --ok: 152 60% 28%;
  --radius: 1rem;
  color-scheme: light;
}
.dark {
  --background: 188 55% 9%;
  --foreground: 0 7% 97%;
  --card: 187 54% 12%;
  --card-foreground: 0 7% 97%;
  --secondary: 187 47% 17%;
  --secondary-foreground: 0 7% 97%;
  --muted: 187 47% 17%;
  --muted-foreground: 188 25% 71%;
  --destructive: 9 69% 47%;
  --border: 188 36% 22%;
  --input: 187 31% 27%;
  --ring: 183 100% 37%;
  --link: 183 64% 65%;
  --px-icon-accent: #00B4BC;
  --warn: 38 92% 60%;
  --ok: 152 55% 55%;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; border-color: hsl(var(--border)); }
html, body { margin: 0; }
body {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: hsl(var(--link)); }
.px-icon { flex-shrink: 0; vertical-align: middle; }
.px-icon-akzent { stroke: var(--px-icon-accent, currentColor); }
:is(button, .btn) .px-icon-akzent { stroke: currentColor; }

/* Kopfzeile: Tiefpetrol in beiden Modi */
.kopf { background: hsl(var(--sidebar)); color: hsl(var(--sidebar-foreground)); --px-icon-accent: #00B4BC; }
.kopf-innen { max-width: 1100px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.marke { font-family: "TT Firs Neue", "Instrument Sans", system-ui, sans-serif; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; color: inherit; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.marke-punkt { width: 10px; height: 10px; border-radius: 3px; background: hsl(var(--primary)); }
.kopf-rechts { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.kopf .wer { color: hsl(var(--sidebar-muted)); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
.kopf .btn-ghost { color: hsl(var(--sidebar-foreground)); }
.kopf .btn-ghost:hover { background: hsl(var(--sidebar-active)); }
.kopf form { margin: 0; }

main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { font-family: "TT Firs Neue", "Instrument Sans", system-ui, sans-serif; font-size: 24px; line-height: 1.2; margin: 0 0 4px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: hsl(var(--muted-foreground)); margin: 32px 0 12px; }
.unterzeile { color: hsl(var(--muted-foreground)); margin: 0; }

/* Knöpfe (DriveDesk Button: rounded-md = 12 px, h-10, am Handy min-h-12) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  height: 40px; padding: 0 16px; border-radius: calc(var(--radius) - 4px); border: 0;
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none;
  transition: background-color .15s, transform .1s;
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible, .kachel-link:focus-visible, input:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
.btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.btn-primary:hover { background: hsl(var(--primary) / 0.9); }
.btn-ghost { background: transparent; color: hsl(var(--foreground)); }
.btn-ghost:hover { background: hsl(var(--secondary)); }
.btn-icon { width: 40px; padding: 0; }
@media (max-width: 767px) { .btn { min-height: 48px; } .btn-icon { min-width: 48px; } }

/* Karten (DriveDesk Card: rounded-lg = 16 px, border, bg-card, shadow-sm) */
.karte { background: hsl(var(--card)); color: hsl(var(--card-foreground)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); box-shadow: 0 1px 2px rgb(0 0 0 / 0.05); }
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
@media (max-width: 400px) { .kacheln { grid-template-columns: 1fr; } }
.kachel { display: flex; flex-direction: column; min-height: 200px; }
.kachel-link { color: inherit; text-decoration: none; display: flex; flex-direction: column; flex: 1; padding: 20px; border-radius: var(--radius); }
a.kachel-link:hover { background: hsl(var(--muted)); }
.kachel-kopf { display: flex; align-items: flex-start; gap: 12px; }
.kachel-icon { width: 40px; height: 40px; border-radius: calc(var(--radius) - 6px); background: hsl(var(--secondary)); display: grid; place-items: center; }
.kachel-titel { font-family: "TT Firs Neue", "Instrument Sans", system-ui, sans-serif; font-weight: 600; font-size: 18px; line-height: 1.25; margin: 0; }
.kachel-untertitel { color: hsl(var(--muted-foreground)); font-size: 14px; margin: 2px 0 0; }
.kachel-extern { margin-left: auto; color: hsl(var(--muted-foreground)); }
.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.kennzahl { background: hsl(var(--muted)); border-radius: calc(var(--radius) - 6px); padding: 8px 10px; }
.kennzahl-wert { font-family: "IBM Plex Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 500; line-height: 1.2; display: block; }
.kennzahl-name { font-size: 12px; color: hsl(var(--muted-foreground)); }
.kennzahl[data-ton="warn"][data-aktiv] .kennzahl-wert { color: hsl(var(--warn)); }
.kennzahl[data-ton="danger"][data-aktiv] .kennzahl-wert { color: hsl(var(--destructive)); }
.kennzahl[data-ton="ok"] .kennzahl-wert { color: hsl(var(--ok)); }
.kachel-fuss { margin-top: auto; padding-top: 16px; display: flex; align-items: center; gap: 6px; font-size: 13px; color: hsl(var(--muted-foreground)); }
.kachel-fuss[data-ok="false"] { color: hsl(var(--destructive)); }
.hinweis { margin-top: 12px; font-size: 14px; color: hsl(var(--muted-foreground)); }
.kachel[data-platzhalter] { border-style: dashed; box-shadow: none; opacity: 0.65; }
.kachel[data-platzhalter] .kachel-link { cursor: default; }

/* Anmeldung */
.anmelden { max-width: 420px; margin: 8vh auto 0; padding: 24px; }
.anmelden form { display: grid; gap: 12px; margin-top: 16px; }
label { font-weight: 500; font-size: 14px; }
input[type="email"] {
  font: inherit; height: 44px; padding: 0 12px; border-radius: calc(var(--radius) - 4px);
  border: 1px solid hsl(var(--input)); background: hsl(var(--card)); color: hsl(var(--foreground)); width: 100%;
}
.notiz { font-size: 14px; color: hsl(var(--muted-foreground)); background: hsl(var(--muted)); border-radius: calc(var(--radius) - 6px); padding: 10px 12px; margin-top: 16px; }
.meldung { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; }
.nur-dunkel { display: none; }
.dark .nur-dunkel { display: inline; }
.dark .nur-hell { display: none; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:active { transform: none; } }
