/* Hallmark · genre: modern-minimal · macrostructure: Workbench · design-system: design.md · designed-as-app
   Theme: InPraxis Türkis/Rosa (locked) · tone: freundlich-klinisch · anchor hue: türkis
   Hallmark · pre-emit critique: P4 H4 E4 S4 R5 V4
   ========================================================================= */
@font-face {
  font-family: "Inclusive Sans";
  src: url("/fonts/InclusiveSans-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inclusive Sans";
  src: url("/fonts/InclusiveSans-Italic-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900; font-style: italic; font-display: swap;
}

:root {
  /* Flächen (hell, kühl-klinisch mit Türkis-Hauch) */
  --bg:            #F4FAFA;
  --surface:       #FFFFFF;   /* Karten */
  --surface-2:     #ECF6F5;   /* erhöht / Kopfzeilen / Hover-Tint */
  --bg-hover:      #E6F3F2;

  /* Text (weiches Schiefer-Petrol) */
  --text:          #23383E;
  --text-muted:    #5F757B;
  --text-subtle:   #9AACB0;

  /* Akzent (Türkis) — primäre Aktion */
  --brand:         #17B3AC;
  --brand-600:     #109A94;
  --primary:       #17B3AC;
  --primary-600:   #109A94;

  /* Rosa (hauchzart) — sekundärer Akzent / weiche Hervorhebung */
  --pink:          #EFA6BE;
  --pink-soft:     #FCEAF0;

  /* Linien */
  --border:        #E0EBEB;
  --border-strong: #C9DCDB;

  /* Status */
  --danger:        #E06478;
  --success:       #2FB39B;
  --warning:       #E0A33E;

  /* Node-/Kalender-Akzente (Editor-Semantik) */
  --accent-event:      #5DCAA5;
  --accent-action:     #7FC4E0;
  --accent-gateway:    #E7B36A;
  --accent-automation: #B4A9E6;

  /* Radius */
  --radius-sm:   5px;
  --radius:      9px;
  --radius-lg:   14px;
  --radius-pill: 999px;

  /* Schatten (auf hellem Grund weich) */
  --shadow-sm: 0 1px 2px rgba(35,56,62,.06);
  --shadow:    0 4px 16px rgba(35,56,62,.08);
  --shadow-lg: 0 18px 50px rgba(35,56,62,.16);

  /* Abstände */
  --space-1: 8px;  --space-2: 8px;  --space-3: 16px; --space-4: 24px;
  --space-5: 32px; --space-6: 32px; --space-8: 48px;

  /* Typografie — Inclusive Sans (Display+Body) + System-Mono (Daten-Outlier, DSGVO-sicher) */
  --font: "Inclusive Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "SF Mono", "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", "Liberation Mono", monospace;
  --fs-sm: 14px; --fs: 16px; --fs-lg: 20px;
  --text-2xl: 25px; --text-3xl: 31px;
  --text-display: clamp(2rem, 3vw + 1rem, 2.9rem);

  /* Bewegung */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-short: 200ms; --dur-mid: 320ms;

  --ring: 0 0 0 3px rgba(23,179,172,.28);
  --max-width: 1180px;

  /* Einheitliche Höhe für Bedienelemente (Höhe der Nav-Pill-Buttons) */
  --control-h: 36px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }
body {
  font-family: var(--font); font-size: var(--fs); line-height: 1.55;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6 { text-wrap: balance; letter-spacing: -0.02em; font-weight: 700; line-height: 1.15; }
p, li { text-wrap: pretty; }
a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: none; }
code, .mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
code { background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 6px; font-size: .9em; }
/* Daten-Register: Zeiten, GOP-Ziffern, Chiffren, Beträge, IDs — mono + tabellarische Ziffern */
.num { letter-spacing: -0.01em; }
.tnum { font-variant-numeric: tabular-nums; }

/* Kleinschrift-Label (Small-Caps-Stimme) */
.label { font-size: var(--fs-sm); font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted); }
/* Hairline-Regel als Struktur-Sprache (statt überall Karten) */
.rule { border: none; border-top: 1px solid var(--border); margin: var(--space-4) 0; }

/* ---- Topbar: einheitliche Floating-Pill (Arbeit + Admin gleich) ---- */
header {
  position: fixed; top: 14px; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  padding: 0 var(--space-4); height: auto; background: transparent; border: none;
}
/* Die Pill selbst: nur Marke + Navigation, zentriert, gut eingerückt, einzeilig */
.navpill {
  display: flex; align-items: center; gap: var(--space-5);
  padding: 9px 24px; max-width: calc(100% - 420px);
  background: var(--surface); /* Fallback ohne color-mix */
  background: color-mix(in oklch, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 12px 34px -14px rgba(35,56,62,.28);
}
.navpill .wordmark { display: flex; align-items: center; gap: 9px; font-weight: 700;
  letter-spacing: -0.02em; font-size: var(--fs-lg); white-space: nowrap; }
.navpill .wordmark::before {
  content: ""; width: 13px; height: 13px; border-radius: 4px;
  background: var(--brand); box-shadow: 0 0 0 3px rgba(23,179,172,.18);
}
.navpill .topnav { flex-wrap: nowrap; gap: 6px; }
.navpill .topnav a { padding: 7px 15px; border-radius: var(--radius-pill); border-bottom: none;
  color: var(--text-muted); white-space: nowrap; }
.navpill .topnav a:hover { background: var(--surface-2); color: var(--text); }
.navpill .topnav a.active { background: var(--brand); color: #fff; border-bottom: none; }

/* Außerhalb der Pill: Modus-Umschalter + Logout, rechts angeheftet */
.chrome-right {
  position: absolute; right: var(--space-4); top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: var(--space-3);
}
.chrome-right #logout { color: var(--text-muted); font-size: var(--fs-sm); font-weight: 600; }
.chrome-right #logout:hover { color: var(--text); }

body.has-pill main { padding-top: 92px; }
@media (max-width: 1024px) {
  header { flex-wrap: wrap; justify-content: center; gap: 8px; top: 8px; }
  .navpill { max-width: calc(100% - 20px); padding: 8px 16px; gap: var(--space-3); }
  .navpill .topnav { flex-wrap: wrap; justify-content: center; }
  .chrome-right { position: static; transform: none; }
  body.has-pill main { padding-top: 150px; }
}

main { padding: var(--space-6) var(--space-4); max-width: var(--max-width); margin: 0 auto; }

/* Seiten-Kopf (Masthead statt Deko-Hero): Display-Titel + Hairline, links-betont */
.masthead { margin-bottom: var(--space-5); padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border); }
.masthead h1 { font-size: var(--text-display); margin: 0 0 4px; }
.masthead .sub { color: var(--text-muted); font-size: var(--fs-lg);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---- Buttons ---- */
button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--control-h); padding: 0 16px;
  font: inherit; font-weight: 600; cursor: pointer;
  color: var(--text); background: var(--surface);
  border: 1.5px solid var(--border-strong); border-radius: var(--radius);
  transition: background var(--dur-short) var(--ease-out),
              color var(--dur-short) var(--ease-out),
              border-color var(--dur-short) var(--ease-out),
              transform 100ms var(--ease-out);
}
button:hover { background: var(--surface-2); border-color: var(--brand); color: var(--text); }
button:active { transform: translateY(1px); }
button:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.primary:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
button.ghost { background: transparent; border-color: transparent; color: var(--brand); min-height: 0; padding: 6px 10px; }
button.ghost:hover { background: transparent; color: var(--brand-600); text-decoration: underline; }

/* ---- Formularfelder ---- */
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 8px 12px;
  transition: border-color var(--dur-short) var(--ease-out), box-shadow var(--dur-short) var(--ease-out);
}
/* Exakt gleiche Höhe wie die Buttons (geerbte line-height 1.55 zurücksetzen) */
input, select { min-height: var(--control-h); padding: 6px 12px; line-height: 1.2; }
input::placeholder { color: var(--text-subtle); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
label { font-size: var(--fs-sm); color: var(--text-muted); }

/* ---- Tabellen ---- */
table {
  border-collapse: separate; border-spacing: 0; width: 100%;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  font-variant-numeric: tabular-nums;
}
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); }
th { background: var(--surface-2); color: var(--text-muted);
  font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }

/* ---- Bausteine ---- */
.card { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--shadow); }
.panel { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--space-3); }
.badge { display: inline-block; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); border-radius: var(--radius-pill); padding: 3px 12px; font-size: 13px; font-weight: 600; }
.toolbar { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; margin-bottom: var(--space-4); }
.muted { color: var(--text-muted); }

/* Workbench-Split: breitere Primär-Spalte + schmales Rail (bewusst asymmetrisch) */
.workbench { display: grid; grid-template-columns: 1.65fr 1fr; gap: var(--space-4); align-items: start; }
.workbench > .rail { position: sticky; top: calc(60px + var(--space-4)); }
@media (max-width: 860px) { .workbench { grid-template-columns: 1fr; } .workbench > .rail { position: static; } }

/* Hero (Startseite) — ruhig, ohne Verlauf/Blob (Slop entfernt) */
.hero {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-8); position: relative;
}
.hero h1 { margin: 0 0 8px; font-size: var(--text-display); color: var(--text); }
.hero .badge { background: var(--surface-2); border-color: var(--border); color: var(--text-muted); }

/* Kachel-Navigation (admin/index) */
.tiles { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.tile { flex: 1; min-width: 180px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-4);
  transition: border-color var(--dur-short) var(--ease-out), transform 100ms var(--ease-out), box-shadow var(--dur-short) var(--ease-out); }
.tile:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-2px); }
.tile b { display: block; margin-bottom: 3px; color: var(--text); font-size: var(--fs-lg); }
.tile span { color: var(--text-muted); font-size: var(--fs-sm); }

/* Arbeit/Admin-Umschalter (Kopfzeile) */
.mode-toggle { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 3px; }
.mode-toggle button { min-height: 0; border: none; background: transparent; color: var(--text-muted);
  font-weight: 700; font-size: var(--fs-sm); padding: 5px 15px; border-radius: var(--radius-pill); }
.mode-toggle button:hover { color: var(--text); background: transparent; }
.mode-toggle button.on { background: var(--brand); color: #fff; }

/* Modusabhängige Navigation */
.topnav { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.topnav a { color: var(--text-muted); font-size: var(--fs-sm); font-weight: 600;
  padding-bottom: 3px; border-bottom: 2px solid transparent; }
.topnav a:hover { color: var(--text); }
.topnav a.active { color: var(--text); border-bottom-color: var(--brand); }

/* Scroll-Reveal (nur Admin) — Klarheit/Position wird per js/reveal.js gesetzt */
.reveal { will-change: opacity, filter, transform; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; filter: none !important; transform: none !important; }
}
