﻿/*
  VEFKapp Design System
  UI-Größen bitte ausschließlich über diese Tokens oder die zentralen App-Komponenten ändern.
  Diese Datei ist additiv und greift bewusst defensiv, damit bestehende Fachlogik und PDF-Ausgaben unverändert bleiben.
*/
:root {
  color-scheme: dark;
  --app-font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  --app-accent: #f5a400;
  --app-accent-strong: #ffbf2f;
  --app-bg: #050505;
  --app-surface: rgba(10, 10, 8, 0.94);
  --app-surface-raised: linear-gradient(145deg, rgba(27, 23, 13, 0.96), rgba(4, 4, 4, 0.96));
  --app-text: #fff8e8;
  --app-text-muted: rgba(255, 248, 232, 0.72);
  --app-border: rgba(245, 164, 0, 0.42);
  --app-border-soft: rgba(245, 164, 0, 0.24);
  --app-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
  --app-glow: 0 0 20px rgba(245, 164, 0, 0.18);

  --app-text-xs: calc(0.66rem * var(--hub-ui-scale, 1));
  --app-text-sm: calc(0.76rem * var(--hub-ui-scale, 1));
  --app-text-md: calc(0.88rem * var(--hub-ui-scale, 1));
  --app-text-lg: calc(1.02rem * var(--hub-ui-scale, 1));
  --app-text-xl: calc(1.22rem * var(--hub-ui-scale, 1));
  --app-text-title: calc(1.58rem * var(--hub-ui-scale, 1));

  --app-space-1: 4px;
  --app-space-2: 8px;
  --app-space-3: 12px;
  --app-space-4: 16px;
  --app-space-5: 20px;
  --app-space-6: 24px;

  --app-radius-sm: 8px;
  --app-radius-md: 12px;
  --app-radius-lg: 16px;
  --app-icon-sm: calc(18px * var(--hub-ui-scale, 1));
  --app-icon-md: calc(24px * var(--hub-ui-scale, 1));
  --app-icon-lg: calc(38px * var(--hub-ui-scale, 1));
  --app-button-height: calc(38px * var(--hub-ui-scale, 1));
  --app-button-height-sm: calc(32px * var(--hub-ui-scale, 1));
  --app-header-height: clamp(58px, 8vw, 96px);
  --app-sidebar-width: clamp(190px, 18vw, 224px);
}

html { font-family: var(--app-font-family); }
body { font-family: var(--app-font-family); }

.app-card,
.hub-shell-card,
.hub-app-context-row,
.audit-shell-frame-card {
  border-radius: var(--app-radius-lg);
  border-color: var(--app-border-soft);
}

.app-section-title {
  margin: 0 0 var(--app-space-3);
  color: var(--app-text);
  font-size: var(--app-text-xl);
  line-height: 1.15;
  font-weight: 850;
}

.app-empty-state {
  padding: var(--app-space-5);
  border: 1px dashed var(--app-border);
  border-radius: var(--app-radius-md);
  background: rgba(245, 164, 0, 0.07);
  color: var(--app-text-muted);
}

button,
.button,
.primary,
.secondary,
.primary-button,
.secondary-button,
.hub-nav-item,
.nav-item {
  font-family: var(--app-font-family);
}

.primary,
.secondary,
.primary-button,
.secondary-button,
.app-primary-button,
.app-secondary-button {
  min-height: var(--app-button-height-sm);
  border-radius: var(--app-radius-sm);
  font-size: var(--app-text-sm);
}

.hub-shell-navigation,
.audit-shell-sidebar,
.sidebar {
  width: var(--app-sidebar-width);
}

.hub-nav-item,
.nav-item {
  min-height: calc(42px * var(--hub-ui-scale, 1));
  border-radius: var(--app-radius-md);
  font-size: var(--app-text-sm);
}

.hub-nav-item .icon,
.nav-item .icon {
  width: var(--app-icon-md);
  height: var(--app-icon-md);
  flex: 0 0 var(--app-icon-md);
}

.topbar,
.hub-shell-header,
.app-shell-header {
  min-height: var(--app-header-height);
  border-radius: var(--app-radius-lg);
}

input,
select,
textarea {
  font-family: var(--app-font-family);
  font-size: var(--app-text-sm);
}

@media (max-width: 760px) {
  :root {
    --app-sidebar-width: 72px;
    --app-header-height: clamp(56px, 14vw, 82px);
    --app-button-height: 36px;
    --app-button-height-sm: 32px;
  }
  .hub-nav-item,
  .nav-item { min-height: 40px; }
}

/* 2026-06-06: verbindlicher Groessenvertrag fuer Hub und App-Inhalte. */
@media screen {
  :where(.view, .app-view, .content, .main-content, .dashboard, .page-content) {
    gap: var(--app-space-3);
  }

  :where(.panel, .card, .metric, .tile, .table-wrap, .section, .app-card, .dashboard-card, .customer-card) {
    border-radius: var(--app-radius-md);
  }

  :where(.panel, .card, .metric, .tile, .table-wrap, .section, .app-card, .dashboard-card, .customer-card):not(.report-page *) {
    padding: var(--app-space-3);
  }

  :where(h1):not(.report-page h1) {
    font-size: var(--app-text-title);
    line-height: 1.08;
  }

  :where(h2):not(.report-page h2) {
    font-size: var(--app-text-xl);
    line-height: 1.12;
  }

  :where(h3):not(.report-page h3) {
    font-size: var(--app-text-lg);
    line-height: 1.18;
  }

  :where(p, label, td, th, li, input, select, textarea):not(.report-page *) {
    font-size: var(--app-text-sm);
  }

  :where(small, .muted, .muted-text, .hint, .eyebrow):not(.report-page *) {
    font-size: var(--app-text-xs);
  }

  :where(.metrics-grid, .dashboard-metrics, .stat-grid) {
    gap: var(--app-space-2);
  }

  :where(.metric, .stat-card, .summary-card):not(.report-page *) {
    min-height: calc(74px * var(--hub-ui-scale, 1));
  }

  :where(.metric strong, .stat-card strong, .summary-card strong):not(.report-page *) {
    font-size: calc(1.45rem * var(--hub-ui-scale, 1));
    line-height: 1.04;
  }

  :where(.table, table):not(.report-page table) th,
  :where(.table, table):not(.report-page table) td {
    padding: var(--app-space-2) var(--app-space-3);
  }

  :where(button, .button, .primary, .secondary, .primary-button, .secondary-button):not(.report-page *) {
    min-height: var(--app-button-height-sm);
    padding: 0 var(--app-space-3);
    line-height: 1.15;
  }

  :where(input, select):not(.report-page *) {
    min-height: var(--app-button-height-sm);
  }

  :where(textarea):not(.report-page *) {
    min-height: calc(72px * var(--hub-ui-scale, 1));
  }

  :where(.app-brand-icon svg, .brand-logo svg, .icon svg):not(.report-page *) {
    max-width: var(--app-icon-lg);
    max-height: var(--app-icon-lg);
  }
}

/* 2026-06-06: harte Groessen-Sperre fuer normale App-Oberflaechen.
   Nicht fuer PDF-/Reportseiten verwenden. */
@media screen {
  body:not(.print-mode) :is(.panel, .card, .metric, .tile, .table-wrap, .section, .app-card, .dashboard-card, .customer-card, .audit-point):not(.report-page *) {
    padding: var(--app-space-3) !important;
    border-radius: var(--app-radius-md) !important;
  }

  body:not(.print-mode) :is(h1):not(.report-page *) {
    font-size: var(--app-text-title) !important;
    line-height: 1.08 !important;
  }

  body:not(.print-mode) :is(h2):not(.report-page *) {
    font-size: var(--app-text-xl) !important;
    line-height: 1.12 !important;
  }

  body:not(.print-mode) :is(h3):not(.report-page *) {
    font-size: var(--app-text-lg) !important;
    line-height: 1.18 !important;
  }

  body:not(.print-mode) :is(p, label, td, th, li, input, select, textarea, button):not(.report-page *) {
    font-size: var(--app-text-sm) !important;
  }

  body:not(.print-mode) :is(small, .muted, .muted-text, .hint, .eyebrow, .status-chip, .result-pill, .priority-chip):not(.report-page *) {
    font-size: var(--app-text-xs) !important;
  }

  body:not(.print-mode) :is(.metrics-grid, .dashboard-metrics, .stat-grid, .dashboard-grid):not(.report-page *) {
    gap: var(--app-space-2) !important;
  }

  body:not(.print-mode) :is(.metric, .stat-card, .summary-card):not(.report-page *) {
    min-height: calc(68px * var(--hub-ui-scale, 1)) !important;
  }

  body:not(.print-mode) :is(.metric strong, .stat-card strong, .summary-card strong):not(.report-page *) {
    font-size: calc(1.32rem * var(--hub-ui-scale, 1)) !important;
    line-height: 1.02 !important;
  }

  body:not(.print-mode) :is(.topbar, .hub-shell-header, .app-shell-header, .audit-page-header):not(.report-page *) {
    min-height: var(--app-header-height) !important;
  }

  body:not(.print-mode) :is(.hub-shell-navigation, .audit-shell-sidebar, .sidebar):not(.report-page *) {
    width: var(--app-sidebar-width) !important;
  }

  body:not(.print-mode) :is(.hub-nav-item, .nav-item):not(.report-page *) {
    min-height: calc(40px * var(--hub-ui-scale, 1)) !important;
    font-size: var(--app-text-sm) !important;
    border-radius: var(--app-radius-md) !important;
  }

  body:not(.print-mode) :is(button, .button, .primary, .secondary, .primary-button, .secondary-button):not(.report-page *) {
    min-height: var(--app-button-height-sm) !important;
    border-radius: var(--app-radius-sm) !important;
    padding: 0 var(--app-space-3) !important;
  }

  body:not(.print-mode) :is(input, select):not(.report-page *) {
    min-height: var(--app-button-height-sm) !important;
  }
}

/* 2026-06-06: mobile App-Shell-Navigation darf nicht auf Icon-Breite kollabieren. */
@media screen and (max-width: 760px) {
  body.hub-shell-ready[class*="-shell"]:not(.print-mode) :is(.hub-shell-navigation, .audit-shell-sidebar, .sidebar):not(.report-page *) {
    width: auto !important;
    max-width: none !important;
  }

  body.hub-shell-ready[class*="-shell"]:not(.print-mode) [class$="-shell-nav"] {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  body.hub-shell-ready[class*="-shell"]:not(.print-mode) .hub-nav-item:not(.report-page *) {
    width: 100% !important;
    justify-content: flex-start !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    gap: 7px !important;
    padding-inline: 8px !important;
  }

  body.hub-shell-ready[class*="-shell"]:not(.print-mode) .hub-nav-item .icon {
    flex: 0 0 24px !important;
    width: 24px !important;
    height: 24px !important;
  }
}



