/* NF Systems: gemeinsames Design (Login + Tasks).
   Hell = "Morgenlicht": Weiss/Eisblau mit warmem Licht, Milchglas, Buttons im
   Logo-Verlauf Cyan #22D3FF -> Blau #0A84FF. Dunkel = bestehende NF-Systemfarben.
   Umschaltung ueber <html data-theme="light|dark"> (pro Person gespeichert).
   Identische Kopie in nf_login/static/css und nf_board/static/css. */

:root {
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --bg: linear-gradient(160deg, #f9fcff 0%, #eaf4ff 48%, #fbf8f4 100%);
  --bg-solid: #f2f8ff;
  --blob1: radial-gradient(circle, rgba(34, 211, 255, .34), rgba(34, 211, 255, 0) 70%);
  --blob2: radial-gradient(circle, rgba(10, 132, 255, .22), rgba(10, 132, 255, 0) 70%);
  --glass: rgba(255, 255, 255, .55);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-border: rgba(255, 255, 255, .85);
  --line: rgba(15, 31, 56, .09);
  --blur: 18px;
  --bar: rgba(255, 255, 255, .6);
  --side: rgba(255, 255, 255, .5);
  --col: rgba(255, 255, 255, .42);
  --col-border: rgba(255, 255, 255, .85);
  --card: rgba(255, 255, 255, .92);
  --card-border: #ffffff;
  --shadow: 0 1px 2px rgba(16, 48, 96, .05), 0 6px 18px rgba(16, 72, 140, .07);
  --shadow-h: 0 2px 4px rgba(16, 48, 96, .06), 0 12px 28px rgba(16, 72, 140, .12);
  --shadow-pop: 0 30px 80px rgba(10, 30, 60, .22);
  --text: #0f1f38;
  --muted: #5d6f8a;
  --accent: #0a84ff;
  --accent-strong: #0b5fd1;
  --btn: linear-gradient(135deg, #22d3ff, #0a84ff);
  --btn-text: #ffffff;
  --btn-shadow: 0 6px 16px rgba(10, 132, 255, .28);
  --input: rgba(234, 243, 255, .75);
  --input-solid: #ffffff;
  --chip-bg: #e1efff;
  --chip-fg: #0b5fd1;
  --scrim: rgba(205, 225, 248, .5);
  --modal: rgba(255, 255, 255, .86);
  --over-bg: #ffe4e8; --over-fg: #c0263f;
  --soon-bg: #fff1d9; --soon-fg: #a15c00;
  --done-bg: #dcf6ea; --done-fg: #11784b;
  --info-bg: #e1efff; --info-fg: #0b5fd1;
  --danger: #d92d4a;
  --focus: 0 0 0 3px rgba(10, 132, 255, .28);
  color-scheme: light;
}

html[data-theme="dark"] {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #0a0a0f;
  --bg-solid: #0a0a0f;
  --blob1: radial-gradient(circle, rgba(99, 102, 241, .18), rgba(99, 102, 241, 0) 70%);
  --blob2: radial-gradient(circle, rgba(129, 140, 248, .1), rgba(129, 140, 248, 0) 70%);
  --glass: rgba(18, 18, 26, .72);
  --glass-strong: rgba(18, 18, 26, .92);
  --glass-border: #242438;
  --line: #242438;
  --bar: rgba(18, 18, 26, .88);
  --side: rgba(18, 18, 26, .88);
  --col: #12121a;
  --col-border: #242438;
  --card: #1a1a2e;
  --card-border: #242438;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-h: 0 8px 24px rgba(0, 0, 0, .5);
  --shadow-pop: 0 30px 80px rgba(0, 0, 0, .6);
  --text: #e2e8f0;
  --muted: #9ca3af;
  --accent: #818cf8;
  --accent-strong: #a5b4fc;
  --btn: #6366f1;
  --btn-text: #ffffff;
  --btn-shadow: 0 4px 14px rgba(99, 102, 241, .3);
  --input: #242438;
  --input-solid: #1a1a2e;
  --chip-bg: rgba(99, 102, 241, .18);
  --chip-fg: #a5b4fc;
  --scrim: rgba(5, 5, 10, .62);
  --modal: rgba(18, 18, 26, .96);
  --over-bg: rgba(248, 113, 113, .14); --over-fg: #fca5a5;
  --soon-bg: rgba(250, 204, 21, .12); --soon-fg: #fde68a;
  --done-bg: rgba(134, 239, 172, .12); --done-fg: #86efac;
  --info-bg: rgba(99, 102, 241, .18); --info-fg: #a5b4fc;
  --danger: #f87171;
  --focus: 0 0 0 3px rgba(129, 140, 248, .35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font-family: var(--font); font-size: 15px; line-height: 1.5;
  color: var(--text); background: var(--bg-solid); background-image: var(--bg);
  background-attachment: fixed; position: relative; isolation: isolate;
}
body::before, body::after {
  content: ""; position: fixed; z-index: -1; border-radius: 50%; filter: blur(60px); pointer-events: none;
}
body::before { width: 560px; height: 460px; left: -140px; top: -180px; background: var(--blob1); }
body::after { width: 660px; height: 560px; right: -200px; bottom: -260px; background: var(--blob2); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { letter-spacing: -.02em; line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: clamp(22px, 3vw, 28px); font-weight: 800; }
h2 { font-size: 18px; font-weight: 700; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.inline, .nf-inline { display: inline; margin: 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }

/* Glas */
.glass {
  background: var(--glass); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%); backdrop-filter: blur(var(--blur)) saturate(160%);
}

/* Knoepfe */
.btn {
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; border-radius: 11px;
  padding: 8px 14px; display: inline-flex; gap: 6px; align-items: center; justify-content: center;
  white-space: nowrap; color: var(--text); background: var(--input); border: 1px solid var(--glass-border);
  text-decoration: none; line-height: 1.3; transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { text-decoration: none; background: var(--glass-strong); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--btn); color: var(--btn-text); border-color: transparent; box-shadow: var(--btn-shadow); }
.btn--primary:hover { background: var(--btn); filter: brightness(1.05); }
.btn--danger { color: var(--danger); }
.btn--sm { font-size: 12.5px; padding: 5px 10px; border-radius: 9px; }
.btn--icon { padding: 5px 8px; }
.btn--block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-row form { margin: 0; }
.nf-iconbtn {
  border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 9px;
  display: inline-grid; place-items: center; font: inherit;
}
.nf-iconbtn:hover { background: var(--input); color: var(--text); }

/* Formulare */
.field { display: grid; gap: 5px; margin-bottom: 14px; }
.field label, .field legend { font-weight: 600; font-size: 13px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="date"], input[type="number"], select, textarea {
  font: inherit; font-size: 14px; width: 100%; padding: 9px 12px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--input-solid); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
textarea { resize: vertical; }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
.check { display: flex; gap: 9px; align-items: center; font-size: 14px; padding: 4px 0; }
.check--strong { font-weight: 700; }

/* Meldungen, Badges */
.flash { padding: 10px 14px; border-radius: 12px; margin-bottom: 12px; font-size: 14px; border: 1px solid transparent; }
.flash--ok { background: var(--done-bg); color: var(--done-fg); }
.flash--warn { background: var(--soon-bg); color: var(--soon-fg); }
.flash--error { background: var(--over-bg); color: var(--over-fg); }
.flash--info { background: var(--info-bg); color: var(--info-fg); }
.flash a { color: inherit; font-weight: 700; text-decoration: underline; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; background: var(--chip-bg); color: var(--chip-fg); white-space: nowrap;
}
.badge--muted { background: var(--input); color: var(--muted); }
.badge--danger { background: var(--over-bg); color: var(--over-fg); }
.badge--warn { background: var(--soon-bg); color: var(--soon-fg); }
.badge--ok { background: var(--done-bg); color: var(--done-fg); }
.badge--info { background: var(--info-bg); color: var(--info-fg); }

/* Karten, Tabellen */
.card {
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 18px; padding: 18px;
  box-shadow: var(--shadow); margin-bottom: 16px;
  -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur));
}
.card__title { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 12px; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num { text-align: right; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions form { margin: 0; }

/* Seitenkopf */
.page { max-width: 1240px; margin: 0 auto; padding: 24px 20px 60px; }
.page__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page__head p { color: var(--muted); margin: 0; max-width: 70ch; }

/* Tool-Leiste (nf_sso) */
.nf-toolbar {
  position: sticky; top: 0; z-index: 50; background: var(--bar); border-bottom: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%); backdrop-filter: blur(var(--blur)) saturate(160%);
}
.nf-toolbar__inner { max-width: 1400px; margin: 0 auto; padding: 8px 20px; min-height: 56px; display: flex; align-items: center; gap: 16px; }
.nf-toolbar__brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); white-space: nowrap; letter-spacing: -.01em; }
.nf-toolbar__brand:hover { text-decoration: none; }
.nf-logo { width: 30px; height: 30px; border-radius: 9px; display: block; }
.nf-toolbar__tools { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nf-toolbar__tools a, .nf-pill { padding: 6px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.nf-toolbar__tools a:hover, .nf-pill:hover { background: var(--input); color: var(--text); text-decoration: none; }
.nf-toolbar__tools a.is-active, .nf-pill.is-active { background: var(--chip-bg); color: var(--chip-fg); }
.nf-toolbar__right { display: flex; align-items: center; gap: 10px; font-size: 13.5px; white-space: nowrap; }
.nf-toolbar__name { color: var(--text); font-weight: 600; }
.nf-toolbar__logout { color: var(--muted); font-weight: 600; }
.nf-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--input); }
.nf-seg button { font: inherit; font-size: 12px; font-weight: 700; padding: 3px 8px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.nf-seg button.is-active { background: var(--card); color: var(--accent); box-shadow: var(--shadow); }
@media (max-width: 760px) {
  .nf-toolbar__inner { flex-wrap: wrap; gap: 8px 10px; padding: 8px 14px; }
  .nf-toolbar__tools { order: 3; flex-basis: 100%; }
  .nf-toolbar__right { margin-left: auto; gap: 8px; }
  .nf-toolbar__name, .nf-toolbar__brand span { display: none; }
}

/* Login-Seiten */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 40px 16px; position: relative; }
.login-card {
  width: min(420px, 100%); padding: 30px 28px; border-radius: 24px; background: var(--glass-strong);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow-pop);
  -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%);
}
.login-card__logo { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.login-card__logo img { width: 48px; height: 48px; border-radius: 14px; box-shadow: 0 8px 20px rgba(10, 80, 170, .25); }
.login-card__logo strong { font-size: 20px; letter-spacing: -.02em; }
.login-card__logo span { display: block; color: var(--muted); font-size: 13px; font-weight: 500; }
.login-card__sub { font-weight: 700; font-size: 17px; margin-bottom: 14px; }
.login-card__foot { margin: 16px 0 0; font-size: 13.5px; text-align: center; }
.login-card .btn--primary { width: 100%; padding: 11px 14px; font-size: 14.5px; }
.lang-switch--light { position: absolute; top: 18px; right: 18px; }
.lang-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--glass); border: 1px solid var(--glass-border); }
.lang-switch form { margin: 0; }
.lang-switch button { font: inherit; font-size: 12px; font-weight: 700; padding: 4px 9px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.lang-switch button.is-active { background: var(--card); color: var(--accent); box-shadow: var(--shadow); }

/* Portal-Kacheln */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tool-tile {
  display: grid; gap: 4px; padding: 20px; border-radius: 20px; color: var(--text); background: var(--glass);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease;
  -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur));
}
.tool-tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-h); }
.tool-tile__word { justify-self: start; padding: 8px 14px; border-radius: 12px; background: var(--btn); color: #fff !important; font-weight: 800; font-size: 15px !important; letter-spacing: .01em; margin-bottom: 8px; }
.tool-tile strong { font-size: 18px; }
.tool-tile span { color: var(--muted); font-size: 13px; }

/* Reiter */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 13px; background: var(--glass); border: 1px solid var(--glass-border); margin-bottom: 16px; }
.tabs a { padding: 7px 14px; border-radius: 10px; font-weight: 700; font-size: 13.5px; color: var(--muted); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.is-active { background: var(--card); color: var(--accent); box-shadow: var(--shadow); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
