/* verwaltung-dashboard.css — Dashboard (Analytics-Stil) für die Kundenversion-v2.
   Erbt die App-Tokens (--accent, --ink, --line …) aus styles.css. */

.vwd { display: flex; flex-direction: column; }
.vwd .num { font-variant-numeric: tabular-nums; }

/* Panels */
.vwd-grid2 { display: grid; grid-template-columns: 1fr 1.45fr; gap: 18px; }
.vwd-panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; }
.vwd-panel-h { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.vwd-panel-h h2, .vwd-panel-h h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.vwd-panel-h .vwd-big { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.vwd-panel-h a { font-size: 13px; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.vwd-panel-b { padding: 20px 22px; }

/* Flächendiagramm */
.vwd-plot { display: flex; gap: 8px; align-items: flex-start; }
.vwd-yaxis { position: relative; width: 42px; height: 200px; flex-shrink: 0; }
.vwd-yaxis span { position: absolute; right: 0; transform: translateY(-50%); font-size: 11px; color: var(--ink-3); font-weight: 600; white-space: nowrap; line-height: 1; }
.vwd-plot-main { flex: 1; min-width: 0; }
.vwd-chart { width: 100%; height: 200px; display: block; }
.vwd-months { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); font-weight: 600; padding: 10px 2px 0; }

/* Donut + Legende */
.vwd-donut-wrap { display: flex; justify-content: center; padding: 6px 0 2px; }
.vwd-legend { display: flex; flex-direction: column; gap: 11px; margin-top: 16px; }
.vwd-dl { display: flex; align-items: center; gap: 11px; font-size: 14px; }
.vwd-dl-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.vwd-dl-label { color: var(--ink-2); flex: 1; }
.vwd-dl-val { font-weight: 700; }

/* Top-Objekte (horizontale Balken) */
.vwd-topobj-row { display: grid; grid-template-columns: 150px 1fr auto; align-items: center; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.vwd-topobj-row:last-child { border-bottom: 0; padding-bottom: 0; }
.vwd-topobj-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vwd-topobj-track { height: 10px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.vwd-topobj-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, color-mix(in oklab, var(--accent) 55%, white), var(--accent)); }
.vwd-topobj-val { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }

@media (max-width: 900px) {
  .vwd-grid2 { grid-template-columns: 1fr; }
  .vwd-topobj-row { grid-template-columns: 120px 1fr auto; }
}

/* YoY + Chart-Legende */
.vwd-yoy { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; margin-top: 3px; justify-content: flex-end; }
.vwd-chart-legend { display: flex; gap: 18px; align-items: center; margin-bottom: 8px; }
.vwd-chart-legend span { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.vwd-chart-legend i { display: inline-block; }
.vwd-lg-cur { width: 16px; height: 3px; border-radius: 2px; background: var(--accent); }
.vwd-lg-prev { width: 16px; height: 0; border-top: 2px dashed var(--ink-4); }

/* Klickbare Top-Objekte-Zeile */
.vwd-topobj-row.is-click { cursor: pointer; border-radius: 9px; padding-left: 8px; padding-right: 8px; margin: 0 -8px; transition: background .12s ease; }
.vwd-topobj-row.is-click:hover { background: var(--line-2); }

/* Panel-Link (Alle …) */
.vwd-panel-h a:hover { text-decoration: underline; }
.vwd-count { font-size: 12px; font-weight: 800; color: var(--ink-3); background: var(--line-2); border-radius: 999px; padding: 3px 11px; }

/* Listen (Auslaufende Verträge / Aufgaben) */
.vwd-list { display: flex; flex-direction: column; }
.vwd-litem { display: flex; align-items: center; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--line-2); }
.vwd-litem:last-child { border-bottom: 0; padding-bottom: 0; }
.vwd-li-ic { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.vwd-li-ic.is-warn { background: #FBEAD2; color: #B5710F; }
.vwd-li-ic.is-ok { background: #E4F5EA; color: #1F8A4D; }
.vwd-li-ic.is-info { background: #EAF1FB; color: #3B6FB8; }
.vwd-li-ic.is-accent { background: var(--accent-soft); color: var(--accent); }
.vwd-li-t { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vwd-li-s { font-size: 13px; color: var(--ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vwd-li-meta { margin-left: auto; text-align: right; white-space: nowrap; flex-shrink: 0; }
.vwd-li-meta b { display: block; font-size: 13px; font-weight: 700; color: var(--ink); }
.vwd-li-badge { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.vwd-li-badge.is-warn { color: #B5710F; }
.vwd-check { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line); flex-shrink: 0; }
.vwd-empty { padding: 22px 0; text-align: center; color: var(--ink-3); font-size: 14px; }

/* ── v7 ───────────────────────────────────────────────────────────────── */

/* Eingang-Hinweis */
.vwd-alert {
  display: flex; align-items: center; gap: 12px; width: 100%;
  margin-bottom: 18px; padding: 13px 16px; border-radius: 13px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  font-family: inherit; font-size: 14px; color: var(--ink-2); text-align: left;
  cursor: pointer; transition: border-color .12s, background .12s;
}
.vwd-alert:hover { border-color: var(--accent); }
.vwd-alert-ic {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #fff; color: var(--accent); border: 1px solid var(--accent-line);
}
.vwd-alert-txt { flex: 1; min-width: 0; }
.vwd-alert-txt b { color: var(--ink); }
.vwd-alert-cta { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--accent); white-space: nowrap; }

/* Portfolio-Legende: absolute Anzahl */
.vwd-dl-count { font-weight: 700; color: var(--ink); min-width: 18px; text-align: right; }
.vwd-dl-val { color: var(--ink-3); min-width: 42px; text-align: right; }

/* Top-Objekte: Typ-Punkt + mehr Platz fürs Label */
.vwd-topobj-row { grid-template-columns: minmax(150px, 210px) 1fr auto; }
.vwd-topobj-name { display: flex; align-items: center; gap: 7px; }
.vwd-topobj-dot { width: 8px; height: 8px; border-radius: 3px; flex-shrink: 0; }

/* Klickbare Listenzeilen (sind jetzt <button>) */
button.vwd-litem {
  font-family: inherit; background: none; border: 0; border-bottom: 1px solid var(--line-2);
  width: 100%; text-align: left; cursor: pointer; border-radius: 0;
}
button.vwd-litem:last-child { border-bottom: 0; }
.vwd-litem.is-click { transition: background .12s; }
.vwd-litem.is-click:hover { background: color-mix(in oklab, var(--accent-soft) 55%, transparent); }
.vwd-li-ic.is-neutral { background: var(--line-2); color: var(--ink-2); }

/* Inline-Aktion (z. B. „Vertrag anlegen“ bei Leerstand) */
.vwd-li-action {
  font-family: inherit; font-size: 12px; font-weight: 700;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  background: #fff; color: var(--accent); border: 1px solid var(--accent-line);
  transition: all .12s;
}
.vwd-li-action:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Schmale Viewports: Panels dürfen unter ihre Inhaltsbreite schrumpfen —
   breite Inhalte (Chart, Listen) scrollen im Panel statt die Seite zu verbreitern. */
@media (max-width: 760px) {
  .vwd-grid2 { grid-template-columns: 1fr; }
  .vwd-panel { min-width: 0; max-width: 100%; }
  .vwd-panel-b, .vwd-panel-h { min-width: 0; max-width: 100%; overflow-x: auto; }
}
