/* High Volume Manager — tool-spezifische Ergänzungen.
 * Basis (Tokens, Komponenten, Fonts, Theme) kommt zentral aus
 * https://ui.<env>.capita-aws.ch/v1/capita-ui.css  (Klassen-Präfix `cui-`).
 * Hier nur, was der Kanon nicht abdeckt.
 */

/* app.js schaltet Ansichten über die .hidden-KLASSE (der Kanon kennt nur [hidden]) */
.hidden { display: none !important; }

/* Nur für Screenreader */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
/* Sonst entkommen unsichtbare Spaltentitel dem Scrollbereich und verbreitern die Seite */
.cui-table-wrap { position: relative; }

/* Ohne „Part of …“ (Branding-Regel): Fusszeile; die Telag-Marke kommt ohne Zusatzzeile
   aus assets/telag-dark.png (die zentrale telag-dark.png trägt noch die alte Zeile). */
.cui-side .cui-foot::after { content: "TELAG AG"; }
.cui-brand img.hv-telag { height: 30px; }

/* ---------- Login / Kein Zugriff / Callback ---------- */
.hv-center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg); }
.hv-auth-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 44px 48px; text-align: center; max-width: 460px;
}
.hv-auth-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.hv-auth-card p { color: var(--muted); margin: 14px 0 26px; line-height: 1.5; }
.hv-auth-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }

/* ---------- Kopfleiste ---------- */
.hv-user { color: var(--muted); font-size: 13px; }
.hv-env-badge { white-space: nowrap; }
.hv-nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--cyan); color: #09090b; font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; }

/* ---------- Seitenkopf ---------- */
.hv-eyebrow { color: var(--accent); font-size: 10.5px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; margin-bottom: 5px; }
.cui-page-head p { max-width: 760px; }
.hv-head-actions { flex-shrink: 0; }
.hv-stand { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hv-sub { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); font-weight: 400; }
.hv-none { color: var(--faint); font-size: 12.5px; }
.hv-who { font-weight: 600; color: var(--ink-2); }

/* ---------- Hinweise ---------- */
.hv-alert { padding: 12px 16px; margin-bottom: 16px; border-radius: var(--radius); border: 1px solid; font-size: 13.5px; line-height: 1.5; }
.hv-alert-warn { background: var(--warn-bg); color: var(--warn-ink); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.hv-alert-bad { background: var(--bad-bg); color: var(--bad-ink); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.hv-alert .hv-flow { background: color-mix(in srgb, var(--surface) 70%, transparent); }

/* ---------- Kennzahlen = Filter ---------- */
.hv-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.hv-stat { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); position: relative; }
.hv-stat:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.hv-stat:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hv-stat.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.hv-stat-lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.hv-stat-val { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.hv-stat-sub { font-size: 12px; color: var(--faint); }
.hv-stat.is-hv .hv-stat-val { color: var(--info-ink); }
.hv-stat.is-dev .hv-stat-val { color: var(--warn-ink); }
.hv-stat.is-hv::before, .hv-stat.is-dev::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--info); }
.hv-stat.is-dev::before { background: var(--warn); }

/* ---------- Hinweis: Nummern laufen auf High Volume ---------- */
.hv-banner { display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin-bottom: 16px; border: 1px solid color-mix(in srgb, var(--info) 35%, transparent); border-radius: var(--radius); background: var(--info-bg); }
.hv-banner-icon { width: 34px; height: 34px; border-radius: var(--r-sm); background: var(--info); color: #fff; display: grid; place-items: center; flex: none; }
.hv-banner-icon svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; }
.hv-banner-text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.hv-banner-text strong { color: var(--info-ink); font-size: 14px; }
.hv-banner-text span { color: var(--ink-2); font-size: 12.5px; }
.hv-banner-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Liste ---------- */
.hv-list { overflow: visible; }
.hv-toolbar { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.hv-search { position: relative; max-width: 560px; }
.hv-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; stroke: var(--muted); stroke-width: 1.8; fill: none; pointer-events: none; }
.hv-search .cui-input { padding: 11px 12px 11px 40px; font-size: 14.5px; }
.hv-search-hint { margin-top: 7px; font-size: 12px; color: var(--muted); }
.hv-search-hint b { color: var(--ink); }
.hv-toolbar-history { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.hv-search-sm { flex: 0 1 320px; }
.hv-search-sm .cui-input { padding: 8px 11px 8px 36px; font-size: 13px; }
.hv-search-sm svg { left: 11px; width: 16px; height: 16px; }
.cui-chips button.cui-chip { font-family: inherit; }

/* Bleibt beim Scrollen unter der Kopfleiste stehen, damit die Knöpfe erreichbar sind */
.hv-selbar { position: sticky; top: var(--hv-topbar, 61px); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 10px 18px; background: var(--surface-2); border-bottom: 1px solid var(--border); transition: background var(--dur) var(--ease); }
.hv-selbar.has-sel { background: color-mix(in srgb, var(--accent) 6%, var(--surface-2)); box-shadow: var(--shadow-sm); }
.hv-sel-info { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hv-sel-info strong { font-size: 13px; margin-right: 4px; }
.hv-sel-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.hv-table thead th { padding: 10px 14px; }
.hv-table tbody td { padding: 11px 14px; vertical-align: middle; }
.hv-table th:first-child, .hv-table td:first-child { padding-left: 18px; }
.hv-table th:last-child, .hv-table td:last-child { padding-right: 18px; }
.hv-col-sel { width: 36px; padding-right: 4px !important; }
.hv-table input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; vertical-align: middle; }
.hv-table input[type="checkbox"]:disabled { cursor: not-allowed; opacity: .45; }
.hv-col-act { text-align: right; white-space: nowrap; width: 1%; }
.hv-num { white-space: nowrap; }
.hv-num > .cui-mono { font-weight: 600; font-size: 13.5px; }
.hv-desc { min-width: 180px; }
.hv-status { min-width: 150px; }
.hv-status .cui-badge { white-space: nowrap; }
.hv-when { white-space: nowrap; font-variant-numeric: tabular-nums; }
#rows tr.hv-selectable { cursor: pointer; }
.hv-table tr.tint-info { background: color-mix(in srgb, var(--info) 6%, transparent); }
.hv-table tbody tr.hv-selected td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
:root[data-theme="dark"] .hv-table tbody tr.hv-selected td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.hv-table tbody tr.hv-flash td { animation: hv-flash 1.6s var(--ease); }
@keyframes hv-flash { 0% { background: color-mix(in srgb, var(--ok) 22%, transparent); } 100% { background: transparent; } }
#rows.hv-loading { opacity: .45; pointer-events: none; transition: opacity var(--dur) var(--ease); }

.hv-flow { font-family: var(--mono); font-size: 12px; padding: 2px 6px; border-radius: var(--r-xs); background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.hv-flow.is-hv { background: var(--info-bg); color: var(--info-ink); font-weight: 600; }
.hv-flow.is-dev { background: var(--warn-bg); color: var(--warn-ink); font-weight: 600; }
.hv-sub .hv-flow { font-size: 11px; padding: 1px 5px; }
.hv-change { white-space: nowrap; }
.hv-history .cui-badge, .hv-history .hv-person { white-space: nowrap; }
.hv-arrow { width: 14px; height: 14px; stroke: var(--muted); stroke-width: 2; fill: none; vertical-align: -2px; margin: 0 6px; }

.cui-btn.hv-act-dev { color: var(--warn-ink); }
.cui-btn.hv-act-dev:hover { background: var(--warn-bg); color: var(--warn-ink); }

.hv-empty-row:hover { background: transparent !important; }
.hv-empty { padding: 26px 8px; text-align: center; display: flex; flex-direction: column; gap: 4px; color: var(--muted); }
.hv-empty strong { color: var(--ink); font-size: 14px; }
.hv-foot { padding: 12px 18px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.hv-foot .hv-flow { font-size: 11px; }

/* ---------- Modal ---------- */
.hv-modal { width: min(860px, 94vw); padding: 22px 24px; max-height: 90vh; display: flex; flex-direction: column; }
.hv-modal-sm { width: min(540px, 94vw); }
.hv-modal-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.hv-modal-head h2 { margin-bottom: 4px; }
.cui-modal .hv-modal-head p { margin-bottom: 0; }
.hv-modal-icon { width: 38px; height: 38px; border-radius: var(--r-sm); display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--ink-2); }
.hv-modal-icon.is-hv { background: var(--info); color: #fff; }
.hv-modal-icon.is-warn { background: var(--warn-bg); color: var(--warn-ink); }
.hv-modal-icon svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 2; fill: none; }
.hv-skip { font-size: 12.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 9px 12px; margin-bottom: 12px; }
.hv-modal-table { border: 1px solid var(--border); border-radius: var(--r-sm); overflow: auto; max-height: 46vh; }
.hv-table-compact thead th { position: sticky; top: 0; z-index: 1; padding: 9px 12px; }
.hv-table-compact tbody td { padding: 9px 12px; font-size: 13px; }
.hv-table-compact .hv-desc { min-width: 0; }
.hv-col-state { width: 1%; white-space: nowrap; }
#confirm:not(.is-running) .hv-col-state { display: none; }
.hv-state { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--faint); white-space: nowrap; }
.hv-state svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2.2; fill: none; }
.hv-state.is-run { color: var(--info-ink); }
.hv-state.is-run::before { content: ""; width: 11px; height: 11px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: hv-spin .8s linear infinite; }
.hv-state.is-done { color: var(--ok-ink); }
.hv-state.is-retry { color: var(--warn-ink); }
.hv-state.is-problem { color: var(--bad-ink); }
.hv-state-msg { display: block; max-width: 260px; white-space: normal; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.hv-state-msg:empty { display: none; }
@keyframes hv-spin { to { transform: rotate(360deg); } }
.hv-progress { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.hv-progress-bar { height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.hv-progress-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 300ms var(--ease); }
.hv-progress > span { font-size: 12.5px; color: var(--ink-2); }
.cui-modal p.hv-modal-note { font-size: 12.5px; color: var(--muted); margin: 14px 0 18px; }
.cui-modal p.hv-modal-error { font-size: 12.5px; color: var(--bad-ink); margin: -6px 0 14px; }
.hv-dl { display: grid; grid-template-columns: 170px 1fr; gap: 10px 14px; padding: 14px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); font-size: 13px; }
.hv-dl dt { color: var(--muted); font-weight: 600; }
.hv-dl dd small { display: block; color: var(--faint); font-size: 12px; margin-top: 2px; }

/* ---------- So funktioniert es ---------- */
.hv-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.hv-step { padding: 20px 22px; }
.hv-step-no { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 14px; margin-bottom: 12px; }
.hv-step h2 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.hv-step p { color: var(--ink-2); font-size: 13.5px; }
.hv-help { max-width: 900px; }
.hv-facts { list-style: none; padding: 8px 22px 18px; }
.hv-facts li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.hv-facts li:last-child { border-bottom: none; }
.hv-facts b { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .hv-table tbody tr.hv-flash td { animation: none; }
  .hv-state.is-run::before { animation: none; }
}

/* Reiter nur für schmale Fenster (Seitenleiste ausgeblendet) */
.hv-narrow-tabs { display: none; }
.hv-narrow-tabs .cui-tab { text-decoration: none; }

/* Schmale Fenster: nur sauberes Umbrechen, keine eigene Handy-Bedienung (AWS Apps = Desktop) */
@media (max-width: 900px) {
  .hv-narrow-tabs { display: flex; }
  .cui-topbar { padding: 10px 16px; flex-wrap: wrap; }
  .cui-content { padding: 20px 16px; }
  .cui-page-head { flex-direction: column; align-items: flex-start; }
  .hv-stats { grid-template-columns: 1fr 1fr; }
  .hv-steps { grid-template-columns: 1fr; }
  .hv-user { display: none; }
  .hv-banner { flex-wrap: wrap; }
  .hv-banner-actions { width: 100%; justify-content: flex-start; }
  .hv-dl { grid-template-columns: 1fr; gap: 2px 0; }
  .hv-dl dd { margin-bottom: 8px; }
}

/* Programmatisch fokussierte Titel (Dialoge, Seitentitel) ohne Rahmen */
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus { outline: none; }
