/* ==========================================================================
   CARO Prototype — Design Tokens
   Source: Figma "CARO (New)" (fileKey 5xKER5hbObbgv29Jm6cLYI), get_variable_defs
   on Dashboard (254:25218) and TPN Overview (92:65469) frames, 13 Aug 2026.
   ========================================================================== */

:root {
  /* Color — text */
  --text-primary: #101828;
  --text-secondary: #344054;
  --text-tertiary: #475467;
  --text-quaternary: #667085;
  --text-placeholder: #667085;
  --text-brand-secondary: #02324a;
  --text-success-primary: #079455;
  --text-warning-primary: #dc6803;
  --text-error-primary: #d92d20;

  /* Color — background */
  --bg-primary: #ffffff;
  --bg-primary-hover: #f9fafb;
  --bg-secondary: #f9fafb;
  --bg-secondary-alt: #f9fafb;
  --bg-active: #f9fafb;
  --bg-quaternary: #e4e7ec;
  --bg-success-secondary: #dcfae6;

  /* Color — border */
  --border-primary: #d0d5dd;
  --border-secondary: #e4e7ec;
  --border-tertiary: #f2f4f7;

  /* Color — foreground / icons */
  --fg-quaternary: #667085;
  --fg-quinary: #98a2b3;
  --fg-senary: #d0d5dd;
  --fg-white: #ffffff;
  --fg-success-primary: #079455;
  --fg-success-secondary: #17b26a;
  --fg-error-primary: #d92d20;

  /* Brand */
  --brand-900: #023852;
  --brand-700: #02324a;
  --brand-200: #91bcd0;
  --brand-50: #ebf4f8;
  /* Brand accent (color.brand.accent); also the focus-ring colour per policy_accessibility. */
  --accent-cyan: #2BFEBB;

  /* Sub-brand accent — CARO Petrol (guardrails: ≤10% of surface, Active-Nav/Counter-Badges/Avatar-Gradient only) */
  --accent-caro-700: #1f6f8b;
  --accent-caro-200: #a9c9d3;
  --accent-caro-50: #eaf3f5;

  /* Utility — success */
  --success-700: #067647;
  --success-600: #079455;
  --success-500: #17b26a;
  --success-200: #abefc6;
  --success-100: #dcfae6;
  --success-50: #ecfdf3;

  /* Utility — warning */
  --warning-700: #b54708;
  --warning-500: #f79009;
  --warning-200: #fedf89;
  --warning-100: #fef0c7;
  --warning-50: #fffaeb;

  /* Utility — error */
  --error-700: #b42318;
  --error-500: #f04438;
  --error-200: #fecdca;
  --error-100: #fee4e2;
  --error-50: #fef3f2;

  /* Utility — blue (info) */
  --blue-700: #175cd3;
  --blue-500: #2e90fa;
  --blue-200: #b2ddff;
  --blue-100: #d1e9ff;
  --blue-50: #eff8ff;
  --blue-light-700: #026aa2;

  /* Utility — orange */
  --orange-700: #b93815;
  --orange-200: #f9dbaf;
  --orange-50: #fef6ee;

  /* Utility — gray */
  --gray-700: #344054;
  --gray-500: #667085;
  --gray-200: #e4e7ec;
  --gray-100: #f2f4f7;
  --gray-50: #f9fafb;

  /* Buttons */
  --btn-primary-bg: #023852;
  --btn-primary-fg: #ffffff;
  --btn-secondary-bg: #ffffff;
  --btn-secondary-fg: #344054;
  --btn-secondary-border: #d0d5dd;
  --btn-tertiary-fg: #475467;
  --btn-tertiary-color-fg: #02324a;

  /* Spacing scale */
  --sp-none: 0px;
  --sp-xxs: 2px;
  --sp-xs: 4px;
  --sp-sm: 6px;
  --sp-md: 8px;
  --sp-lg: 12px;
  --sp-xl: 16px;
  --sp-2xl: 20px;
  --sp-3xl: 24px;
  --sp-4xl: 32px;
  --sp-5xl: 40px;
  --sp-6xl: 48px;

  /* Radius */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 10px;
  --r-xl: 12px;
  --r-2xl: 16px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 #1018280d;
  --shadow-sm: 0 1px 3px 0 #1018281a, 0 1px 2px 0 #1018280f;
  --shadow-lg: 0 12px 16px -4px #10182814, 0 4px 6px -2px #10182808;

  /* Typography */
  --font-body: "Inter", -apple-system, sans-serif;
  --font-display: "Inter", -apple-system, sans-serif;
  /* Reserved for codes/IDs/compliance-codes only (DesignOS tokens.md: "Counterpoint — Code, IDs, Compliance-Codes") — never for general status labels like .pill */
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Consolas, monospace;

  /* Typography — scale (Figma: display-md/sm/xs, text-lg/md/sm/xs) */
  --fs-display-md: 36px; --lh-display-md: 44px;
  --fs-display-sm: 30px; --lh-display-sm: 38px;
  --fs-display-xs: 24px; --lh-display-xs: 32px;
  --fs-lg: 18px; --lh-lg: 28px;
  --fs-md: 16px; --lh-md: 24px;
  --fs-sm: 14px; --lh-sm: 20px;
  --fs-xs: 12px; --lh-xs: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-secondary);
  font-size: var(--fs-sm);
  line-height: var(--lh-sm);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: var(--fs-sm); }

.icon { width: 20px; height: 20px; flex-shrink: 0; fill: none; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }

/* ==========================================================================
   App shell
   ========================================================================== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 288px;
  flex-shrink: 0;
  background: var(--bg-primary);
  border-right: 1px solid var(--border-secondary);
  display: flex;
  flex-direction: column;
  padding: var(--sp-3xl) var(--sp-xl);
  gap: var(--sp-3xl);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-logo { display: flex; align-items: center; gap: var(--sp-md); padding: 0 var(--sp-md); }
.sidebar-logo img { height: 40px; min-height: 40px; } /* DesignOS: product logos ≥40px height on all surfaces */
.sidebar-nav { display: flex; flex-direction: column; gap: var(--sp-xxs); flex: 1; }
.nav-section { display: flex; flex-direction: column; gap: var(--sp-xxs); margin-top: var(--sp-lg); }
.nav-section-label {
  font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--fg-quaternary); padding: var(--sp-sm) var(--sp-md) var(--sp-xxs);
  font-family: var(--font-mono);
}
.nav-group { display: flex; flex-direction: column; }
.nav-item, .nav-group-toggle {
  display: flex; align-items: center; gap: var(--sp-lg);
  padding: var(--sp-md) var(--sp-md);
  border-radius: var(--r-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: var(--fs-sm);
  width: 100%;
  border: none;
  background: none;
  text-align: left;
}
.nav-item:hover, .nav-group-toggle:hover { background: var(--bg-active); }
.nav-item.active { background: var(--accent-caro-50); color: var(--accent-caro-700); }
.nav-item .icon, .nav-group-toggle .icon { color: var(--fg-quaternary); }
.nav-item.active .icon { color: var(--accent-caro-700); }
.nav-group-toggle { justify-content: space-between; }
.nav-group-toggle .toggle-main { display: flex; align-items: center; gap: var(--sp-lg); }
.nav-group-toggle .chevron { transition: transform .15s ease; color: var(--fg-quaternary); }
.nav-group.open .chevron { transform: rotate(180deg); }
.nav-subitems { display: flex; flex-direction: column; padding-left: 44px; gap: var(--sp-xxs); max-height: 0; overflow: hidden; transition: max-height .2s ease; }
.nav-group.open .nav-subitems { max-height: 400px; }
.nav-subitem {
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--r-md);
  color: var(--text-tertiary);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.nav-subitem:hover { background: var(--bg-active); color: var(--text-secondary); }
.nav-subitem.active { background: var(--accent-caro-50); color: var(--accent-caro-700); font-weight: 600; }

/* Coming Soon marker for nav items, quick-actions and links with no data behind them yet — never a dead
   href="#" or a silent no-op (ADR-CARO-06). */
.badge-soon {
  display: inline-flex; align-items: center; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 1px 6px; border-radius: var(--r-full); background: var(--gray-100); color: var(--text-quaternary); flex-shrink: 0;
}
.nav-item.is-soon, .nav-subitem.is-soon, .nav-group-toggle.is-soon { display: flex; align-items: center; color: var(--fg-senary); cursor: default; justify-content: space-between; }
.nav-item.is-soon:hover, .nav-subitem.is-soon:hover, .nav-group-toggle.is-soon:hover { background: none; }
.nav-item.is-soon .icon, .nav-group-toggle.is-soon .icon { color: var(--fg-senary); }
.quick-action.is-soon, .btn-link.is-soon { cursor: default; }
.quick-action.is-soon { opacity: .7; }
.quick-action.is-soon:hover { border-color: var(--border-secondary); }
.quick-action.is-soon .icon-wrap { background: var(--gray-100); color: var(--fg-quaternary); }
.quick-action strong .badge-soon { margin-left: var(--sp-xs); vertical-align: middle; }
.btn-link.is-soon { color: var(--fg-quaternary); pointer-events: none; }
.btn-link.is-soon .badge-soon { margin-left: var(--sp-xxs); }

.sidebar-user { display: flex; align-items: center; gap: var(--sp-lg); padding: var(--sp-md); border-radius: var(--r-md); position: relative; border: 1px  solid var(--border-secondary); background: var(--bg-primary); }
.sidebar-user:hover { background: var(--bg-active); cursor: pointer; }
.sidebar-user .avatar { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--accent-caro-200); color: var(--accent-caro-700); font-weight: 700; font-size: var(--fs-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-user .user-meta { flex: 1; min-width: 0; }
.sidebar-user .user-name { font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); }
.sidebar-user .user-email { font-size: var(--fs-sm); color: var(--text-tertiary); }
.sidebar-user > .icon { color: var(--fg-quaternary); flex-shrink: 0; }
/* DesignOS component_ui_side_nav v1.3: sidebar-bottom = user block (name + user context menu) */
.role-pill {
  font-size: var(--fs-xs); font-weight: 600; padding: 2px 8px; border-radius: var(--r-full);
  background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-200);
}

.company-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 240px;
  background: var(--bg-primary); border: 1px solid var(--border-secondary); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); padding: var(--sp-sm); display: none; z-index: 40;
}
.company-menu.open { display: block; }
.company-menu-label { font-size: var(--fs-xs); color: var(--text-quaternary); padding: var(--sp-sm) var(--sp-lg); text-transform: uppercase; letter-spacing: .03em; font-weight: 600; font-family: var(--font-mono); }
.company-menu-item { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-md) var(--sp-lg); border-radius: var(--r-md); font-size: var(--fs-sm); font-weight: 500; color: var(--text-secondary); }
.company-menu-item:hover { background: var(--bg-active); cursor: pointer; }
.company-menu-item.selected { color: var(--brand-700); font-weight: 600; }
.company-menu-item .icon { color: var(--success-600); }
.company-menu-divider { height: 1px; background: var(--border-secondary); margin: var(--sp-sm) var(--sp-xs); }
/* DesignOS component_ui_side_nav v1.3: topbar-right = company block (name + company config + company switch) */

/* Notification bell dropdown (CAR-774/775/776/777): .notif-menu reuses .company-menu's dropdown styling;
   .notif-dot and the .bell-ring animation are new — see _docs/ux-entscheidungen.md. */
.notif-menu {
  position: absolute; top: calc(100% + 8px); right: 0; width: 340px;
  background: var(--bg-primary); border: 1px solid var(--border-secondary); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); padding: var(--sp-sm); display: none; z-index: 40;
}
.notif-menu.open { display: block; }
.notif-menu-head { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-sm) var(--sp-lg) var(--sp-xs); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-quaternary); font-family: var(--font-mono); }
.notif-menu-head a { color: var(--text-quaternary); display: flex; }
.notif-menu-head a:hover { color: var(--brand-700); }
.notif-menu-list { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; }
.notif-menu .mini-list-row { padding: var(--sp-md) var(--sp-lg); border-radius: var(--r-md); border-bottom: none; text-decoration: none; color: inherit; }
.notif-menu .mini-list-row:hover { background: var(--bg-active); cursor: pointer; }
.notif-item-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--gray-100); color: var(--text-tertiary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-item-icon .icon { width: 16px; height: 16px; }
.notif-menu-foot { display: flex; align-items: center; justify-content: center; gap: var(--sp-xxs); padding: var(--sp-md); margin-top: var(--sp-xs); border-top: 1px solid var(--border-tertiary); font-size: var(--fs-sm); font-weight: 600; color: var(--brand-700); text-decoration: none; }
.notif-menu-foot:hover { background: var(--bg-active); border-radius: 0 0 var(--r-lg) var(--r-lg); }

.bell-btn { position: relative; }
.notif-dot {
  display: none; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--error-500); border: 1.5px solid var(--bg-primary);
}
.notif-dot.show { display: block; }
@keyframes bell-ring {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(-14deg); }
  30% { transform: rotate(11deg); }
  45% { transform: rotate(-8deg); }
  60% { transform: rotate(5deg); }
  75% { transform: rotate(-2deg); }
}
.bell-btn.bell-ring .icon { animation: bell-ring .7s ease-in-out; transform-origin: 50% 15%; display: inline-block; }

.user-menu {
  position: absolute; bottom: calc(100% + 8px); left: var(--sp-md); right: var(--sp-md);
  background: var(--bg-primary); border: 1px solid var(--border-secondary); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); padding: var(--sp-sm); display: none; z-index: 40;
}
.user-menu.open { display: block; }
.user-menu-item { display: flex; align-items: center; padding: var(--sp-md) var(--sp-lg); border-radius: var(--r-md); font-size: var(--fs-sm); font-weight: 500; color: var(--text-secondary); }
.user-menu-item:hover { background: var(--bg-active); cursor: pointer; }
.user-menu-divider { height: 1px; background: var(--border-secondary); margin: var(--sp-sm) var(--sp-xs); }

/* ==========================================================================
   Main content
   ========================================================================== */
.main { flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-xl) var(--sp-4xl) 0;
}
.breadcrumb { display: flex; align-items: center; gap: var(--sp-sm); font-size: var(--fs-sm); color: var(--text-tertiary); font-weight: 500; }
.breadcrumb .icon { color: var(--fg-quaternary); width: 18px; height: 18px; }
.breadcrumb .sep { color: var(--fg-senary); width: 16px; height: 16px; }
.breadcrumb .current { background: var(--gray-100); color: var(--text-secondary); padding: 2px 8px; border-radius: var(--r-sm); font-weight: 600; }
.breadcrumb a { color: inherit; text-decoration: none; }
.breadcrumb a:hover { color: var(--text-secondary); text-decoration: underline; }
.breadcrumb-home { display: flex; }
.breadcrumb-home:hover .icon { color: var(--fg-quaternary); }
.topbar-actions { display: flex; align-items: center; gap: var(--sp-md); }
.topbar-org { display: flex; align-items: center; gap: var(--sp-md); padding: var(--sp-xs) var(--sp-md); margin-left: var(--sp-xs); border: 1px solid var(--border-secondary); position: relative; cursor: pointer; border-radius: var(--r-md); }
.topbar-org:hover { background: var(--bg-active); }
.topbar-org .avatar { width: 32px; height: 32px; border-radius: var(--r-md); background: var(--gray-100); color: var(--text-tertiary); font-size: var(--fs-xs); font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.topbar-org .org-meta { display: flex; flex-direction: column; }
.topbar-org .org-name { font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); }
.topbar-org .org-role { font-size: var(--fs-xs); color: var(--text-tertiary); }
.topbar-org > .icon { color: var(--fg-quaternary); flex-shrink: 0; }
.icon-btn {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-md); border: 1px solid var(--border-primary); background: var(--bg-primary);
  color: var(--text-tertiary);
}
.icon-btn:hover { background: var(--bg-active); }
.icon-btn.primary { background: var(--btn-primary-bg); color: var(--btn-primary-fg); border-color: var(--btn-primary-bg); }
/* Row-level Accept/Decline icon actions, coloured like pill-success/pill-error. */
.icon-btn.success { background: var(--success-50); color: var(--success-700); border-color: var(--success-200); }
.icon-btn.success:hover { background: var(--success-100); }
.icon-btn.danger { background: var(--error-50); color: var(--error-700); border-color: var(--error-200); }
.icon-btn.danger:hover { background: var(--error-100); }

/* Destructive inline actions: text colour only (no box), matching .icon-btn-inline's borderless anatomy. */
.icon-btn-inline.danger { color: var(--error-700); }
.icon-btn-inline.danger:hover { background: var(--error-50); color: var(--error-700); }

/* .icon-btn-inline: small borderless icon trigger inside table cells/text (e.g. "show QR code" next to a DID) — pattern_wallet. */
.icon-btn-inline {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 28px; height: 28px; padding: 0; border: none; border-radius: var(--r-sm);
  background: none; color: var(--text-tertiary); cursor: pointer;
}
.icon-btn-inline .icon { width: 18px; height: 18px; }
.icon-btn-inline:hover { background: var(--bg-secondary); color: var(--text-primary); }
.icon-btn-inline:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }

/* Close-X — matches Figma "Buttons/Button close X, Size=sm": 36px hit area, r-md radius, hover fill */
.close-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--r-md);
  border: none; background: none; color: var(--fg-quaternary); cursor: pointer; flex-shrink: 0;
}
.close-x:hover { background: var(--bg-active); color: var(--text-secondary); }
.icon-btn:focus-visible, .close-x:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
/* component_ui_mode_switch_panel: dashed border marks this trigger as prototype-only, never a production control. */
.mode-switch-trigger { border: 1px dashed var(--border-secondary); }
.mode-switch-trigger:hover { border-color: var(--brand-300); }

.page-content { padding: var(--sp-4xl); }
.page-header { margin-bottom: var(--sp-3xl); display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-xl); }
.page-header h1 { font-size: var(--fs-display-sm); font-weight: 600; letter-spacing: -0.02em; margin-bottom: var(--sp-lg); }
.page-header .subtitle { color: var(--text-tertiary); font-size: var(--fs-md); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: var(--sp-sm);
  padding: var(--sp-lg) var(--sp-xl);
  border-radius: var(--r-md);
  font-size: var(--fs-sm); font-weight: 600;
  border: 1px solid transparent;
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
  position: relative;
}
.btn .icon { width: 20px; height: 20px; }
.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-fg); }
.btn-primary:hover { background: var(--brand-700); }
.btn-secondary { background: var(--btn-secondary-bg); color: var(--btn-secondary-fg); border-color: var(--btn-secondary-border); }
.btn-secondary:hover { background: var(--bg-active); }
.btn-tertiary { background: none; box-shadow: none; color: var(--btn-tertiary-fg); }
.btn-tertiary:hover { background: var(--bg-active); }
.btn-destructive { background: var(--error-500); color: #fff; }
.btn-destructive:hover { background: var(--error-700); }
.btn-outline-destructive { background: var(--bg-primary); color: var(--error-700); border-color: var(--error-200); }
.btn-outline-destructive:hover { background: var(--error-50); }
.btn-sm { padding: var(--sp-sm) var(--sp-lg); font-size: var(--fs-sm); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Loading state — Figma "Buttons/Button, State=Loading": label hidden, centered spinner, button keeps its size */
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading[disabled] { opacity: 1; }
.btn.is-loading .icon { visibility: hidden; }
.btn.is-loading::after {
  content: '';
  position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%;
  border: 2px solid var(--btn-spinner-color, currentColor);
  border-top-color: transparent;
  animation: btn-spin .6s linear infinite;
}
.btn-primary.is-loading::after, .btn-destructive.is-loading::after { --btn-spinner-color: #fff; }
.btn-secondary.is-loading::after { --btn-spinner-color: var(--text-secondary); }
.btn-tertiary.is-loading::after { --btn-spinner-color: var(--btn-tertiary-fg); }
.btn-outline-destructive.is-loading::after { --btn-spinner-color: var(--error-700); }
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .btn.is-loading::after { animation-duration: 1.5s; }
}
.btn-link { background: none; border: none; box-shadow: none; color: var(--brand-700); font-weight: 600; font-size: var(--fs-sm); display: inline-flex; align-items: center; gap: var(--sp-xs); white-space: nowrap; }

/* ==========================================================================
   Metric tiles
   ========================================================================== */
.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-xl); margin-bottom: var(--sp-3xl); }
.metric-row.cols-4 { grid-template-columns: repeat(4, 1fr); }
.metric-tile {
  background: var(--bg-primary); border: 1px solid var(--border-secondary); border-radius: var(--r-xl);
  padding: var(--sp-xl); box-shadow: var(--shadow-xs);
}
/* Clickable metric tile: links to the related detail page, same hover affordance as other clickable cards. */
.metric-tile.clickable { cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease; }
.metric-tile.clickable:hover { background: var(--bg-active); border-color: var(--border-primary); }
.metric-tile.clickable:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
.metric-tile-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-md); }
.metric-tile-head span { font-size: var(--fs-sm); font-weight: 500; color: var(--text-tertiary); }
.metric-tile-head .icon { color: var(--fg-quaternary); width: 18px; height: 18px; }
.metric-value-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-md); }
.metric-value { font-size: var(--fs-display-sm); font-weight: 600; letter-spacing: -0.02em; }
.metric-delta {
  display: inline-flex; align-items: center; gap: 2px; font-size: var(--fs-xs); font-weight: 600;
  padding: 2px 8px; border-radius: var(--r-full); background: var(--success-50); color: var(--success-700);
}
.metric-delta .icon { width: 12px; height: 12px; }
.metric-avatars { display: flex; }
.metric-avatars img { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #fff; margin-left: -8px; object-fit: cover; background: var(--gray-200); }
.metric-avatars img:first-child { margin-left: 0; }
.metric-avatars span { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #fff; margin-left: -8px; background: var(--accent-caro-200); color: var(--accent-caro-700); font-size: var(--fs-xs); font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.metric-avatars span:first-child { margin-left: 0; }

/* ==========================================================================
   Filter bar / A-Z + search
   ========================================================================== */
.az-filter { display: flex; gap: var(--sp-xs); flex-wrap: wrap; margin-bottom: var(--sp-xl); }
.az-btn {
  min-width: 36px; height: 36px; padding: 0 var(--sp-md); display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-md); border: 1px solid var(--border-primary); background: var(--bg-primary);
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary);
}
.az-btn:hover { background: var(--bg-active); }
.az-btn.active { background: var(--btn-primary-bg); color: #fff; border-color: var(--btn-primary-bg); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-xl); margin-bottom: var(--sp-xl); flex-wrap: wrap; }
.toolbar-left { display: flex; align-items: center; gap: var(--sp-md); flex: 1; }
.tab-pill-group { display: flex; gap: var(--sp-xs); padding: 4px; background: var(--gray-50); border: 1px solid var(--border-secondary); border-radius: var(--r-md); }
/* Button reset so .tab-pill also renders correctly as a <button>. */
.tab-pill { background: none; border: none; appearance: none; text-align: left; cursor: pointer; padding: var(--sp-sm) var(--sp-lg); border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 600; color: var(--text-tertiary); display: flex; align-items: center; gap: var(--sp-xs); }
.tab-pill.active { background: var(--bg-primary); color: var(--text-primary); box-shadow: var(--shadow-xs); }
.search-input {
  display: flex; align-items: center; gap: var(--sp-md); border: 1px solid var(--border-primary); border-radius: var(--r-md);
  padding: 0 var(--sp-lg); height: 44px; min-width: 280px; background: var(--bg-primary);
}
.search-input .icon { color: var(--fg-quaternary); }
.search-input input { border: none; flex: 1; font-size: var(--fs-sm); color: var(--text-primary); background: none; }
.search-input input:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; border-radius: var(--r-sm); }
.toolbar-right { display: flex; align-items: center; gap: var(--sp-md); }

/* ==========================================================================
   Table
   ========================================================================== */
.data-table-wrap { background: var(--bg-primary); border: 1px solid var(--border-secondary); border-radius: var(--r-xl); overflow: hidden; }
table.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  text-align: left; font-size: var(--fs-xs); font-weight: 600; color: var(--text-quaternary);
  text-transform: uppercase; letter-spacing: .02em;
  padding: var(--sp-lg) var(--sp-xl); border-bottom: 1px solid var(--border-secondary); background: var(--bg-secondary);
}
.data-table tbody tr { border-bottom: 1px solid var(--border-secondary); }
.data-table tbody tr:last-child { border-bottom: none; }
/* Zebra striping on every .data-table; tr.clickable:hover still wins on specificity. */
.data-table tbody tr:nth-child(even) { background: var(--bg-secondary); }
.data-table tbody tr.clickable:hover { background: var(--bg-active); cursor: pointer; }
.data-table td { padding: var(--sp-lg) var(--sp-xl); font-size: var(--fs-sm); color: var(--text-secondary); vertical-align: middle; }
.cell-company { display: flex; align-items: center; gap: var(--sp-lg); }
.avatar-initials {
  width: 40px; height: 40px; border-radius: 50%; background: var(--gray-100); color: var(--text-tertiary);
  display: flex; align-items: center; justify-content: center; font-size: var(--fs-sm); font-weight: 600; flex-shrink: 0;
}
.cell-company .company-name { color: var(--text-primary); font-weight: 600; }
.cell-address .addr-1 { color: var(--text-primary); }
.cell-address .addr-2 { color: var(--text-tertiary); font-size: var(--fs-sm); }
.row-chevron { color: var(--fg-quaternary); }

/* Pills / Badges */
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 500; padding: 2px 10px; border-radius: var(--r-full); border: 1px solid var(--border-secondary); color: var(--text-tertiary); background: var(--gray-50); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-success { background: var(--success-50); color: var(--success-700); border-color: var(--success-200); }
.pill-warning { background: var(--warning-50); color: var(--warning-700); border-color: var(--warning-200); }
.pill-error { background: var(--error-50); color: var(--error-700); border-color: var(--error-200); }
.pill-info { background: var(--blue-50); color: var(--blue-700); border-color: var(--blue-200); }
.pill-neutral { background: var(--gray-50); color: var(--gray-700); border-color: var(--border-secondary); }
.pill-brand { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-200); }

.source-tag { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 600; padding: 3px 10px 3px 8px; border-radius: var(--r-full); }
.source-tag .icon { width: 14px; height: 14px; }
.source-manual { background: var(--gray-100); color: var(--gray-700); }
.source-vrs { background: var(--blue-50); color: var(--blue-700); }
.source-tpn { background: var(--accent-caro-50); color: var(--accent-caro-700); }
.source-xatp { background: var(--orange-50); color: var(--orange-700); }
.source-message { background: var(--brand-50); color: var(--brand-700); }

/* Document-type badge: DesignOS "Misc Icons/Licence" (Style=Filled); the credential code (ATP/LIC) is part of the icon artwork. */
.doc-icon { width: 32px; height: 40px; position: relative; display: flex; align-items: flex-end; justify-content: center; flex-shrink: 0; }
.doc-icon-file { position: absolute; top: 0; left: 0; width: 32px; height: 40px; }

/* Info-Tip — subtle marker for proposed/not-yet-agreed elements (icon + tooltip instead of a warning box) */
.info-tip { position: relative; display: inline-flex; align-items: center; vertical-align: middle; margin-left: 4px; }
.info-tip-trigger { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0; border: none; background: none; color: var(--fg-quaternary); cursor: help; border-radius: var(--r-sm); }
.info-tip-trigger:hover, .info-tip-trigger:focus-visible { color: var(--brand-700); }
.info-tip-trigger:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
/* Verified modifier: success-tinted Info-Tip that confirms a fact (e.g. a verified email address); icon check-verified-01. */
.info-tip-trigger.verified { color: var(--success-600); }
.info-tip-trigger.verified:hover, .info-tip-trigger.verified:focus-visible { color: var(--success-700); }
.info-tip-trigger .icon { width: 16px; height: 16px; }
.info-tip .tooltip-bubble {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--text-primary); color: #fff; font-size: var(--fs-xs); line-height: var(--lh-xs);
  font-weight: 400; text-transform: none; letter-spacing: normal; text-align: left;
  padding: var(--sp-sm) var(--sp-md); border-radius: var(--r-md); width: 230px;
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .12s ease; box-shadow: var(--shadow-lg); z-index: 30;
}
.info-tip .tooltip-bubble::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--text-primary); }
.info-tip:hover .tooltip-bubble, .info-tip-trigger:focus-visible + .tooltip-bubble { opacity: 1; visibility: visible; }
/* .tip-below: opens the tooltip downward when the trigger sits near the top of a clipping scroll container
   (e.g. the first row inside .modal-body). */
.info-tip.tip-below .tooltip-bubble { bottom: auto; top: calc(100% + 8px); }
.info-tip.tip-below .tooltip-bubble::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--text-primary); }

/* Pagination footer, always rendered by renderPagination() in app.js: result count left, Prev/pages/Next right — pattern_data_table. */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-xl); border-top: 1px solid var(--border-secondary); }
.pagination-count { font-size: var(--fs-sm); color: var(--text-tertiary); }
.pagination-controls { display: flex; align-items: center; gap: var(--sp-sm); }
.pagination-nav {
  display: inline-flex; align-items: center; gap: var(--sp-xs);
  padding: var(--sp-sm) var(--sp-lg);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: none;
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary);
}
.pagination-nav:hover { background: var(--bg-active); }
.pagination-nav:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
.pagination-nav[disabled] { opacity: .4; cursor: not-allowed; pointer-events: none; }
.pagination-nav .icon { color: var(--fg-quaternary); width: 18px; height: 18px; }
.page-numbers { display: flex; gap: var(--sp-xs); }
.page-num { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-md); font-size: var(--fs-sm); font-weight: 600; color: var(--text-tertiary); }
.page-num.active { background: var(--gray-100); color: var(--text-primary); }
.page-num.ellipsis { color: var(--fg-quaternary); font-weight: 400; }

/* Empty state */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: var(--sp-6xl) var(--sp-4xl); }
/* asset_empty_states: colour follows the state type — default gray = no results, .empty-state-cyan = first use,
   .empty-state-warning = permission denied. Cyan currently uses the accent-caro scale. */
.empty-state .empty-icon-wrap { width: 56px; height: 56px; border-radius: 50%; background: var(--gray-100); display: flex; align-items: center; justify-content: center; margin-bottom: var(--sp-xl); color: var(--fg-quaternary); }
.empty-state-cyan .empty-icon-wrap { background: var(--accent-caro-50); color: var(--accent-caro-700); }
.empty-state-warning .empty-icon-wrap { background: var(--warning-100); color: var(--warning-700); }
.empty-state h3 { font-size: var(--fs-md); font-weight: 600; margin-bottom: var(--sp-sm); }
.empty-state p { color: var(--text-tertiary); font-size: var(--fs-sm); max-width: 360px; margin-bottom: var(--sp-xl); }

/* ==========================================================================
   Cards / Sections
   ========================================================================== */
/* No box-shadow: border + shadow on the same edge is a Hard-Refuse (policy_elevation edge_definition_exclusivity) — see _docs/ux-entscheidungen.md. */
.card { background: var(--bg-primary); border: 1px solid var(--border-secondary); border-radius: var(--r-xl); }
/* No justify-content: the title sits next to its icon; right-aligned actions use margin-left:auto
   (direct .card-header children only). */
.card-header { display: flex; align-items: flex-start; padding: var(--sp-xl); border-bottom: 1px solid var(--border-secondary); }
.card-header > .btn-link, .card-header > .tab-pill-group, .card-header > .icon-btn { margin-left: auto; }
.card-header h3 { font-size: var(--fs-md); font-weight: 600; margin-bottom: 2px; }
.card-header p { font-size: var(--fs-sm); color: var(--text-tertiary); }
.card-body { padding: var(--sp-xl); }
.section-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-xl); }
.section-label span.label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-700); font-family: var(--font-mono); }
.section-label h2 { font-size: var(--fs-display-xs); font-weight: 600; margin-top: 2px; }

/* Callout / banner */
.callout { display: flex; gap: var(--sp-lg); padding: var(--sp-xl); border-radius: var(--r-xl); border: 1px solid; margin-bottom: var(--sp-3xl); position: relative; }
.callout .icon-wrap { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.callout h4 { font-size: var(--fs-sm); font-weight: 600; margin-bottom: 2px; }
.callout p { font-size: var(--fs-sm); line-height: var(--lh-sm); }
.callout:has(.close-x) h4 { padding-right: 20px; }
.callout .close-x { position: absolute; top: var(--sp-lg); right: var(--sp-lg); color: var(--fg-quaternary); background: none; border: none; }
.callout-warning { background: var(--warning-50); border-color: var(--warning-200); }
.callout-warning .icon-wrap { background: var(--warning-100); color: var(--warning-700); }
.callout-warning h4 { color: var(--warning-700); }
.callout-warning p { color: var(--warning-700); }
/* component_ui_callout: Info uses a pale Petrol tint, not blue (not used in product UI), paler than .callout-brand. */
.callout-info { background: #E5EAEE; border-color: var(--brand-200); }
.callout-info .icon-wrap { background: #ffffff; color: var(--brand-900); }
.callout-info h4 { color: var(--brand-900); }
.callout-info p { color: var(--text-secondary); }
.callout-brand { background: var(--brand-50); border-color: var(--brand-200); }
.callout-brand .icon-wrap { background: var(--brand-200); color: var(--brand-700); }
.callout-brand h4 { color: var(--brand-700); }
.callout-brand p { color: var(--text-secondary); }

/* ==========================================================================
   Modals
   ========================================================================== */
.overlay {
  position: fixed; inset: 0; background: rgba(16,24,40,.55); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: var(--sp-3xl);
}
.overlay.open { display: flex; }
.modal { background: var(--bg-primary); border-radius: var(--r-2xl); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column; animation: modal-in .18s ease; }
.modal.modal-wide { max-width: 720px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-lg); padding: var(--sp-2xl) var(--sp-2xl) var(--sp-xl); border-bottom: 1px solid var(--border-secondary); }
.modal-header .modal-icon { width: 44px; height: 44px; border-radius: var(--r-md); border: 1px solid var(--border-secondary); display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); margin-bottom: var(--sp-lg); }
.modal-header h3 { font-size: var(--fs-lg); font-weight: 600; margin-bottom: var(--sp-xs); }
.modal-header p { font-size: var(--fs-sm); color: var(--text-tertiary); }
/* Confirmation modals name the affected object in bold (pattern_confirmation v1.3). */
.modal-header p strong { color: var(--text-primary); font-weight: 600; }
.modal-header .close-x { background: none; border: none; color: var(--fg-quaternary); flex-shrink: 0; }
.modal-body { padding: var(--sp-2xl); overflow-y: auto; flex: 1; }
.modal-actions { display: flex; gap: var(--sp-lg); padding: var(--sp-xl) var(--sp-2xl); border-top: 1px solid var(--border-secondary); }
.modal-actions .btn { flex: 1; justify-content: center; }

.form-row { margin-bottom: var(--sp-xl); }
.form-row label { display: block; font-size: var(--fs-sm); font-weight: 500; color: var(--text-secondary); margin-bottom: var(--sp-sm); }
.form-row .hint { font-size: var(--fs-sm); color: var(--text-quaternary); margin-top: var(--sp-xs); }
/* .form-row-settings: settings-page row with label + caption left, control right (pattern_form).
   .form-row stays the default for modals. */
.form-row-settings { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: var(--sp-xl); align-items: start; }
.form-row-settings label { margin-bottom: var(--sp-xs); }
.form-row-settings .hint { margin-top: 0; }
@media (max-width: 720px) { .form-row-settings { grid-template-columns: 1fr; } }
.form-input, .form-textarea, .form-select {
  width: 100%; border: 1px solid var(--border-primary); border-radius: var(--r-md); padding: var(--sp-lg);
  font-size: var(--fs-sm); color: var(--text-primary); background: var(--bg-primary);
}
/* Native appearance off and caret drawn as background-image, so .form-select has exactly the same height as .form-input. */
.form-select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding-right: calc(var(--sp-lg) + 20px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2398A2B3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9L12 15L18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right var(--sp-md) center; background-size: 18px 18px;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-placeholder); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-input:focus, .form-textarea:focus, .form-select:focus { outline: 2px solid var(--accent-cyan); outline-offset: 2px; border-color: var(--brand-700); }
.form-input.error, .form-textarea.error { border-color: var(--error-500); }
.error-text { display: flex; align-items: center; gap: 4px; color: var(--error-700); font-size: var(--fs-sm); margin-top: var(--sp-xs); }
.error-text .icon { width: 14px; height: 14px; }

.tab-underline-group { display: flex; gap: var(--sp-3xl); border-bottom: 1px solid var(--border-secondary); margin-bottom: var(--sp-xl); }
.tab-underline { padding: var(--sp-lg) 0; font-size: var(--fs-sm); font-weight: 600; color: var(--text-quaternary); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.tab-underline.active { color: var(--brand-700); border-color: var(--brand-700); }
/* Reset so <button class="tab-underline"> renders like the <div> version. */
button.tab-underline { background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0; appearance: none; -webkit-appearance: none; -moz-appearance: none; }
button.tab-underline.active { border-bottom-color: var(--brand-700); }

.toggle-row { display: flex; align-items: center; gap: var(--sp-lg); padding: var(--sp-lg) 0; border-bottom: 1px solid var(--border-secondary); margin-bottom: var(--sp-xl); }
.toggle-row label { margin: 0; font-size: var(--fs-sm); font-weight: 500; color: var(--text-secondary); }
.switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track { position: absolute; inset: 0; background: var(--gray-200); border-radius: var(--r-full); transition: .15s; cursor: pointer; }
.switch-track::before { content: ''; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: var(--shadow-xs); }
.switch input:checked + .switch-track { background: var(--btn-primary-bg); }
.switch input:checked + .switch-track::before { transform: translateX(18px); }

.checkbox-card { display: flex; gap: var(--sp-lg); padding: var(--sp-lg); border: 1px solid var(--border-secondary); border-radius: var(--r-lg); margin-bottom: var(--sp-lg); }
.checkbox-card input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--btn-primary-bg); }
.checkbox-card strong { font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); display: block; margin-bottom: 2px; }
.checkbox-card span.desc { font-size: var(--fs-sm); color: var(--text-tertiary); line-height: var(--lh-sm); }
/* .selection-card (Compact Card): radio trailing beside the title, divider, description below — pattern_selection_grid.
   Other .checkbox-card uses keep the default anatomy. */
.checkbox-card.selection-card { flex-direction: column; align-items: stretch; gap: 0; }
.checkbox-card.selection-card .checkbox-card-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-lg); padding-bottom: var(--sp-md); margin-bottom: var(--sp-md); border-bottom: 1px solid var(--border-secondary); }
.checkbox-card.selection-card strong { margin-bottom: 0; }
.checkbox-card.selection-card input { margin-top: 0; flex-shrink: 0; }
/* Selected state: the 1px base border only changes colour (no extra width or ring), per Figma "Radio group item";
   header row has a leading icon-wrap ("Icon card" anatomy) — pattern_selection_grid — see _docs/ux-entscheidungen.md. */
.checkbox-card.selection-card:hover { border-color: var(--border-primary); }
.checkbox-card.selection-card:has(input:checked) { border-color: var(--btn-primary-bg); background: var(--brand-50); }
.checkbox-card.selection-card:has(input:checked) .checkbox-card-row { border-bottom-color: var(--brand-200); }
.checkbox-card.selection-card:has(input:focus-visible) { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
.checkbox-card.selection-card .checkbox-card-row-main { display: flex; align-items: center; gap: var(--sp-md); }
.checkbox-card.selection-card .checkbox-card-row-main .icon-wrap { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--gray-100); color: var(--text-tertiary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.checkbox-card.selection-card:has(input:checked) .checkbox-card-row-main .icon-wrap { background: var(--brand-700); color: #fff; }

.status-illustration { display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--sp-3xl) var(--sp-2xl); }
.status-illustration .icon-circle { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: var(--sp-xl); }
.status-illustration.success .icon-circle { background: var(--success-100); color: var(--success-600); }
.status-illustration h3 { font-size: var(--fs-lg); font-weight: 600; margin-bottom: var(--sp-xs); }
.status-illustration p { color: var(--text-tertiary); font-size: var(--fs-sm); }

.progress-ring-wrap { position: relative; width: 140px; height: 140px; margin: 0 auto var(--sp-xl); }
.progress-ring-wrap svg { transform: rotate(-90deg); }
.progress-ring-bg { fill: none; stroke: var(--gray-100); stroke-width: 10; }
.progress-ring-fg { fill: none; stroke: var(--btn-primary-bg); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .3s ease; }
.progress-ring-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: var(--fs-display-xs); font-weight: 700; }

/* ==========================================================================
   Slide-over panel
   ========================================================================== */
.slideover-scrim { position: fixed; inset: 0; background: rgba(16,24,40,.45); z-index: 90; display: none; }
.slideover-scrim.open { display: block; }
.slideover {
  position: fixed; top: 0; right: -440px; width: 420px; height: 100vh; background: var(--bg-primary);
  box-shadow: var(--shadow-lg); z-index: 95; transition: right .22s ease; overflow-y: auto;
  border-left: 1px solid var(--border-secondary);
}
.slideover.open { right: 0; }
.slideover-header { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-xl) var(--sp-2xl); border-bottom: 1px solid var(--border-secondary); }
.slideover-header h3 { font-size: var(--fs-lg); font-weight: 600; }
.slideover-header button { background: none; border: none; color: var(--fg-quaternary); }
.slideover-body { padding: var(--sp-2xl); }
.slideover-profile { text-align: left; margin-bottom: var(--sp-2xl); }
.slideover-avatar-wrap { position: relative; width: 96px; height: 96px; margin-bottom: var(--sp-xl); }
.slideover-avatar { width: 96px; height: 96px; border-radius: 50%; background: var(--gray-100); display: flex; align-items: center; justify-content: center; font-size: var(--fs-display-sm); font-weight: 700; color: var(--text-tertiary); }
.verified-check { position: absolute; bottom: -2px; right: -2px; width: 28px; height: 28px; border-radius: 50%; background: var(--blue-500); color: #fff; display: flex; align-items: center; justify-content: center; border: 3px solid var(--bg-primary); }
.slideover-profile h2 { font-size: var(--fs-display-xs); font-weight: 600; margin-bottom: 2px; }
.slideover-profile .email { color: var(--text-tertiary); font-size: var(--fs-sm); margin-bottom: var(--sp-xl); }
.slideover-actions { display: flex; gap: var(--sp-md); margin-bottom: var(--sp-2xl); }
.slideover-section { padding: var(--sp-xl) 0; border-top: 1px solid var(--border-secondary); }
.slideover-section:first-of-type { border-top: none; padding-top: 0; }
.slideover-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-lg); }
.slideover-section-head h4 { font-size: var(--fs-md); font-weight: 600; }
.slideover-section-head .icon { color: var(--success-600); }
.kv-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-lg); }
.kv-row .k { font-size: var(--fs-sm); color: var(--text-quaternary); }
.kv-row .v { font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: var(--sp-sm); }
.kv-row .v button { background: none; border: none; color: var(--fg-quaternary); display: flex; }
.slideover-address { color: var(--text-primary); font-weight: 600; font-size: var(--fs-sm); line-height: var(--lh-sm); margin-bottom: var(--sp-lg); }
.slideover-map { width: 100%; height: 140px; border-radius: var(--r-lg); background: linear-gradient(135deg, #eef2f6, #e3e9ef); border: 1px solid var(--border-secondary); position: relative; overflow: hidden; }
.slideover-map svg { width: 100%; height: 100%; }
.log-table { width: 100%; font-size: var(--fs-sm); }
.log-table th { text-align: left; color: var(--text-quaternary); font-weight: 600; padding-bottom: var(--sp-sm); border-bottom: 1px solid var(--border-secondary); }
.log-table td { padding: var(--sp-md) 0; color: var(--text-secondary); border-bottom: 1px solid var(--border-tertiary); }

/* Tabs inside slideover (contact detail tabs) */
.slideover-tabs { display: flex; gap: var(--sp-xs); overflow-x: auto; margin: 0 calc(var(--sp-2xl) * -1) var(--sp-xl); padding: 0 var(--sp-2xl); border-bottom: 1px solid var(--border-secondary); }
.slideover-tab { padding: var(--sp-md) var(--sp-lg); font-size: var(--fs-sm); font-weight: 600; color: var(--text-quaternary); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.slideover-tab.active { color: var(--brand-700); border-color: var(--brand-700); }

/* Toast */
.toast-wrap { position: fixed; bottom: var(--sp-3xl); right: var(--sp-3xl); z-index: 200; display: flex; flex-direction: column; gap: var(--sp-md); }
.toast { display: flex; align-items: center; gap: var(--sp-md); background: var(--text-primary); color: #fff; padding: var(--sp-lg) var(--sp-xl); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); font-size: var(--fs-sm); font-weight: 500; animation: toast-in .2s ease; }
.toast .icon { color: var(--success-500); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Grids for dashboard */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-xl); margin-bottom: var(--sp-xl); }
/* 3-column sibling of .dash-grid for the Gold/Silver/Unverified tier cards (CAR-774, non-compliant-partners.html). */
.dash-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--sp-xl); margin-bottom: var(--sp-xl); }
.dash-donut-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-xl); margin-bottom: var(--sp-xl); }
.donut-chart-row { display: flex; align-items: center; gap: var(--sp-lg); }
.donut-wrap { position: relative; width: 128px; height: 128px; flex-shrink: 0; margin: 0; }
.donut-legend { display: flex; flex-direction: column; gap: var(--sp-sm); font-size: var(--fs-xs); }
.donut-legend .row { display: flex; align-items: center; gap: var(--sp-sm); color: var(--text-tertiary); }
.donut-legend .swatch { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Compliance card variants: meter / sparkline / stacked bar (donut variant above) */
.stat-value-row { display: flex; align-items: baseline; gap: var(--sp-sm); margin-bottom: var(--sp-lg); }
.stat-value-row .num { font-size: var(--fs-lg); font-weight: 700; color: var(--text-primary); }
.stat-value-row .unit { font-size: var(--fs-xs); color: var(--text-quaternary); }
.meter-track { width: 100%; height: 10px; border-radius: var(--r-full); overflow: hidden; margin-bottom: var(--sp-lg); }
.meter-fill { height: 100%; border-radius: var(--r-full); }
.stacked-bar { display: flex; gap: 2px; width: 100%; height: 10px; background: var(--bg-primary); border-radius: var(--r-full); overflow: hidden; margin-bottom: var(--sp-lg); }
.stacked-bar-seg { height: 100%; }
.sparkline-row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-md); margin-bottom: var(--sp-md); }
.bar-row { display: flex; align-items: center; gap: var(--sp-lg); margin-bottom: var(--sp-lg); }
.bar-row .label { width: 96px; font-size: var(--fs-sm); color: var(--text-secondary); font-weight: 500; flex-shrink: 0; }
.bar-track { flex: 1; height: 8px; background: var(--gray-100); border-radius: var(--r-full); overflow: hidden; }
.bar-fill { height: 100%; background: var(--btn-primary-bg); border-radius: var(--r-full); }
.bar-row .val { font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); width: 40px; text-align: right; }

.mini-tile-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-md); margin-top: var(--sp-lg); }
.mini-tile { padding: var(--sp-lg); border-radius: var(--r-lg); text-align: center; }
.mini-tile .num { font-size: var(--fs-display-xs); font-weight: 700; }
.mini-tile .lbl { font-size: var(--fs-xs); margin-top: 2px; }
.mini-tile.error { background: var(--error-50); } .mini-tile.error .num, .mini-tile.error .lbl { color: var(--error-700); }
.mini-tile.warning { background: var(--warning-50); } .mini-tile.warning .num, .mini-tile.warning .lbl { color: var(--warning-700); }
.mini-tile.success { background: var(--success-50); } .mini-tile.success .num, .mini-tile.success .lbl { color: var(--success-700); }

.stage-pill-row { display: flex; gap: var(--sp-md); margin-bottom: var(--sp-lg); }
.stage-tile { flex: 1; border-radius: var(--r-lg); padding: var(--sp-lg); text-align: center; }
.stage-tile .num { font-size: var(--fs-display-xs); font-weight: 700; }
.stage-tile .lbl { font-size: var(--fs-xs); margin-top: 2px; }
.stage-tile.a { background: var(--error-50); } .stage-tile.a .num,.stage-tile.a .lbl{ color: var(--error-700);}
.stage-tile.b { background: var(--blue-50); } .stage-tile.b .num,.stage-tile.b .lbl{ color: var(--blue-700);}
.stage-tile.c { background: var(--success-50); } .stage-tile.c .num,.stage-tile.c .lbl{ color: var(--success-700);}

.mini-list-row { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-md) 0; border-bottom: 1px solid var(--border-tertiary); font-size: var(--fs-sm); }
.mini-list-row:last-child { border-bottom: none; }
.mini-list-row .name { font-weight: 600; color: var(--text-primary); }
.mini-list-row .sub { color: var(--text-quaternary); font-size: var(--fs-xs); }
/* Clickable mini-list rows, same affordance as .metric-tile.clickable. */
.mini-list-row.clickable { cursor: pointer; margin: 0 calc(-1 * var(--sp-md)); padding: var(--sp-md); border-radius: var(--r-md); transition: background 0.15s ease; }
.mini-list-row.clickable:hover { background: var(--bg-active); }
.mini-list-row.clickable:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }

/* Compact news/to-do feed row (dashboard), reusable for other activity feeds — see _docs/ux-entscheidungen.md. */
.feed-row { display: flex; align-items: center; gap: var(--sp-md); padding: var(--sp-md) var(--sp-xl); border-bottom: 1px solid var(--border-tertiary); text-decoration: none; color: inherit; }
.feed-row:last-child { border-bottom: none; }
.feed-row:hover { background: var(--bg-active); }
.feed-row .feed-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.feed-row .feed-icon.type-news { background: #E5EAEE; color: var(--brand-900); }
.feed-row .feed-icon.type-maintenance { background: var(--warning-50); color: var(--warning-700); }
.feed-row .feed-icon.type-release { background: var(--success-50); color: var(--success-700); }
.feed-row .feed-icon.type-todo { background: var(--warning-50); color: var(--warning-700); }
.feed-row .feed-icon.type-regulation { background: var(--gray-100); color: var(--text-tertiary); }
.feed-row .feed-text { flex: 1; min-width: 0; }
.feed-row .feed-title { font-weight: 600; font-size: var(--fs-sm); color: var(--text-primary); }
.feed-row .feed-sub { font-size: var(--fs-xs); color: var(--text-quaternary); margin-top: 2px; }
.feed-row .feed-meta { flex-shrink: 0; font-size: var(--fs-xs); color: var(--text-quaternary); white-space: nowrap; }

.quick-actions-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-xl); margin-bottom: var(--sp-3xl); }
.quick-action { display: flex; align-items: center; gap: var(--sp-lg); padding: var(--sp-xl); }
.quick-action .icon-wrap { width: 44px; height: 44px; border-radius: var(--r-lg); background: var(--brand-50); color: var(--brand-700); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.quick-action strong { display: block; font-size: var(--fs-sm); font-weight: 600; margin-bottom: 2px; }
.quick-action span.desc { font-size: var(--fs-sm); color: var(--text-tertiary); }
.quick-action { cursor: pointer; }
.quick-action:hover { border-color: var(--border-primary); }
/* Keyboard focus ring for .quick-action (a card with role="button", not a native <button>). */
.quick-action:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }

.filter-bar { display: flex; gap: var(--sp-lg); align-items: center; margin-bottom: var(--sp-xl); }
.select-input { display: flex; align-items: center; gap: var(--sp-sm); border: 1px solid var(--border-primary); border-radius: var(--r-md); padding: var(--sp-sm) var(--sp-lg); font-size: var(--fs-sm); font-weight: 500; color: var(--text-secondary); background: var(--bg-primary); }
.select-input .icon { color: var(--fg-quaternary); width: 16px; height: 16px; }
/* .select-input.is-soon: a not-yet-functional filter reads as "not built", same as .quick-action.is-soon (ADR-CARO-06). */
.select-input.is-soon { opacity: .7; cursor: default; }

.wizard-steps { display: flex; align-items: center; margin-bottom: var(--sp-3xl); }
.wizard-step { display: flex; align-items: center; gap: var(--sp-md); }
.wizard-step .dot { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border-primary); display: flex; align-items: center; justify-content: center; font-size: var(--fs-sm); font-weight: 600; color: var(--text-quaternary); background: var(--bg-primary); flex-shrink: 0; }
.wizard-step.done .dot { background: var(--btn-primary-bg); border-color: var(--btn-primary-bg); color: #fff; }
.wizard-step.current .dot { border-color: var(--btn-primary-bg); color: var(--btn-primary-bg); }
.wizard-step .label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-quaternary); }
.wizard-step.current .label, .wizard-step.done .label { color: var(--text-primary); }
.wizard-connector { width: 64px; height: 2px; background: var(--border-secondary); margin: 0 var(--sp-lg); }
.wizard-connector.done { background: var(--btn-primary-bg); }

.locked-panel { position: relative; opacity: .6; filter: grayscale(.3); pointer-events: none; }
.locked-banner { display: flex; align-items: center; gap: var(--sp-md); background: var(--gray-50); border: 1px dashed var(--border-primary); border-radius: var(--r-lg); padding: var(--sp-lg); margin-bottom: var(--sp-xl); }
.locked-banner .icon { color: var(--text-quaternary); }
.locked-banner strong { font-size: var(--fs-sm); color: var(--text-secondary); }
.locked-banner span { font-size: var(--fs-xs); color: var(--text-quaternary); }

/* Test panel — prototype-only reviewer tool, not part of the product screen itself (spherity-prototype §4) */
.test-panel-trigger { position: fixed; bottom: 24px; right: 24px; z-index: 500; width: 48px; height: 48px; border-radius: 50%; background: var(--brand-700); color: #fff; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow-lg); }
.test-panel-trigger:hover { background: var(--brand-800, var(--brand-700)); }
.test-panel-trigger .icon { width: 22px; height: 22px; }
.test-panel { position: fixed; bottom: 84px; right: 24px; z-index: 500; width: 300px; background: var(--bg-primary); border: 1px solid var(--border-secondary); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: var(--sp-lg); display: none; }
.test-panel.open { display: block; }
.test-panel h4 { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-quaternary); margin-bottom: var(--sp-md); }
.test-panel-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-md); margin-bottom: var(--sp-md); }
.test-panel-row:last-child { margin-bottom: 0; }
.test-panel-row label { font-size: var(--fs-sm); color: var(--text-secondary); flex: 1; }
.test-panel-row label.switch { flex: 0 0 40px; }

.hidden { display: none !important; }
/* Visually hidden but kept in the accessibility tree (unlike .hidden, which is display:none). */
.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; }

@media (max-width: 1080px) {
  .metric-row, .metric-row.cols-4, .dash-donut-row { grid-template-columns: 1fr 1fr; }
  .dash-grid, .dash-grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: -288px; z-index: 80; transition: left .2s ease; }
  .sidebar.open { left: 0; }
  .page-content, .topbar { padding-left: var(--sp-xl); padding-right: var(--sp-xl); }
  .metric-row, .metric-row.cols-4, .dash-donut-row, .quick-actions-row { grid-template-columns: 1fr; }
  .data-table-wrap { overflow-x: auto; }
}

/* ==========================================================================
   Wallet, Team Management, VRS Interactions and Messages screens (CAR-893),
   ported from reference-minimal/assets/styles.css.
   ========================================================================== */
/* ---- pattern_selection_grid: single-select radio-card grid ---- */
/* Icon card anatomy (Figma "Icon card"): icon-wrap + title in a header row with the radio trailing, a divider,
   description below full-width — pattern_selection_grid — see _docs/ux-entscheidungen.md. */
.radio-card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-lg); margin-bottom: var(--sp-xl); }
.radio-card {
  position: relative; display: flex; flex-direction: column;
  padding: var(--sp-xl); border: 1px solid var(--border-primary); border-radius: var(--r-lg);
  cursor: pointer; background: var(--bg-primary);
}
.radio-card-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-md); padding-bottom: var(--sp-md); margin-bottom: var(--sp-md); border-bottom: 1px solid var(--border-secondary); }
.radio-card-row-main { display: flex; align-items: center; gap: var(--sp-md); min-width: 0; }
.radio-card input { position: static; width: 18px; height: 18px; accent-color: var(--btn-primary-bg); flex-shrink: 0; }
.radio-card .icon-wrap { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--gray-100); color: var(--text-tertiary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.radio-card strong { font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); }
.radio-card span.desc { font-size: var(--fs-sm); color: var(--text-tertiary); display: block; }
.radio-card:hover { border-color: var(--border-primary); background: var(--bg-active); }
.radio-card:has(input:checked) { border-color: var(--btn-primary-bg); background: var(--brand-50); }
.radio-card:has(input:checked) .radio-card-row { border-bottom-color: var(--brand-200); }
.radio-card:has(input:checked) .icon-wrap { background: var(--brand-700); color: #fff; }
.radio-card:has(input:focus-visible) { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }

/* ---- pattern_filter_builder: Filters button + two-level flyout ---- */
.filter-flyout-wrap { position: relative; }
.filter-flyout {
  position: absolute; top: calc(100% + 8px); left: 0; width: 260px; z-index: 40;
  background: var(--bg-primary); border: 1px solid var(--border-secondary); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); padding: var(--sp-sm); display: none;
}
.filter-flyout.open { display: block; }
/* .align-right is set by toggleFilterFlyout() in app.js when the 260px flyout would overflow the viewport on the right. */
.filter-flyout.align-right { left: auto; right: 0; }
.filter-flyout-back { display: flex; align-items: center; gap: var(--sp-sm); padding: var(--sp-md) var(--sp-lg); font-size: var(--fs-sm); font-weight: 600; color: var(--text-tertiary); border-bottom: 1px solid var(--border-secondary); margin-bottom: var(--sp-sm); border-radius: var(--r-md); cursor: pointer; }
.filter-flyout-back:hover { background: var(--bg-active); }
.filter-flyout-back .icon { width: 16px; height: 16px; }
.filter-flyout-item { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-md) var(--sp-lg); border-radius: var(--r-md); font-size: var(--fs-sm); font-weight: 500; color: var(--text-secondary); }
.filter-flyout-item:hover { background: var(--bg-active); cursor: pointer; }
.filter-flyout-item .icon { width: 16px; height: 16px; color: var(--fg-quaternary); }
.filter-flyout-checkbox { display: flex; align-items: center; gap: var(--sp-md); padding: var(--sp-md) var(--sp-lg); font-size: var(--fs-sm); color: var(--text-secondary); }
.filter-flyout-checkbox input { accent-color: var(--btn-primary-bg); width: 16px; height: 16px; }
.filter-flyout-apply { display: flex; gap: var(--sp-sm); padding: var(--sp-sm); border-top: 1px solid var(--border-secondary); margin-top: var(--sp-sm); }
.filter-flyout-apply .btn { flex: 1; justify-content: center; }
.active-filter-chip { display: inline-flex; align-items: center; gap: var(--sp-xs); font-size: var(--fs-xs); font-weight: 600; padding: 4px 10px; border-radius: var(--r-full); background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-200); }
.active-filter-row { display: flex; gap: var(--sp-sm); margin-bottom: var(--sp-lg); flex-wrap: wrap; }

/* Minimal date-range picker: "Created" opens a range picker, not a typed field (pattern_filter_builder). */
.date-range-picker { padding: var(--sp-lg); }
.date-range-inputs { display: flex; gap: var(--sp-md); margin-bottom: var(--sp-md); }
.date-range-inputs input { flex: 1; }
.mini-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: var(--fs-xs); color: var(--text-tertiary); }
.mini-calendar .day { padding: var(--sp-sm) 0; border-radius: var(--r-sm); }
.mini-calendar .day.in-range { background: var(--brand-50); color: var(--brand-700); }
.mini-calendar .day.today { font-weight: 700; color: var(--text-primary); }

/* ---- Settings General tab: link-out cards (pattern_settings Flow step 5) ---- */
.linkout-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-lg); }
.linkout-card { display: flex; align-items: center; gap: var(--sp-lg); padding: var(--sp-xl); border: 1px solid var(--border-secondary); border-radius: var(--r-xl); background: var(--bg-primary); }
.linkout-card:hover { border-color: var(--border-primary); background: var(--bg-active); }
.linkout-card .icon-wrap { width: 44px; height: 44px; border-radius: var(--r-lg); background: var(--brand-50); color: var(--brand-700); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.linkout-card strong { display: block; font-size: var(--fs-sm); font-weight: 600; margin-bottom: 2px; }
.linkout-card span.desc { font-size: var(--fs-sm); color: var(--text-tertiary); }
.linkout-card .icon.ext { margin-left: auto; color: var(--fg-quaternary); flex-shrink: 0; }

/* ---- Disabled tab (pattern_user_profile: Notifications, "present but
   disabled" — a named, honest gap, not hidden and not built as functional) ---- */
.tab-underline.disabled, .tab-pill.disabled {
  color: var(--fg-senary); cursor: not-allowed; pointer-events: none;
}
.tab-underline.disabled .tab-note, .tab-pill.disabled .tab-note {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  margin-left: var(--sp-xs); color: var(--fg-quaternary);
}

/* ---- pattern_messaging v2.0 (Figma node 1180:39291): inbox as stacked cards, thread panel with a header bar
   and sender avatar/email per message — see _docs/ux-entscheidungen.md. ---- */
.inbox-list { display: flex; flex-direction: column; }
.inbox-row { display: flex; flex-direction: column; gap: var(--sp-sm); padding: var(--sp-lg) var(--sp-xl); border-bottom: 1px solid var(--border-secondary); cursor: pointer; }
.inbox-row:last-child { border-bottom: none; }
.inbox-row:hover, .inbox-row.active { background: var(--bg-active); }
.inbox-row-top { display: flex; align-items: center; justify-content: space-between; }
.inbox-row .ref { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-quaternary); }
.inbox-row-meta { display: flex; align-items: center; gap: var(--sp-sm); min-width: 0; }
.inbox-row-meta .avatar-initials { flex-shrink: 0; }
.inbox-row-meta .counterparty { font-weight: 600; color: var(--text-primary); font-size: var(--fs-sm); flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-row-meta .pill { flex-shrink: 0; }
.inbox-row-date { margin-left: auto; font-size: var(--fs-xs); color: var(--text-quaternary); flex-shrink: 0; white-space: nowrap; }
.inbox-row-subject { font-weight: 600; color: var(--text-primary); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-row-tags { display: flex; gap: 6px; }

/* One message-type tag per card (Basic Message / Data Request); own class because it is neither a lifecycle
   status nor a record-source badge. */
.msg-type-tag { display: inline-flex; align-items: center; font-size: var(--fs-xs); font-weight: 600; padding: 3px 10px; border-radius: var(--r-full); }
.msg-type-tag.basic { background: var(--gray-100); color: var(--gray-700); }
.msg-type-tag.data-request { background: var(--brand-50); color: var(--brand-700); }
/* CAR-844: system-generated compliance notification threads. Same accent tokens as .source-tpn,
   icon + label so the distinction does not rely on colour alone. */
.msg-type-tag.automated { gap: 4px; background: var(--accent-caro-50); color: var(--accent-caro-700); }
.msg-type-tag.automated .icon { width: 12px; height: 12px; }

/* License-type tag (contact-details.html Locations & Licenses): Brand/Sub-Brand ramp stops only, no semantic tints,
   so a type never reads as a status. Documented deviation from pattern_data_table — see _docs/ux-entscheidungen.md. */
.license-type-tag { display: inline-flex; align-items: center; font-size: var(--fs-xs); font-weight: 600; padding: 2px 10px; border-radius: var(--r-full); border: 1px solid transparent; white-space: nowrap; }
/* State license: Petrol 100 (color.brand.primary.100) + Petrol 500 text + Petrol 300 hairline */
.license-type-tag.type-sl { background: #E5EAEE; color: #023852; border-color: #6F8895; }
/* State ID: CARO 300 (color.subbrand.caro.300, the ramp's pill-badge stop) + CARO 700 text */
.license-type-tag.type-id { background: #BFD5DD; color: #144A5E; border-color: #BFD5DD; }
/* DEA registration: Cyan 100 mint (color.brand.accent.100) + Petrol text ("text on Cyan is Petrol") */
.license-type-tag.type-dea { background: #DFFFF2; color: #023852; border-color: #8AFED9; }
/* ATP / License / fallback: neutral Off-White 300 (color.brand.surface.300) + Off-White 700 hairline */
.license-type-tag.type-atp, .license-type-tag.type-lic, .license-type-tag.type-gln { background: #F4F2EE; color: var(--gray-700); border-color: #C9C7C2; }

/* 28px avatar-initials variant for compact inbox rows (the default stays 40px). */
.avatar-initials.sm { width: 28px; height: 28px; font-size: var(--fs-xs); }

.thread-header-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-lg); width: 100%; flex-wrap: wrap; }
.thread-header-bar .ref { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text-secondary); font-weight: 600; }
.thread-header-actions { display: flex; gap: var(--sp-md); }

.thread-message { padding: var(--sp-xl); border-bottom: 1px solid var(--border-secondary); }
.thread-message:last-child { border-bottom: none; }
.thread-message-head { display: flex; align-items: flex-start; gap: var(--sp-md); margin-bottom: var(--sp-md); }
.thread-message-head .tm-who { flex: 1; min-width: 0; }
.thread-message-head .tm-name { font-weight: 600; font-size: var(--fs-sm); color: var(--text-primary); }
.thread-message-head .tm-email { font-size: var(--fs-xs); color: var(--text-quaternary); }
.thread-message-head .tm-meta { flex-shrink: 0; }
.thread-message-head span.time { font-size: var(--fs-xs); color: var(--text-quaternary); }
.thread-message .subject-line { font-weight: 600; font-size: var(--fs-sm); color: var(--text-primary); margin-bottom: var(--sp-sm); }
.thread-message p { font-size: var(--fs-sm); color: var(--text-secondary); line-height: var(--lh-sm); }

/* Inline reply composer for an open thread; the "Send a Message" modal remains for starting new threads. */
.reply-composer { padding: var(--sp-xl); border-top: 1px solid var(--border-secondary); }
.reply-composer .form-textarea { margin-bottom: var(--sp-lg); min-height: 90px; }
.reply-composer .upload-dropzone { margin-bottom: var(--sp-lg); }
.reply-actions { display: flex; justify-content: flex-end; gap: var(--sp-md); }

.data-proposal-card { margin-top: var(--sp-lg); border: 1px solid var(--brand-200); background: var(--brand-50); border-radius: var(--r-lg); padding: var(--sp-lg); }
.data-proposal-card h3 { font-size: var(--fs-sm); font-weight: 600; color: var(--brand-700); margin-bottom: var(--sp-md); }
.data-proposal-fields { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-md) var(--sp-xl); margin-bottom: var(--sp-lg); }
.data-proposal-fields .k { font-size: var(--fs-xs); color: var(--text-quaternary); text-transform: uppercase; letter-spacing: .02em; }
.data-proposal-fields .v { font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); }

/* ---- pattern_form: grouped-section composition (Contact modal) ---- */
.form-group-label { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-quaternary); font-family: var(--font-mono); margin: var(--sp-2xl) 0 var(--sp-lg); }
.form-group-label:first-child { margin-top: 0; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-lg); margin-bottom: var(--sp-xl); }
.form-row-2 .form-row { margin-bottom: 0; }

/* ---- Company Profile / logo upload dropzone ---- */
.upload-dropzone { display: flex; align-items: center; gap: var(--sp-lg); border: 1px dashed var(--border-primary); border-radius: var(--r-lg); padding: var(--sp-xl); }
.upload-dropzone { cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.upload-dropzone.dropzone-active { border-color: var(--brand-700); background: var(--gray-50); }
.upload-dropzone-prompt { display: flex; align-items: center; gap: var(--sp-lg); flex: 1; min-width: 0; }
.upload-file-list { display: flex; flex-direction: column; gap: var(--sp-sm); margin-top: var(--sp-sm); }
.upload-file-row { display: flex; align-items: center; gap: var(--sp-sm); padding: var(--sp-sm) var(--sp-md); border: 1px solid var(--border-secondary); border-radius: var(--r-md); font-size: var(--fs-sm); }
.upload-file-row .icon { color: var(--fg-quaternary); flex-shrink: 0; }
.upload-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.upload-file-size { color: var(--text-quaternary); font-size: var(--fs-xs); flex-shrink: 0; }

.upload-dropzone .icon-wrap { width: 44px; height: 44px; border-radius: var(--r-lg); background: var(--gray-100); color: var(--fg-quaternary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.upload-dropzone strong { display: block; font-size: var(--fs-sm); font-weight: 600; }
.upload-dropzone span.desc { font-size: var(--fs-xs); color: var(--text-quaternary); }


/* Contact Details page (contact-details.html): only the section-header icon square and the section tab bar are new. */
.detail-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.detail-card-head h3 { font-size: var(--fs-lg); font-weight: 700; }
.detail-icon-sq { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--brand-900); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.detail-map-wrap { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border-secondary); }

/* Underline tab bar for a page section: like .slideover-tab, without the slideover's negative margins. */
.section-tabs { display: flex; gap: var(--sp-xs); border-bottom: 1px solid var(--border-secondary); margin-bottom: var(--sp-xl); }
.section-tab { padding: var(--sp-md) var(--sp-lg); font-size: var(--fs-sm); font-weight: 600; color: var(--text-quaternary); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.section-tab.active { color: var(--brand-700); border-color: var(--brand-700); }
/* contact-details.html uses .tab-pill button tabs instead; .section-tabs stays for other pages — see _docs/ux-entscheidungen.md. */

/* Large first-use / no-data empty state (Credentials, Correlation Reports, Contacts), distinct from the
   small no-results .empty-state. */
.empty-state-lg { padding: var(--sp-6xl) var(--sp-4xl); }
.empty-state-lg .empty-icon-wrap { width: 96px; height: 96px; margin-bottom: var(--sp-2xl); }
.empty-state-lg .empty-icon-wrap > .icon { width: 40px; height: 40px; }
.empty-state-lg h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-md); }
.empty-state-lg p { max-width: 440px; font-size: var(--fs-sm); }
.empty-state-lg p strong { color: var(--text-secondary); }
/* Folder-in-square variant (Credentials / Correlation Reports); the Contacts empty state shows the people icon directly. */
.empty-icon-sq { width: 48px; height: 48px; border-radius: var(--r-md); background: var(--brand-900); color: #fff; display: flex; align-items: center; justify-content: center; }
.empty-icon-sq .icon { width: 22px; height: 22px; }


/* --- Proto info bar (spherity-prototype §2d): sits above .app-shell, not part of the product UI;
   neutral gray, no brand tokens. Required on every page. --- */
.proto-infobar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-lg); flex-wrap: wrap; padding: var(--sp-sm) var(--sp-xl); background: var(--gray-50); border-bottom: 1px solid var(--border-secondary); font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-tertiary); }
.proto-infobar .proto-infobar-left { display: flex; align-items: center; gap: var(--sp-sm); }
.proto-infobar .proto-infobar-version { font-weight: 700; color: var(--text-secondary); }
.proto-infobar a { color: var(--text-tertiary); text-decoration: none; }
.proto-infobar a:hover { color: var(--brand-700); text-decoration: underline; }


/* ===== Dashboard emphasis (dashboard.html only): additive classes, shared card rules untouched. =====
   "Needs your attention" outranks the utility cards (pattern_dashboard); no shadow, no oversized numbers. */
.section-label.emphasis h2 { font-weight: 700; }
.card.card-attention { transition: box-shadow .15s ease; }
.card.card-attention:hover { border-color: var(--border-primary); }
.card.card-attention .mini-tile .num { font-weight: 800; }
.card-header .header-badge { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-right: var(--sp-lg); }
.card-header .header-badge.error { background: var(--error-50); color: var(--error-700); }
/* .header-badge .warning/.info variants for the notification-settings.html event cards, same pairing as .pill-warning/.pill-info. */
.card-header .header-badge.warning { background: var(--warning-50); color: var(--warning-700); }
.card-header .header-badge.info { background: var(--blue-50); color: var(--blue-700); }
.card-header .header-badge .icon { width: 18px; height: 18px; }

.card-header .header-badge { align-self: center; }

/* Dashboard News (blog-style posts) and To-Dos (checklist) cards; .feed-row/.feed-icon stay for other pages. */
.news-post { padding: var(--sp-lg) var(--sp-xl); border-bottom: 1px solid var(--border-tertiary); }
.news-post:last-child { border-bottom: none; }
/* Optional news thumbnail: only .has-thumb rows use the flex layout. */
.news-post.has-thumb { display: flex; gap: var(--sp-lg); align-items: flex-start; }
.news-post-thumb { width: 72px; height: 72px; border-radius: var(--r-md); object-fit: cover; flex-shrink: 0; background: var(--gray-100); }
.news-post-content { flex: 1; min-width: 0; }
.news-post-kicker { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: var(--sp-sm); }
.news-post-kicker.type-news { color: var(--brand-700); }
.news-post-kicker.type-maintenance { color: var(--warning-700); }
.news-post-kicker.type-release { color: var(--success-700); }
.news-post-kicker.type-regulation { color: var(--text-tertiary); }
.news-post-title { font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.news-post-excerpt { font-size: var(--fs-xs); color: var(--text-tertiary); line-height: var(--lh-sm); margin: 0 0 var(--sp-sm); }
.news-post-meta { font-size: var(--fs-xs); color: var(--text-quaternary); }
.news-post-link { margin-top: var(--sp-sm); font-size: var(--fs-xs); }
.news-post-link .icon { width: 14px; height: 14px; }

/* .v3-hero: shared dashboard hero (also used by dashboard-hierarchy-variants.html). */
.v3-hero {
  background: var(--brand-900, #023852);
  color: #fff;
  border-radius: var(--r-xl);
  padding: var(--sp-3xl) var(--sp-4xl);
  margin-bottom: var(--sp-3xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3xl);
  flex-wrap: wrap;
}
.v3-hero-eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-cyan); font-family: var(--font-mono); margin-bottom: var(--sp-sm); }
.v3-hero-num { font-size: 64px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.v3-hero-label { font-size: var(--fs-lg); color: rgba(255,255,255,.8); margin-top: var(--sp-sm); max-width: 46ch; }
.v3-hero .btn { background: #fff; color: var(--brand-900, #023852); border: none; flex-shrink: 0; }
.v3-hero .btn:hover { background: #f5f5f5; }

/* News teaser banner (Figma node 3836:47392): same box treatment as .v3-hero; separate class because
   .v3-hero keeps its old content on dashboard-hierarchy-variants.html. */
.news-teaser {
  background: var(--brand-900, #023852);
  color: #fff;
  border-radius: var(--r-xl);
  padding: var(--sp-3xl) var(--sp-4xl);
  margin-bottom: var(--sp-3xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3xl);
  flex-wrap: wrap;
}
.news-teaser-eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-cyan); font-family: var(--font-mono); margin-bottom: var(--sp-sm); }
.news-teaser-title { font-size: var(--fs-lg); font-weight: 700; line-height: 1.3; max-width: 56ch; }
.news-teaser-excerpt { font-size: var(--fs-sm); color: rgba(255,255,255,.7); margin-top: var(--sp-xs); max-width: 60ch; }
.news-teaser-meta { font-size: var(--fs-xs); color: rgba(255,255,255,.45); margin-top: var(--sp-sm); }
/* Outlined ghost CTAs on this dark surface (.btn-link's default colour is unreadable here);
   the inline "Read full post" link uses .news-post-link. */
.news-teaser .btn-link { color: rgba(255,255,255,.85); }
.news-teaser > a.btn-link { border: 1px solid rgba(255,255,255,.6); border-radius: var(--r-md); padding: var(--sp-sm) var(--sp-lg); flex-shrink: 0; }
.news-teaser-readmore { margin-top: var(--sp-sm); font-size: var(--fs-xs); }
.news-teaser-readmore .icon { width: 14px; height: 14px; }

.todo-row { display: flex; align-items: center; gap: var(--sp-md); padding: var(--sp-md) var(--sp-xl); border-bottom: 1px solid var(--border-tertiary); }
.todo-row:last-child { border-bottom: none; }
.todo-row .todo-check { flex-shrink: 0; margin: 0; width: 16px; height: 16px; accent-color: var(--btn-primary-bg); cursor: pointer; }
.todo-row .todo-row-text { flex: 1; min-width: 0; cursor: pointer; }
.todo-row .todo-row-title { display: block; font-weight: 600; font-size: var(--fs-sm); color: var(--text-primary); }
.todo-row .todo-row-sub { display: block; font-size: var(--fs-xs); color: var(--text-quaternary); margin-top: 2px; }
.todo-row .todo-check:checked + .todo-row-text .todo-row-title { text-decoration: line-through; }
.todo-row .todo-check:checked + .todo-row-text { opacity: .55; }
.todo-row .pill { flex-shrink: 0; text-decoration: none; }

/* To-do checklist card (Figma node 3830:19122): the 5px coloured left border is an agreed exception to the
   no-side-stripe guidance — see _docs/ux-entscheidungen.md. */
.card-todo-checklist { border-left: 5px solid var(--error-500); }

/* Hierarchical rows (pattern_data_table v1.16) for the GLN hierarchy in contact-details.html: depth via --row-depth
   (0 = root), 24px per level from level 2 on, CSS-only L-connector. */
.row-indent { display: flex; align-items: center; padding-left: max(0px, calc((var(--row-depth, 0) - 1) * 24px)); }
.row-connector { display: inline-block; width: 14px; height: 10px; border-left: 1px solid var(--border-primary); border-bottom: 1px solid var(--border-primary); margin: -6px 10px 0 4px; flex-shrink: 0; }
.row-root { font-weight: 600; }

/* ==========================================================================
   CAR-897 Audit Trail & Exports. Only compositions of existing tokens; no new colors or components.
   ========================================================================== */
.radio-card.is-soon { cursor: default; opacity: .6; }
.radio-card.is-soon:hover { border-color: var(--border-primary); background: var(--bg-primary); }
.audit-table-scroll { overflow-x: auto; }
.audit-table-scroll .data-table { min-width: 1060px; }
.audit-table-scroll .data-table th, .audit-table-scroll .data-table td { padding-left: var(--sp-lg); padding-right: var(--sp-lg); }
.audit-table-scroll .data-table td { vertical-align: top; }
.audit-ts { white-space: nowrap; }
.audit-ts .sub, .audit-cell .sub { display: block; font-size: var(--fs-xs); color: var(--text-quaternary); }
.audit-change { display: inline-flex; align-items: center; gap: var(--sp-xs); flex-wrap: wrap; font-size: var(--fs-xs); color: var(--text-tertiary); }
.audit-change .icon { width: 14px; height: 14px; color: var(--fg-quaternary); }
.audit-change strong { color: var(--text-primary); font-weight: 600; }
.audit-ref { font-size: var(--fs-xs); color: var(--text-tertiary); overflow-wrap: anywhere; }
.audit-ref.mono { font-family: var(--font-mono); word-break: break-all; }
.slideover.slideover-wide { width: 520px; right: -540px; }
.slideover.slideover-wide.open { right: 0; }
.audit-change-block { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--sp-md); align-items: center; }
.audit-change-block > div { border: 1px solid var(--border-secondary); border-radius: var(--r-md); padding: var(--sp-md) var(--sp-lg); }
.audit-change-block .k { display: block; font-size: var(--fs-xs); color: var(--text-quaternary); margin-bottom: 2px; }
.audit-change-block .v { font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); }
.audit-link-list { display: flex; flex-direction: column; gap: var(--sp-sm); }
.pit-result { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-lg); margin-top: var(--sp-lg); }
@media (max-width: 720px) { .pit-result, .audit-change-block { grid-template-columns: 1fr; } }
.slideover .kv-row .v a { color: var(--brand-700); }
.slideover .kv-row .v a:hover { text-decoration: underline; }

/* KPI tiles as links (stretched link): <a class="tile-link"> covers the tile via ::after, info-tips sit above it;
   focus ring on the tile. */
.metric-tile.clickable { position: relative; }
.metric-tile .tile-link { color: inherit; text-decoration: none; }
.metric-tile .tile-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.metric-tile .tile-link:focus-visible { outline: none; }
.metric-tile.clickable:has(.tile-link:focus-visible) { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
.metric-tile .info-tip { z-index: 1; }
