/* Hausdesign Hermann Scherer: Gold auf Onyx bzw. Elfenbein, Glasflächen, hell/dunkel.
   Gemeinsame Grundlage für Hub (/app/static/brand.css) und Kundenbereich (/static/brand.css).
   Markenwerte nach hermannscherer.com: Gold #C1A045, Onyx #0C0C0C, Schrift DIN Pro → hier Barlow (OFL, selbst gehostet). */

@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/barlow-regular.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap; src: url(fonts/barlow-medium.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600 700; font-style: normal; font-display: swap; src: url(fonts/barlow-semibold.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/barlowcondensed-semibold.woff2) format("woff2"); }

/* ── Hell (Elfenbein) ── */
:root {
  color-scheme: light;
  --gold: #c1a045;
  --gold-hi: #ead592;
  --gold-lo: #94762a;
  --gold-grad: linear-gradient(135deg, #f0dc9c 0%, #c9a94f 42%, #a8872f 100%);
  --gold-ink: #7d5f17; /* Gold als Text auf hellem Grund, ≥ 4.5:1 */
  --gold-soft: rgba(193, 160, 69, 0.14);

  --bg: #f4f1ea;
  --mesh-1: rgba(214, 184, 98, 0.30);
  --mesh-2: rgba(255, 246, 222, 0.95);
  --mesh-3: rgba(193, 160, 69, 0.14);
  --surface: rgba(255, 254, 251, 0.86);
  --surface-solid: #fffdf9;
  --surface-2: rgba(70, 58, 30, 0.045);
  --surface-3: rgba(70, 58, 30, 0.08);
  --field: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-edge: rgba(80, 64, 24, 0.10);
  --bar: rgba(250, 248, 243, 0.72);

  --ink: #1b1813;
  --muted: #6c655a;
  --line: rgba(60, 50, 25, 0.11);
  --line-strong: rgba(60, 50, 25, 0.22);
  --accent: var(--gold-ink);
  --accent-ink: #1a1405;

  --ok: #2b6b3f;   --ok-bg: rgba(52, 140, 82, 0.13);
  --warn: #8a4d07; --warn-bg: rgba(214, 140, 40, 0.15);
  --block: #a12a22; --block-bg: rgba(200, 50, 40, 0.11);
  --todo: #285a8e; --todo-bg: rgba(60, 120, 190, 0.12);

  --shadow: 0 1px 1px rgba(60, 45, 10, 0.04), 0 8px 30px -6px rgba(60, 45, 10, 0.10);
  --shadow-lg: 0 2px 6px rgba(60, 45, 10, 0.06), 0 30px 70px -12px rgba(60, 45, 10, 0.22);
  --hairline: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --blur: blur(24px) saturate(1.6);
  --logo-filter: brightness(0.8) saturate(1.3); /* die helle Gold-Wortmarke braucht auf Elfenbein mehr Tiefe */

  --radius: 14px;
  --radius-sm: 10px;
  --sans: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Barlow Condensed", "Barlow", -apple-system, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ── Dunkel (Onyx) – Systemeinstellung, außer jemand hat „hell“ gewählt ── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="hell"]) {
    color-scheme: dark;
    --gold-ink: #dcc076;
    --gold-soft: rgba(212, 178, 92, 0.16);
    --bg: #0b0a08;
    --mesh-1: rgba(193, 160, 69, 0.22);
    --mesh-2: rgba(120, 92, 30, 0.20);
    --mesh-3: rgba(255, 220, 140, 0.06);
    --surface: rgba(24, 22, 17, 0.84);
    --surface-solid: #18160f;
    --surface-2: rgba(255, 240, 210, 0.05);
    --surface-3: rgba(255, 240, 210, 0.09);
    --field: rgba(0, 0, 0, 0.28);
    --glass-border: rgba(255, 240, 210, 0.09);
    --glass-edge: rgba(0, 0, 0, 0.5);
    --bar: rgba(14, 13, 10, 0.70);
    --ink: #f3eee4;
    --muted: #a9a193;
    --line: rgba(255, 240, 210, 0.09);
    --line-strong: rgba(255, 240, 210, 0.18);
    --ok: #7fd39c;   --ok-bg: rgba(90, 200, 130, 0.14);
    --warn: #f0b768; --warn-bg: rgba(240, 170, 80, 0.14);
    --block: #ff9a8f; --block-bg: rgba(255, 110, 95, 0.14);
    --todo: #8fbdf0; --todo-bg: rgba(110, 165, 235, 0.15);
    --shadow: 0 1px 1px rgba(0, 0, 0, 0.3), 0 10px 34px -6px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 30px 80px -10px rgba(0, 0, 0, 0.75);
    --hairline: inset 0 1px 0 rgba(255, 240, 210, 0.07);
    --logo-filter: none;
  }
}
:root[data-theme="dunkel"] {
  color-scheme: dark;
  --gold-ink: #dcc076;
  --gold-soft: rgba(212, 178, 92, 0.16);
  --bg: #0b0a08;
  --mesh-1: rgba(193, 160, 69, 0.22);
  --mesh-2: rgba(120, 92, 30, 0.20);
  --mesh-3: rgba(255, 220, 140, 0.06);
  --surface: rgba(24, 22, 17, 0.84);
  --surface-solid: #18160f;
  --surface-2: rgba(255, 240, 210, 0.05);
  --surface-3: rgba(255, 240, 210, 0.09);
  --field: rgba(0, 0, 0, 0.28);
  --glass-border: rgba(255, 240, 210, 0.09);
  --glass-edge: rgba(0, 0, 0, 0.5);
  --bar: rgba(14, 13, 10, 0.70);
  --ink: #f3eee4;
  --muted: #a9a193;
  --line: rgba(255, 240, 210, 0.09);
  --line-strong: rgba(255, 240, 210, 0.18);
  --ok: #7fd39c;   --ok-bg: rgba(90, 200, 130, 0.14);
  --warn: #f0b768; --warn-bg: rgba(240, 170, 80, 0.14);
  --block: #ff9a8f; --block-bg: rgba(255, 110, 95, 0.14);
  --todo: #8fbdf0; --todo-bg: rgba(110, 165, 235, 0.15);
  --shadow: 0 1px 1px rgba(0, 0, 0, 0.3), 0 10px 34px -6px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 30px 80px -10px rgba(0, 0, 0, 0.75);
  --hairline: inset 0 1px 0 rgba(255, 240, 210, 0.07);
  --logo-filter: none;
}

/* ── Grund ── */
* { box-sizing: border-box; }
html { font-family: var(--sans); font-size: 15px; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body { margin: 0; min-height: 100vh; line-height: 1.5; font-feature-settings: "kern", "lnum"; background-color: var(--bg); position: relative; isolation: isolate; }
/* Goldschimmer im Grund; Datenansichten dämpfen ihn über --mesh-opacity */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: var(--mesh-opacity, 1);
  background-image:
    radial-gradient(1100px 620px at 6% -12%, var(--mesh-1), transparent 62%),
    radial-gradient(900px 560px at 100% -4%, var(--mesh-2), transparent 58%),
    radial-gradient(1000px 700px at 55% 112%, var(--mesh-3), transparent 62%);
}
::selection { background: var(--gold-soft); color: var(--ink); }
html { caret-color: var(--gold); scrollbar-color: var(--line-strong) transparent; accent-color: var(--gold); }
a { color: var(--gold-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3 { letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: 1.08rem; font-weight: 600; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }


/* ── Flächen: Inhalt fast deckend; echtes Glas (Unschärfe) nur auf der Navigationsebene, unter der Inhalt durchläuft ── */
.glass, .card, .section, .kpi, table.list {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  box-shadow: var(--hairline), var(--shadow);
}
.glass { -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }

/* ── Kopfleiste ── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.65rem 1.5rem;
  background: var(--bar);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--line);
}
/* Kante erst, wenn Inhalt unter die Leiste scrollt (wo unterstützt) */
@supports (animation-timeline: scroll()) {
  .topbar { border-bottom-color: transparent; animation: bar-edge linear both; animation-timeline: scroll(root); animation-range: 0 48px; }
  @keyframes bar-edge { to { border-bottom-color: var(--line); box-shadow: 0 8px 24px -16px rgba(0, 0, 0, 0.35); } }
}
.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); font-weight: 600; }
.brand-logo { height: 18px; width: auto; display: block; filter: var(--logo-filter); }
.brand-word { font-family: var(--display); font-size: 1.15rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-ink); }
.brand-sub { font-family: var(--display); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding-left: 0.7rem; border-left: 1px solid var(--line-strong); }

/* ── Darstellung hell / System / dunkel ── */
.theme-switch { display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px; background: var(--surface-3); margin: 0; }
.theme-switch button {
  display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); cursor: pointer; font-weight: 400;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.theme-switch button:hover { color: var(--ink); }
.theme-switch svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:root:not([data-theme]) .theme-switch button[value="system"],
:root[data-theme="hell"] .theme-switch button[value="hell"],
:root[data-theme="dunkel"] .theme-switch button[value="dunkel"] { background: var(--surface-solid); color: var(--gold-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 45%, transparent), 0 1px 3px rgba(0, 0, 0, 0.18); }
html.theme-fade, html.theme-fade * { transition: background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease) !important; }

/* ── Knöpfe ── */
button, a.button, .button {
  font: inherit; font-weight: 600; letter-spacing: 0.01em;
  padding: 0.55rem 1.05rem; border-radius: 999px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border: 1px solid rgba(120, 90, 20, 0.35);
  background: var(--gold-grad); color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 1px 2px rgba(80, 60, 10, 0.18), 0 6px 16px -6px rgba(150, 115, 30, 0.55);
  transition: transform 0.16s var(--ease), box-shadow 0.2s var(--ease), filter 0.2s var(--ease), background 0.2s var(--ease);
}
button .i, .button .i { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button:hover, a.button:hover, .button:hover { filter: brightness(1.05) saturate(1.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 4px rgba(80, 60, 10, 0.2), 0 10px 24px -8px rgba(150, 115, 30, 0.6); }
button:active, a.button:active, .button:active { transform: scale(0.98); }
button.secondary, a.button.secondary, .button.secondary {
  background: var(--surface-solid); color: var(--ink); border-color: var(--line-strong);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
button.secondary:hover, a.button.secondary:hover, .button.secondary:hover { border-color: var(--gold); color: var(--gold-ink); filter: none; }
button.danger { background: var(--surface-solid); color: var(--block); border-color: color-mix(in srgb, var(--block) 40%, transparent); box-shadow: none; }
button.link { background: none; border: 0; padding: 0; color: var(--gold-ink); font-weight: 500; box-shadow: none; border-radius: 4px; }
.topbar button.link { color: var(--muted); }
.topbar button.link:hover { color: var(--ink); }
button.link:hover { filter: none; text-decoration: underline; text-underline-offset: 3px; }
button:disabled { opacity: 0.5; cursor: not-allowed; filter: grayscale(0.4); transform: none; }

/* ── Felder ── */
input, select, textarea {
  font: inherit; color: var(--ink); padding: 0.5rem 0.7rem; width: 100%; min-width: 0;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--field);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.75; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--gold); width: auto; }

/* ── Hinweise und Marken ── */
.badge { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.01em; padding: 0.14rem 0.5rem; border-radius: 6px; white-space: nowrap; vertical-align: middle; background: var(--surface-3); color: var(--muted); }
.notice { padding: 0.75rem 1rem; border-radius: var(--radius-sm); border: 1px solid transparent; }

/* Reduzierte Transparenz (Systemeinstellung): volle Flächen statt Glas */
@media (prefers-reduced-transparency: reduce) {
  .glass, .card, .section, .kpi, table.list, .topbar, .actions, .catalog-bar { background: var(--surface-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
  body::before { display: none; }
}
@media (prefers-contrast: more) {
  .glass, .card, .section, .kpi, table.list, .topbar { background: var(--surface-solid); -webkit-backdrop-filter: none; backdrop-filter: none; border-color: var(--line-strong); }
  :root { --muted: var(--ink); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (max-width: 560px) {
  .topbar { padding: 0.6rem 1rem; }
  .brand-sub { display: none; }
}
