/* vbba jugend Hub – Komponenten-Grundlage (Phase 4)
   Gemeinsame Gestaltung aller Module nach B1 „Elegant“. Muster aus Tabler (Formulare, Buttons, Badges, Tabellen,
   Segment-Steuerung) und Flowbite (Dialogaufbau, Formularabstände), portiert als eigenes, gekapseltes CSS – keine
   Framework-Klassen, kein globales Framework. Office-Editoren (#hubDocumentEditor, #hubSheetEditor) und der
   PDF-Viewer sind über :where(:not(:is(Editor-Container) *)) ausgenommen und behalten ihr bisheriges Erscheinungsbild.
   Spezifität bewusst niedrig (:where), damit modulgebundene Regeln mit IDs weiter greifen. */

/* ---------- App-Variablen → Tokens (gilt in allen Modulen, hell und dunkel) ---------- */
.hub-ui{
  --m:var(--vb-accent);--md:var(--vb-accent-hover);--ink:var(--vb-text);--mut:var(--vb-text-muted);--bg:var(--vb-bg);
  --card:var(--vb-surface);--line:var(--vb-border);--ok:var(--vb-success);--warn:var(--vb-warning);--bad:var(--vb-danger);
  --r:var(--vb-radius-lg);--shadow:var(--vb-shadow-sm);
  --workspace-bg:var(--vb-bg);--workspace-radius:var(--vb-radius-lg);--workspace-shadow:none;
}
.hub-ui[data-scheme="dark"]{color-scheme:dark}
/* Editoren und PDF-Viewer: bisherige Werte, immer hell */
.hub-ui :is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer){
  --m:#c3006b;--md:#8f004f;--ink:#17151a;--mut:#746f78;--bg:#f7f5f8;--card:#fff;--line:#e7e2e8;--ok:#168a5b;--warn:#a97000;--bad:#a42c2c;
  --r:20px;--shadow:0 12px 35px rgba(42,22,35,.08);--workspace-bg:#f6f6f5;--workspace-radius:16px;
  --vb-surface:#fff;--vb-surface-2:#fbfafc;--vb-surface-sunken:#eeedf1;--vb-border:#e2e0e6;--vb-border-strong:#cfcdd4;--vb-text:#1b1920;--vb-text-muted:#5f5d66;--vb-text-subtle:#6d6b74;
  color-scheme:light;color:#17151a;font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
}

/* ---------- Typografie ---------- */
.hub-ui body{font-family:var(--hx-font);color:var(--vb-text);background:var(--vb-bg);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
.hub-ui :is(main,.modal,.mobile-more-sheet,.chat-window,.login-card) :is(h2,h3,h4):where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){font-family:var(--hx-font);font-weight:600;letter-spacing:-.005em;color:var(--vb-text)}
.hub-ui .modal-head h2:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){font-size:var(--vb-text-xl);line-height:1.25;margin:0}
.hub-ui .eyebrow:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){font:600 var(--vb-text-xs)/1.3 var(--hx-font);color:var(--vb-accent-text);letter-spacing:normal;text-transform:none}
.hub-ui .muted:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){color:var(--vb-text-muted)}
.hub-ui :is(main,.modal) a:not([class]):where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){color:var(--vb-accent-text);text-underline-offset:2px}

/* ---------- Buttons ---------- */
.hub-ui :is(button.primary,button.secondary,a.secondary,a.primary,button.ghost,button.danger-btn,.white-btn,button.link,.chip,.response):where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){
  align-items:center;justify-content:center;gap:6px;padding:0 14px;border-radius:var(--vb-radius-md);
  font:500 var(--vb-text-md)/1.2 var(--hx-font);letter-spacing:normal;text-decoration:none;white-space:nowrap;cursor:pointer;
  box-shadow:none;transform:none;transition:background-color var(--vb-dur-fast) var(--vb-ease-out),border-color var(--vb-dur-fast) var(--vb-ease-out),color var(--vb-dur-fast) var(--vb-ease-out);
}
.hub-ui :is(button.secondary,a.secondary,.white-btn):where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){background:var(--vb-surface);color:var(--vb-text);border:1px solid var(--vb-border-strong)}
.hub-ui :is(button.secondary,a.secondary,.white-btn):hover:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){background:var(--vb-surface-sunken);border-color:var(--vb-border-strong);transform:none;box-shadow:none}
.hub-ui :is(button.primary,a.primary):where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){background:var(--vb-accent);color:var(--vb-accent-fg);border:1px solid var(--vb-accent)}
.hub-ui :is(button.primary,a.primary):hover:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){background:var(--vb-accent-hover);border-color:var(--vb-accent-hover);transform:none;box-shadow:none}
.hub-ui button.ghost:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){background:transparent;color:var(--vb-text-muted);border:1px solid transparent}
.hub-ui button.ghost:hover:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){background:var(--vb-surface-sunken);color:var(--vb-text)}
.hub-ui button.danger-btn:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){background:var(--vb-surface);color:var(--vb-danger);border:1px solid color-mix(in srgb,var(--vb-danger) 35%,var(--vb-border))}
.hub-ui button.danger-btn:hover:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){background:var(--vb-danger-soft)}
.hub-ui button.link:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){min-height:32px;padding:0 4px;background:none;border:0;color:var(--vb-accent-text)}
.hub-ui button.link:hover:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){text-decoration:underline;background:none}
.hub-ui :is(.icon-btn):where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){place-items:center;min-width:40px;min-height:40px;padding:0 10px;border-radius:var(--vb-radius-md);
  background:var(--vb-surface);color:var(--vb-text-muted);border:1px solid var(--vb-border);font:500 var(--vb-text-sm)/1 var(--hx-font);text-decoration:none;box-shadow:none;transform:none}
.hub-ui :is(.icon-btn):hover:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){background:var(--vb-surface-sunken);color:var(--vb-text);border-color:var(--vb-border-strong)}
.hub-ui .icon-btn .hx-icon:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){width:18px;height:18px}
.hub-ui button.close:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){place-items:center;width:36px;height:36px;min-width:36px;min-height:36px;padding:0;border:0;border-radius:var(--vb-radius-md);
  background:transparent;color:var(--vb-text-muted);font:400 22px/1 var(--hx-font)}
.hub-ui button.close:hover:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){background:var(--vb-surface-sunken);color:var(--vb-text)}
.hub-ui :is(button,a.secondary,a.primary,.icon-btn,[role="button"],summary):focus-visible:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){outline:var(--vb-focus-width) solid var(--vb-accent);outline-offset:2px}
.hub-ui button:disabled:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){opacity:.55;cursor:not-allowed}
@media (pointer:coarse){
  .hub-ui :is(button.primary,button.secondary,a.secondary,a.primary,button.ghost,button.danger-btn,.white-btn,.icon-btn,.chip,.response):where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){min-height:44px}
  .hub-ui :is(.icon-btn):where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){min-width:44px}
  .hub-ui button.close:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){width:44px;height:44px;min-width:44px;min-height:44px}
}

/* ---------- Formulare ---------- */
.hub-ui label:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){color:var(--vb-text-muted);font:500 var(--vb-text-sm)/1.35 var(--hx-font);letter-spacing:normal;text-transform:none}
.hub-ui :is(input,select,textarea):where(:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"])):where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){
  min-height:40px;padding:8px 12px;border:1px solid var(--vb-border-strong);border-radius:var(--vb-radius-md);background:var(--vb-surface);color:var(--vb-text);
  font:400 var(--vb-text-md)/1.4 var(--hx-font);box-shadow:none;transition:border-color var(--vb-dur-fast) var(--vb-ease-out),box-shadow var(--vb-dur-fast) var(--vb-ease-out)}
.hub-ui :is(input,select,textarea)::placeholder:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){color:var(--vb-text-subtle);opacity:1}
.hub-ui :is(input,select,textarea):where(:not([type="checkbox"]):not([type="radio"])):focus:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){border-color:var(--vb-accent);box-shadow:var(--vb-focus);outline:none}
.hub-ui :is(input,select,textarea):disabled:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){background:var(--vb-surface-sunken);color:var(--vb-text-subtle)}
.hub-ui :is(input[type="checkbox"],input[type="radio"]):where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){accent-color:var(--vb-accent);width:18px;height:18px}
.hub-ui select:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){cursor:pointer}
@media (max-width:720px){.hub-ui :is(input,select,textarea):where(:not([type="checkbox"]):not([type="radio"]):not([type="file"])):where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){font-size:16px;min-height:44px}}

/* ---------- Dialoge ---------- */
.hub-ui .modal-backdrop:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){background:color-mix(in srgb,var(--vb-gray-950) 48%,transparent);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}
.hub-ui #modal.modal{background:var(--vb-surface);color:var(--vb-text);border:1px solid var(--vb-border);border-radius:var(--vb-radius-lg);box-shadow:var(--vb-shadow-lg);font-family:var(--hx-font)}
.hub-ui .modal-head:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){gap:12px;align-items:flex-start;margin-bottom:16px}
/* Spezifität 0: modulspezifische Aktionsleisten (z. B. fixierte Leiste der Release-Details) behalten ihre Abstände */
:where(.hub-ui) :where(.modal-actions):where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){gap:8px;margin-top:20px;padding-top:16px;border-top:1px solid var(--vb-border)}
@media (max-width:720px){.hub-ui #modal.modal{border-radius:12px 12px 0 0;border-bottom:0}}

/* ---------- Badges, Hinweise, Karten, Listen ---------- */
.hub-ui .badge:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){align-items:center;gap:4px;min-height:22px;padding:0 8px;border-radius:var(--vb-radius-sm);
  background:var(--vb-surface-sunken);color:var(--vb-text-muted);font:500 var(--vb-text-xs)/1 var(--hx-font);letter-spacing:normal;border:0}
.hub-ui .badge.ok:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){background:var(--vb-success-soft);color:var(--vb-success)}
.hub-ui .badge.warn:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){background:var(--vb-warning-soft);color:var(--vb-warning)}
.hub-ui .badge.bad:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){background:var(--vb-danger-soft);color:var(--vb-danger)}
.hub-ui .info-banner:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){background:var(--vb-surface-2);border:1px solid var(--vb-border);border-radius:var(--vb-radius-md);color:var(--vb-text)}
.hub-ui .info-banner b:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){color:var(--vb-accent-text)}
.hub-ui .card:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){background:var(--vb-surface);border:1px solid var(--vb-border);border-radius:var(--vb-radius-lg);box-shadow:none}
.hub-ui .card-head:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){gap:12px}
.hub-ui .list-row:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){border-bottom:1px solid var(--vb-border);border-radius:0;transition:background-color var(--vb-dur-fast) var(--vb-ease-out)}
.hub-ui .list-row:last-child:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){border-bottom:0}
.hub-ui .list-row:hover:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){background:var(--vb-surface-2)}
.hub-ui .list-row h4:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){font-weight:600;font-size:var(--vb-text-md)}
.hub-ui .list-row p:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){color:var(--vb-text-muted);font-size:var(--vb-text-sm)}

/* ---------- Segment-Steuerung und Tabs (Tabler „nav-segmented“) ---------- */
.hub-ui .segmented:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){gap:2px;padding:3px;border-radius:var(--vb-radius-md);background:var(--vb-surface-sunken);border:1px solid var(--vb-border)}
.hub-ui .segmented button:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){min-height:34px;padding:0 12px;border:0;border-radius:var(--vb-radius-sm);background:transparent;color:var(--vb-text-muted);font:500 var(--vb-text-md)/1 var(--hx-font);box-shadow:none}
.hub-ui .segmented button:hover:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){color:var(--vb-text);background:color-mix(in srgb,var(--vb-surface) 60%,transparent)}
.hub-ui .segmented button.active:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){background:var(--vb-surface);color:var(--vb-text);box-shadow:var(--vb-shadow-sm);font-weight:600}
@media (pointer:coarse){.hub-ui .segmented button:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){min-height:40px}}

/* ---------- Tabellen ---------- */
.hub-ui table:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){border-collapse:collapse;width:100%;font-size:var(--vb-text-md)}
.hub-ui th:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){color:var(--vb-text-subtle);font:600 var(--vb-text-xs)/1.3 var(--hx-font);text-align:left;letter-spacing:normal;text-transform:none;padding:10px 12px;border-bottom:1px solid var(--vb-border);background:var(--vb-surface-2)}
.hub-ui td:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){padding:10px 12px;border-bottom:1px solid var(--vb-border);color:var(--vb-text)}

/* ---------- Abschnitte in Ansichten ---------- */
.hub-ui .section-actions:where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){gap:8px}
.hub-ui ::selection{background:var(--vb-accent-soft-strong);color:var(--vb-text)}

/* Anzeige-Typ mit Spezifität 0: bestehende Sichtbarkeitsregeln (z. B. display:none für Desktop/Mobil) behalten Vorrang */
:where(.hub-ui) :where(button.primary,button.secondary,a.secondary,a.primary,button.ghost,button.danger-btn,.white-btn,button.link,.chip,.response,.badge,.segmented):where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){display:inline-flex}
:where(.hub-ui) :where(.icon-btn,button.close):where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){display:inline-grid}

/* Mindesthöhe mit Spezifität 0: bestehende Mindesthöhen (z. B. 44 px in Dialogen und Push-Onboarding) behalten Vorrang */
:where(.hub-ui) :where(button.primary,button.secondary,a.secondary,a.primary,button.ghost,button.danger-btn,.white-btn,.chip,.response):where(:not(:is(#hubDocumentEditor,#hubSheetEditor,.pdf-canvas-viewer) *)){min-height:40px}
:where(.hub-ui) :where(.modal-actions,[data-push-onboarding],.push-onboarding,.first-login-panel) :where(button,a.secondary,a.primary){min-height:44px}
