/* inrema-dashboard — Komponenten. Nur var(--*), kein Hex (Master-Konzept §2.5). */

/* ---------- Reset / Basis ---------- */
* { box-sizing: border-box; }
/* Kein Overscroll-„Gummiband" (iOS/PWA) -> fixierte Elemente wie der FAB wandern beim Scrollen nicht mit. */
html, body { overscroll-behavior-y: none; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
::placeholder { color: var(--faint); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }

@keyframes pulseDot { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Layout ---------- */
.app { display: flex; align-items: flex-start; }
.main { flex: 1; min-width: 0; max-width: 100%; overflow-x: hidden; min-height: 100vh; padding: 28px 36px 56px; }
.main__inner { max-width: 1280px; margin: 0 auto; }
/* Einheitlicher vertikaler Rhythmus: jeder Top-Level-Block bekommt denselben Abstand zum
   vorigen (statt verstreuter margin-bottom-Werte je Komponente). Loest auch Bento->Suche->Bento. */
.main__inner > * + * { margin-top: var(--gap-section); }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w); flex: none; background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column; padding: 22px 16px 18px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar__brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; }
.sidebar__brand img { width: 34px; height: 34px; object-fit: contain; flex: none; }
.sidebar__brand-name { font-size: 15px; font-weight: 700; letter-spacing: .06em; color: var(--white); }
.sidebar__brand-sub { font-size: 10px; color: var(--sidebar-muted); letter-spacing: .14em; margin-top: 1px; }
.sidebar__label { font-size: 10px; letter-spacing: .13em; color: var(--sidebar-muted); font-weight: 600; padding: 20px 10px 8px; }
.sidebar__label:first-of-type { padding-top: 8px; }

/* Einklappbare Nav-Gruppen (Uebersicht/Dienste/Projekte/Schnellzugriff). Persistenz: app.js. */
.sidebar__group { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; background: none; border: none; cursor: pointer; font-family: inherit; text-align: left; }
.sidebar__group:hover { color: var(--sidebar-text); }
.navgroup:first-of-type .sidebar__group { padding-top: 8px; }
.sidebar__caret { font-size: 14px; transition: transform .2s ease; }
.navgroup:not(.is-collapsed) .sidebar__caret { transform: rotate(90deg); }
.navgroup.is-collapsed .navgroup__body { display: none; }

/* Navgroup-Toggle fuer helle Karten (WMT-Seitenliste nach Hosting, Faellige-Aufgaben-Updates).
   Gleiche Mechanik wie .sidebar__group, aber Optik wie .pc-group (helle Karte statt Sidebar). */
.navgroup__toggle { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; background: none; border: none; cursor: pointer; font-family: inherit; text-align: left; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 14px 0 8px; }
.navgroup__toggle:hover { color: var(--muted); }
.navgroup__toggle .sidebar__caret { font-size: 13px; }
.sidebar__foot { margin-top: auto; padding: 14px 10px 2px; border-top: 1px solid var(--sidebar-2); font-size: 11px; color: var(--sidebar-muted); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sidebar__foot strong { display: block; color: var(--sidebar-text); font-weight: 600; margin-top: 3px; }
.sidebar__bell { position: relative; flex: none; width: 36px; height: 36px; border: none; border-radius: 10px; background: var(--sidebar-2); color: var(--sidebar-text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.sidebar__bell svg { width: 19px; height: 19px; }
.sidebar__bell .nav-badge { position: absolute; top: -5px; right: -5px; }

.nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; padding: 9px 11px; border-radius: var(--radius-sm);
  border: none; background: transparent; color: var(--sidebar-text); font: inherit; font-size: 13.5px;
  font-weight: 500; cursor: pointer; transition: background .15s, color .15s; text-decoration: none;
}
/* Aufgaben-Zaehler am Nav-Eintrag (blauer Kreis). Generisch: app.js fuellt per data-badge, >0 = sichtbar. */
.nav-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--radius-pill);
  background: var(--accent); color: var(--white); font-size: 10.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex: none; line-height: 1;
}
.nav-badge[hidden] { display: none; } /* sonst ueberschreibt .nav-badge das hidden-Attribut -> leerer blauer Kreis ueberall */
.nav-badge--amber { background: var(--amber); }
.nav-badge--red { background: var(--red); }
.nav-item:hover { background: var(--sidebar-2); }
.nav-item.is-active { background: var(--sidebar-2); color: var(--white); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }

.quick { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--sidebar-text); font-size: 13px; text-decoration: none; transition: background .15s; }
.quick:hover { background: var(--sidebar-2); }
.quick__badge { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); color: var(--white); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: none; }

/* ---------- Mobile-Nav (Hamburger oben rechts) ---------- */
.topnav { display: none; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--sidebar); color: var(--white); position: sticky; top: 0; z-index: 30; }
.topnav__brand { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 700; letter-spacing: .05em; }
.topnav__brand img { width: 26px; height: 26px; object-fit: contain; }
.nav-toggle { background: var(--sidebar-2); border: none; color: var(--white); width: 40px; height: 40px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.nav-toggle svg { width: 20px; height: 20px; }
.scrim { display: none; position: fixed; inset: 0; background: var(--overlay); z-index: 25; animation: fadeIn .2s ease; }

/* Benachrichtigungen: die Glocke (#ns-bell) im Sidebar-Fuss ist ein Link auf benachrichtigungen.php */

/* Freigabe: Wisch-zum-Bestaetigen (Sparkasse-Stil) */
.slideconf { position: relative; height: 58px; border-radius: 29px; background: var(--track); overflow: hidden; user-select: none; touch-action: none; margin-top: 12px; }
.slideconf__fill { position: absolute; top: 0; left: 0; height: 100%; width: 54px; background: var(--green); border-radius: 29px; }
.slideconf.is-warn .slideconf__fill { background: var(--amber); }
.slideconf.is-danger .slideconf__fill { background: var(--red); }
.slideconf__label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 13.5px; letter-spacing: .01em; pointer-events: none; padding-left: 44px; transition: opacity .12s ease; }
.slideconf.is-done .slideconf__label { opacity: 0; }
.slideconf__fill { transition: width .18s ease; }
.slideconf__handle { position: absolute; top: 5px; left: 5px; width: 48px; height: 48px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); color: var(--text); display: flex; align-items: center; justify-content: center; cursor: grab; touch-action: none; }
.slideconf__handle svg { width: 22px; height: 22px; }
.slideconf__handle:active { cursor: grabbing; }

/* ---------- Topbar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.topbar__greet { font-size: 24px; font-weight: 700; letter-spacing: -.01em; color: var(--text); }
.topbar__date { font-size: 13px; color: var(--muted); margin-top: 3px; text-transform: capitalize; }
.topbar__right { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }

.pill { display: inline-flex; align-items: center; gap: 9px; border-radius: var(--radius-pill); padding: 8px 15px; font-size: 13px; font-weight: 600; border: 1px solid; }
.pill__dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.pill--ok { background: var(--status-ok-bg); border-color: var(--status-ok-border); color: var(--green-text); }
.pill--ok .pill__dot { background: var(--green); }
.pill--warn { background: var(--status-warn-bg); border-color: var(--status-warn-border); color: var(--amber-text); }
.pill--warn .pill__dot { background: var(--amber); }
.pill--bad { background: var(--status-down-bg); border-color: var(--status-down-border); color: var(--red-text); }
.pill--bad .pill__dot { background: var(--red); }

.searchbar { position: relative; }
.searchbar svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); }
/* font-size: 16px Pflicht -> verhindert iOS-Safari Auto-Zoom beim Fokussieren (gilt fuer alle Eingabefelder). */
.searchbar input { width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 13px 16px 13px 44px; color: var(--text); font-size: 16px; font-family: inherit; outline: none; box-shadow: var(--shadow); }
.searchbar input:focus { border-color: var(--accent); }

/* ---------- Alarm-Banner ---------- */
.alert-banner { display: flex; align-items: center; gap: 13px; background: var(--alert-bg); border: 1px solid var(--alert-border); border-radius: 12px; padding: 13px 16px; cursor: pointer; }
.alert-banner[hidden] { display: none; } /* sonst ueberschreibt display:flex das hidden-Attribut -> Banner immer sichtbar */
.alert-banner__icon { width: 26px; height: 26px; border-radius: 7px; background: var(--amber); color: var(--white); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex: none; }
.alert-banner__text { flex: 1; font-size: 13.5px; color: var(--text); }
.alert-banner__text b { font-weight: 700; }
.alert-banner__text span { color: var(--muted); }
.alert-banner__cta { font-size: 12px; color: var(--accent-deep); font-weight: 600; white-space: nowrap; }

/* ---------- KPI-Kacheln ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 14px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: 13px; padding: 16px 18px; box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s, transform .15s; }
.kpi:hover { border-color: var(--accent); transform: translateY(-2px); }
.kpi__head { display: flex; align-items: center; justify-content: space-between; }
.kpi__label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.kpi__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.kpi__value { font-size: 29px; font-weight: 700; margin-top: 9px; letter-spacing: -.01em; }

/* ---------- Karten / Bento ---------- */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
/* GMS-Pipeline: 4 Spalten (Funnel w2 + Discovery + Final q6 = obere Zeile; 4 Flotten = untere Zeile). */
.bento--4 { grid-template-columns: repeat(4, 1fr); }
/* Grid-Kinder MUESSEN schrumpfen duerfen (Default min-width:auto sprengt sonst die Spalte
   bei langem, nicht umbrechbarem Inhalt -> horizontaler Ueberlauf). Gilt auf ALLEN Breiten. */
.bento > *, .cards-grid > *, .stage-grid > *, .kpi-grid > *, .svc-grid > * { min-width: 0; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 15px; padding: 22px; box-shadow: var(--shadow); transition: border-color .15s; }
.card.is-clickable { cursor: pointer; }
.card.is-clickable:hover { border-color: var(--accent); }
.card--w2 { grid-column: span 2; }
.card--w3 { grid-column: span 3; }
.card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card__title { font-size: 14.5px; font-weight: 700; color: var(--text); }
.card__sub { font-size: 11.5px; color: var(--faint); margin-left: 9px; font-weight: 400; }
.card__more { font-size: 12px; color: var(--accent-deep); font-weight: 600; }

/* ---------- Server-Zeilen + Balken ---------- */
.srv-row { display: grid; grid-template-columns: 135px 1fr 40px; gap: 24px; align-items: center; padding: 11px 0; border-top: 1px solid var(--border); }
.srv-row__name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.srv-row__name span { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot--green { background: var(--green); }
.srv-row__bars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.srv-row__end { text-align: right; }
.srv-row__end .ok { font-size: 10px; color: var(--green); }
.srv-row__end .warn { font-size: 11px; color: var(--red); }

.metric { display: flex; align-items: center; gap: 9px; }
.metric__label { font-size: 9.5px; letter-spacing: .04em; color: var(--faint); width: 28px; flex: none; }
.metric__num { font-size: 10px; color: var(--muted); width: 22px; text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.bar { flex: 1; height: 6px; background: var(--track); border-radius: 99px; overflow: hidden; }
.bar__fill { height: 100%; border-radius: 99px; transition: width .9s ease; }

/* ---------- Listen-Zeilen (Jobs, DB, USV) ---------- */
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--border); }
.row__l { font-size: 13px; color: var(--text); min-width: 0; }
.row__sub { font-size: 10.5px; color: var(--faint); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Wert rechts: darf umbrechen statt nach rechts auszubrechen (lange Domain-Listen, Nameserver, Secrets).
   text-align:right haelt umgebrochene Zeilen buendig rechts; tabular-nums fuer Zahlen erhalten. */
.row__r { font-size: 12.5px; font-weight: 600; min-width: 0; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.row--link { text-decoration: none; cursor: pointer; margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 8px; }
.row--link:hover { background: var(--tint); }
.pc-group { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 14px 0 2px; }
.pc-pre { font-size: 12px; color: var(--muted); white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; line-height: 1.5; padding: 4px 0 12px; }

.pool { margin-bottom: 16px; }
.pool__head { display: flex; justify-content: space-between; margin-bottom: 6px; }
.pool__name { font-size: 12.5px; color: var(--text); }
.pool__val { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Dienste-Kacheln ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.svc { background: var(--tint); border: 1px solid var(--border); border-radius: 11px; padding: 13px 15px; }
.svc__head { display: flex; align-items: center; gap: 9px; }
.svc__name { font-size: 13px; font-weight: 600; color: var(--text); }
.svc__val { font-size: 11px; color: var(--green); margin-left: auto; }
.svc__meta { font-size: 10.5px; color: var(--faint); margin-top: 6px; }

/* ---------- Karten-Raster (Detailseiten) ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.cards-grid--3 { grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); }
.metric-row { display: grid; grid-template-columns: 46px 1fr 64px; gap: 12px; align-items: center; padding: 7px 0; }
.metric-row__label { font-size: 10px; letter-spacing: .04em; color: var(--faint); font-weight: 600; }
.metric-row__val { font-size: 12px; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- GMS-Pipeline ---------- */
.page-head__title { font-size: 24px; font-weight: 700; letter-spacing: -.01em; color: var(--text); }
.page-head__sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.stage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stage { background: var(--card); border: 1px solid var(--border); border-radius: 13px; padding: 16px 18px; box-shadow: var(--shadow); }
.stage__label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.stage__rate { font-size: 27px; font-weight: 700; margin-top: 8px; color: var(--accent); letter-spacing: -.01em; }
.stage__rate small { font-size: 12px; color: var(--faint); font-weight: 600; }
.stage__meta { font-size: 11px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.frow { display: grid; grid-template-columns: 160px 1fr 90px; gap: 14px; align-items: center; padding: 9px 0; border-top: 1px solid var(--border); }
.frow__name { font-size: 12.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frow__num { font-size: 12.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.badge { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-pill); }
.badge--ok { background: var(--status-ok-bg); color: var(--green-text); }
.badge--down { background: var(--status-down-bg); color: var(--red); }
.badge--upd { background: var(--status-warn-bg); color: var(--amber-text); }

/* ---------- WMT: Seiten-Zeile (gerahmte Karte je Seite, Badge-Logik) ---------- */
.wsite { display: flex; align-items: center; gap: 14px; padding: 13px 16px; margin-top: 10px; border: 1px solid var(--border); border-radius: 12px; transition: border-color .15s; text-decoration: none; color: inherit; cursor: pointer; }
.wsite:hover { border-color: var(--accent); }
.wsite:hover .wsite__title { color: var(--accent); }
.wsite__main { flex: 1; min-width: 0; }
.wsite__title { font-size: 14px; font-weight: 600; color: var(--text); }
.wsite__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 5px; font-size: 12px; color: var(--muted); }
.wsite__right { display: flex; align-items: center; gap: 12px; flex: none; }

/* ---------- WMT: Loeschen am Detailseiten-Ende (dezent) ---------- */
.wdanger { margin-top: 22px; text-align: center; }
.wdanger__btn { background: none; border: none; font: inherit; font-size: 12.5px; color: var(--faint); cursor: pointer; text-decoration: underline; }
.wdanger__btn:hover { color: var(--red); }
.wbk-restore { background: none; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); cursor: pointer; font-size: 11px; line-height: 1; padding: 2px 7px; margin-left: 8px; }
.wbk-restore:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Schnellzugriff: zweiter Block (Weitere Dienste, einklappbar) ---------- */
.sidebar__more { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; background: none; border: none; cursor: pointer; font-family: inherit; text-align: left; }
.sidebar__more:hover { color: var(--sidebar-text); }
.sidebar__more-caret { font-size: 14px; transition: transform .2s ease; }
.app.quick-more-open .sidebar__more-caret { transform: rotate(90deg); }
.quick-more { display: none; }
.app.quick-more-open .quick-more { display: block; }

/* ---------- Favoriten-Formular ---------- */
.fav-form { display: flex; gap: 10px; flex-wrap: wrap; }
.fav-input { flex: 1 1 160px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 13px; color: var(--text); font-size: 16px; font-family: inherit; outline: none; } /* 16px: kein iOS-Zoom */
.fav-input:focus { border-color: var(--accent); }
select.fav-input { flex: 0 1 180px; }
/* Beschriftetes Eingabefeld (Label ueber Input) — fuer Formulare mit vielen Feldern (snori-Detail/Neu). */
.fld { display: flex; flex-direction: column; gap: 4px; flex: 1 1 180px; min-width: 0; }
.fld > span { font-size: 11px; letter-spacing: .02em; color: var(--faint); font-weight: 600; }
.fld--wide { flex-basis: 100%; }
/* Input darf in der .fld-Spalte NICHT vertikal wachsen (sonst Riesen-Kaesten) — volle Breite, eigene Hoehe. */
.fld > .fav-input { flex: none; width: 100%; }
.fld > textarea.fav-input { min-height: 64px; resize: vertical; }
.fav-btn { background: var(--accent); color: var(--white); border: none; border-radius: 10px; padding: 10px 18px; font-size: 13.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.fav-btn:hover { background: var(--accent-deep); }
.fav-btn--ghost { background: transparent; color: var(--accent-deep); border: 1px solid var(--border); }
.fav-btn--ghost:hover { background: var(--tint); border-color: var(--accent); color: var(--accent-deep); }
.fav-btn--warn { background: transparent; color: var(--amber-text); border: 1px solid var(--amber); }
.fav-btn--warn:hover { background: var(--status-warn-bg); }
.fav-btn[disabled] { opacity: .55; cursor: default; }

/* Toggle-Schalter (An/Aus) — tokenisiert, wiederverwendbar */
.switch { position: relative; display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { position: relative; width: 42px; height: 24px; border-radius: var(--radius-pill); background: var(--border); transition: background .15s; flex: none; }
.switch__track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--white); box-shadow: var(--shadow); transition: transform .15s; }
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch__label { font-size: 13.5px; color: var(--muted); }

/* URL-Einwurf (KI-Spotlight-Projektseite -> Pipeline) */
.einwurf { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.einwurf .fav-input { flex: 1 1 320px; }
.einwurf__hint { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.einwurf--text { flex-direction: column; align-items: stretch; margin-top: 12px; }
.einwurf--text .fav-input { flex: none; width: 100%; }
.einwurf--text textarea.fav-input { min-height: 120px; resize: vertical; }
.einwurf__top0 { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.einwurf__top0 .fav-input { width: 66px; flex: none; }

/* Aktions-Leiste (Detailseite) */
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions__msg { font-size: 12.5px; color: var(--muted); margin-top: 10px; min-height: 1em; }
.fav-del { background: transparent; border: none; color: var(--faint); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; flex: none; }
.fav-del:hover { color: var(--red); }

/* Kategorie-Filter-Chips */
.fav-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.fav-chip { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 7px 14px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; font-family: inherit; transition: all .15s; }
.fav-chip:hover { border-color: var(--accent); }
.fav-chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--white); }

/* Scrollbare Kategorie-Box + buendige Zeile */
.fav-cat[hidden] { display: none; }
.fav-list { max-height: 380px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.fav-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.fav-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fav-row__title { font-size: 13px; color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-row__title:hover { color: var(--accent); }
.fav-row__url { font-size: 11px; color: var(--faint); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.fav-row form { margin: 0; flex: none; display: flex; }

/* ---------- Skeleton / Shimmer (asynchrones Nachladen) ---------- */
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton {
  display: inline-block; height: 13px; border-radius: 6px;
  background: linear-gradient(90deg, var(--track) 25%, var(--border) 50%, var(--track) 75%);
  background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite;
}
.skeleton--label { display: block; width: 55%; height: 10px; margin-bottom: 10px; }
.skeleton--big   { display: block; width: 78px; height: 26px; margin: 8px 0 7px; }
.skeleton--meta  { display: block; width: 72%; height: 10px; }
.skeleton--text  { height: 13px; }
.skeleton--num   { width: 58px; height: 13px; }
.skel-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 11px 0; border-top: 1px solid var(--border); }
[data-load].loaded { animation: fadeIn .3s ease; }

/* ---------- Loesch-Bestaetigung (PIN-Overlay, global, app.js) ---------- */
.cfm { position: fixed; inset: 0; background: var(--overlay); display: flex; align-items: center; justify-content: center; z-index: 50; animation: fadeIn .15s ease; padding: 20px; }
.cfm__box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-drawer); padding: 24px; width: min(360px, 92vw); text-align: center; }
.cfm__title { font-size: 17px; font-weight: 700; color: var(--text); }
.cfm__hint { font-size: 12.5px; color: var(--muted); margin: 8px 0 12px; }
.cfm__pin { font-size: 30px; font-weight: 700; letter-spacing: .5em; color: var(--accent); font-variant-numeric: tabular-nums; padding-left: .5em; }
.cfm__in { width: 150px; margin: 14px auto 0; display: block; text-align: center; font-size: 22px; letter-spacing: .35em; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); outline: none; font-variant-numeric: tabular-nums; }
.cfm__in:focus { border-color: var(--accent); }
.cfm__row { margin-top: 14px; }
.cfm__cancel { background: transparent; border: 1px solid var(--border); border-radius: 10px; padding: 8px 16px; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.cfm__cancel:hover { border-color: var(--accent); color: var(--text); }
.cfm--bad { animation: cfmShake .4s ease; }
.cfm--bad .cfm__in { border-color: var(--red); }
@keyframes cfmShake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-7px); } 40%,80% { transform: translateX(7px); } }

/* ---------- Footer ---------- */
.foot { text-align: center; color: var(--faint); font-size: 11px; margin-top: 26px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.foot__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulseDot 2s ease infinite; }

/* ---------- Responsive: Hamburger oben rechts ---------- */
@media (max-width: 860px) {
  .topnav { display: flex; position: fixed; top: 0; left: 0; right: 0; }
  .sidebar {
    position: fixed; top: 0; right: 0; left: auto; z-index: 28; height: 100vh;
    width: min(290px, 86vw); padding-top: 70px;
    transform: translateX(100%); transition: transform .25s ease;
    box-shadow: var(--shadow-drawer);
  }
  .sidebar__brand { display: none; }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .scrim { display: block; }
  .main { padding: 80px 14px 48px; }
  /* Grid-Items duerfen schrumpfen (sonst erzwingt min-content Ueberlauf) */
  .bento, .bento--4, .cards-grid, .cards-grid--3 { grid-template-columns: 1fr; }
  .card--w2, .card--w3 { grid-column: span 1; }
  .stage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Server-Zeile: Name schmal, Balken untereinander statt nebeneinander */
  .srv-row { grid-template-columns: 84px 1fr; gap: 12px; }
  .srv-row__bars { grid-template-columns: 1fr; gap: 6px; }
  .srv-row__end { display: none; }
  .metric { min-width: 0; }
  /* Zeilen-Layouts schrumpffaehig machen */
  .frow { gap: 10px; }
  .frow__name, .frow__num, .metric-row__label, .metric-row__val, .row__l, .row__r { min-width: 0; }
  .metric-row__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ===== Content-Hub Komponenten (Phase 12, D40) — wiederverwendbar ===== */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 28px 2px 12px; }
.sec-head__t { font-size: 15px; font-weight: 700; color: var(--text); }
.sec-head__s { font-size: 12px; color: var(--faint); }

/* Empfehlungs-/Anlass-Karte */
.rec { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 9px; }
.rec__top { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.rec__title { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.32; }
.rec__sum { font-size: 13px; line-height: 1.6; color: var(--muted); }
.rec__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 2px; padding-top: 11px; border-top: 1px solid var(--border); }
.rec__fb { display: flex; align-items: center; gap: 6px; }
.rec__acts { display: flex; gap: 8px; }

/* Score-Pille + Meta-Pillen (Projekt/Format/Dringlichkeit) */
.score-pill { font-weight: 700; font-size: 12.5px; padding: 3px 10px; border-radius: var(--radius-pill); flex: none; }
.score-pill--hi { background: var(--status-ok-bg); color: var(--green-text); }
.score-pill--mid { background: var(--status-warn-bg); color: var(--amber-text); }
.score-pill--lo { background: var(--track); color: var(--faint); }
.meta-pill { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: var(--radius-pill); background: var(--tint); color: var(--muted); border: 1px solid var(--border); }
.meta-pill--project { background: var(--status-ok-bg); color: var(--green-text); border-color: transparent; }
.meta-pill--urgent { background: var(--status-warn-bg); color: var(--amber-text); border-color: transparent; }

/* Tab-Panels (nur aktiver sichtbar; Tab-Leiste = .fav-chips) */
.tabpanel { display: none; }
.tabpanel.is-active { display: block; }

/* Zentrales Detail-Overlay (Artikel/Event) — wiederverwendbar, tokenisiert.
   Body scrollt INNERHALB der Box, Kopf bleibt fest (kein Ueberlappen beim Scrollen). */
.ov { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.55); display: none; align-items: center; justify-content: center; padding: 32px 16px; }
.ov.is-open { display: flex; }
.ov__box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-drawer); width: min(820px, 96vw); max-height: calc(100vh - 64px); display: flex; flex-direction: column; overflow: hidden; }
.ov__head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--card); }
.ov__title { font-weight: 700; font-size: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov__body { flex: 1 1 auto; overflow-y: auto; padding: 18px 20px 24px; }
.ov__art { line-height: 1.62; font-size: 14.5px; }
.ov__art p { margin: 0 0 12px; }
.ov__art ul { margin: 0 0 12px; padding-left: 20px; }
.ov__art li { margin: 3px 0; }
.ov__art h1, .ov__art h2, .ov__art h3 { font-size: 15.5px; font-weight: 700; margin: 18px 0 8px; }

/* Datentabelle (Quellen-Registry u.a.) — kompakt, tokenisiert, horizontal scrollbar im .card */
.dtable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dtable th { text-align: left; font-weight: 600; color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.dtable td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }
.dtable tr:last-child td { border-bottom: 0; }
.dtable tr:hover td { background: var(--tint); }
.dtable .dt-name { font-weight: 600; }
.dtable .dt-sub { color: var(--faint); font-size: 11px; }
.dtable .dt-num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.dtable a { color: var(--accent); text-decoration: none; }
.dtable a:hover { text-decoration: underline; }

/* kleine Icon-Buttons (Feedback gut/schlecht) */
.icon-btn { border: 1px solid var(--border); background: var(--card); border-radius: 9px; min-width: 36px; height: 32px; padding: 0 8px; cursor: pointer; font-size: 14px; line-height: 1; color: var(--muted); font-family: inherit; }
.icon-btn:hover { border-color: var(--accent); color: var(--text); }
.icon-btn.is-on-good { border-color: var(--green); color: var(--green-text); font-weight: 700; }
.icon-btn.is-on-bad { border-color: var(--red); color: var(--red-text); font-weight: 700; }

/* Empfehlungs-Liste als schmales Karten-Raster */
.rec-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 1100px) { .rec-grid--2 { grid-template-columns: 1fr 1fr; } }

/* Trend-Medienkarte */
.tcard { display: flex; flex-direction: column; gap: 7px; text-decoration: none; color: inherit; }
.tcard__thumb { aspect-ratio: 16 / 10; overflow: hidden; border-radius: 11px; background: var(--track); }
.tcard__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tcard__meta { font-size: 11.5px; color: var(--faint); }

/* Content-Hub: Quellen-Aufklapp in der Empfehlungskarte (D42) */
.rec__src { margin-top: 2px; }
.ch-src { margin: 6px 0 2px; border-left: 2px solid var(--border); padding-left: 11px; }

/* ---------- Lage-Diagramme (D54): Skalen, Heatmap, Verteilungen ---------- */
/* Zentral, weil sie ab jetzt an mehreren Stellen gebraucht werden (§2.6). Nur var(--*) (§2.5). */

/* Skala 0..100 mit Farbton nach Lage (gut/neutral/schlecht) */
.gauge { background: var(--card); border: 1px solid var(--border); border-radius: 13px; padding: 14px 16px; box-shadow: var(--shadow); }
.gauge__label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.gauge__value { font-size: 27px; font-weight: 700; margin: 7px 0 2px; letter-spacing: -.01em; }
.gauge__value small { font-size: 13px; font-weight: 500; color: var(--faint); }
.gauge__text { font-size: 12px; color: var(--text); margin-bottom: 9px; }
.gauge__track { height: 7px; background: var(--track); border-radius: 99px; overflow: hidden; }
.gauge__fill { height: 100%; border-radius: 99px; background: var(--accent); transition: width .9s ease; }
.gauge__fill--gut { background: var(--green); }
.gauge__fill--schlecht { background: var(--red); }
.gauge__sub { font-size: 10.5px; color: var(--faint); margin-top: 7px; }

/* Heatmap: Zeilenkopf + Zellen. Intensitaet ueber --i (0..1) als Deckkraft des Akzents. */
.heat { display: grid; gap: 3px; align-items: center; }
.heat__head { font-size: 10.5px; color: var(--faint); text-align: center; padding-bottom: 2px; }
.heat__row { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 8px; }
.heat__cell { position: relative; height: 26px; border-radius: 4px; background: var(--track); display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text); }
.heat__cell::before { content: ""; position: absolute; inset: 0; border-radius: 4px; background: var(--accent); opacity: var(--i, 0); }
.heat__cell--risiko::before { background: var(--red); }
.heat__cell span { position: relative; z-index: 1; }
.heat__cell--leer { color: var(--faint); }

/* Verteilungs-Balken (gestapelt, ein Balken = 100 %) */
.sbar { display: flex; height: 22px; border-radius: 5px; overflow: hidden; background: var(--track); }
.sbar__seg { position: relative; transition: width .9s ease; }
.sbar-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 9px; font-size: 11px; color: var(--muted); }
.sbar-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* Divergierender Balken: Mitte = 0, links negativ, rechts positiv */
.dbar { display: grid; grid-template-columns: 120px 1fr 54px; align-items: center; gap: 8px; margin-bottom: 5px; font-size: 12px; }
.dbar__l { color: var(--text); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dbar__track { position: relative; height: 16px; background: var(--track); border-radius: 4px; }
.dbar__mid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--border); }
.dbar__fill { position: absolute; top: 3px; bottom: 3px; border-radius: 3px; background: var(--green); }
.dbar__fill--neg { background: var(--red); }
.dbar__v { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
