/* Auvance Cockpit: gemeinsame Tokens und Grundbausteine.
   Gehört allen Modulen. Nur ergänzen, nichts umbenennen, was ein Modul benutzt.
   Seit 09.10.2026 immer hell und mit größerer Schrift (Zielgruppe: Inhaber um die 50, siehe PRODUCT.md). */

@import url("https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@100..125,500..800&family=Public+Sans:ital,wght@0,400..700;1,400&display=swap");

:root {
  color-scheme: light;
  /* Neutrale, ganz leicht Richtung Auvance-Blau getönt */
  --bg:          oklch(0.972 0.005 250);
  --surface:     oklch(0.995 0.002 250);
  --surface-2:   oklch(0.948 0.007 250);
  --ink:         oklch(0.235 0.022 258);
  --ink-2:       oklch(0.35 0.02 258);
  --muted:       oklch(0.46 0.018 258);
  --faint:       oklch(0.6 0.014 256);
  --line:        oklch(0.905 0.007 250);
  --line-strong: oklch(0.835 0.011 252);

  /* Akzent = Auvance-Blau (#0968f6), nur für Aktionen, Links, Auswahl */
  --accent:      oklch(0.555 0.205 260);
  --accent-press:oklch(0.49 0.19 260);
  --accent-soft: oklch(0.945 0.028 258);
  --on-accent:   oklch(0.99 0.004 250);

  /* Zustände: Grün = in Ordnung, Bernstein = bitte ansehen, Rot nur für echtes Überfälliges */
  --danger:      oklch(0.53 0.18 28);
  --danger-soft: oklch(0.955 0.024 28);
  --warn:        oklch(0.52 0.12 62);
  --warn-soft:   oklch(0.96 0.04 82);
  --ok:          oklch(0.5 0.12 155);
  --ok-soft:     oklch(0.955 0.032 155);

  --font: "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Archivo", "Public Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Typo-Skala ca. 1.2, eine Stufe größer als üblich: lesbar mit Lesebrille */
  --t-xs: 0.8125rem;  /* 13 */
  --t-sm: 0.9375rem;  /* 15 */
  --t-md: 1.0625rem;  /* 17 */
  --t-lg: 1.25rem;    /* 20 */
  --t-xl: 1.5rem;     /* 24 */
  --t-2xl: 1.875rem;  /* 30 */
  --t-3xl: 2.375rem;  /* 38 */

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1); /* ease-out-quint */
  --shadow-pop: 0 14px 36px -18px oklch(0.3 0.05 260 / 0.35);
  --leiste-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.num, td.num, .tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 0.88em; letter-spacing: 0; }

h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-family: var(--display); font-weight: 700; font-stretch: 112%; letter-spacing: -0.015em; }
a { color: var(--accent); text-underline-offset: 3px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Buttons: eine Form für alle Module */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45em;
  min-height: 44px; padding: 0 18px;
  font: 600 var(--t-sm)/1 var(--font);
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), transform 160ms var(--ease);
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-press); border-color: var(--accent-press); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: var(--t-xs); }

/* Segment-Umschalter */
.seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--surface-2); border-radius: 10px; }
.seg button {
  min-height: 36px; padding: 0 14px; border: 0; border-radius: 7px;
  font: 600 var(--t-sm)/1 var(--font); color: var(--muted); background: transparent; cursor: pointer;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] {
  color: var(--ink); background: var(--surface); box-shadow: 0 1px 2px oklch(0.3 0.03 260 / 0.14);
}

/* Formfelder */
.field { display: grid; gap: 6px; font-size: var(--t-sm); color: var(--ink-2); font-weight: 500; }
.input {
  min-height: 44px; padding: 0 12px; width: 100%;
  font: 400 var(--t-md)/1.2 var(--font); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
}
textarea.input { padding: 12px; min-height: 180px; line-height: 1.55; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Status-Marken */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: var(--t-xs); font-weight: 600; white-space: nowrap;
  color: var(--ink-2); background: var(--surface-2);
}
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.tag-danger { color: var(--danger); background: var(--danger-soft); }
.tag-warn { color: var(--warn); background: var(--warn-soft); }
.tag-ok { color: var(--ok); background: var(--ok-soft); }
.tag-accent { color: var(--accent); background: var(--accent-soft); }

/* „Mehr Details“: alles, was nicht auf den ersten Blick muss */
details.mehr-details { margin-top: 48px; border-top: 1px solid var(--line-strong); }
details.mehr-details > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px;
  padding: 20px 0; font: 650 var(--t-lg)/1.3 var(--font); color: var(--ink);
}
details.mehr-details > summary::-webkit-details-marker { display: none; }
details.mehr-details > summary .pfeil {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-2); color: var(--ink-2); transition: transform 220ms var(--ease), background-color 160ms var(--ease);
}
details.mehr-details > summary:hover .pfeil { background: var(--accent-soft); color: var(--accent); }
details.mehr-details[open] > summary .pfeil { transform: rotate(180deg); }
details.mehr-details > summary small { display: block; font: 400 var(--t-sm)/1.4 var(--font); color: var(--muted); margin-top: 2px; }

/* Maskottchen: echtes 3D, freigestellt, nie in Kreise geschnitten */
.maskottchen { display: block; height: auto; filter: drop-shadow(0 10px 14px oklch(0.35 0.04 258 / 0.16)); user-select: none; pointer-events: none; }

/* ---------------------------------------------------------------- Cockpit-Leiste (shell.js) */
.av-leiste {
  position: sticky; top: 0; z-index: 50; height: var(--leiste-h);
  display: flex; align-items: center; gap: 28px; padding: 0 28px;
  background: color-mix(in oklch, var(--surface) 96%, transparent);
  border-bottom: 1px solid var(--line);
  font: 600 var(--t-sm)/1 var(--font); color: var(--ink-2);
}
.av-leiste a { color: inherit; text-decoration: none; }
.av-marke { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); white-space: nowrap; }
.av-marke b { font: 750 1.125rem/1 var(--display); font-stretch: 115%; letter-spacing: -0.01em; }
.av-marke span { font-weight: 500; color: var(--muted); }
.av-tabs { display: flex; gap: 4px; height: 100%; flex: 1; min-width: 0; }
.av-tabs a {
  display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 100%;
  color: var(--muted); border-bottom: 3px solid transparent; border-top: 3px solid transparent; white-space: nowrap;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}
.av-tabs a svg { flex: none; }
.av-tabs a:hover { color: var(--ink); }
.av-tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.av-rechts { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.av-leiste .av-konto {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px 0 6px;
  border-radius: 999px; color: var(--ink);
  transition: background-color 160ms var(--ease);
}
.av-konto:hover, .av-konto[aria-current="page"] { background: var(--surface-2); }
.av-konto .kreis {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font: 700 var(--t-sm)/1 var(--font);
}
.av-rechts select {
  font: 600 var(--t-sm)/1 var(--font); color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 10px; min-height: 40px; max-width: 220px;
}
.av-raus {
  font: 600 var(--t-sm)/1 var(--font); color: var(--ink-2); background: none;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); min-height: 40px; padding: 0 14px; cursor: pointer;
}
.av-raus:hover { background: var(--surface-2); }
.av-unten { display: none; }

@media (max-width: 760px) {
  .av-leiste { padding: 0 16px; gap: 12px; }
  .av-tabs { display: none; }
  .av-rechts { margin-left: auto; }
  .av-raus, .av-konto .name { display: none; }
  .av-leiste .av-konto { padding: 0 6px; }
  .av-rechts select { max-width: 150px; }
  /* Unten eine App-Leiste mit großen Feldern, wie man es vom Handy kennt */
  .av-unten {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in oklch, var(--surface) 97%, transparent); border-top: 1px solid var(--line);
  }
  .av-unten a {
    display: grid; justify-items: center; gap: 4px; padding: 8px 4px; border-radius: var(--r-sm);
    font: 600 var(--t-xs)/1.1 var(--font); color: var(--muted); text-decoration: none; text-align: center;
  }
  .av-unten a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
  body.av-hat-unten { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
