/* Athene: AGFEO-nahe Oberflaeche. Farben aus der AGFEO-Webconf der Sandbox gemessen:
   Blau #334C86, Hellblau #6F8EB7 / #D5E1EC, Gruen #7CBA42 (Uebernehmen), Orange #D5552A (Verwerfen/Streifen),
   Grau #7F7F7F, Seitenhintergrund #F8F8F8, schwarze Tabellenkopfzeile #1F1F1F. Tailwind/DaisyUI-Basis, Kontraste >= 4,5:1. */
:root, html[data-theme="light"] {
  color-scheme: light;
  --color-base-100: #ffffff; --color-base-200: #f8f8f8; --color-base-300: #c4ccdb;
  --color-base-content: #1f1f1f; --color-primary: #7cba42; --color-primary-content: #10200a;
  --color-secondary: #6f8eb7; --color-accent: #334c86;
  --color-info: #334c86; --color-info-content: #ffffff;
  --accent-text: #334c86; --muted: #565d6e; --line: #dde3ec; --selection: #d5e1ec; --control: #eef2f8;
  --toolbar: #334c86; --toolbar-text: #ffffff; --stripe: #d5552a;
  --sidebar: #2b4175; --sidebar-text: #ffffff; --sidebar-muted: #bccae8; --sidebar-hover: #38508f; --sidebar-active: #435c9c; --sidebar-active-text: #ffffff;
  --thead: #1f1f1f; --thead-text: #ffffff;
  --surface-shadow: 0 1px 2px #1f2f5514, 0 4px 14px #1f2f550d;
  --radius-box: .75rem; --radius-field: .625rem; --radius-selector: .5rem;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --color-base-100: #1c2130; --color-base-200: #12151f; --color-base-300: #3b4560;
  --color-base-content: #e9ecf3; --color-primary: #7cba42; --color-primary-content: #10200a;
  --color-secondary: #8aa6d0; --color-accent: #9db4ee;
  --color-info: #9db4ee; --color-info-content: #0f1a38;
  --accent-text: #a9bff2; --muted: #aab2c5; --line: #2c3448; --selection: #26345a; --control: #242b3d;
  --toolbar: #1f2c4d; --toolbar-text: #ffffff; --stripe: #d5552a;
  --sidebar: #172039; --sidebar-text: #ffffff; --sidebar-muted: #aab6d6; --sidebar-hover: #212d4f; --sidebar-active: #2c3d6b; --sidebar-active-text: #ffffff;
  --thead: #0b0d14; --thead-text: #ffffff;
  --surface-shadow: 0 1px 2px #0005, 0 4px 14px #0003;
}
html[data-theme="sakura"] {
  color-scheme: light;
  --color-base-100: #fff7fa; --color-base-200: #fdeaf1; --color-base-300: #f0c3d4;
  --color-base-content: #3b2a33; --color-primary: #ec8fa8; --color-primary-content: #39141f;
  --color-secondary: #79c6f0; --color-accent: #4f90c9;
  --color-info: #4f90c9; --color-info-content: #ffffff;
  --accent-text: #3a76a6; --muted: #86707b; --line: #f2d2de; --selection: #fbdce7; --control: #fdecf2;
  --toolbar: #e58aa6; --toolbar-text: #39141f; --stripe: #d5552a;
  --sidebar: #3d78a8; --sidebar-text: #ffffff; --sidebar-muted: #d6e7f5; --sidebar-hover: #4885b7; --sidebar-active: #5696c7; --sidebar-active-text: #ffffff;
  --thead: #3b2a33; --thead-text: #ffffff;
  --surface-shadow: 0 1px 2px #d58aa31a, 0 4px 14px #d58aa312;
  --radius-box: .75rem; --radius-field: .625rem; --radius-selector: .5rem;
}
html[data-theme="sonnenuntergang"] {
  color-scheme: light;
  --color-base-100: #fffaf2; --color-base-200: #fcefdb; --color-base-300: #f0cd9c;
  --color-base-content: #3a2a1a; --color-primary: #e58328; --color-primary-content: #2a1504;
  --color-secondary: #f0c419; --color-accent: #2f5a86;
  --color-info: #2f5a86; --color-info-content: #ffffff;
  --accent-text: #2f5a86; --muted: #8a7458; --line: #f0dabc; --selection: #fce4c6; --control: #fcefdb;
  --toolbar: #e07b2e; --toolbar-text: #fff8ee; --stripe: #c0392b;
  --sidebar: #203856; --sidebar-text: #ffffff; --sidebar-muted: #b7c5da; --sidebar-hover: #2a4568; --sidebar-active: #35527a; --sidebar-active-text: #ffffff;
  --thead: #3a2a1a; --thead-text: #ffffff;
  --surface-shadow: 0 1px 2px #c06a2318, 0 4px 14px #c06a2310;
  --radius-box: .75rem; --radius-field: .625rem; --radius-selector: .5rem;
}
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; font-size: 1rem; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 3px; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; padding: 12px 20px; background: var(--color-base-100); border-radius: 8px; }
.skip-link:focus { top: 12px; }
.navbar { min-height: 72px; padding: 10px 20px; background: var(--toolbar); color: var(--color-base-content); border-bottom: 1px solid var(--line); box-shadow: none; flex-wrap: wrap; gap: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.25rem; font-weight: 650; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--color-primary); color: var(--color-primary-content); font-size: 1.125rem; font-weight: 700; }
.brand-caption { color: var(--muted); font-size: .875rem; border-left: 1px solid var(--line); padding-left: 16px; }
.drawer-content { min-width: 0; padding: 36px 40px 64px; }
#view { margin: 0 auto; max-width: 1200px; }
.drawer-side { top: 72px; }
.drawer-side > nav { min-height: 100%; background: var(--sidebar); }
#nav { width: 256px; min-height: 100%; padding: 24px 12px; background: var(--sidebar); border-color: var(--line); font-size: .875rem; gap: 3px; }
#nav a, #nav summary { min-height: 44px; border-radius: 8px; padding: 10px 12px; }
#nav summary { color: var(--muted); font-size: .8125rem; font-weight: 600; }
#nav .menu-title { color: var(--muted); padding: 20px 12px 4px; }
#view h1[tabindex="-1"]:focus { outline: none; }
#applybtn { background: var(--selection); color: var(--color-primary); border-color: transparent; }
#nav ul { margin-inline-start: 0; padding-inline-start: 0; }
#nav ul::before { display: none; }
#nav a.active { background: var(--selection); color: var(--color-primary); font-weight: 650; box-shadow: inset 3px 0 var(--color-primary); }
#nav a:hover { background: var(--selection); }
#nav .badge { margin-left: auto; font-size: .6875rem; }
h1.text-2xl { font-size: 1.875rem; line-height: 1.25; font-weight: 700; }
h1 + p, .page-heading p { margin-top: 8px; color: var(--muted); opacity: 1; }
.page-heading { margin-bottom: 28px; }
.eyebrow { color: var(--muted); font-size: .75rem; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.card, .stats { border: 1px solid var(--line); box-shadow: var(--surface-shadow); border-radius: 16px; }
.btn { min-height: 44px; height: auto; min-width: 44px; padding: 10px 16px; border-radius: 10px; font-size: .875rem; font-weight: 600; box-shadow: none; text-transform: none; transition: background-color 120ms, border-color 120ms; }
.btn-circle, .btn-square { padding: 10px; }
.btn-ghost { border-color: transparent; }
.btn-ghost:hover { background: var(--control); }
.btn:active { filter: brightness(.94); }
.btn:disabled { opacity: .55; }
.input, .select, .textarea { min-height: 44px; border-radius: 10px; background: var(--color-base-100); border: 1px solid var(--color-base-300); font-size: 1rem; }
.label-text { display: inline-block; margin-bottom: 6px; font-size: .875rem; font-weight: 500; }
.table { font-size: .875rem; }
.table th { padding: 16px; color: var(--muted); font-size: .75rem; font-weight: 600; background: var(--control); }
.table td { padding: 12px 16px; border-color: var(--line); }
.table-zebra tbody tr:nth-child(even) { background: color-mix(in srgb, var(--control) 45%, var(--color-base-100)); }
.table tbody tr:hover { background: var(--control); }
.table .btn { font-size: .8125rem; padding-inline: 12px; }
.badge { border-radius: 6px; font-weight: 500; }
.modal-box { padding: 28px; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 24px 80px #0003; }
.modal-action { gap: 8px; flex-wrap: wrap; }
.modal::backdrop { background: #10101855; }
.alert { border-radius: 12px; box-shadow: none; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--color-base-100); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.metric { display: block; padding: 24px; border-right: 1px solid var(--line); }
.metric:last-child { border: 0; }
.metric:hover { background: var(--control); }
.metric-value { display: block; font-size: 2.125rem; line-height: 1.2; font-weight: 650; font-variant-numeric: tabular-nums; margin: 12px 0; }
.metric-label { color: var(--muted); font-size: .875rem; }
.metric-link { color: var(--color-primary); font-size: .8125rem; font-weight: 600; }
.overview-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; margin-top: 24px; }
.overview-panel { padding: 28px; background: var(--color-base-100); border: 1px solid var(--line); border-radius: 16px; }
.overview-panel h2 { font-size: 1.125rem; font-weight: 650; margin-bottom: 12px; }
.overview-panel p { color: var(--muted); margin-bottom: 20px; }
.quick-link { display: flex; justify-content: space-between; align-items: center; min-height: 52px; gap: 16px; border-bottom: 1px solid var(--line); font-size: .9375rem; }
.quick-link:last-child { border: 0; }
.quick-link span:last-child { color: var(--muted); }
.system-note { color: var(--muted); font-size: .8125rem; margin-top: 24px; overflow-wrap: anywhere; }
#authscreen { background: var(--color-base-200); overflow-y: auto; }
#authform { max-width: 420px; }
#authform .card-body { padding: 36px; gap: 20px; }
.auth-brand { font-size: 1.75rem; margin-bottom: 8px; }
.auth-brand .brand-mark { width: 44px; height: 44px; font-size: 1.5rem; border-radius: 12px; }
.pw { letter-spacing: .15em; }
.appearance-control .select { width: 112px; font-size: .875rem; }
.navbar > .flex-none:last-child { flex-wrap: wrap; max-width: 100%; }
label:has(> input[type="checkbox"]) { min-height: 44px; cursor: pointer; }
.checkbox { flex-shrink: 0; }
.form-control, .grid > *, .mk > *, .flex > .flex-1 { min-width: 0; }
.modal-box .flex { flex-wrap: wrap; }
.modal-box .input, .modal-box .select { max-width: 100%; }
.file-input { min-height: 44px; height: auto; max-width: 100%; }
.overflow-x-auto { border-radius: inherit; }
.table td { overflow-wrap: anywhere; }
.text-error { color: #b42335; }
html[data-theme="dark"] .text-error { color: #ff9ca8; }
.opacity-50, .opacity-60, .opacity-70 { opacity: 1; color: var(--muted); }
.modal-box .grid { align-items: start; }
@media (max-width: 700px) {
  .navbar > .flex-1 { flex-basis: calc(100% - 60px); }
  .navbar > .flex-none:last-child { width: 100%; justify-content: flex-end; }
  .mk { grid-template-columns: minmax(0, 1fr) 44px; }
  .mk > .mk-key, .mk > .mk-type, .mk > .mk-tgt { grid-column: 1; width: 100%; }
  .mk > button { grid-column: 2; grid-row: 1; }
  .modal-box .grid:not(.mk) { grid-template-columns: minmax(0, 1fr); }
  .modal-box .grid:not(.mk) > * { grid-column: auto; }
}
@media (min-width: 1024px) { .drawer-side { top: 72px; height: calc(100dvh - 72px); } }
@media (max-width: 1023px) { .drawer-content { padding: 28px 24px 48px; } .drawer-side { z-index: 30; top: 0; } #nav { padding-top: 24px; } }
@media (max-width: 700px) {
  .navbar { padding: 8px; gap: 4px; }
  .navbar > .flex-1 { padding-inline: 0; }
  .brand { font-size: 1.0625rem; gap: 8px; }
  #status { display: none; }
  .drawer-content { padding: 24px 16px 40px; }
  h1.text-2xl { font-size: 1.625rem; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { padding: 20px; border-bottom: 1px solid var(--line); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(3) { border-bottom: 0; }
  .overview-grid { grid-template-columns: 1fr; gap: 16px; }
  .overview-panel { padding: 22px; }
  #view > .flex { flex-wrap: wrap; }
  .modal-box { padding: 20px; max-height: 85dvh; }
  #authform .card-body { padding: 28px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; scroll-behavior: auto !important; } }
@media (prefers-contrast: more) { :root, html[data-theme] { --muted: var(--color-base-content); --line: var(--color-base-content); } .opacity-50, .opacity-60, .opacity-70 { opacity: 1; } }
@media (forced-colors: active) { .btn, .card, .metric-grid, .overview-panel { border: 1px solid CanvasText; } #nav a.active { outline: 2px solid Highlight; } }

/* ===== AGFEO-nah: Kopfzeile, Seitenleiste, Karten, Tabellen ===== */
.navbar { min-height: 64px; background: var(--toolbar); color: var(--toolbar-text); border-bottom: 0; box-shadow: inset 0 4px 0 var(--stripe); padding-top: 14px; }
.navbar .btn-ghost { color: var(--toolbar-text); }
.navbar .btn-ghost:hover { background: #ffffff1f; }
.navbar .brand { color: #ffffff; }
.navbar .brand-mark, .auth-brand .brand-mark { background: var(--color-primary); color: var(--color-primary-content); }
.navbar .brand-caption { color: #d3dcf1; border-left-color: #ffffff44; }
#status { background: #ffffff1f; border-color: #ffffff55; color: var(--toolbar-text); }
.appearance-control .select { background-color: #ffffff1f; border-color: #ffffff55; color: var(--toolbar-text); }
.appearance-control .select option { background: #ffffff; color: #1f1f1f; }
#applybtn:hover:not(:disabled) { background: #8fcb55; }
.navbar :focus-visible, #nav :focus-visible { outline-color: #c8ec9f; }

.drawer-side > nav, #nav { background: var(--sidebar); color: var(--sidebar-text); border: 0; }
#nav { width: 264px; padding: 12px 10px 28px; }
#nav a { display: flex; align-items: center; gap: 12px; color: var(--sidebar-text); }
#nav a:hover { background: var(--sidebar-hover); }
#nav a.active { background: var(--sidebar-active); color: var(--sidebar-active-text); font-weight: 650; box-shadow: inset 4px 0 var(--color-primary); }
#nav .menu-title { color: var(--sidebar-muted); font-size: .6875rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; padding: 22px 12px 6px; }
#nav summary { color: var(--sidebar-muted); }
#nav .badge-ghost { background: #ffffff1f; border: 0; color: var(--sidebar-muted); }
.nav-ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

h1.text-2xl::after { content: ""; display: block; width: 44px; height: 4px; margin-top: 10px; border-radius: 2px; background: var(--color-primary); }
.eyebrow { color: var(--accent-text); }
.text-primary { color: var(--accent-text); }
.btn-primary { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-primary-content); }
.btn-primary:hover { background: #8fcb55; border-color: #8fcb55; }
.badge-primary.badge-outline { color: var(--accent-text); border-color: var(--accent-text); }
.card, .stats, .overview-panel, .metric { border-radius: 12px; box-shadow: var(--surface-shadow); }
.table th { padding: 12px 14px; background: var(--thead); color: var(--thead-text); border-bottom: 0; font-size: .6875rem; letter-spacing: .06em; text-transform: uppercase; }
.table td { padding: 10px 14px; }
.table tbody tr:hover { background: var(--selection); }

.metric-grid { gap: 16px; background: none; border: 0; border-radius: 0; overflow: visible; }
.metric-grid > .metric { position: relative; overflow: hidden; background: var(--color-base-100); border: 1px solid var(--line); padding: 20px 22px 18px 26px; }
.metric-grid > .metric::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--color-secondary); }
.metric-grid > .metric:hover { background: var(--selection); }
.metric-ic { position: absolute; top: 18px; right: 18px; width: 30px; height: 30px; fill: none; stroke: var(--accent-text); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.metric-value { font-size: 2.25rem; margin: 10px 0 8px; }
.metric-link { color: var(--accent-text); }
.quick-link:hover { color: var(--accent-text); }
.quick-link:hover span:last-child { color: var(--accent-text); }

#authscreen { background: radial-gradient(circle at 30% 15%, #4a64a6 0, #334c86 42%, #1f2f55 100%); }
html[data-theme="dark"] #authscreen { background: radial-gradient(circle at 30% 15%, #2c3d6b 0, #1f2c4d 42%, #0e1424 100%); }
#authform { box-shadow: 0 24px 80px #0008; }
@media (max-width: 700px) { .metric-grid > .metric { padding: 16px 16px 14px 20px; } .metric-ic { width: 24px; height: 24px; top: 14px; right: 12px; } }
@media (forced-colors: active) { #nav a.active { outline: 2px solid Highlight; } .navbar { border-bottom: 3px solid CanvasText; box-shadow: none; } .metric-grid > .metric::before { background: Highlight; } }

/* Tabellen: Rufnummern und Namen nicht mitten im Wort umbrechen, stattdessen seitlich scrollen */
.table { min-width: 34rem; }
.table td { overflow-wrap: break-word; }
.table td:first-child, .table td.font-mono, .table th { white-space: nowrap; }
.table td .badge { white-space: nowrap; }

/* Uebernehmen / Verwerfen wie in der Webconf: grau, solange nichts offen ist; gruen bzw. orange bei offenen Aenderungen */
#applybtn, #discardbtn { background: #6b6b6b; border-color: transparent; color: #ffffff; font-weight: 700; text-transform: none; opacity: 1; }
#applybtn:disabled, #discardbtn:disabled { background: #6b6b6b; color: #ffffff; opacity: 1; cursor: not-allowed; }
#applybtn.is-active { background: var(--color-primary); color: var(--color-primary-content); }
#discardbtn.is-active { background: #c4481f; color: #ffffff; }
#discardbtn.is-active:hover { background: #d5552a; }
@media (forced-colors: active) { #applybtn:disabled, #discardbtn:disabled { border: 1px solid GrayText; color: GrayText; } }

/* Kontrast: gelbe Outline-Badges (Umleitungen) im Hellmodus zu hell auf Weiss (war 1,67:1) */
html[data-theme="light"] .badge-warning.badge-outline { color: #7a4300; border-color: #b86a00; }

/* Kontrast: Menue-Ueberschriften (z. B. "Angemeldet als") nutzen in DaisyUI nur 40 % Deckkraft -> zu blass */
.menu .menu-title { color: var(--muted); opacity: 1; }

/* Kontrast: "Geplant"-Marken in der blauen Seitenleiste (Hellmodus 4,26:1) */
#nav .badge-ghost { color: #e1e8f7; }

/* Logo: griechischer Tempel (Parthenon, Akropolis) passend zu "Athene" */
.brand-mark { padding: 0; overflow: hidden; }
.brand-mark svg { display: block; width: 100%; height: 100%; }
.auth-brand .brand-mark { padding: 0; }

/* Konto-Menue: nur per Klick/Enter/Leertaste oeffnen (nicht schon beim Durchtabben), DaisyUI oeffnet sonst per :focus-within */
#usermenu:not(.is-open) .dropdown-content { visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; }
#usermenu.is-open .dropdown-content { visibility: visible; opacity: 1; pointer-events: auto; }

/* Kopfzeile: immer eine Zeile, alle Bedienelemente gleich hoch (44 px) und mittig zum App-Namen.
   Auf schmalen Bildschirmen nur Symbole; die Texte bleiben fuer Hilfstechnik erhalten. */
.navbar { flex-wrap: nowrap; align-items: center; gap: 8px; padding: 10px 16px; }
.navbar > .flex-1 { flex: 1 1 auto; flex-basis: auto; min-width: 0; display: flex; align-items: center; gap: 12px; padding-inline: 0; }
.navbar > .flex-none:last-child { width: auto; max-width: none; flex-wrap: nowrap; justify-content: flex-end; align-items: center; gap: 6px; padding-right: 0; }
.brand { line-height: 1; align-items: center; }
.brand-caption { line-height: 1; padding-block: 5px; align-self: center; }
.hdr-ctl { box-sizing: border-box; height: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border-radius: 10px; line-height: 1; white-space: nowrap; }
.hdr-icon { width: 44px; padding: 0; }
.hdr-ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#status { display: inline-flex; padding: 0 12px; border: 1px solid #ffffff55; font-size: .8125rem; font-weight: 500; }
@media (max-width: 639px) {
  .hdr-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  #applybtn, #discardbtn, #status { width: 44px; padding: 0; }
  .navbar { padding: 8px; gap: 4px; }
  .navbar > .flex-none:last-child { gap: 4px; }
}
@media (max-width: 400px) { #status { display: none; } }
.navbar #nav-toggle { box-sizing: border-box; width: 44px; height: 44px; min-height: 44px; padding: 0; }

/* Erklärung als ?-Symbol mit Hinweis (statt langer Absätze) */
.help-row { display: flex; align-items: center; gap: .375rem; min-width: 0; }
.help-row > .help { margin-left: 0; }
.help { display: inline-flex; vertical-align: middle; position: relative; margin-left: .25rem; }
.help-btn { width: 1.25rem; height: 1.25rem; border-radius: 9999px; border: 1px solid var(--color-base-300); background: var(--control);
  color: var(--accent-text); font-family: inherit; font-size: .75rem; font-weight: 600; line-height: 1; display: inline-flex; align-items: center; justify-content: center; cursor: help; }
.help-btn:hover, .help.open .help-btn { background: var(--accent-text); color: var(--color-base-100); border-color: var(--accent-text); }
.help-btn:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.help-pop { display: none; position: fixed; z-index: 1000; padding: .625rem .75rem; border-radius: var(--radius-field); background: var(--color-base-100);
  color: var(--color-base-content); border: 1px solid var(--color-base-300); box-shadow: var(--surface-shadow), 0 8px 24px #0002;
  font-family: inherit; font-size: .875rem; font-weight: 400; line-height: 1.45; text-align: left; white-space: normal; letter-spacing: normal; text-transform: none; }
.help-pop.shown { display: block; }
.help-part { display: block; }
.help-part + .help-part { margin-top: .5rem; }

/* ===== Athene Remote: eigene Ergaenzungen ===== */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-tools { display: flex; gap: 8px; flex-wrap: wrap; }
/* Piktogramm-Knopf: Symbol im Kreis, kurzes Wort darunter */
.pikto { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; min-width: 64px; padding: 4px 6px; border-radius: 12px; background: none; border: 0; cursor: pointer; color: var(--color-base-content); font-size: .75rem; font-weight: 600; }
.pikto-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 9999px; background: var(--color-primary); color: var(--color-primary-content); }
.pikto:hover .pikto-ic { filter: brightness(1.08); }
.pikto:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }
.act-btn { width: 36px; height: 36px; min-height: 36px; min-width: 36px; padding: 0; color: var(--accent-text); }
.act-ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.badge-ic { display: inline-block; width: 14px; height: 14px; margin-right: 2px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -2px; }
/* Mandantenbaum */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 22px; padding-left: 14px; border-left: 2px solid var(--line); }
.tree-row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 8px; border-radius: 10px; flex-wrap: wrap; }
.tree-row:hover { background: var(--selection); }
.tree-ic { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--accent-text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tree-name { font-weight: 650; }
.tree-site .tree-name { font-weight: 500; }
.tree-kind, .tree-place { color: var(--muted); font-size: .8125rem; }
.tree-badges { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.tree-acts { margin-left: auto; display: inline-flex; gap: 2px; }
/* Standorte fuer Techniker / Iris-Benutzer */
.site-list { display: grid; gap: 12px; }
.site-card { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--color-base-100); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--surface-shadow); }
.site-card > div:nth-child(2) { flex: 1; min-width: 0; }
.site-ic { width: 28px; height: 28px; flex: none; fill: none; stroke: var(--accent-text); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
/* Geheimnisse (Einmal-Passwort, Kopplungscode, TOTP-Schluessel) */
.secret { display: inline-block; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1.125rem; letter-spacing: .06em; padding: 6px 10px; border-radius: 8px; background: var(--control); user-select: all; overflow-wrap: anywhere; }
.secret-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.totp-setup { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.totp-setup img { background: #fff; border-radius: 8px; padding: 6px; }
.totp-setup .secret { font-size: .9375rem; }
.secret.codes { white-space: pre; font-size: 1rem; line-height: 1.6; }
.codes-acts { display: flex; flex-direction: column; gap: 4px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.warn-text { color: var(--color-warning); }
/* Zugriffsliste */
.assign-list { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow-y: auto; }
.assign-row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 4px 8px; border-radius: 8px; flex-wrap: wrap; cursor: pointer; }
.assign-row:hover { background: var(--selection); }
.filter .select { min-width: 240px; }
.audit-fail td { color: var(--color-base-content); }
.audit-fail td:first-child { box-shadow: inset 3px 0 #c4481f; }
.cell-sub { color: var(--muted); font-size: .8125rem; white-space: nowrap; }
.table td:last-child { white-space: nowrap; }
.metric-of { font-size: 1.125rem; color: var(--muted); font-weight: 500; }
a.pikto { text-decoration: none; }
/* Stoerungsmeldungen */
.form-2col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .form-2col { grid-template-columns: 1fr; } }
.metric-grid.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1200px) { .metric-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.metric.metric-warn .metric-value { color: var(--color-error); }
.fault-ic { width: 22px; height: 22px; display: block; fill: none; stroke: var(--accent-text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fault-row.stale { opacity: .6; }
.nav-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--color-error); color: var(--color-error-content); font-size: .75rem; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; }
.fault-badge { gap: 3px; }
.fault-note { margin: 0 0 8px; }
.fault-intro { margin: 0 0 16px; }
.fault-h2 { margin: 24px 0 8px; }
@media (max-width: 700px) {
  .metric-grid.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid.five .metric:nth-child(5) { grid-column: span 2; }
}
/* Nutzung */
.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.usage-total td { font-weight: 650; border-top: 2px solid var(--line); }
.sect-gap { margin-top: 24px; }

/* Nutzung: Monatsauswahl + Abschluss-Status umbrechen */
.usage-state { flex-wrap: wrap; }

/* Anmeldung: Trenner zwischen Passkey und Code */
.auth-or { text-align: center; font-size: .8rem; opacity: .65; margin: 4px 0; }

/* Website-Einbindung: Bausteine-Auswahl umbrechen */
.embed-widgets { flex-wrap: wrap; }
/* Code-Schnipsel (Website-Einbindung) umbrechen statt seitlich scrollen */
.secret.codes.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
/* E-Mail-Versand: OAuth-Anmeldung */
.pikto-row { display: flex; gap: 8px; flex-wrap: wrap; }
.oauth-step { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--control); margin: 8px 0; }
.oauth-step .form-control { flex: 1; min-width: 0; }
.wait-spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: wait-spin 1s linear infinite; opacity: .7; }
@keyframes wait-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .wait-spin { animation: none; } }
.oauth-paste { display: flex; gap: 8px; align-items: flex-end; }
/* Aktualisierung per Upload */
.upd-row { display: flex; gap: 8px; align-items: flex-end; }
.upd-row .form-control { flex: 1; min-width: 0; }
.upd-row input[type=file] { padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--control); font-size: .875rem; min-height: 2.25rem; }
.pikto:disabled { opacity: .4; cursor: not-allowed; }
/* Lizenz */
.lic-banner { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 16px; border-radius: 10px; background: var(--control); font-size: .875rem; }
.lic-banner.lic-bad { background: color-mix(in srgb, var(--color-error) 18%, var(--control)); }
.lic-rows { display: grid; gap: 4px; font-size: .875rem; }
.lic-row { display: grid; grid-template-columns: 9rem 1fr; gap: 8px; align-items: center; }
.eula-text { max-height: 45vh; overflow: auto; white-space: pre-wrap; font-size: .8125rem; line-height: 1.45; padding: 10px 12px; border-radius: 8px; background: var(--control); margin-bottom: 8px; }
@media (max-width: 640px) { .lic-row { grid-template-columns: 1fr; } }
.lic-feat { display: flex; flex-wrap: wrap; gap: 8px 24px; }
