/* Designsystem wie 6Hconfig / 6hselect: shadcn „zinc“ + ein blauer Akzent, Schrift Geist (lokal, OFL) */
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/fonts/geist-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/fonts/geist-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.141 0.005 285.823);
  --card: oklch(1 0 0);
  --primary: oklch(0.45 0.13 250);
  --primary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.967 0.001 286.375);
  --muted-foreground: oklch(0.552 0.016 285.938);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.92 0.004 286.32);
  --input: oklch(0.92 0.004 286.32);
  --ring: oklch(0.62 0.11 250);
  --akzent: oklch(0.95 0.02 250);
  --akzent-foreground: oklch(0.3 0.09 250);
  --radius: 0.625rem;
  /* Abzeichen (lib/abzeichen.ts) */
  --grau-bg: #f4f4f5; --grau-fg: #3f3f46;
  --blau-bg: #dbeafe; --blau-fg: #1c398e;
  --gruen-bg: #dcfce7; --gruen-fg: #0d542b;
  --amber-bg: #fef3c6; --amber-fg: #7b3306;
  --violett-bg: #ede9fe; --violett-fg: #4d179a;
  --hinweis-bg: #fffbeb; --hinweis-rand: rgb(252 211 77 / 0.6); --hinweis-fg: #461901;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: oklch(0.141 0.005 285.823);
    --foreground: oklch(0.985 0 0);
    --card: oklch(0.21 0.006 285.885);
    --primary: oklch(0.92 0.004 286.32);
    --primary-foreground: oklch(0.21 0.006 285.885);
    --muted: oklch(0.274 0.006 286.033);
    --muted-foreground: oklch(0.705 0.015 286.067);
    --destructive: oklch(0.704 0.191 22.216);
    --border: oklch(1 0 0 / 10%);
    --input: oklch(1 0 0 / 15%);
    --ring: oklch(0.552 0.016 285.938);
    --akzent: oklch(0.274 0.006 286.033);
    --akzent-foreground: oklch(0.985 0 0);
    --grau-bg: rgb(113 113 122 / .2); --grau-fg: #e4e4e7;
    --blau-bg: rgb(59 130 246 / .2); --blau-fg: #bedbff;
    --gruen-bg: rgb(34 197 94 / .2); --gruen-fg: #b9f8cf;
    --amber-bg: rgb(245 158 11 / .2); --amber-fg: #fee685;
    --violett-bg: rgb(139 92 246 / .2); --violett-fg: #ddd6ff;
    --hinweis-bg: rgb(245 158 11 / .12); --hinweis-rand: rgb(245 158 11 / .35); --hinweis-fg: #fee685;
  }
}

* { box-sizing: border-box; border-color: var(--border); }
html { height: 100%; }
body { margin: 0; display: flex; flex-direction: column; min-height: 100%;
       background: var(--background); color: var(--foreground);
       font: 14px/1.43 "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
       -webkit-font-smoothing: antialiased; }
svg.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
           stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

/* Gerüst: Kopfzeile, Seite, Fußzeile */
.kopfzeile { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; height: 56px;
             padding: 0 16px; border-bottom: 1px solid var(--border);
             background: color-mix(in oklch, var(--background) 95%, transparent); backdrop-filter: blur(8px); }
.wortmarke { display: flex; align-items: center; gap: 8px; font-weight: 600; letter-spacing: -0.025em;
             color: inherit; text-decoration: none; }
.wortmarke .zeichen { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px;
                      border-radius: calc(var(--radius) * 0.6); background: var(--primary); color: var(--primary-foreground);
                      font-size: 12px; font-weight: 700; }
.kopfzeile .claim { margin: 0 0 0 auto; color: var(--muted-foreground); }
main { width: 100%; max-width: 1280px; margin: 0 auto; flex: 1; padding: 24px 16px; }
.fusszeile { border-top: 1px solid var(--border); padding: 16px; font-size: 12px; line-height: 1.375;
             color: var(--muted-foreground); }
@media (min-width: 640px) { main { padding: 32px 24px; } }
@media (min-width: 768px) { .kopfzeile, .fusszeile { padding-left: 32px; padding-right: 32px; } }
@media (max-width: 639px) { .kopfzeile .claim { display: none; } }

.seitenkopf { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.seitenkopf .kennung { margin: 0; color: var(--muted-foreground); }
.seitenkopf h1 { margin: 0; font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.025em; }
.seitenkopf .beschreibung { margin: 4px 0 0; max-width: 42rem; color: var(--muted-foreground); }
.aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Button */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 10px;
       border: 1px solid transparent; border-radius: var(--radius); font: inherit; font-weight: 500; white-space: nowrap;
       cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; pointer-events: none; }
.btn:focus-visible, .eingabe:focus-visible, .auswahl select:focus-visible, .tabs button:focus-visible {
  outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent); }
.btn-primaer { background: var(--primary); color: var(--primary-foreground); }
.btn-primaer:hover { background: color-mix(in oklch, var(--primary) 80%, transparent); }
.btn-outline { background: var(--background); color: var(--foreground); border-color: var(--border); }
.btn-outline:hover { background: var(--muted); }
.btn-sm { height: 28px; font-size: 12.8px; }

/* Eingaben */
.eingabe { height: 32px; width: 100%; padding: 4px 10px; border: 1px solid var(--input); border-radius: var(--radius);
           background: transparent; color: inherit; font: inherit; }
.eingabe::placeholder { color: var(--muted-foreground); }
.suche { position: relative; flex: 1 1 260px; max-width: 360px; }
.suche svg { position: absolute; left: 10px; top: 8px; color: var(--muted-foreground); }
.suche .eingabe { padding-left: 32px; }
.auswahl { position: relative; display: inline-flex; }
.auswahl select { appearance: none; height: 32px; padding: 4px 32px 4px 10px; border: 1px solid var(--input);
                  border-radius: var(--radius); background: transparent; color: inherit; font: inherit; }
.auswahl svg { position: absolute; right: 10px; top: 8px; color: var(--muted-foreground); pointer-events: none; }
.haken { display: inline-flex; align-items: center; gap: 6px; color: var(--foreground); cursor: pointer; user-select: none; }
.haken input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }

/* Karte, Kennzahlen, Hinweise */
.karte { background: var(--card); border-radius: calc(var(--radius) * 1.4);
         box-shadow: 0 0 0 1px color-mix(in oklch, var(--foreground) 10%, transparent); }
.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.kennzahl { padding: 12px 16px; }
.kennzahl .wert { font-size: 24px; font-weight: 600; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.kennzahl .label { color: var(--muted-foreground); font-size: 12px; }
.hinweis { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--hinweis-rand); background: var(--hinweis-bg);
           color: var(--hinweis-fg); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 12px; }
.hinweis svg { margin-top: 2px; }
.fehler { border-color: color-mix(in oklch, var(--destructive) 30%, transparent);
          background: color-mix(in oklch, var(--destructive) 10%, transparent); color: var(--destructive); }

/* Ablage / Leerzustand */
.ablage { border: 1px dashed var(--border); border-radius: calc(var(--radius) * 1.4); padding: 48px 24px; text-align: center;
          transition: border-color .15s, background .15s; }
.ablage.aktiv { border-color: var(--primary); background: color-mix(in oklch, var(--primary) 5%, transparent); }
.ablage .gross { width: 32px; height: 32px; color: var(--muted-foreground); }
.ablage .titel { margin: 12px auto 4px; font-size: 18px; font-weight: 500; color: var(--foreground); }
.ablage p { margin: 0 auto 16px; max-width: 32rem; color: var(--muted-foreground); }
.fortschritt { height: 4px; border-radius: 999px; background: var(--muted); overflow: hidden; margin-bottom: 16px; }
.fortschritt span { display: block; height: 100%; width: 35%; border-radius: 999px; background: var(--primary);
                    animation: lauf 1.2s ease-in-out infinite; }
@keyframes lauf { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

/* Tabs (Segment) */
.tabs { display: inline-flex; align-items: center; height: 32px; padding: 3px; border-radius: var(--radius);
        background: var(--muted); color: var(--muted-foreground); margin-bottom: 16px; }
.tabs button { height: 100%; padding: 2px 10px; border: 1px solid transparent; border-radius: calc(var(--radius) * 0.6);
               background: none; font: inherit; font-weight: 500; color: color-mix(in oklch, var(--foreground) 60%, transparent); cursor: pointer; }
.tabs button:hover { color: var(--foreground); }
.tabs button.aktiv { background: var(--background); color: var(--foreground); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.filter { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 12px; }
.treffer { margin-left: auto; color: var(--muted-foreground); font-size: 12px; }

/* Tabelle */
.tabelle { overflow: hidden; margin-bottom: 24px; }
.tabelle .scroll { overflow-x: auto; }
h2 { font-size: 16px; font-weight: 500; margin: 0 0 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { height: 40px; padding: 0 8px; text-align: left; vertical-align: middle; font-weight: 500; white-space: nowrap;
     background: var(--background); box-shadow: inset 0 -1px 0 var(--border); }
td { padding: 8px; vertical-align: top; border-bottom: 1px solid var(--border); }
tbody tr:nth-child(even) td { background: color-mix(in oklch, var(--muted) 40%, transparent); }
tbody tr:hover td { background: color-mix(in oklch, var(--muted) 50%, var(--background)); }
tbody tr:last-child td { border-bottom: 0; }
@media (min-width: 768px) { th { position: sticky; top: 56px; z-index: 10; } .tabelle { overflow: visible; } .tabelle .scroll { overflow: visible; } }
th:first-child, td:first-child { padding-left: 16px; }
th:last-child, td:last-child { padding-right: 16px; }
.zahl { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
td.erm { color: var(--muted-foreground); font-size: 12.5px; max-width: 520px; }
td.bez { min-width: 220px; }
tr.oz td { background: var(--akzent) !important; color: var(--akzent-foreground); font-weight: 600; }
tr.oz td .neben { font-weight: 400; opacity: .8; }
tr.aus td { color: var(--muted-foreground); }
.leer { padding: 40px; text-align: center; color: var(--muted-foreground); }

/* Abzeichen */
.abzeichen { display: inline-flex; align-items: center; height: 20px; padding: 2px 8px; border-radius: 999px;
             font-size: 12px; font-weight: 500; white-space: nowrap; }
.abzeichen + .abzeichen { margin-left: 4px; }
.grau { background: var(--grau-bg); color: var(--grau-fg); }
.blau { background: var(--blau-bg); color: var(--blau-fg); }
.gruen { background: var(--gruen-bg); color: var(--gruen-fg); }
.amber { background: var(--amber-bg); color: var(--amber-fg); }
.violett { background: var(--violett-bg); color: var(--violett-fg); }
