/* ============================================================
   Rechnungstool – Design-Grundlage im Stil von "Salty Minimal"
   (Tokens, Schriften, Grundbausteine). Jede Seite bindet diese
   Datei ein und ergänzt nur ihre eigenen Bausteine.

   Hell/Dunkel: Klasse .light oder .dark am <html>, gesetzt vor dem
   ersten Paint (Inline-Skript im <head>) und umgeschaltet über
   /assets/theme.js. Ohne Wahl entscheidet die Systemeinstellung.
   ============================================================ */

/* ---------- Schriften (self-hosted, OFL – siehe fonts/LICENSE.md) ---------- */
@font-face {
  font-family: 'DM Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('fonts/dm-sans/dm-sans-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: 'DM Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('fonts/dm-sans/dm-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Outfit'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('fonts/outfit/outfit-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: 'Outfit'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('fonts/outfit/outfit-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens: DUNKEL (Standard) ---------- */
:root {
  color-scheme: dark;
  --color-accent:        #fc0fc0;
  --color-accent-hover:  #e00eab;
  --color-on-accent:     #ffffff;
  --color-bg:            #0e0e12;
  --color-bg-content:    #1a1a24;
  --color-bg-card:       #22222e;
  --color-bg-input:      #16161d;
  --color-text:          #e8e6f0;
  --color-text-muted:    #9895a8;
  --color-text-heading:  #ffffff;
  --color-border:        #2a2a38;
  --color-border-strong: #3a3a4c;

  --accent-tint-05: rgba(252, 15, 192, 0.05);
  --accent-tint-08: rgba(252, 15, 192, 0.08);
  --accent-tint-15: rgba(252, 15, 192, 0.15);

  /* Zustandsfarben: Text + Fläche */
  --color-ok:        #2fdc9c;  --color-ok-bg:     rgba(0, 208, 132, 0.14);
  --color-warn:      #f5c542;  --color-warn-bg:   rgba(252, 185, 0, 0.14);
  --color-danger:    #ff6b6b;  --color-danger-bg: rgba(207, 46, 46, 0.18);
  --color-info:      #6cb8ff;  --color-info-bg:   rgba(56, 152, 236, 0.15);
  --color-danger-solid: #cf2e2e;
  --color-ok-solid:     #0f9d6b;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.35);
  --overlay:   rgba(5, 5, 10, 0.7);

  --radius: 8px;
  --radius-lg: 12px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    ui-monospace, 'JetBrains Mono', Menlo, Consolas, monospace;
}

/* ---------- Tokens: HELL ---------- */
:root.light {
  color-scheme: light;
  --color-accent:        #d60aaa;
  --color-accent-hover:  #b8088f;
  --color-bg:            #f5f5f8;
  --color-bg-content:    #eeeef3;
  --color-bg-card:       #ffffff;
  --color-bg-input:      #ffffff;
  --color-text:          #2a2a3a;
  --color-text-muted:    #6b6880;
  --color-text-heading:  #1a1a2a;
  --color-border:        #d8d8e2;
  --color-border-strong: #c4c4d2;

  --accent-tint-05: rgba(214, 10, 170, 0.05);
  --accent-tint-08: rgba(214, 10, 170, 0.08);
  --accent-tint-15: rgba(214, 10, 170, 0.15);

  --color-ok:        #0b7a52;  --color-ok-bg:     rgba(0, 168, 107, 0.12);
  --color-warn:      #8a5d00;  --color-warn-bg:   rgba(252, 185, 0, 0.18);
  --color-danger:    #b42323;  --color-danger-bg: rgba(207, 46, 46, 0.10);
  --color-info:      #1d64b0;  --color-info-bg:   rgba(56, 152, 236, 0.12);

  --shadow-sm: 0 2px 4px rgba(30, 30, 50, 0.05);
  --shadow-md: 0 4px 12px rgba(30, 30, 50, 0.08);
  --shadow-lg: 0 8px 28px rgba(30, 30, 50, 0.16);
  --overlay:   rgba(20, 20, 35, 0.45);
}

/* ---------- Grundlage ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}
h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--color-text-heading); font-weight: 600; line-height: 1.3; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-hover); }
:focus { outline: none; }
a:focus-visible, button:focus-visible, summary:focus-visible, input[type=checkbox]:focus-visible {
  outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: 4px;
}
::selection { background: var(--accent-tint-15); }
input[type=checkbox], input[type=radio] { accent-color: var(--color-accent); }

/* Eingabefelder überall gleich – auch die ohne eigene Klasse */
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=time], input[type=month], input[type=search], select, textarea {
  background: var(--color-bg-input);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--accent-tint-15);
}
::placeholder { color: var(--color-text-muted); opacity: .8; }

/* ---------- Hell/Dunkel-Umschalter ---------- */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius);
  border: 1px solid var(--color-border); background: transparent; color: var(--color-text-muted);
  cursor: pointer; transition: all var(--transition); flex-shrink: 0;
}
.theme-toggle:hover { color: var(--color-accent); border-color: var(--color-accent); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-sonne { display: inline; }
.theme-toggle .icon-mond { display: none; }
:root.light .theme-toggle .icon-sonne { display: none; }
:root.light .theme-toggle .icon-mond { display: inline; }

/* ---------- Logo ---------- */
.rt-logo { height: 38px; width: 38px; fill: var(--color-accent); flex-shrink: 0; }
