/* ==========================================================================
   greengoon – gemeinsames Designsystem (style.css)
   Eine Datei für ALLE Apps: Zentrale, Dateiablage, Admin, Notizen, Links,
   Verwaltung. Jede Seite nutzt dieselben Klassen (BEM-artig: .block__teil
   und .block--variante). Zustände werden mit .is-… markiert.
   Nur Systemschriften, keine externen Ressourcen.
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. DESIGN-TOKENS
   Alle Farben, Abstände und Radien stehen hier. Wer das Aussehen ändern will,
   ändert nur diesen Block.
   -------------------------------------------------------------------------- */
:root {
  /* Flächen */
  --bg: #131513;              /* Seitenhintergrund */
  --bg-sunken: #0f110f;       /* eingelassene Felder (Eingaben, Codes) */
  --panel: #1b1e1a;           /* Karten und Panels */
  --panel-raised: #222721;    /* hervorgehobene Flächen (Hover, Menüs) */
  --line: #2c302b;            /* feine Linien und Rahmen */
  --line-strong: #3b423a;     /* kräftigere Rahmen (Eingabefelder) */

  /* Text */
  --text: #e4e7e2;
  --muted: #9aa097;           /* gedämpfter Text, Kontrast >= 6:1 auf --panel */

  /* Akzent (Grün) mit Abstufungen */
  --accent: #6fcf7f;
  --accent-hi: #8bdc98;
  --accent-lo: #3f9e6a;
  --accent-ink: #0d1a10;      /* Text auf grünen Flächen */
  --accent-soft: rgba(111, 207, 127, .10);
  --accent-line: rgba(111, 207, 127, .40);
  --accent-glow: rgba(111, 207, 127, .50);

  /* Warnung (Orange) */
  --warn: #e0a458;
  --warn-soft: rgba(224, 164, 88, .10);
  --warn-line: rgba(224, 164, 88, .42);

  /* Gefahr (Rot) – nur für zerstörerische Aktionen */
  --danger: #e07a6f;
  --danger-hi: #ec9a91;
  --danger-ink: #230a07;
  --danger-soft: rgba(224, 122, 111, .10);
  --danger-line: rgba(224, 122, 111, .45);
  --danger-glow: rgba(224, 122, 111, .50);

  /* Radien */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;

  /* Abstände (4er-Raster) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;

  /* Schriften: nur Systemschriften */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}


/* --------------------------------------------------------------------------
   2. GRUNDLAGEN
   Zurücksetzen, Typografie, Links und sichtbarer Tastaturfokus.
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -.02em; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hi); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent-line); }

/* Icons: Inline-SVG mit class="icon" */
.icon {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon--lg { width: 28px; height: 28px; }


/* --------------------------------------------------------------------------
   3. SEITENRAHMEN (.shell)
   Umschließt jede Seite. Liefert den dezenten Hintergrund: ein feines Raster,
   das langsam wandert, und einen weichen grünen Lichtfleck.
   -------------------------------------------------------------------------- */
.shell {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; display: flex; flex-direction: column;
}
.shell::before {                         /* Raster */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(rgba(44,48,43,.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(44,48,43,.5) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000, transparent 72%);
          mask-image: radial-gradient(ellipse at 50% 0%, #000, transparent 72%);
  animation: gridmove 16s linear infinite;
}
.shell::after {                          /* Lichtfleck */
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: 50%; top: -360px; width: 900px; height: 640px; margin-left: -450px;
  background: radial-gradient(closest-side, rgba(111,207,127,.20), transparent);
  animation: breathe 9s ease-in-out infinite;
}
.shell--danger::after {                  /* Lösch-Seiten leuchten rot */
  background: radial-gradient(closest-side, rgba(224,122,111,.20), transparent);
}


/* --------------------------------------------------------------------------
   4. LAYOUT-HELFER
   Container, vertikale/horizontale Stapel und Raster.
   -------------------------------------------------------------------------- */
.container        { width: 100%; max-width: 1120px; margin: 0 auto; padding: var(--s-7) var(--s-5) var(--s-8); }
.container--mid   { max-width: 920px; }
.container--narrow{ max-width: 560px; }
.main { flex: 1; }

.stack { display: flex; flex-direction: column; gap: var(--gap, 16px); }
.row   { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, 12px); }
.row--between { justify-content: space-between; }
.grow  { flex: 1 1 0; min-width: 0; }
.push  { margin-left: auto; }
.grid  { display: grid; gap: var(--gap, 16px); grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); }
.divider { height: 1px; border: 0; background: var(--line); margin: 0; }

.muted { color: var(--muted); }
.mono  { font-family: var(--mono); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger-hi); }
.center { text-align: center; }
.small { font-size: .875rem; }


/* --------------------------------------------------------------------------
   5. KOPFLEISTE (.topbar)
   Glasartig mit Blur, bleibt beim Scrollen oben. Marke links,
   Navigation in der Mitte, Benutzer rechts.
   -------------------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s-5);
  min-height: 64px; padding: 0 max(var(--s-5), calc((100% - 1120px) / 2));
  background: rgba(19, 21, 19, .72);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
          backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.topbar__brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 700; text-decoration: none; white-space: nowrap;
}
.topbar__brand:hover { color: var(--text); }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  color: var(--accent); border: 1px solid var(--accent); background: var(--accent-soft);
  box-shadow: 0 0 16px rgba(111,207,127,.4), inset 0 0 10px rgba(111,207,127,.15);
}
.brand-mark .icon { width: 18px; height: 18px; }
.topbar__app { color: var(--muted); font-weight: 500; padding-left: 10px; border-left: 1px solid var(--line-strong); }
/* Die Navigation bricht bei Platzmangel in eine zweite Zeile um (kein seitliches Wischen nötig) */
.topbar__nav { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; }
.topbar__link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 550; white-space: nowrap;
  transition: background .2s, color .2s;
}
.topbar__link:hover { color: var(--text); background: rgba(255,255,255,.05); }
.topbar__link.is-active { color: var(--text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.topbar__user { display: flex; align-items: center; gap: var(--s-3); margin-left: auto; }

.avatar {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--accent-hi), var(--accent-lo)); color: var(--accent-ink);
  font-weight: 800; text-decoration: none;
}
.avatar:hover { color: var(--accent-ink); }
.avatar--lg { width: 72px; height: 72px; border-radius: 20px; font-size: 1.8rem; }

/* Unternavigation (Reiter), z. B. im Adminbereich */
.subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.subnav__link {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px; margin-bottom: -1px;
  color: var(--muted); text-decoration: none; font-weight: 600; white-space: nowrap;
  border-bottom: 2px solid transparent; transition: color .2s, border-color .2s;
}
.subnav__link:hover { color: var(--text); }
.subnav__link.is-active { color: var(--accent-hi); border-bottom-color: var(--accent); }

/* Brotkrumen */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .9rem; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent-hi); }


/* --------------------------------------------------------------------------
   6. SEITENKOPF (Titel + Untertitel)
   -------------------------------------------------------------------------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-6); }
.page-title { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; text-shadow: 0 0 32px rgba(111,207,127,.28); }
.page-sub { color: var(--muted); font-size: 1.05rem; margin-top: var(--s-2); }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.section-title { font-size: 1.25rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }


/* --------------------------------------------------------------------------
   7. KARTEN (.card)
   Grundbaustein für jeden Inhaltsblock. --danger für Lösch-Seiten.
   -------------------------------------------------------------------------- */
.card {
  padding: var(--s-5) 28px; border-radius: var(--r-xl);
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.04);
}
.card--flush { padding: 0; overflow: hidden; }
.card--glass {
  background: rgba(27, 30, 26, .66);
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
}
.card--danger {
  border-color: var(--danger-line);
  box-shadow: 0 0 0 1px rgba(224,122,111,.15), 0 0 50px rgba(224,122,111,.14), 0 18px 50px rgba(0,0,0,.4);
}
.card__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: var(--s-4); }
.card__foot { display: flex; flex-wrap: wrap; gap: var(--s-3); justify-content: flex-end; margin-top: var(--s-5); }

/* Anmelde-/Dialogseiten: Karte mittig */
.auth { flex: 1; display: grid; place-items: center; padding: var(--s-7) var(--s-4); }
.auth__card { width: min(440px, 100%); }
.auth__icon {
  width: 64px; height: 64px; margin: 0 auto var(--s-4); border-radius: 20px; display: grid; place-items: center;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line);
  box-shadow: 0 0 30px rgba(111,207,127,.25);
}
.auth__icon--warn   { color: var(--warn);   background: var(--warn-soft);   border-color: var(--warn-line);   box-shadow: 0 0 30px rgba(224,164,88,.22); }
.auth__icon--danger { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-line); box-shadow: 0 0 30px rgba(224,122,111,.25); }
.auth__icon .icon { width: 30px; height: 30px; }


/* --------------------------------------------------------------------------
   8. KNÖPFE (.btn)
   Primär = grün mit Glow, Ghost = Umriss mit Leuchtrand, Quiet = neutral,
   Danger = rote Variante für zerstörerische Aktionen.
   Mindesthöhe 48px (bei .btn--sm 44px) für gute Antippbarkeit.
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border: 1px solid transparent; border-radius: var(--r-md);
  font: inherit; font-weight: 650; line-height: 1.1; text-decoration: none; cursor: pointer;
  transition: box-shadow .2s, transform .2s, background .2s, border-color .2s, color .2s;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent)); color: var(--accent-ink);
  box-shadow: 0 0 0 1px var(--accent), 0 4px 22px rgba(111,207,127,.38), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn--primary:hover { color: var(--accent-ink); transform: translateY(-1px);
  box-shadow: 0 0 0 1px var(--accent-hi), 0 6px 38px rgba(111,207,127,.7), inset 0 1px 0 rgba(255,255,255,.4); }
.btn--ghost { background: transparent; color: var(--accent); border-color: var(--accent-line); }
.btn--ghost:hover { color: var(--accent-hi); border-color: var(--accent); background: var(--accent-soft);
  box-shadow: 0 0 22px rgba(111,207,127,.35); }
.btn--quiet { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn--quiet:hover { color: var(--text); border-color: var(--accent); box-shadow: 0 0 16px rgba(111,207,127,.25); }
.btn--danger {
  background: linear-gradient(180deg, var(--danger-hi), var(--danger)); color: var(--danger-ink);
  box-shadow: 0 0 0 1px var(--danger), 0 4px 22px rgba(224,122,111,.38), inset 0 1px 0 rgba(255,255,255,.3);
}
.btn--danger:hover { color: var(--danger-ink); transform: translateY(-1px);
  box-shadow: 0 0 0 1px var(--danger-hi), 0 6px 38px rgba(224,122,111,.7), inset 0 1px 0 rgba(255,255,255,.35); }
.btn--danger-ghost { background: transparent; color: var(--danger-hi); border-color: var(--danger-line); }
.btn--danger-ghost:hover { color: var(--danger-hi); border-color: var(--danger); background: var(--danger-soft);
  box-shadow: 0 0 22px rgba(224,122,111,.35); }
.btn--danger:focus-visible, .btn--danger-ghost:focus-visible { outline-color: var(--danger-hi); }
.btn--sm { min-height: 44px; padding: 0 16px; font-size: .92rem; }
.btn--block { width: 100%; }
.btn--icon { width: 48px; padding: 0; }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }


/* --------------------------------------------------------------------------
   9. FORMULARE
   .field = Label + Eingabe + Hinweis/Fehler. Eingaben sind 48px hoch.
   -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-weight: 600; font-size: .92rem; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: var(--r-md);
  border: 1px solid var(--line-strong); background: var(--bg-sunken); color: var(--text);
  font: inherit; transition: border-color .2s, box-shadow .2s;
}
.textarea { padding: 12px 14px; min-height: 160px; line-height: 1.5; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: #7d847a; }
.input:hover, .select:hover, .textarea:hover { border-color: #4a5348; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 18px rgba(111,207,127,.2); }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon > .input { padding-left: 44px; }
.hint { color: var(--muted); font-size: .85rem; }
.error-text { color: var(--danger-hi); font-size: .85rem; display: flex; gap: 6px; align-items: center; }
.field--error .input { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.check { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }

/* 2FA-Code: sechs einzelne Ziffernfelder */
.code-input { display: flex; justify-content: center; gap: 10px; }
.code-input__digit {
  width: 52px; height: 64px; text-align: center; border-radius: var(--r-md);
  border: 1px solid var(--line-strong); background: var(--bg-sunken); color: var(--text);
  font: 700 1.7rem var(--mono); display: grid; place-items: center;
}
.code-input__digit.is-filled { border-color: var(--accent-line); }
.code-input__digit.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 20px rgba(111,207,127,.3); }


/* --------------------------------------------------------------------------
   10. PLAKETTEN (.badge) UND STATUSPUNKTE (.dot)
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 1px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; line-height: 1.7; white-space: nowrap;
  color: var(--muted); border: 1px solid var(--line-strong);
}
.badge--accent { color: var(--accent-hi); background: var(--accent-soft); border-color: var(--accent-line); }
.badge--warn   { color: var(--warn);      background: var(--warn-soft);   border-color: var(--warn-line); }
.badge--danger { color: var(--danger-hi); background: var(--danger-soft); border-color: var(--danger-line); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.dot--ok     { background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.dot--warn   { background: var(--warn);   box-shadow: 0 0 10px rgba(224,164,88,.5); }
.dot--danger { background: var(--danger); box-shadow: 0 0 10px var(--danger-glow); }


/* --------------------------------------------------------------------------
   11. MELDUNGEN (.alert)
   Erfolg (grün), Warnung/Fehler (orange), Gefahr (rot), Info (neutral).
   -------------------------------------------------------------------------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: rgba(255,255,255,.03); }
.alert .icon { margin-top: 2px; }
.alert__title { font-weight: 700; display: block; }
.alert--ok     { color: #c4efcb; background: var(--accent-soft); border-color: var(--accent-line); box-shadow: 0 0 22px rgba(111,207,127,.12); }
.alert--ok .icon { color: var(--accent); }
.alert--warn   { color: #f2d4a9; background: var(--warn-soft); border-color: var(--warn-line); box-shadow: 0 0 22px rgba(224,164,88,.12); }
.alert--warn .icon { color: var(--warn); }
.alert--danger { color: #f6c4be; background: var(--danger-soft); border-color: var(--danger-line); box-shadow: 0 0 22px rgba(224,122,111,.14); }
.alert--danger .icon { color: var(--danger); }


/* --------------------------------------------------------------------------
   12. TABELLEN (.table)
   In .table-wrap, damit sie am Handy seitlich scrollen statt zu brechen.
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
.table { width: 100%; min-width: 680px; border-collapse: collapse; }
.table th {
  text-align: left; padding: 14px 18px; white-space: nowrap;
  font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.table td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .2s; }
.table tbody tr:hover { background: rgba(255,255,255,.025); }
.table__actions { text-align: right; white-space: nowrap; }
.table__user { display: flex; align-items: center; gap: 12px; }


/* --------------------------------------------------------------------------
   13. KACHELN (.tile) – App-Übersicht auf der Startseite
   -------------------------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: var(--s-4); }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 14px; min-height: 190px; padding: 22px;
  border-radius: var(--r-lg); background: var(--panel); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; transition: transform .2s, border-color .2s, box-shadow .2s, background .2s;
}
.tile:hover { color: var(--text); transform: translateY(-3px); border-color: var(--accent-line); background: var(--panel-raised);
  box-shadow: 0 0 0 1px var(--accent-soft), 0 14px 40px rgba(0,0,0,.4), 0 0 30px rgba(111,207,127,.12); }
.tile__icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line);
}
.tile__icon .icon { width: 24px; height: 24px; }
.tile__title { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; }
.tile__desc { color: var(--muted); font-size: .95rem; flex: 1; }
.tile__go { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; font-weight: 600; transition: color .2s; }
.tile:hover .tile__go { color: var(--accent-hi); }
.tile__badge { position: absolute; top: 18px; right: 18px; }


/* --------------------------------------------------------------------------
   14. LISTEN (.list) – Dateien, Links, Einträge
   Jede Zeile: Kürzel/Symbol, Haupttext (bricht lange Namen um), Aktion.
   -------------------------------------------------------------------------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.list__item {
  display: flex; align-items: center; gap: 16px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(255,255,255,.02);
  transition: background .2s, border-color .2s;
}
.list__item:hover { background: var(--panel-raised); border-color: var(--line-strong); }
.list__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list__name { font-weight: 600; overflow-wrap: anywhere; }
.list__meta { color: var(--muted); font-size: .85rem; }
.list__item.is-new { animation: pop .7s cubic-bezier(.2,.8,.2,1) both; border-color: var(--accent-line); }
.file-ext {
  min-width: 52px; height: 36px; padding: 0 8px; border-radius: 8px; display: grid; place-items: center; flex: none;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line);
  font: 800 .72rem var(--mono); letter-spacing: .04em;
}
.favicon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--panel-raised); border: 1px solid var(--line-strong); color: var(--accent); font-weight: 800; }

/* Upload: Ablagefläche + Fortschritt */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 20px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--accent-line); border-radius: var(--r-lg); background: var(--accent-soft);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.dropzone:hover { border-color: var(--accent); background: rgba(111,207,127,.14); }
.dropzone.is-dragover { border-style: solid; border-color: var(--accent); background: rgba(111,207,127,.16); animation: pulse 1.6s ease-in-out infinite; }
.dropzone__icon { color: var(--accent); filter: drop-shadow(0 0 10px var(--accent-glow)); }
.dropzone__title { font-weight: 700; font-size: 1.1rem; }
.progress { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress__bar {
  height: 100%; border-radius: 999px; width: var(--value, 0%);
  background: linear-gradient(90deg, var(--accent-lo), var(--accent), var(--accent-hi), var(--accent));
  background-size: 200px 100%; box-shadow: 0 0 14px var(--accent-glow); animation: shine 1.6s linear infinite;
}


/* --------------------------------------------------------------------------
   15. LEERER ZUSTAND (.empty)
   -------------------------------------------------------------------------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: var(--s-7) var(--s-4); text-align: center; color: var(--muted); }
.empty__art { width: 132px; height: auto; margin-bottom: var(--s-2); }
.empty__title { color: var(--text); font-size: 1.15rem; font-weight: 700; }


/* --------------------------------------------------------------------------
   16. SUCHE, GRUPPEN, NOTIZEN (Notizen- und Links-App)
   -------------------------------------------------------------------------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.toolbar .search { flex: 1 1 280px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem;
  transition: color .2s, border-color .2s, background .2s;
}
.chip:hover { color: var(--text); border-color: var(--accent-line); }
.chip.is-active { color: var(--accent-hi); border-color: var(--accent-line); background: var(--accent-soft); }
.group-title { display: flex; align-items: center; gap: 10px; margin: var(--s-6) 0 var(--s-3); }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s-4); }
.note {
  display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: var(--r-lg);
  background: var(--panel); border: 1px solid var(--line); color: var(--text); text-decoration: none;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.note:hover { color: var(--text); transform: translateY(-2px); border-color: var(--accent-line); box-shadow: 0 12px 32px rgba(0,0,0,.35), 0 0 24px rgba(111,207,127,.1); }
.note__title { font-weight: 700; font-size: 1.05rem; }
.note__text { color: var(--muted); font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.note__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; color: var(--muted); font-size: .82rem; }


/* --------------------------------------------------------------------------
   17. DETAILS: Schlüssel-Wert-Listen, Wiederherstellungscodes, Farbmuster
   -------------------------------------------------------------------------- */
.kv { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 14px 24px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.code-chip {
  padding: 11px 12px; border-radius: 10px; text-align: center; user-select: all;
  font: 600 .95rem var(--mono); letter-spacing: .08em;
  background: var(--bg-sunken); border: 1px dashed var(--line-strong);
}
.swatch { height: 56px; border-radius: 12px; border: 1px solid rgba(255,255,255,.08); }


/* --------------------------------------------------------------------------
   18. GEFAHR (.danger-zone) UND LÖSCH-BESTÄTIGUNG
   Roter Bereich für unumkehrbare Aktionen. Immer mit Warntext
   und rotem Primärknopf (.btn--danger) kombinieren.
   -------------------------------------------------------------------------- */
.danger-zone { padding: var(--s-5); border: 1px solid var(--danger-line); border-radius: var(--r-lg); background: var(--danger-soft); }
.danger-zone__title { color: var(--danger-hi); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.target {   /* zeigt, WAS gelöscht wird */
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-md);
  background: var(--bg-sunken); border: 1px solid var(--danger-line);
}


/* --------------------------------------------------------------------------
   19. KENNZAHLEN UND CONTAINER (Verwaltung)
   -------------------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s-4); }
.stat { padding: 20px; border-radius: var(--r-lg); background: var(--panel); border: 1px solid var(--line); }
.stat__label { color: var(--muted); font-size: .85rem; font-weight: 600; }
.stat__value { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: baseline; gap: 8px; }
.stat__value small { font-size: .9rem; color: var(--muted); font-weight: 600; }
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }


/* --------------------------------------------------------------------------
   20. ANIMATIONEN
   Alles sanft und dezent. Wird bei prefers-reduced-motion abgeschaltet (unten).
   -------------------------------------------------------------------------- */
@keyframes rise     { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop      { 0% { opacity: 0; transform: translateY(-8px) scale(.98); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes pulse    { 0%, 100% { box-shadow: 0 0 0 1px rgba(111,207,127,.35), 0 0 24px rgba(111,207,127,.15); } 50% { box-shadow: 0 0 0 1px rgba(111,207,127,.9), 0 0 54px rgba(111,207,127,.45); } }
@keyframes shine    { from { background-position: -200px 0; } to { background-position: 400px 0; } }
@keyframes gridmove { from { background-position: 0 0; } to { background-position: 0 48px; } }
@keyframes breathe  { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* Einblenden beim Laden; Verzögerung über style="--i:2" je Element */
.reveal { animation: rise .6s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 70ms); }


/* --------------------------------------------------------------------------
   21. RESPONSIV
   Am Handy: Navigation scrollt, Karten werden schmaler, Knöpfe füllen
   die Breite, Zeilen brechen um.
   -------------------------------------------------------------------------- */
@media (max-width: 720px) {
  .topbar { gap: var(--s-3); padding: 0 var(--s-4); flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .topbar__app { display: none; }
  .topbar__nav { order: 3; flex: 1 0 100%; }
  .topbar__link { min-height: 40px; padding: 0 12px; }
  .container { padding: var(--s-5) var(--s-4) var(--s-7); }
  .card { padding: 20px; border-radius: var(--r-lg); }
  .page-head { align-items: flex-start; }
  .list__item { flex-wrap: wrap; }
  .list__item .btn { width: 100%; }
  .card__foot .btn { flex: 1 1 100%; }
  .kv { grid-template-columns: 1fr; gap: 4px; }
  .kv dd { margin-bottom: 12px; }
  .code-input { gap: 6px; }
  .code-input__digit { width: 44px; height: 56px; font-size: 1.4rem; }
  .grid { grid-template-columns: 1fr; }
}


/* --------------------------------------------------------------------------
   22. BEWEGUNG REDUZIEREN
   Wer das im System eingestellt hat, bekommt keine Animationen.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* --------------------------------------------------------------------------
   23. ERGÄNZUNGEN (Barrierefreiheit)
   .visually-hidden: Element bleibt für Tastatur und Screenreader erreichbar,
   ist aber unsichtbar (z. B. das Datei-Feld hinter der Ablagefläche).
   Der Fokus wird dann an der sichtbaren Ablagefläche gezeigt.
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.dropzone:focus-within { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }


/* --------------------------------------------------------------------------
   24. HILFSKLASSEN (statt Inline-Styles)
   Die Apps (Zentrale, Notizen, Links, Verwaltung) erlauben per Content-Security-
   Policy keine style="…"-Attribute. Darum stehen die häufigen Werte hier als Klassen:
   .g-N = Abstand in .stack/.row/.grid, .i-N = Verzögerung von .reveal (Einblenden),
   .t-xl = Titel in Karten, übrige = kleine Einzelwerte.
   -------------------------------------------------------------------------- */
.g-6  { --gap: 6px; }  .g-8  { --gap: 8px; }  .g-10 { --gap: 10px; } .g-12 { --gap: 12px; }
.g-16 { --gap: 16px; } .g-18 { --gap: 18px; } .g-20 { --gap: 20px; } .g-22 { --gap: 22px; }
.g-24 { --gap: 24px; } .g-28 { --gap: 28px; } .g-36 { --gap: 36px; }
.i-1 { --i: 1; } .i-2 { --i: 2; } .i-3 { --i: 3; } .i-4 { --i: 4; } .i-5 { --i: 5; }
.i-6 { --i: 6; } .i-7 { --i: 7; } .i-8 { --i: 8; } .i-9 { --i: 9; }
.cols-2 { --cols: 2; }
.t-xl { font-size: 1.8rem; font-weight: 800; }
.mt-0 { margin-top: 0; } .mt-6 { margin-top: 6px; } .mt-10 { margin-top: 10px; }
.mb-0 { margin-bottom: 0; } .mb-4 { margin-bottom: 4px; }
.lh-13 { line-height: 1.3; }
.flex-1 { flex: 1; } .flex-14 { flex: 1.4; }
.stretch { justify-content: stretch; }
.link-plain { color: var(--text); text-decoration: none; }
.link-plain:hover { color: var(--accent-hi); }
.text-main { color: var(--text); }
.ml-6 { margin-left: 6px; }
.fw-700 { font-weight: 700; } .fw-650 { font-weight: 650; }
.danger-icon { color: var(--danger-hi); border-color: var(--danger-line); }
.btn--sq { width: 44px; padding: 0; }


/* --------------------------------------------------------------------------
   25. ERGÄNZUNGEN FÜR ZENTRALE UND VERWALTUNG
   [hidden] muss immer gewinnen (sonst überschreibt z. B. display:flex das Attribut),
   dazu Benutzermenü (natives <details>), QR-Code, Code-Schrift und Gruppenrahmen.
   -------------------------------------------------------------------------- */
[hidden] { display: none !important; }

.usermenu { position: relative; }
.usermenu > summary { list-style: none; cursor: pointer; border-radius: 12px; }
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu[open] > summary .avatar { box-shadow: 0 0 0 3px var(--accent-soft), 0 0 18px var(--accent-glow); }
.usermenu__panel {
  position: absolute; right: 0; top: calc(100% + 12px); z-index: 30; min-width: 230px; padding: 8px;
  border-radius: var(--r-md); background: var(--panel-raised); border: 1px solid var(--line-strong);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
}
.usermenu__who { display: flex; flex-direction: column; padding: 8px 12px 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line); line-height: 1.3; }
.usermenu__item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px;
  border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: left;
  text-decoration: none; cursor: pointer; transition: background .15s;
}
.usermenu__item:hover { background: var(--accent-soft); color: var(--text); }
.usermenu__item--danger { color: var(--danger-hi); }
.usermenu__item--danger:hover { background: var(--danger-soft); color: var(--danger-hi); }

code {
  font-family: var(--mono); font-size: .9em; padding: 1px 6px; border-radius: 6px;
  background: var(--bg-sunken); border: 1px solid var(--line);
}
.qr { display: inline-block; align-self: flex-start; padding: 12px; border-radius: var(--r-md); background: #fff; line-height: 0; }
.qr svg { width: 220px; height: 220px; }
.fieldset { margin: 0; padding: 14px 16px 12px; border: 1px solid var(--line); border-radius: var(--r-md); }
.fieldset > legend { padding: 0 8px; font-weight: 600; font-size: .92rem; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 24px; }
@media (max-width: 520px) { .check-grid { grid-template-columns: 1fr; } }
.dot.an  { background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.dot.aus { background: var(--danger); box-shadow: 0 0 10px var(--danger-glow); }
.tile__status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .85rem; }
.w-full { width: 100%; }
.inline-form { display: inline; margin: 0; }
.row-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row-form .input { width: auto; flex: 1 1 160px; }

.card--slim { padding: 12px 18px; border-radius: 14px; display: flex; align-items: center; gap: 12px; }
.card--slim .icon { color: var(--accent); }
.block { display: block; }
.mb-14 { margin-bottom: 14px; } .mt-14 { margin-top: 14px; } .my-20 { margin: 20px 0; }
.top { align-items: flex-start; }
.basis-300 { flex: 1 1 300px; }
.select--auto { width: auto; min-width: 180px; }
.divider--danger { background: var(--danger-line); }
.mt-8 { margin-top: 8px; }
.title-md { font-size: 2.4rem; }
.select { appearance: auto; }
.code-chip code { padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; }
