/* =============================================================
   Atrium — App (minimal / full-width / airy)
   -------------------------------------------------------------
   Kuratierter Port des ReloCrate-Designsystems (siehe
   docs/ui-conventions.md). Enthält die allgemeinen Komponenten;
   ReloCrate-spezifische Teile (Scanner, Labels/QR, KI-Import …)
   wurden bewusst weggelassen.
   ============================================================= */

/* ---- Reset --------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
input { font: inherit; color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); color: var(--accent); }

* { scrollbar-width: thin; scrollbar-color: var(--n-200) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--n-200); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--n-300); background-clip: content-box; }

/* ---- Typo-Helfer --------------------------------------------- */
.h-cond {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: var(--text-strong);
  line-height: var(--lh-tight);
}
.eyebrow {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 600;
  font-size: var(--fs-xs);
  color: var(--text-faint);
}
a.eyebrow--link { display: inline-flex; align-items: center; gap: 6px; transition: color var(--dur-fast) var(--ease); }
a.eyebrow--link:hover { color: var(--accent); }
.mono { font-family: var(--font-mono); font-feature-settings: "tnum"; letter-spacing: -0.01em; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }

/* =============================================================
   App-Shell + Hintergrund-Glow
   ============================================================= */
.app { min-height: 100vh; }

.bg-glow { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-glow::before, .bg-glow::after { content: ""; position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; }
.bg-glow::before {
  width: 620px; height: 620px; top: -260px; right: -120px;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%); opacity: 0.28;
}
.bg-glow::after {
  width: 520px; height: 520px; bottom: -240px; left: 180px;
  background: radial-gradient(circle, rgba(31,168,144,0.22), transparent 70%); opacity: 0.22;
}

/* ---- Schwebende Sidebar -------------------------------------- */
.sidebar {
  position: fixed; top: var(--sidebar-gap); left: var(--sidebar-gap); bottom: var(--sidebar-gap);
  width: var(--sidebar-w); z-index: 40; display: flex; flex-direction: column;
  padding: var(--space-6) var(--space-4) var(--space-4);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--hairline); border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  transition: transform var(--dur) var(--ease);
}
.brand { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3) var(--space-7); }
.brand__mark {
  width: 40px; height: 40px; border-radius: 11px;
  background: linear-gradient(150deg, var(--accent), var(--accent-press));
  color: #fff; display: grid; place-items: center; font-size: 17px;
  box-shadow: 0 6px 16px var(--accent-glow); flex-shrink: 0;
}
.brand__name {
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 700; font-size: var(--fs-lg); color: var(--text-strong); line-height: 1;
}
.brand__name b { color: var(--accent); font-weight: 700; }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav__label {
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: 0.16em;
  font-size: 10px; font-weight: 600; color: var(--text-faint);
  padding: var(--space-5) var(--space-3) var(--space-2);
}
.nav__item {
  position: relative; display: flex; align-items: center; gap: var(--space-4);
  padding: 11px var(--space-4); border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 13.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.04em;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.nav__item i { font-size: 18px; width: 24px; text-align: center; color: var(--text-faint); transition: color var(--dur-fast) var(--ease); }
.nav__item:hover { background: var(--surface-hover); color: var(--text-strong); }
.nav__item:hover i { color: var(--text); }
.nav__item.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav__item.is-active i { color: var(--accent); }
.nav__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); flex-shrink: 0; margin-left: auto;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent); }
.app.is-collapsed .nav__dot { position: absolute; top: 8px; right: 8px; margin: 0; }

/* Verwaltung + User nach unten schieben */
.sidebar__bottom { margin-top: auto; }
.sidebar__foot { padding-top: var(--space-3); margin-top: var(--space-3); border-top: 1px solid var(--hairline); }
.user { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm); transition: background var(--dur-fast) var(--ease); }
.user:hover { background: var(--surface-hover); }
.user__avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--n-800); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 500; flex-shrink: 0; }
.user__meta { min-width: 0; line-height: 1.3; }
.user__name { font-size: var(--fs-sm); font-weight: 500; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user__mail { font-size: 11px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary::marker { content: ""; }
.user-menu[open] > summary { background: var(--surface-hover); }
.user-pop {
  position: absolute; bottom: calc(100% + var(--space-2)); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--hairline-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: var(--space-2); z-index: 40;
  animation: userpop-in var(--dur-fast) var(--ease-out);
}
@keyframes userpop-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.user-pop__item {
  display: flex; align-items: center; gap: var(--space-3); width: 100%;
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-xs);
  font-size: var(--fs-sm); color: var(--text); text-align: left;
  transition: background var(--dur-fast) var(--ease);
}
.user-pop__item:hover { background: var(--surface-hover); color: var(--text-strong); }
.user-pop__item > i { font-size: 14px; color: var(--text-faint); width: 16px; text-align: center; }
.user-pop__form { margin: 0; }
.user-pop__item--danger:hover { background: var(--danger-soft); color: var(--danger); }
.user-pop__item--danger:hover > i { color: var(--danger); }
.user-pop__sep { height: 1px; background: var(--hairline); margin: var(--space-2) 0; }

/* ---- Content: volle Breite ----------------------------------- */
.content {
  position: relative; z-index: 1;
  margin-left: calc(var(--sidebar-w) + var(--sidebar-gap) * 2);
  padding: var(--pad-top) var(--pad-x) var(--space-20); min-height: 100vh;
}

/* =============================================================
   Page-Header
   ============================================================= */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-6); flex-wrap: wrap; margin-bottom: var(--space-10); }
.page-head__titles { display: flex; flex-direction: column; gap: var(--space-3); }
.page-title { font-family: var(--font-head); text-transform: uppercase; letter-spacing: 0.02em; font-weight: 700; font-size: var(--fs-2xl); color: var(--text-strong); line-height: 1; }
.page-meta { display: flex; align-items: center; gap: var(--space-4); font-size: var(--fs-sm); color: var(--text-muted); flex-wrap: wrap; }
.page-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--n-300); }
.page-meta b { color: var(--text-strong); font-weight: 500; }
.page-head__actions { display: flex; align-items: center; gap: var(--space-3); }

/* =============================================================
   Buttons
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: 42px; padding: 0 var(--space-5); border-radius: var(--radius-sm);
  font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; border: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn i { font-size: 14px; }
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary { background: var(--accent); color: var(--text-on-accent); box-shadow: 0 6px 18px var(--accent-glow); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--ghost { background: var(--surface); color: var(--text-strong); border-color: var(--hairline-strong); }
.btn--ghost:hover { border-color: var(--n-300); background: var(--surface-2); }
.btn--quiet { background: transparent; color: var(--text-muted); height: 38px; padding: 0 var(--space-3); }
.btn--quiet:hover { background: var(--surface-hover); color: var(--text-strong); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #d13b40; }
.btn--danger-ghost { background: transparent; color: var(--danger); }
.btn--danger-ghost:hover { background: var(--danger-soft); }
.btn--sm { height: 36px; padding: 0 var(--space-4); }
.btn--block { width: 100%; justify-content: center; }

.icon-btn {
  width: 42px; height: 42px; border-radius: var(--radius-sm); display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--hairline-strong); color: var(--text-muted); font-size: 15px;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.icon-btn:hover { color: var(--text-strong); border-color: var(--n-300); background: var(--surface-2); }
.icon-btn--plain { background: transparent; border-color: transparent; }
.icon-btn--plain:hover { background: var(--surface-hover); }
.icon-btn--sm { width: 34px; height: 34px; font-size: 13px; }

/* =============================================================
   Toolbar (Suche · Filter · View)
   ============================================================= */
.toolbar { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-6); flex-wrap: wrap; }
.toolbar__spacer { flex: 1; }
.result-count { font-size: var(--fs-sm); color: var(--text-faint); }
.result-count b { color: var(--text); font-weight: 500; }

.search {
  display: flex; align-items: center; gap: var(--space-3); height: 42px; padding: 0 var(--space-4);
  background: var(--surface); border: 1px solid var(--hairline-strong); border-radius: var(--radius-sm);
  min-width: 300px; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.search:focus-within { border-color: var(--accent-line); box-shadow: var(--ring); }
.search i { color: var(--text-faint); font-size: 14px; }
.search input { flex: 1 1 auto; min-width: 0; border: none; outline: none; background: none; font-size: var(--fs-sm); }
.search input::placeholder { color: var(--text-faint); }
.search__clear {
  display: none; align-items: center; gap: 5px; flex-shrink: 0; padding: 3px 9px; border-radius: var(--radius-pill);
  font-size: 11.5px; color: var(--text-faint); background: var(--n-100); border: 1px solid var(--hairline);
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.search.has-value .search__clear { display: inline-flex; }
.search__clear:hover { color: var(--text); background: var(--surface-hover); }
.search__clear i { font-size: 10px; }

/* Segmented / View-Toggle */
.seg { display: inline-flex; padding: 3px; background: var(--n-100); border-radius: var(--radius-sm); }
.seg button, .seg__btn {
  min-width: 34px; height: 30px; padding: 0 var(--space-4); border-radius: 7px;
  color: var(--text-faint); font-size: var(--fs-sm); font-weight: 500; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  transition: all var(--dur-fast) var(--ease);
}
.seg button.is-active, .seg__btn.is-active { background: var(--surface); color: var(--text-strong); box-shadow: var(--shadow-xs); }

/* =============================================================
   Custom Inline-Dropdown (nie natives <select>)
   ============================================================= */
.dropdown { position: relative; }
.dropdown__toggle {
  display: inline-flex; align-items: center; justify-content: flex-start; gap: var(--space-3);
  height: 42px; padding: 0 var(--space-3) 0 var(--space-4);
  background: var(--surface); border: 1px solid var(--hairline-strong); border-radius: var(--radius-sm);
  font-size: var(--fs-sm); color: var(--text-strong); text-align: left;
  transition: border-color var(--dur-fast) var(--ease);
}
.dropdown__toggle .value { text-align: left; }
.dropdown__toggle:hover { border-color: var(--n-300); }
.dropdown.is-open .dropdown__toggle { border-color: var(--accent-line); box-shadow: var(--ring); }
.dropdown__toggle .lead { color: var(--text-faint); font-size: 13px; }
.dropdown__toggle .chev { color: var(--text-faint); font-size: 11px; transition: transform var(--dur) var(--ease); margin-left: 2px; }
.dropdown.is-open .dropdown__toggle .chev { transform: rotate(180deg); }
.dropdown__menu {
  position: absolute; top: calc(100% + 8px); left: 0;
  display: flex; flex-direction: column; min-width: 100%; width: max-content;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 7px; z-index: 60; opacity: 0; transform: translateY(-6px) scale(0.985); transform-origin: top;
  pointer-events: none; transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease-out);
}
.dropdown__menu--right { left: auto; right: 0; }
.dropdown__menu--scroll { max-height: 320px; overflow-y: auto; }
.dropdown.is-open .dropdown__menu { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.dropdown__opt {
  display: flex; align-items: center; justify-content: flex-start; gap: var(--space-3);
  padding: 9px var(--space-3); border-radius: var(--radius-xs);
  font-size: var(--fs-sm); color: var(--text); white-space: nowrap; text-align: left;
  transition: background var(--dur-fast) var(--ease);
}
.dropdown__opt i:first-child { width: 15px; text-align: center; color: var(--text-faint); font-size: 13px; }
.dropdown__opt:hover { background: var(--surface-hover); color: var(--text-strong); }
.dropdown__opt .check { margin-left: auto; color: var(--accent); opacity: 0; font-size: 12px; }
.dropdown__opt.is-selected { color: var(--text-strong); font-weight: 500; }
.dropdown__opt.is-selected .check { opacity: 1; }
.dropdown__sep { height: 1px; background: var(--hairline); margin: 6px 4px; }
.dropdown__empty { padding: var(--space-3) var(--space-4); color: var(--text-muted); font-size: var(--fs-sm); }
.dropdown--block { display: block; }
.dropdown--block .dropdown__toggle { width: 100%; }
.dropdown--block .dropdown__toggle .chev { margin-left: auto; }
.dropdown--block .dropdown__menu { width: 100%; }
.dropdown--up .dropdown__menu { top: auto; bottom: calc(100% + 8px); transform-origin: bottom; }

/* =============================================================
   Generische Daten-Tabelle (schwebende Zeilen, kein Gitternetz)
   -------------------------------------------------------------
   Markup: .tbl > .tbl-cols.tbl-head + .tbl-cols.tbl-row …
   Spaltenraster pro Seite inline setzen:
     style="grid-template-columns: 2fr 1fr 1fr 44px"
   ============================================================= */
.tbl { display: flex; flex-direction: column; }
.tbl-cols {
  display: grid; grid-template-columns: minmax(220px, 2fr) 1fr 1fr 44px;
  align-items: center; gap: var(--space-6); column-gap: var(--space-5);
  padding: var(--space-4);
}
.tbl-head { padding-top: 0; padding-bottom: var(--space-3); }
.tbl-head .col {
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 10.5px; font-weight: 600; color: var(--text-faint);
}
.tbl-head .col.right, .tbl-row .cell.right { justify-self: end; text-align: right; }
.tbl-row {
  width: 100%; text-align: left; border-radius: var(--radius); color: inherit; text-decoration: none;
  transition: background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.tbl-row--link, .tbl-row--btn { cursor: pointer; }
.tbl-row:hover { background: var(--surface); box-shadow: var(--shadow-sm); }
.cell { font-size: var(--fs-sm); color: var(--text-muted); min-width: 0; }
.cell .num { font-family: var(--font-mono); color: var(--text); }

/* Identitäts-Zelle (Icon/Avatar + Text) */
.ent-id { display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
.ent-thumb {
  width: 44px; height: 44px; border-radius: var(--radius-xs); border: 1px solid var(--hairline);
  background: var(--surface-2); display: grid; place-items: center; color: var(--text-muted);
  font-size: 17px; flex-shrink: 0;
}
.tbl-row:hover .ent-thumb { border-color: var(--accent-line); color: var(--accent); }
.ent-id__text { min-width: 0; }
.ent-name { font-size: var(--fs-base); font-weight: 500; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ent-sub { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Zeilen-Aktion (erst bei Hover) */
.row-act {
  width: 32px; height: 32px; border-radius: var(--radius-xs); display: grid; place-items: center;
  color: var(--text-faint); font-size: 14px; background: transparent; border: 0; padding: 0; cursor: pointer;
  opacity: 0; transition: opacity var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.tbl-row:hover .row-act { opacity: 1; }
.row-act:hover { background: var(--n-100); color: var(--text-strong); }
.row-act--danger:hover { background: var(--danger-soft); color: var(--danger); }

/* =============================================================
   Status (Dot + Text) / Pills / Badges / Chips
   ============================================================= */
.status { display: inline-flex; align-items: center; gap: var(--space-3); font-size: var(--fs-sm); color: var(--text); white-space: nowrap; }
.status .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.status--ok .dot     { background: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-2-soft); }
.status--warn .dot   { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.status--danger .dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.status--muted .dot  { background: transparent; box-shadow: inset 0 0 0 1.5px var(--n-300); }
.status--pending .dot{ background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 500;
  color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--hairline);
  padding: 3px 10px; border-radius: var(--radius-pill); white-space: nowrap;
}
.pill--accent { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.pill--ok { color: var(--accent-2); background: var(--accent-2-soft); border-color: transparent; }
.pill--warn { color: var(--amber); background: var(--amber-soft); border-color: transparent; }
.pill--danger { color: var(--danger); background: var(--danger-soft); border-color: transparent; }

.chip { padding: 6px 14px; border: 1px solid var(--hairline-strong); background: var(--surface);
  border-radius: var(--radius-pill); font-size: var(--fs-sm); font-weight: 500; color: var(--text);
  cursor: pointer; transition: all var(--dur-fast) var(--ease); }
.chip:hover { border-color: var(--accent-line); color: var(--text-strong); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--text-on-accent); }

/* =============================================================
   Empty State
   ============================================================= */
.empty { padding: var(--space-20) var(--space-6); text-align: center; }
.empty--flush { padding: var(--space-16) var(--space-6); }
.empty__icon {
  width: 60px; height: 60px; border-radius: var(--radius); margin: 0 auto var(--space-5);
  display: grid; place-items: center; font-size: 24px; color: var(--accent); background: var(--accent-soft);
}
.empty__title { font-size: var(--fs-md); font-weight: 500; color: var(--text-strong); }
.empty__text { font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--space-2); }

/* =============================================================
   Panel-Card + KPI-Karten
   ============================================================= */
.panel-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.panel--flush { padding: 0; background: transparent; border: 0; box-shadow: none; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
.kpi-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: var(--space-5); }
.kpi-card__icon { width: 38px; height: 38px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 16px; margin-bottom: var(--space-4); }
.kpi-card__value { font-size: var(--fs-2xl); font-weight: 500; color: var(--text-strong); line-height: 1; display: flex; align-items: baseline; gap: var(--space-2); }
.kpi-card__unit { font-size: var(--fs-sm); font-weight: 400; color: var(--text-faint); font-family: var(--font-sans); }
.kpi-card__label { font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--space-3); }
.kpi-card__note { font-size: var(--fs-xs); color: var(--text-faint); margin-top: var(--space-2); }
@media (max-width: 1080px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .kpi-grid { grid-template-columns: 1fr; } }

/* =============================================================
   Verbrauchs-/Usage-Widget (Balken mit gelb/rot-Schwellen)
   -------------------------------------------------------------
   Zustände über Modifier: .usage-card.is-warn (>=70%),
   .usage-card.is-full (>=90%). Meter-Breite inline setzen.
   ============================================================= */
.usage-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: var(--space-6); }
.usage-card__head { display: flex; align-items: center; gap: var(--space-4); }
.usage-card__icon { width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 16px; flex-shrink: 0; }
.usage-card__figures { flex: 1; min-width: 0; }
.usage-card__value { font-size: var(--fs-md); color: var(--text-strong); }
.usage-card__value b { font-weight: 700; }
.usage-card__value span { color: var(--text-muted); font-size: var(--fs-sm); font-weight: 400; }
.usage-card__sub { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 2px; }
.usage-card__pct { font-family: var(--font-head); font-weight: 700; font-size: var(--fs-lg); color: var(--accent); font-variant-numeric: tabular-nums; }
.usage-meter { margin-top: var(--space-4); height: 8px; border-radius: var(--radius-pill); background: var(--surface-2); border: 1px solid var(--hairline); overflow: hidden; }
.usage-meter__fill { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width var(--dur) var(--ease); }
.usage-card__note { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-3); font-size: var(--fs-sm); color: var(--text-muted); }
.usage-card.is-warn .usage-card__pct { color: var(--amber); }
.usage-card.is-warn .usage-meter__fill { background: var(--amber); }
.usage-card.is-warn .usage-card__note { color: var(--amber); }
.usage-card.is-full .usage-card__pct { color: var(--danger); }
.usage-card.is-full .usage-meter__fill { background: var(--danger); }
.usage-card.is-full .usage-card__note { color: var(--danger); }

/* Aufschlüsselung als kleine Tabelle */
.breakdown { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.breakdown th { text-align: left; font-weight: 500; color: var(--text-faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; padding: 0 var(--space-3) var(--space-2); border-bottom: 1px solid var(--hairline); }
.breakdown td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--hairline); color: var(--text); }
.breakdown tbody tr:last-child td { border-bottom: none; }
.breakdown .right { text-align: right; }

/* =============================================================
   Formular-Controls
   ============================================================= */
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field__label { font-size: var(--fs-sm); font-weight: 500; color: var(--text-strong); }
.field__hint { font-size: var(--fs-xs); color: var(--text-faint); line-height: 1.55; }
.field__opt { font-size: 11px; font-weight: 400; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; margin-left: 6px; }

.input-field {
  height: 44px; width: 100%; padding: 0 var(--space-4);
  background: var(--surface); border: 1px solid var(--hairline-strong); border-radius: var(--radius-sm);
  font-size: var(--fs-sm); transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input-field:focus { outline: none; border-color: var(--accent-line); box-shadow: var(--ring); }
.input-field::placeholder { color: var(--text-faint); }
.input-field.has-error { border-color: var(--danger); box-shadow: 0 0 0 3.5px var(--danger-soft); }

.input-text {
  display: flex; align-items: center; gap: var(--space-3); height: 44px; padding: 0 var(--space-3) 0 var(--space-4);
  background: var(--surface); border: 1px solid var(--hairline-strong); border-radius: var(--radius-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input-text:focus-within { border-color: var(--accent-line); box-shadow: var(--ring); }
.input-text > i { color: var(--text-faint); font-size: 14px; }
.input-text input { flex: 1; min-width: 0; border: none; outline: none; background: none; font-size: var(--fs-sm); }
.input-text input::placeholder { color: var(--text-faint); }
.input-affix-btn { color: var(--text-faint); font-size: 14px; padding: 6px; border-radius: var(--radius-xs); }
.input-affix-btn:hover { color: var(--text); }
.input-text .eye-hide { display: none; }
.input-text.is-revealed .eye-show { display: none; }
.input-text.is-revealed .eye-hide { display: inline-block; }
.input-prefix { color: var(--text-faint); font-size: 12px; white-space: nowrap; }
.input-suffix { color: var(--text-faint); font-size: var(--fs-sm); white-space: nowrap; }

.textarea {
  padding: var(--space-3) var(--space-4); background: var(--surface);
  border: 1px solid var(--hairline-strong); border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: var(--fs-sm); line-height: 1.6; resize: vertical; min-height: 130px; width: 100%;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.textarea:focus { outline: none; border-color: var(--accent-line); box-shadow: var(--ring); }
.textarea::placeholder { color: var(--text-faint); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.form-grid .col-span-2 { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } .form-grid .col-span-2 { grid-column: auto; } }

.or-sep { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-5) 0; color: var(--text-faint); font-size: var(--fs-xs); }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }

/* Custom-Checkbox */
.at-check { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; }
.at-check input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.at-check__box {
  width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0;
  border: 1px solid var(--hairline-strong); background: var(--surface);
  display: grid; place-items: center; color: transparent;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.at-check__box i { font-size: 11px; }
.at-check input:checked + .at-check__box { background: var(--accent); border-color: var(--accent); color: #fff; }
.at-check input:focus-visible + .at-check__box { border-color: var(--accent-line); box-shadow: var(--ring); }
.at-check__label { font-size: var(--fs-sm); color: var(--text-muted); }

/* Switch / Toggle */
.switch { position: relative; flex-shrink: 0; display: inline-flex; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { width: 40px; height: 24px; border-radius: var(--radius-pill); background: var(--n-200);
  transition: background var(--dur) var(--ease); display: inline-flex; align-items: center; padding: 2px; }
.switch__thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease-out); }
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { box-shadow: var(--ring); }
.switch input:disabled + .switch__track { opacity: 0.5; cursor: not-allowed; }

/* =============================================================
   Copy-Feld (Wert + Copy-Button) — für App-Zugangsdaten, DNS-Records
   ============================================================= */
.copy-field { display: flex; align-items: stretch; border: 1px solid var(--hairline-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.copy-field__value {
  flex: 1; min-width: 0; padding: 10px var(--space-4); font-family: var(--font-mono); font-size: var(--fs-sm);
  color: var(--text-strong); white-space: pre; overflow-x: auto; display: flex; align-items: center;
}
.copy-field__btn {
  flex-shrink: 0; padding: 0 var(--space-4); border-left: 1px solid var(--hairline);
  color: var(--text-muted); font-size: 13px; display: inline-flex; align-items: center; gap: var(--space-2);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.copy-field__btn:hover { background: var(--surface-2); color: var(--text-strong); }
.copy-field__btn.is-copied { color: var(--accent-2); }

/* Definitionsliste (Key/Value) für Detailansichten */
.detail-dl { display: flex; flex-direction: column; }
.detail-dl > div { display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--hairline); }
.detail-dl > div:last-child { border-bottom: none; }
.detail-dl dt { font-size: var(--fs-sm); color: var(--text-muted); }
.detail-dl dd { font-size: var(--fs-sm); color: var(--text-strong); text-align: right; }

/* =============================================================
   Einstellungen (Sub-Navigation + Content)
   ============================================================= */
.settings { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: var(--space-8); align-items: start; }
.subnav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: var(--space-6); }
.subnav__item {
  display: flex; align-items: center; gap: var(--space-3); padding: 11px var(--space-4); border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: var(--fs-sm); font-weight: 500;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.subnav__item i:first-child { width: 18px; text-align: center; font-size: 14px; color: var(--text-faint); transition: color var(--dur-fast) var(--ease); }
.subnav__item:hover { background: var(--surface); color: var(--text-strong); }
.subnav__item:hover i:first-child { color: var(--text); }
.subnav__item.is-active { background: var(--surface); color: var(--text-strong); box-shadow: var(--shadow-sm); }
.subnav__item.is-active i:first-child { color: var(--accent); }

.settings__content { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.settings__head { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-6); border-bottom: 1px solid var(--hairline); }
.settings__head-icon { width: 44px; height: 44px; border-radius: var(--radius-sm); flex-shrink: 0; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 17px; }
.settings__title { font-family: var(--font-head); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; font-size: var(--fs-md); color: var(--text-strong); }
.settings__desc { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 2px; }
.settings__body { padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-7); }
.admin-body { display: flex; flex-direction: column; gap: var(--space-7); padding: var(--space-6); }

.switch-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-5); padding: var(--space-4) 0; }
.switch-row + .switch-row { border-top: 1px solid var(--hairline); }
.switch-row__text { min-width: 0; }
.switch-row__label { font-size: var(--fs-sm); font-weight: 500; color: var(--text-strong); }
.switch-row__hint { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; max-width: 52ch; line-height: var(--lh-snug); }

@media (max-width: 820px) { .settings { grid-template-columns: 1fr; gap: var(--space-5); } .subnav { position: static; } }

/* =============================================================
   Callout / Inline-Hinweise
   ============================================================= */
.callout { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-sm); font-size: var(--fs-sm); line-height: 1.55; }
.callout i { margin-top: 2px; flex-shrink: 0; }
.callout--info { background: var(--accent-soft); color: var(--accent); }
.callout--ok { background: var(--accent-2-soft); color: var(--accent-2); }
.callout--warn { background: var(--amber-soft); color: var(--amber); }
.callout--danger { background: var(--danger-soft); color: var(--danger); }
.callout--info .mono, .callout--ok .mono, .callout--warn .mono, .callout--danger .mono { color: inherit; }

/* =============================================================
   Tabs (Sub-Navigation oben)
   ============================================================= */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--hairline); margin-bottom: var(--space-8); overflow-x: auto; }
.tab {
  display: flex; align-items: center; gap: var(--space-2); white-space: nowrap;
  padding: 12px var(--space-4); font-size: var(--fs-sm); font-weight: 500; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.tab i { font-size: 14px; color: var(--text-faint); transition: color var(--dur-fast) var(--ease); }
.tab:hover { color: var(--text-strong); } .tab:hover i { color: var(--text); }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.tab.is-active i { color: var(--accent); }

/* =============================================================
   Drawer (rechts einschiebendes Panel)
   ============================================================= */
.drawer-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(13, 13, 15, 0.42);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease); }
.drawer-overlay.is-open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 81; width: min(460px, 94vw);
  display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--hairline);
  box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform var(--dur-slow) var(--ease-out); }
.drawer.is-open { transform: translateX(0); }
.drawer__head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--hairline); }
.drawer__title { font-family: var(--font-head); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; font-size: var(--fs-md); color: var(--text-strong); }
.drawer__head .icon-btn { margin-left: auto; }
.drawer__body { flex: 1; overflow-y: auto; padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-6); }
.drawer__foot { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-5) var(--space-6); border-top: 1px solid var(--hairline); }
.drawer__foot-right { margin-left: auto; display: flex; gap: var(--space-3); }

/* =============================================================
   Modal (zentriert)
   ============================================================= */
body.modal-open { overflow: hidden; }
.modal-scrim {
  position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center;
  padding: var(--space-6); background: rgba(13,13,15,0.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease);
}
.modal-scrim.is-open { opacity: 1; pointer-events: auto; }
body.modal-open .content { z-index: 101; }
.modal {
  width: 100%; max-width: 780px; max-height: calc(100vh - var(--space-12)); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(12px) scale(0.985);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease-out);
}
.modal-scrim.is-open .modal { opacity: 1; transform: translateY(0) scale(1); }
.modal--md { max-width: 560px; }
.modal--flow .modal__body { overflow: visible; }
.modal__head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--hairline); }
.modal__title { font-family: var(--font-head); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; font-size: var(--fs-md); color: var(--text-strong); }
.modal__head .icon-btn { margin-left: auto; }
.modal__body { padding: var(--space-6); overflow-y: auto; }
.modal__lead { color: var(--text-muted); font-size: var(--fs-sm); line-height: var(--lh-base); margin-bottom: var(--space-5); }
.modal__foot { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-5) var(--space-6); border-top: 1px solid var(--hairline); }
.modal__foot-right { margin-left: auto; display: flex; gap: var(--space-3); }

/* =============================================================
   Toast
   ============================================================= */
.toast-wrap { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: var(--space-2); background: var(--n-900); color: #fff; font-size: var(--fs-sm); font-weight: 500;
  padding: 10px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(10px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease-out); }
.toast.is-in { opacity: 1; transform: translateY(0); }
.toast i { font-size: 13px; color: var(--accent-2); }
.toast--error i { color: var(--danger); }
:root[data-theme="dark"] .toast { background: var(--n-100); color: var(--n-900); }

/* =============================================================
   Halten-zum-Bestätigen-Button (destruktive Aktionen)
   ============================================================= */
.btn--hold { position: relative; overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none; }
.btn--hold .btn-hold__fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--danger); opacity: 0.22; pointer-events: none; }
.btn--hold .btn-hold__label { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: var(--space-2); }
.btn--hold.is-holding { color: var(--danger); }

/* =============================================================
   Utilities
   ============================================================= */
.row { display: flex; align-items: center; }
.stack { display: flex; flex-direction: column; }
.wrap { flex-wrap: wrap; }
.gap-2 { gap: var(--space-2); } .gap-3 { gap: var(--space-3); } .gap-4 { gap: var(--space-4); } .gap-5 { gap: var(--space-5); }
.mt-2 { margin-top: var(--space-2); } .mt-4 { margin-top: var(--space-4); } .mt-5 { margin-top: var(--space-5); } .mt-6 { margin-top: var(--space-6); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

kbd { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
  border: 1px solid var(--hairline-strong); border-bottom-width: 2px; border-radius: 5px;
  padding: 1px 6px; background: var(--surface); line-height: 1.4; }

/* =============================================================
   Mobile
   ============================================================= */
.sidebar-toggle { display: none; }
.scrim { display: none; }
.sidebar-collapse {
  display: flex; align-items: center; gap: var(--space-4); width: 100%;
  padding: 11px var(--space-4); margin-bottom: var(--space-2); border-radius: var(--radius-sm);
  color: var(--text-faint); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.sidebar-collapse i { font-size: 17px; width: 24px; text-align: center; transition: transform var(--dur) var(--ease); }
.sidebar-collapse:hover { background: var(--surface-hover); color: var(--text); }
.sidebar__foot--collapse { padding-top: var(--space-3); }
.sidebar__foot--collapse .sidebar-collapse { margin-bottom: 0; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(calc(-100% - var(--sidebar-gap) - 8px)); }
  .sidebar.is-open { transform: translateX(0); }
  .content { margin-left: 0; }
  .sidebar-toggle { display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--radius-sm);
    background: var(--surface); border: 1px solid var(--hairline-strong); color: var(--text-strong); }
  .scrim.is-visible { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(13,13,15,0.4); backdrop-filter: blur(3px); }
  .search { min-width: 0; flex: 1; }
  .sidebar-collapse { display: none; }
}

/* Eingeklappte Sidebar (nur Desktop) */
@media (min-width: 901px) {
  .app.is-collapsed .sidebar { width: var(--sidebar-w-collapsed); padding-left: var(--space-3); padding-right: var(--space-3); }
  .app.is-collapsed .content { margin-left: calc(var(--sidebar-w-collapsed) + var(--sidebar-gap) * 2); }
  .app.is-collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .app.is-collapsed .brand__name,
  .app.is-collapsed .nav__item span,
  .app.is-collapsed .sidebar-collapse span,
  .app.is-collapsed .user__meta { display: none; }
  .app.is-collapsed .nav__label { font-size: 0; padding: 0; margin: var(--space-3) auto var(--space-2); width: 22px; height: 1px; background: var(--hairline); }
  .app.is-collapsed .nav__item, .app.is-collapsed .sidebar-collapse, .app.is-collapsed .user { justify-content: center; gap: 0; padding-left: 0; padding-right: 0; }
  .app.is-collapsed .nav__item { padding-top: 15px; padding-bottom: 15px; }
  .app.is-collapsed .sidebar-collapse i { transform: rotate(180deg); }
  .app.is-collapsed .nav__item, .app.is-collapsed .sidebar-collapse, .app.is-collapsed .user { position: relative; }
  .app.is-collapsed [data-tip]:hover::after {
    content: attr(data-tip); position: absolute; left: calc(100% + 16px); top: 50%; transform: translateY(-50%);
    background: var(--surface); color: var(--text-strong); border: 1px solid var(--hairline); box-shadow: var(--shadow-md);
    font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: normal; white-space: nowrap;
    padding: 7px 11px; border-radius: var(--radius-xs); z-index: 60; pointer-events: none;
  }
}

@media (max-width: 640px) {
  .modal-scrim { padding: 0; align-items: flex-end; }
  .modal { max-width: 100%; max-height: 92vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-left: 0; border-right: 0; border-bottom: 0; transform: translateY(100%); }
  .modal-scrim.is-open .modal { transform: translateY(0); }
  .modal--md { max-width: 100%; }
  .modal__foot { flex-wrap: wrap; gap: var(--space-2); }
  .modal__foot-right { margin-left: 0; width: 100%; }
  .modal__foot-right .btn { flex: 1; }
  .drawer { width: 100vw; }
  .page-head__actions { width: 100%; flex-wrap: wrap; }
  .page-head__actions .btn--primary { flex: 1; min-width: 160px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
