  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

  :root {
    /* Brand */
    --brand:          #2563eb;
    --brand-dark:     #1d4ed8;
    --brand-light:    #eff6ff;
    --brand-mid:      #dbeafe;

    /* Surface */
    --surface:        #ffffff;
    --surface-alt:    #f7f8fa;
    --surface-raised: #ffffff;

    /* Border */
    --border:         rgba(0,0,0,0.07);
    --border-mid:     rgba(0,0,0,0.12);
    --border-strong:  rgba(0,0,0,0.18);

    /* Text */
    --text:           #0d1117;
    --text-secondary: #57606a;
    --text-muted:     #8b949e;

    /* Semantic — softer tones */
    --green:          #1a7f37;
    --green-bg:       #dafbe1;
    --green-border:   #aceebb;
    --red:            #cf222e;
    --red-bg:         #ffebe9;
    --red-border:     #ffcecb;
    --amber:          #9a6700;
    --amber-bg:       #fff8c5;
    --amber-border:   #e9c46a;
    --indigo:         #4f46e5;
    --indigo-bg:      #eef2ff;
    --indigo-border:  #c7d2fe;
    --blue:           #1e40af;
    --blue-bg:        #eff6ff;
    --blue-border:    #bfdbfe;

    /* Sidebar */
    --sidebar-bg:     #0d1117;
    --sidebar-text:   rgba(255,255,255,0.55);
    --sidebar-active-bg: rgba(255,255,255,0.09);
    --sidebar-hover:  rgba(255,255,255,0.05);
    --sidebar-border: rgba(255,255,255,0.07);

    /* Radius */
    --radius-sm:      7px;
    --radius:         10px;
    --radius-lg:      13px;

    /* Shadow — very subtle */
    --shadow-xs:      0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm:      0 1px 4px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow:         0 4px 12px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.05);
    --shadow-lg:      0 16px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.07);

    /* 8px Grid System — Spacing Scale */
    --space-0-5: 4px;   /* 0.5 × 8px */
    --space-1:   8px;   /* 1 × 8px */
    --space-1-5: 12px;  /* 1.5 × 8px */
    --space-2:   16px;  /* 2 × 8px */
    --space-2-5: 20px;  /* 2.5 × 8px */
    --space-3:   24px;  /* 3 × 8px */
    --space-4:   32px;  /* 4 × 8px */
    --space-5:   40px;  /* 5 × 8px */
    --space-6:   48px;  /* 6 × 8px */
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--surface-alt);
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
    height: 100vh;
    display: flex;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  /* -----------------------------------------------------------
    # SIDEBAR
  ----------------------------------------------------------- */
  .sidebar {
    width: 216px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    /* Wichtig: Padding für fixed Footer kompensieren */
    padding-bottom: 60px;
    transition: width 0.18s ease;
  }
  /* Sidebar Toggle Button — ChatGPT-Style: im header neben Logo */
  .sidebar-toggle {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: rgba(255,255,255,0.45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.14s, color 0.14s;
    flex-shrink: 0;
    padding: 0;
  }
  .sidebar-toggle:hover {
    background: var(--sidebar-hover);
    color: rgba(255,255,255,0.9);
  }

  .sidebar-header {
    padding: 14px 14px 14px 16px;
    border-bottom: 1px solid var(--sidebar-border);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .sidebar-header-logo {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
  }
  .logo {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.4px;
    margin-bottom: 2px;
    display: flex;
    align-items: baseline;
    gap: 1px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
  }
  .logo-main {
    color: #fff;
  }
  .logo-accent {
    color: #60a5fa;
    font-weight: 600;
  }
  .logo-sub {
    font-size: 10px;
    color: rgba(255,255,255,0.3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
  }

  /* Collapsed Sidebar */
  .sidebar.collapsed {
    width: 72px;
  }
  .sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 14px 8px;
  }
  .sidebar.collapsed .sidebar-header-logo,
  .sidebar.collapsed .nav-group-label,
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .nav-badge,
  .sidebar.collapsed .sidebar-bottom {
    display: none;
  }
  .sidebar.collapsed .nav-item {
    justify-content: center;
    width: 56px;
    margin: 4px auto;
    padding: 12px 10px;
  }
  .sidebar.collapsed .nav-icon {
    margin: 0;
  }
  .sidebar.collapsed .sidebar-toggle {
    width: 40px;
    height: 40px;
    border: 1px solid var(--sidebar-border);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.78);
  }
  .sidebar.collapsed .sidebar-toggle:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
  }
  .sidebar.collapsed .nav-item.active::before {
    left: 0;
    top: 8px;
    bottom: 8px;
  }

  .nav-group-label {
    display: block;
    padding: 10px 16px 4px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.3);
    user-select: none;
  }
  .sidebar-divider {
    height: 1px;
    background: var(--sidebar-border);
    margin: 8px 14px;
    flex-shrink: 0;
  }
  .sidebar.collapsed .sidebar-divider {
    display: none;
  }
  .nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px 7px 14px;
    margin: 1px 7px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--sidebar-text);
    transition: background 0.14s, color 0.14s;
    user-select: none;
    font-weight: 400;
    position: relative;
    letter-spacing: -0.02em;
  }
  .nav-item:hover {
    background: var(--sidebar-hover);
    color: rgba(255,255,255,0.82);
  }
  .nav-item.active {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.95);
    font-weight: 500;
  }
  .nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 5px; bottom: 5px;
    width: 2.5px;
    border-radius: 2px;
    background: var(--brand);
  }
  .nav-icon {
    font-size: 13px;
    width: 17px;
    text-align: center;
    opacity: 0.5;
    flex-shrink: 0;
    transition: opacity 0.12s;
  }
  .nav-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .nav-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    padding: 2px 7px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(239,68,68,0.18);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
    flex-shrink: 0;
  }
  .nav-badge[data-severity="warn"] {
    background: rgba(245,158,11,0.18);
    border-color: rgba(245,158,11,0.28);
  }
  .nav-badge[data-severity="critical"] {
    background: rgba(239,68,68,0.22);
    border-color: rgba(239,68,68,0.34);
  }
  .nav-item:hover .nav-icon, .nav-item.active .nav-icon { opacity: 0.9; }
  .sidebar-bottom {
    margin-top: auto;
    padding: 16px 12px 20px 12px;
    border-top: 1px solid var(--sidebar-border);
    background: var(--sidebar-bg);
  }

  .mandant-portal-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 11px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    text-decoration: none;
    transition: background 0.12s;
    margin-bottom: 8px;
  }
  .mandant-portal-link:hover { background: rgba(255,255,255,0.10); }
  .mandant-portal-icon {
    flex-shrink: 0;
    opacity: 0.85;
    color: #fff;
  }
  .mandant-portal-icon svg {
    stroke: #fff;
  }
  .mandant-portal-label { font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.75); }
  .mandant-portal-sub { font-size: 10px; color: rgba(255,255,255,0.3); margin-top: 1px; }

  /* -----------------------------------------------------------
    # EINSTELLUNGEN TABS
  ----------------------------------------------------------- */
  .settings-header { margin-bottom: 20px; }
  .settings-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 32px; }
  .settings-tab { padding: 8px 16px; border: none; background: transparent; font-size: 13px; font-weight: 400; cursor: pointer; color: var(--text-secondary); transition: color 0.15s; font-family: inherit; border-bottom: 2px solid transparent; margin-bottom: -1px; letter-spacing: -0.01em; }
  .settings-tab:hover { color: var(--text); }
  .settings-tab.active { color: var(--brand); font-weight: 500; border-bottom-color: var(--brand); }
  .settings-tab-content { display: none; }
  .settings-tab-content.active { display: block; }
  .settings-field { display: flex; flex-direction: column; gap: 5px; }
  .settings-label { font-size: 11px; color: var(--text-secondary); font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; }
  .settings-input { height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; background: var(--surface); color: var(--text); outline: none; transition: border-color 0.15s, box-shadow 0.15s; width: 100%; }
  .settings-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
  .settings-input-readonly { background: var(--surface-alt); color: var(--text-secondary); cursor: default; }
  .btn-save-apple { background: var(--brand); color: #fff; border: none; border-radius: 8px; padding: 8px 20px; font-size: 13px; font-weight: 500; cursor: pointer; font-family: inherit; letter-spacing: -0.01em; transition: background 0.15s; width: auto; align-self: flex-end; }
  .btn-save-apple:hover { background: var(--brand-dark); }

  /* -----------------------------------------------------------
    # HAUPTBEREICH & SEITEN-SYSTEM
  ----------------------------------------------------------- */
  .main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

  /* Auth-Guard: App-Shell erst nach erfolgreicher Auth einblenden.
     Verhindert dass das Overlay per DevTools weggblendet werden kann
     und der App-Inhalt sichtbar wird. */
  body.app-loading .sidebar,
  body.app-loading .main { visibility: hidden; pointer-events: none; }
  body:has(.auth-overlay.show) .sidebar,
  body:has(.auth-overlay.show) .main { visibility: hidden; pointer-events: none; }
  body:has(.auth-overlay.show) .auth-overlay { visibility: visible; pointer-events: auto; }
  body.kb-welcoming .sidebar,
  body.kb-welcoming .main { visibility: hidden; pointer-events: none; }
  body.app-loading .auth-overlay { visibility: visible; pointer-events: auto; }
  @keyframes pageFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
  .page { display: none; flex: 1; overflow: hidden; }
  .page.active { display: flex; flex-direction: column; animation: pageFadeIn 0.22s ease forwards; }

  /* -----------------------------------------------------------
    # TOPBAR
  ----------------------------------------------------------- */
  .topbar {
    padding: 0 28px;
    height: 52px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .topbar-title {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
  }
  .topbar-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
  }
  .topbar-date {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-top: 1px;
    letter-spacing: -0.3px;
  }

  /* Status-Pills: Professional, subtle - only show when needed */
  .status-pills { display: flex; gap: 8px; align-items: center; }
  .pill {
    font-size: 11.5px;
    padding: 4px 11px;
    border-radius: 20px;
    font-weight: 500;
    letter-spacing: -0.01em;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.18s ease;
  }
  .pill-dot {
    width: 5.5px;
    height: 5.5px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.2);
  }
  /* Alert - needs attention */
  .pill-alert {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
  }
  .pill-alert .pill-dot { background: #dc2626; }
  /* Action - requires action */
  .pill-action {
    background: #fff7ed;
    color: #9a3412;
    border-color: #fed7aa;
  }
  .pill-action .pill-dot { background: #f97316; }
  /* Legacy classes for compatibility */
  .pill-red   { background: var(--red-bg);   color: var(--red);   border-color: var(--red-border); }
  .pill-amber { background: #fff7ed;       color: #9a3412;     border-color: #fed7aa; }
  .pill-green { background: #f0fdf4;      color: #166534;     border-color: #bbf7d0; }

  /* -----------------------------------------------------------
    # SPLIT-LAYOUT
  ----------------------------------------------------------- */
  .split { display: flex; flex: 1; overflow: hidden; }

  /* Left panel: clearly defined white panel — not toter Raum */
  .left-panel {
    width: 268px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    background: var(--surface);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }

  .list-section-label {
    font-size: 9px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 16px 14px 4px;
    opacity: 0.6;
  }

  .mandant-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.12s, border-left-color 0.12s;
    border-left: 2.5px solid transparent;
  }
  .mandant-item:hover { background: var(--surface-alt); }
  .mandant-item.active { background: var(--brand-light); border-left-color: var(--brand); }
  .mandant-item.urgent   { border-left-color: var(--red); }
  .mandant-item.pending  { border-left-color: var(--amber); }
  .mandant-item.done-item{ border-left-color: var(--green); opacity: 0.7; }
  .mandant-item.done-item:hover { opacity: 1; }

  .avatar { width: 34px; height: 34px; border-radius: 9px; background: var(--brand-mid); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; color: var(--brand); flex-shrink: 0; letter-spacing: -0.02em; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
  .avatar-red   { background: var(--red-bg);   color: var(--red); }
  .avatar-green { background: var(--green-bg); color: var(--green); }
  .avatar-gray  { background: var(--surface-alt); color: var(--text-muted); }

  .item-info { flex: 1; min-width: 0; }
  .item-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; color: var(--text); }
  .item-sub  { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .item-badge { font-size: 10px; padding: 2px 8px; border-radius: 5px; font-weight: 600; flex-shrink: 0; letter-spacing: 0.01em; }
  .ib-red   { background: var(--red);          color: #fff; }
  .ib-amber { background: var(--amber);        color: #fff; }
  .ib-green { background: var(--green);        color: #fff; }
  .ib-gray  { background: var(--border-mid);   color: var(--text-secondary); }

  .right-panel {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px 70px 28px; /* Extra padding für Footer */
    background: var(--surface-alt);
  }
  /* Stripe-principle: constrain content width for readability */
  .right-panel-inner {
    max-width: 860px;
    margin: 0 auto;
  }

  .today-empty-shell {
    min-height: clamp(320px, calc(100vh - 176px), 520px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
  }

  .admin-empty-state {
    width: min(520px, 100%);
    padding: 40px 32px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-xs);
  }

  .admin-empty-state--compact {
    width: 100%;
    padding: 32px 24px;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .admin-table-empty-row td {
    padding: 24px !important;
    border-bottom: 0 !important;
    background: transparent;
  }

  .admin-table-empty-row .admin-empty-state,
  .audit-list > .admin-empty-state {
    margin: 0 auto;
  }

  .tp-empty-state {
    padding: 24px 20px;
  }

  .admin-empty-state-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    color: var(--text-muted);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
  }

  .admin-empty-state-title {
    font-size: 15px;
    line-height: 1.35;
    font-weight: 650;
    color: var(--text);
    margin-bottom: 8px;
  }

  .admin-empty-state-text {
    max-width: 360px;
    margin: 0 auto;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-secondary);
  }

  .today-empty-list {
    margin: 12px 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-alt);
  }

  .today-empty-list-title {
    font-size: 13px;
    line-height: 1.35;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
  }

  .today-empty-list-text {
    font-size: 11px;
    line-height: 1.45;
    color: var(--text-muted);
  }

  /* ── HEUTE EMPTY STATES — elegant fade-in ── */
  @keyframes heute-empty-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Left panel empty */
  .heute-empty-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px;
    text-align: center;
    animation: heute-empty-in 0.4s ease 0.1s both;
  }

  .heute-empty-left-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    margin-bottom: 4px;
  }

  .heute-empty-left-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
  }

  .heute-empty-left-text {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 160px;
  }

  /* Right panel empty */
  .heute-empty-right {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: clamp(320px, calc(100vh - 176px), 520px);
    padding: 48px 32px;
    animation: heute-empty-in 0.5s ease 0.2s both;
  }

  .heute-empty-right-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 340px;
    gap: 12px;
  }

  .heute-empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.05), 0 4px 16px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    margin-bottom: 4px;
  }

  .heute-empty-title {
    font-size: 17px;
    font-weight: 650;
    color: var(--text);
    letter-spacing: -0.025em;
    line-height: 1.25;
  }

  .heute-empty-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
  }

  .heute-empty-hint {
    font-size: 11px;
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    margin-top: 4px;
  }

  /* Dark mode */
  [data-theme="dark"] .heute-empty-left-icon,
  [data-theme="dark"] .heute-empty-icon {
    background: #1e293b;
    border-color: #334155;
  }

  [data-theme="dark"] .heute-empty-hint {
    background: #111827;
    border-color: #334155;
    color: #64748b;
  }

  [data-theme="dark"] .heute-empty-title { color: #f1f5f9; }
  [data-theme="dark"] .heute-empty-text  { color: #94a3b8; }
  [data-theme="dark"] .heute-empty-left-title { color: #f1f5f9; }
  [data-theme="dark"] .heute-empty-left-text  { color: #64748b; }

  /* -----------------------------------------------------------
    # DETAIL-KARTE
  ----------------------------------------------------------- */
  .detail-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
    overflow: hidden;
    margin-bottom: 14px;
    transition: box-shadow 0.2s;
  }
  .detail-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    background: var(--surface);
  }
  .detail-name { font-size: 15px; font-weight: 700; margin-bottom: 3px; color: var(--text); }
  .detail-meta { font-size: 11px; color: var(--text-muted); }

  /* -----------------------------------------------------------
    # BUTTONS
  ----------------------------------------------------------- */
  .btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 13px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border-mid);
    background: var(--surface);
    color: var(--text-secondary);
    transition: background 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s, transform 0.08s;
    font-family: inherit;
    white-space: nowrap;
    letter-spacing: -0.015em;
    line-height: 1.4;
  }
  .btn:hover {
    background: var(--surface-alt);
    border-color: var(--border-strong);
    color: var(--text);
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  }
  .btn:active { transform: scale(0.97); }
  .btn:disabled {
    cursor: not-allowed;
    opacity: 0.48;
    box-shadow: none;
    transform: none;
  }

  /* Primary = einziger farbiger CTA */
  .btn-primary {
    background: var(--brand);
    color: #fff;
    border-color: transparent;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(37,99,235,0.18), 0 2px 6px rgba(37,99,235,0.15);
  }
  .btn-primary:hover {
    background: var(--brand-dark);
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(37,99,235,0.28);
  }

  /* Secondary = Ghost/Outline — tritt zurück */
  .btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-mid);
  }
  .btn-secondary:hover {
    background: var(--surface-alt);
    color: var(--text);
  }

  .btn-row { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }

  .pruef-tab { padding: 5px 13px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); font-size: 12px; font-weight: 500; cursor: pointer; color: var(--text-secondary); transition: all 0.12s; }
  .pruef-tab:hover { background: var(--brand-light); color: var(--brand); border-color: var(--brand); }
  .pruef-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

  .ai-banner { margin: 14px 20px 0; padding: 10px 14px; background: var(--brand-light); border: 1px solid var(--brand-mid); border-radius: var(--radius-sm); font-size: 12px; color: var(--brand); font-weight: 500; }

  /* Dokumenten-Liste in der Detail-Karte */
  .doc-list { padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; }

  /* -----------------------------------------------------------
    # REVIEW-GRID
  ----------------------------------------------------------- */
  .review-grid { margin: 14px 20px 0; display: grid; grid-template-columns: 1.05fr 1fr; gap: 12px; }
  .review-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 14px; }
  .review-title { font-size: 12px; font-weight: 600; margin-bottom: 8px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
  .beleg-preview { border: 1px dashed var(--border-mid); border-radius: var(--radius-sm); min-height: 220px; background: var(--brand-light); padding: 10px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-secondary); }
  .line-muted { color: var(--text-muted); font-size: 11px; }

  .review-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .review-fields label { margin-top: 0; }
  .review-fields .full { grid-column: 1 / -1; }

  .focus-note { margin: 8px 20px 0; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--amber-border); border-left: 3px solid var(--amber); background: var(--surface-alt); color: var(--text); font-size: 12px; }
  .info-dot { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 100%; border: 1px solid var(--amber); font-size: 10px; font-weight: 700; margin-left: 5px; }

  /* -----------------------------------------------------------
    # DOKUMENT-ZEILEN
  ----------------------------------------------------------- */
  .doc-list { padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; }
  .doc-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 13px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    border-left: 2px solid transparent;
    transition: background 0.1s, box-shadow 0.1s;
  }
  .doc-row:hover { background: var(--surface-alt); box-shadow: var(--shadow-xs); }
  /* received: soft green tint, not bright */
  .doc-row.received {
    border-color: var(--green-border);
    border-left-color: var(--green);
    background: rgba(26, 127, 55, 0.04);
  }
  .doc-row.received:hover { background: rgba(26, 127, 55, 0.07); }
  .doc-row.opt-missing { border-color: var(--border); background: var(--surface-alt); opacity: 0.5; }
  .doc-icon   {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text-secondary);
  }
  .doc-row.received .doc-icon {
    background: rgba(26,127,55,0.07);
    border-color: var(--green-border);
    color: var(--green);
  }
  .doc-info   { flex: 1; }
  .doc-title  { font-size: 13px; font-weight: 600; color: var(--text); }
  .doc-sub    { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
  .doc-amount      { font-size: 14px; font-weight: 700; text-align: right; color: var(--text); }
  .doc-amount-gray { color: var(--text-muted); }
  .doc-amount-inline {
    float: right;
    font-size: 12px;
    font-weight: 700;
    color: var(--green);
    background: rgba(26, 127, 55, 0.10);
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
  }
  .doc-row.received .doc-amount-inline { color: var(--green); }
  .doc-time-badge {
    float: right;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(100, 116, 139, 0.15);
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: 6px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    letter-spacing: -0.01em;
  }
  .doc-check  {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
  }
  .check-ok   { color: var(--green);   background: rgba(26,127,55,0.1); }
  .check-no   { color: var(--text-muted); background: var(--surface-alt); border: 1px solid var(--border); font-size: 11px; }

  /* Banners: soft background, subtle border — reads but doesn't shout */
  .closed-banner {
    margin: 14px 18px 18px;
    padding: 12px 16px;
    background: var(--surface-alt);
    border: 1px solid var(--border-mid);
    border-left: 3px solid var(--green);
    border-radius: var(--radius);
  }
  .closed-title { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
  .closed-sub   { font-size: 11px; color: var(--text-secondary); }

  .pending-banner {
    margin: 14px 18px 18px;
    padding: 12px 16px;
    background: var(--surface-alt);
    border: 1px solid var(--border-mid);
    border-left: 3px solid var(--amber);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .pending-title { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
  .pending-sub   { font-size: 11px; color: var(--text-secondary); }

  /* -----------------------------------------------------------
    # SCROLL-PAGE
  ----------------------------------------------------------- */
  .scroll-page { flex: 1; overflow-y: auto; padding: 28px 32px 70px 32px; /* Extra padding für Footer */ }
  .scroll-inner { max-width: 960px; margin: 0 auto; }
  .page-title { font-size: 20px; font-weight: 600; margin-bottom: 4px; letter-spacing: -0.4px; }
  .page-sub   { font-size: 12px; color: var(--text-muted); margin-bottom: 24px; }

  /* -----------------------------------------------------------
    # KASSENBUCH-WORKFLOW
  ----------------------------------------------------------- */
  #page-kassenbuch .scroll-inner {
    max-width: 1040px;
  }

  .kb-flow-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: start;
    padding: 24px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(37,99,235,0.08), rgba(37,99,235,0.02)), var(--surface);
    box-shadow: var(--shadow-sm);
  }

  .kb-eyebrow {
    margin-bottom: 8px;
    color: var(--brand);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
  }

  .kb-flow-copy h1 {
    margin: 0;
    color: var(--text);
    font-size: 24px;
    font-weight: 750;
    line-height: 1.18;
    letter-spacing: 0;
  }

  .kb-flow-copy p {
    max-width: 660px;
    margin: 10px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
  }

  .kb-flow-state {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    min-width: 190px;
  }

  .kb-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--green-border);
    background: var(--green-bg);
    color: var(--green);
    font-size: 12px;
    font-weight: 700;
  }

  .kb-status-pill[data-state="loading"] {
    border-color: var(--amber-border);
    background: var(--amber-bg);
    color: var(--amber);
  }

  .kb-status-pill[data-state="closed"] {
    border-color: var(--red-border);
    background: var(--red-bg);
    color: var(--red);
  }

  .kb-flow-context {
    color: var(--text-muted);
    font-size: 12px;
    text-align: right;
  }

  .kb-flow-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
  }

  .kb-flow-step {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 12px;
    min-height: 96px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--text-muted);
    transition: border-color 0.16s, background 0.16s, transform 0.16s, box-shadow 0.16s;
  }

  .kb-step-index {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid var(--border-mid);
    background: var(--surface-alt);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 750;
  }

  .kb-step-title {
    margin-bottom: 4px;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
  }

  .kb-step-text {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
  }

  .kb-flow-step[data-state="active"] {
    border-color: rgba(37,99,235,0.45);
    background: linear-gradient(180deg, rgba(37,99,235,0.10), rgba(37,99,235,0.03)), var(--surface);
    box-shadow: 0 8px 28px rgba(37,99,235,0.10);
    transform: translateY(-1px);
  }

  .kb-flow-step[data-state="active"] .kb-step-index {
    border-color: rgba(37,99,235,0.45);
    background: var(--brand);
    color: #fff;
  }

  .kb-flow-step[data-state="done"] {
    border-color: var(--green-border);
    background: linear-gradient(180deg, rgba(26,127,55,0.08), rgba(26,127,55,0.02)), var(--surface);
  }

  .kb-flow-step[data-state="done"] .kb-step-index {
    border-color: var(--green-border);
    background: var(--green-bg);
    color: var(--green);
  }

  .kb-control-panel {
    display: grid;
    gap: 16px;
    padding: 18px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }

  .kb-control-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(150px, 180px) minmax(260px, 1.35fr);
    gap: 16px;
    align-items: end;
  }

  .kb-control-field label {
    margin-top: 0;
  }

  .kb-control-field select,
  .kb-control-field input {
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-alt);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
  }

  .kb-control-field select:focus,
  .kb-control-field input:focus {
    border-color: var(--brand);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
  }

  .kb-next-action {
    min-height: 76px;
    padding: 14px 16px;
    border: 1px solid var(--border-mid);
    border-radius: var(--radius);
    background: var(--surface-alt);
  }

  .kb-next-action[data-state="attention"] {
    border-color: var(--amber-border);
    background: var(--amber-bg);
  }

  .kb-next-action[data-state="ready"] {
    border-color: rgba(37,99,235,0.35);
    background: rgba(37,99,235,0.08);
  }

  .kb-next-action[data-state="success"] {
    border-color: var(--green-border);
    background: var(--green-bg);
  }

  .kb-next-label,
  .kb-export-title {
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0;
  }

  .kb-next-title {
    color: var(--text);
    font-size: 14px;
    font-weight: 750;
    line-height: 1.3;
  }

  .kb-next-text,
  .kb-export-sub {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
  }

  .kb-action-row,
  .kb-export-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }

  .kb-export-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
  }

  .card { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04); overflow: hidden; margin-bottom: 14px; transition: box-shadow 0.2s; }
  .card-header { padding: 13px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: var(--surface); }
  .card-title  { font-size: 12px; font-weight: 600; color: var(--text); }

  .mandant-row { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--border); transition: background 0.1s; }
  .mandant-row:last-child { border-bottom: none; }
  .mandant-row:hover { background: var(--surface-alt); }

  .badge        { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; padding: 2px 9px; border-radius: 20px; font-weight: 600; border: 1px solid transparent; letter-spacing: 0.01em; }
  .badge-ok     { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
  .badge-warn   { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-border); }

  /* -----------------------------------------------------------
    # KASSENBUCH-TABELLE
  ----------------------------------------------------------- */
  .kb-table    { width: 100%; border-collapse: collapse; }
  .kb-table th { text-align: left; font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 10px 18px; border-bottom: 1px solid var(--border); background: var(--surface-alt); font-weight: 700; }
  .kb-table td { padding: 11px 18px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text); }
  .kb-table tr:last-child td { border-bottom: none; }
  .kb-table tr:nth-child(even) td { background: rgba(0,0,0,0.016); }
  .kb-table tr:hover td { background: var(--surface-alt); }
  .amount-neg { color: var(--red);   font-weight: 600; }
  .amount-pos { color: var(--green); font-weight: 600; }

  select, input[type=text], input[type=email], input[type=password], input[type=date] { padding: 7px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; font-family: inherit; background: var(--surface); color: var(--text); outline: none; transition: border-color 0.12s, box-shadow 0.12s; }
  select:focus, input[type=text]:focus, input[type=email]:focus, input[type=password]:focus, input[type=date]:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
  label { font-size: 11px; color: var(--text-secondary); display: block; margin-bottom: 4px; margin-top: 12px; font-weight: 500; }

  /* -----------------------------------------------------------
    # KENNZAHLEN-GRID
  ----------------------------------------------------------- */
  .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
  .metric       { background: var(--surface); border-radius: var(--radius-lg); padding: 18px 20px; border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04); transition: box-shadow 0.18s; }
  .metric:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.07), 0 8px 24px rgba(0,0,0,0.06); }
  .metric-label { font-size: 10px; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
  .metric-value { font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -0.7px; font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif; }

  .notice-box {
    background: var(--surface-alt);
    border: 1px solid var(--border-mid);
    border-left: 3px solid var(--amber);
    color: var(--text);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 12px;
    margin-bottom: 12px;
    font-weight: 500;
  }

  .toolbar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }

  /* -----------------------------------------------------------
    # AUDIT-TRAIL
  ----------------------------------------------------------- */
  .audit-card  { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-top: 14px; overflow: hidden; box-shadow: var(--shadow-sm); }
  .audit-head  { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: var(--surface-alt); }
  .audit-title { font-size: 12px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: 0.05em; }
  .audit-list  { max-height: 200px; overflow-y: auto; }
  .audit-item  { padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text); transition: background 0.1s; }
  .audit-item:hover { background: var(--surface-alt); }
  .audit-item:last-child { border-bottom: none; }
  .muted-mini  { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
  .lock-pill   { font-size: 10px; padding: 3px 9px; border-radius: 20px; font-weight: 700; background: var(--green); color: #fff; }

  /* -----------------------------------------------------------
    # MODAL
  ----------------------------------------------------------- */
  .modal-bg  { position: fixed; inset: 0; background: rgba(15,23,42,0.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
  .modal-bg.show { display: flex; }
  .modal-box { background: var(--surface); border-radius: 16px; max-width: 440px; width: 100%; padding: 26px; border: 1px solid var(--border); box-shadow: 0 24px 64px rgba(0,0,0,0.14), 0 4px 16px rgba(0,0,0,0.08); }
  .modal-title   { font-size: 17px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
  .modal-sub     { font-size: 12px; color: var(--text-secondary); margin-bottom: 16px; }
  .modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

  /* -----------------------------------------------------------
    # WELCOME SCREEN (Jarvis-Style Login Greeting)
  ----------------------------------------------------------- */
  @keyframes kbWelcomeIn  { from { opacity: 0; } to { opacity: 1; } }
  @keyframes kbWelcomeOut { from { opacity: 1; } to { opacity: 0; } }
  @keyframes kbBarFill    { from { width: 0; } to { width: 100%; } }
  @keyframes kbNamePulse  { 0%,100% { opacity:1; } 50% { opacity:0.7; } }

  #kb-welcome {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: #050c18;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: kbWelcomeIn 0.4s ease forwards;
  }
  #kb-welcome.kb-welcome-out { animation: kbWelcomeOut 0.6s ease forwards; }

  .kb-welcome-inner {
    text-align: center;
    max-width: 520px;
    padding: 0 32px;
  }
  .kb-welcome-status {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.25em;
    color: #3b82f6;
    text-transform: uppercase;
    margin-bottom: 28px;
    opacity: 0.8;
  }
  .kb-welcome-name {
    font-size: 36px;
    font-weight: 800;
    color: #f1f5f9;
    letter-spacing: -0.03em;
    line-height: 1.1;
    min-height: 44px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  }
  .kb-welcome-sub {
    font-size: 13px;
    color: #64748b;
    margin-top: 12px;
    letter-spacing: 0.04em;
    min-height: 20px;
    font-family: 'SF Mono', 'Fira Code', monospace;
  }
  .kb-welcome-bar {
    margin-top: 32px;
    height: 2px;
    background: #0f172a;
    border-radius: 2px;
    overflow: hidden;
  }
  .kb-welcome-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #1d4ed8, #60a5fa);
    width: 0;
    animation: kbBarFill 3.4s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
  }

  /* -----------------------------------------------------------
    # TOAST
  ----------------------------------------------------------- */
  @keyframes toastIn  { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes toastOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(12px); } }
  .toast { position: fixed; bottom: 24px; right: 24px; left: auto; transform: none; background: #0d1117; color: #f1f5f9; padding: 11px 18px; border-radius: 12px; font-size: 13px; z-index: 300; display: none; max-width: 360px; text-align: left; box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.2); font-weight: 500; border-left: 3px solid var(--brand); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); letter-spacing: -0.01em; }
  .toast.show { display: block; animation: toastIn 0.22s ease forwards; }
  .toast.toast-success { border-left-color: var(--green); }
  .toast.toast-error   { border-left-color: var(--red); background: #1e1e1e; }

  /* -----------------------------------------------------------
    # SITZUNGS-KARTE
  ----------------------------------------------------------- */
  .session-card   { padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); }
  .session-label  { font-size: 9px; color: rgba(255,255,255,0.25); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 6px; font-weight: 700; }
  .session-name   { font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.85); }
  .session-email  { font-size: 10px; color: rgba(255,255,255,0.35); margin-top: 2px; word-break: break-word; }
  .session-role   { font-size: 10px; color: rgba(99,152,255,0.9); margin-top: 4px; font-weight: 600; }
  .session-actions     { display: flex; gap: 5px; margin-top: 9px; }
  .session-actions .btn{ flex: 1; justify-content: center; font-size: 11px; padding: 5px 10px; }
  .session-actions .btn-primary { background: var(--brand); border-color: var(--brand); }
  .session-actions .btn:not(.btn-primary) { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.10); color: rgba(255,255,255,0.7); }

  /* -----------------------------------------------------------
    # AUTH-OVERLAY
  ----------------------------------------------------------- */
  .auth-overlay { position: fixed; inset: 0; background: #050c18; backdrop-filter: blur(12px); display: none; align-items: center; justify-content: center; z-index: 500; padding: 24px; }
  .auth-overlay.show { display: flex; }
  .auth-panel { width: 100%; max-width: 820px; background: #ffffff; border-radius: 20px; overflow: hidden; border: 1px solid #e2e6ed; box-shadow: 0 24px 64px rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.2); }
  .auth-layout { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 520px; }
  .auth-side { padding: 36px; background: linear-gradient(160deg, #0f172a 0%, #1e293b 100%); border-right: 1px solid #1e293b; }
  .auth-kicker { font-size: 11px; font-weight: 700; color: #60a5fa; text-transform: uppercase; letter-spacing: 0.09em; margin-bottom: 14px; }
  .auth-title  { font-size: 28px; line-height: 1.15; font-weight: 800; margin-bottom: 10px; color: #f1f5f9; }
  .auth-copy   { font-size: 14px; color: #94a3b8; line-height: 1.6; max-width: 34ch; }
  .auth-points { margin-top: 20px; display: grid; gap: 10px; }
  .auth-point  { padding: 12px 14px; border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.05); font-size: 13px; color: #cbd5e1; }
  /* Form side: always light mode regardless of theme */
  .auth-form-wrap { padding: 36px; display: flex; align-items: center; justify-content: center; background: #ffffff; }
  .auth-form   { width: 100%; max-width: 360px; }
  .auth-form h2{ font-size: 22px; margin-bottom: 8px; font-weight: 800; color: #0f172a; }
  .auth-sub    { font-size: 13px; color: #64748b; line-height: 1.55; margin-bottom: 20px; }
  .auth-grid   { display: grid; gap: 12px; }
  .auth-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  /* Force light mode on all auth form inputs */
  .auth-form-wrap input,
  .auth-form-wrap select,
  .auth-form-wrap textarea {
    background: #f8fafc !important;
    border-color: #e2e6ed !important;
    color: #0f172a !important;
  }
  .auth-form-wrap input:focus,
  .auth-form-wrap select:focus {
    background: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12) !important;
  }
  .auth-form-wrap label { color: #475569 !important; }
  .auth-form-wrap .auth-sub { color: #64748b !important; }
  .auth-form-wrap .auth-help { color: #64748b !important; }
  .auth-form-wrap .auth-inline-note { color: #94a3b8 !important; }
  .auth-form-wrap .auth-error {
    background: rgba(239,68,68,0.07) !important;
    border-color: rgba(239,68,68,0.2) !important;
    color: #dc2626 !important;
  }
  .auth-form-wrap .auth-notice {
    background: rgba(234,88,12,0.06) !important;
    border-color: rgba(234,88,12,0.25) !important;
    border-left-color: #ea580c !important;
    color: #c2410c !important;
  }
  /* Dark mode: keep auth panel light regardless */
  [data-theme="dark"] .auth-panel { background: #ffffff; border-color: #e2e6ed; }
  [data-theme="dark"] .auth-form-wrap { background: #ffffff; }
  [data-theme="dark"] .auth-form h2 { color: #0f172a; }
  [data-theme="dark"] .auth-form-wrap .btn:not(.btn-primary) {
    background: #f8fafc;
    border-color: #e2e6ed;
    color: #475569;
  }
  [data-theme="dark"] .auth-form-wrap .btn:not(.btn-primary):hover {
    background: #f1f5f9;
    color: #0f172a;
  }
  @keyframes auth-error-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
  .auth-error {
    margin-bottom: 14px;
    padding: 10px 12px 10px 36px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(239,68,68,0.2);
    background: rgba(239,68,68,0.07);
    color: #f87171;
    font-size: 12.5px;
    line-height: 1.5;
    font-weight: 500;
    position: relative;
    animation: auth-error-in 0.25s ease both;
  }
  .auth-error::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23f87171' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E") no-repeat center / contain;
  }
  @keyframes auth-notice-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes kb-scan-wipe {
    from { left: 0%; }
    to   { left: 100%; }
  }
  @keyframes kb-scan-mask {
    from { width: 0%; }
    to   { width: 100%; }
  }
  .auth-notice { margin-bottom: 14px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid rgba(234,88,12,0.25); border-left: 3px solid #ea580c; background: rgba(234,88,12,0.06); color: #c2410c; font-size: 12px; font-weight: 600; animation: auth-notice-in 0.35s ease both; transition: opacity 0.5s ease, transform 0.5s ease, max-height 0.5s ease, margin 0.5s ease, padding 0.5s ease; }
  .auth-notice-fade { opacity: 0; transform: translateY(-4px); max-height: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; }
  .auth-help   { margin-top: 12px; font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
  .auth-help code      { background: var(--surface-alt); padding: 1px 5px; border-radius: 4px; font-family: monospace; }
  .auth-submit         { width: 100%; justify-content: center; margin-top: 8px; padding: 10px; font-size: 13px; }
  .auth-inline-note    { margin-top: 12px; font-size: 12px; color: var(--text-muted); }
  .pw-field            { position: relative; }
  .pw-field input      { width: 100%; padding-right: 38px; box-sizing: border-box; }
  .pw-toggle           { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; padding: 2px; color: var(--text-muted); line-height: 1; }
  .pw-toggle:hover     { color: var(--text); }
  .auth-inline-note strong { color: var(--text-secondary); }

  /* -----------------------------------------------------------
    # STATUS BADGES — Professional color system (replaces emojis)
  ----------------------------------------------------------- */
  .status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    letter-spacing: 0.01em;
  }
  .status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 5px;
    flex-shrink: 0;
  }

  /* Red - Critical/Blocker */
  .status-badge.red {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid var(--red-border);
  }
  .status-badge.red::before { background: var(--red); }

  /* Amber - Late/Verspätet */
  .status-badge.amber {
    background: var(--amber-bg);
    color: var(--amber);
    border: 1px solid var(--amber-border);
  }
  .status-badge.amber::before { background: var(--amber); }

  /* Orange - Warning */
  .status-badge.orange {
    background: #ffedd5;
    color: #c2410c;
    border: 1px solid #fdba74;
  }
  .status-badge.orange::before { background: #f97316; }

  /* Blue - Info/AI */
  .status-badge.blue {
    background: var(--blue-bg);
    color: var(--blue);
    border: 1px solid var(--blue-border);
  }
  .status-badge.blue::before { background: #3b82f6; }

  /* Gray - Missing/Default */
  .status-badge.gray {
    background: var(--surface-alt);
    color: var(--text-secondary);
    border: 1px solid var(--border);
  }
  .status-badge.gray::before { background: var(--text-muted); }

  /* Green - Success */
  .status-badge.green {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid var(--green-border);
  }
  .status-badge.green::before { background: var(--green); }

  /* -----------------------------------------------------------
    # PRINT + RESPONSIVE
  ----------------------------------------------------------- */
  /* Subtle scrollbar — Stripe/Linear style */
  ::-webkit-scrollbar { width: 6px; height: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 10px; }
  ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

  /* ===================================================================
    # MONITORING COMMAND CENTER
    Apple/Cluely + Jarvis: clean, dark-first, precise.
    CSS custom properties drive both light and dark mode.
  =================================================================== */

  /* ── CSS TOKENS ── */
  .monitoring-page {
    --mc-bg:        #f0f2f5;
    --mc-surface:   #ffffff;
    --mc-surface2:  #f8fafc;
    --mc-border:    #e2e6ed;
    --mc-border2:   #edf0f4;
    --mc-text:      #0f172a;
    --mc-text2:     #475569;
    --mc-text3:     #94a3b8;
    --mc-green:     #16a34a;
    --mc-green-bg:  #dcfce7;
    --mc-amber:     #d97706;
    --mc-amber-bg:  #fef9c3;
    --mc-red:       #dc2626;
    --mc-red-bg:    #fee2e2;
    --mc-blue:      #2563eb;
    --mc-blue-bg:   #eff6ff;
    --mc-shadow:    0 1px 3px rgba(15,23,42,0.06), 0 4px 16px rgba(15,23,42,0.04);
  }

  [data-theme="dark"] .monitoring-page {
    --mc-bg:        #0d1117;
    --mc-surface:   #161b22;
    --mc-surface2:  #0d1117;
    --mc-border:    #21262d;
    --mc-border2:   #1c2128;
    --mc-text:      #e6edf3;
    --mc-text2:     #8b949e;
    --mc-text3:     #484f58;
    --mc-green:     #3fb950;
    --mc-green-bg:  rgba(63,185,80,0.1);
    --mc-amber:     #d29922;
    --mc-amber-bg:  rgba(210,153,34,0.1);
    --mc-red:       #f85149;
    --mc-red-bg:    rgba(248,81,73,0.1);
    --mc-blue:      #58a6ff;
    --mc-blue-bg:   rgba(88,166,255,0.1);
    --mc-shadow:    0 1px 3px rgba(0,0,0,0.4);
  }

  /* ── PAGE ── */
  .monitoring-page {
    max-width: 1200px;
    margin: 0 auto;
    flex: 1;
    overflow-y: auto;
    background: var(--mc-bg);
    padding-bottom: 48px;
  }

  /* ── HEADER ── */
  .mc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    background: var(--mc-surface);
    border-bottom: 1px solid var(--mc-border);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .mc-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .mc-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .mc-header-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--mc-text);
    letter-spacing: -0.025em;
  }

  .mc-header-sub {
    font-size: 11px;
    color: var(--mc-text3);
    font-family: 'SF Mono', 'Fira Code', monospace;
  }

  .mc-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    background: var(--mc-green-bg);
    color: var(--mc-green);
    border: 1px solid transparent;
  }

  .mc-status-pill[data-status="warn"] {
    background: var(--mc-amber-bg);
    color: var(--mc-amber);
  }

  .mc-status-pill[data-status="critical"] {
    background: var(--mc-red-bg);
    color: var(--mc-red);
  }

  .mc-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
  }

  .mc-icon-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--mc-border);
    border-radius: 8px;
    background: transparent;
    color: var(--mc-text2);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    font-family: inherit;
  }

  .mc-icon-btn:hover {
    background: var(--mc-surface2);
    color: var(--mc-text);
  }

  /* ── BODY LAYOUT ── */
  .mc-body {
    padding: 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  /* ── CARDS ── */
  .mc-card {
    background: var(--mc-surface);
    border: 1px solid var(--mc-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--mc-shadow);
  }

  .mc-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--mc-border);
  }

  .mc-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--mc-text3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
  }

  .mc-refresh-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--mc-border);
    border-radius: 6px;
    background: transparent;
    color: var(--mc-text3);
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
    font-family: inherit;
  }

  .mc-refresh-btn:hover {
    background: var(--mc-surface2);
    color: var(--mc-text);
  }

  /* ── OVERVIEW GRID ── */
  .mc-overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  @media (max-width: 900px) {
    .mc-overview-grid { grid-template-columns: 1fr; }
  }

  .mc-stats-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  /* ── SERVICE LIST ── */
  .mc-service-list {
    display: flex;
    flex-direction: column;
  }

  .mc-svc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    border-bottom: 1px solid var(--mc-border2);
    transition: background 0.1s;
  }

  .mc-svc-item:last-child { border-bottom: none; }
  .mc-svc-item:hover { background: var(--mc-surface2); }

  .mc-svc-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mc-green);
    flex-shrink: 0;
  }

  .mc-svc-dot[data-status="degraded"] { background: var(--mc-amber); }
  .mc-svc-dot[data-status="down"] { background: var(--mc-red); }

  .mc-svc-icon-wrap {
    color: var(--mc-text3);
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

  .mc-svc-label {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--mc-text);
  }

  .mc-svc-badge {
    font-size: 11px;
    font-weight: 700;
    color: var(--mc-green);
    font-family: 'SF Mono', 'Fira Code', monospace;
  }

  .mc-svc-badge[data-status="degraded"] { color: var(--mc-amber); }
  .mc-svc-badge[data-status="down"] { color: var(--mc-red); }

  /* ── STATS GRID ── */
  .mc-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--mc-border);
    border: 1px solid var(--mc-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--mc-shadow);
  }

  .mc-stat-tile {
    background: var(--mc-surface);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: background 0.1s;
  }

  .mc-stat-tile:hover { background: var(--mc-surface2); }

  .mc-stat-tile.mc-stat-warn .mc-stat-val { color: var(--mc-amber); }

  .mc-stat-val {
    font-size: 24px;
    font-weight: 700;
    color: var(--mc-text);
    letter-spacing: -0.04em;
    line-height: 1;
  }

  .mc-stat-lbl {
    font-size: 10px;
    font-weight: 700;
    color: var(--mc-text3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 4px;
  }

  .mc-stat-sub {
    font-size: 11px;
    color: var(--mc-text3);
  }

  /* ── SECURITY CARD ── */
  .mc-security-card {
    flex-shrink: 0;
  }

  .mc-security-score {
    font-size: 13px;
    font-weight: 700;
    color: var(--mc-green);
  }

  .mc-security-score[data-ok="false"] { color: var(--mc-amber); }

  .mc-check-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--mc-border);
    border-top: 1px solid var(--mc-border);
  }

  .mc-check-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    background: var(--mc-surface);
    font-size: 12px;
    color: var(--mc-text2);
  }

  .mc-check-pip {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--mc-green);
    flex-shrink: 0;
  }

  .mc-check-pip[data-ok="false"] { background: var(--mc-amber); }
  .mc-check-item[data-ok="false"] { color: var(--mc-text3); }

  /* ── INCIDENT CENTER ── */
  .mc-card-incidents { overflow: visible; }

  .mc-incident-center {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: hidden;
  }

  .mc-incident-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--mc-border);
    background: var(--mc-surface);
  }

  .mc-incident-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  .mc-select {
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--mc-border);
    border-radius: 7px;
    background: var(--mc-surface2);
    color: var(--mc-text);
    font-family: inherit;
    font-size: 12px;
    outline: none;
  }

  .mc-incident-list {
    display: flex;
    flex-direction: column;
    background: var(--mc-surface);
  }

  .mc-incident-row {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--mc-border2);
    transition: background 0.1s;
  }

  .mc-incident-row:last-child { border-bottom: none; }
  .mc-incident-row:hover { background: var(--mc-surface2); }
  .mc-incident-row[data-acknowledged="true"] { opacity: 0.4; }

  .mc-incident-bar {
    width: 3px;
    flex-shrink: 0;
    background: var(--mc-amber);
  }

  .mc-incident-row[data-severity="critical"] .mc-incident-bar,
  .mc-incident-row[data-severity="error"] .mc-incident-bar { background: var(--mc-red); }
  .mc-incident-row[data-severity="warn"] .mc-incident-bar { background: var(--mc-amber); }

  .mc-incident-body {
    flex: 1;
    padding: 10px 14px;
    min-width: 0;
  }

  .mc-incident-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 3px;
  }

  .mc-incident-title {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
  }

  .mc-incident-count {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--mc-amber-bg);
    color: var(--mc-amber);
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
  }

  .mc-incident-row[data-severity="critical"] .mc-incident-count,
  .mc-incident-row[data-severity="error"] .mc-incident-count {
    background: var(--mc-red-bg);
    color: var(--mc-red);
  }

  .mc-incident-code {
    font-size: 12px;
    font-weight: 700;
    color: var(--mc-text);
    letter-spacing: -0.01em;
  }

  .mc-incident-path {
    font-size: 11px;
    color: var(--mc-text3);
    font-family: 'SF Mono', 'Fira Code', monospace;
  }

  .mc-incident-time {
    font-size: 11px;
    color: var(--mc-text3);
    white-space: nowrap;
    flex-shrink: 0;
  }

  .mc-incident-msg {
    font-size: 12px;
    color: var(--mc-text2);
    line-height: 1.4;
    margin-bottom: 6px;
  }

  .mc-incident-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .mc-incident-tenant {
    font-size: 11px;
    color: var(--mc-text3);
  }

  .mc-incident-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
  }

  .mc-incident-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 24px;
    color: var(--mc-green);
    opacity: 0.5;
    font-size: 13px;
    background: var(--mc-surface);
  }

  .mc-incident-footer {
    padding: 8px 16px;
    border-top: 1px solid var(--mc-border);
    font-size: 11px;
    color: var(--mc-text3);
    background: var(--mc-surface2);
  }

  /* ── BUTTONS ── */
  .mc-btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 7px;
    background: var(--mc-blue);
    color: #fff;
    border: none;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.12s;
    white-space: nowrap;
  }

  .mc-btn-primary:hover { opacity: 0.85; }
  .mc-btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

  .mc-btn-ghost {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 7px;
    background: transparent;
    color: var(--mc-text2);
    border: 1px solid var(--mc-border);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.1s, color 0.1s;
    white-space: nowrap;
  }

  .mc-btn-ghost:hover { background: var(--mc-surface2); color: var(--mc-text); }
  .mc-btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }
  .mc-btn-danger { color: var(--mc-red); }
  .mc-btn-danger:hover { background: var(--mc-red-bg); color: var(--mc-red); }

  .mc-btn-xs {
    padding: 2px 7px;
    font-size: 13px;
    line-height: 1;
    border-radius: 5px;
  }

  /* ── BOTTOM ROW ── */
  .mc-bottom-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  @media (max-width: 900px) {
    .mc-bottom-row { grid-template-columns: 1fr; }
  }

  .mc-bottom-card {
    padding: 14px 16px;
  }

  .mc-bottom-card .mc-label {
    display: block;
    margin-bottom: 10px;
  }

  .mc-bottom-rows {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--mc-border);
    border-radius: 7px;
    overflow: hidden;
    margin-top: 8px;
  }

  .mc-brow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px;
    background: var(--mc-surface2);
    font-size: 12px;
  }

  .mc-brow span { color: var(--mc-text2); }
  .mc-brow strong { color: var(--mc-text); font-weight: 700; }

  /* ── ADMIN CARD ── */
  .mc-admin-card { grid-column: span 1; }

  .mc-admin-form-inline {
    display: flex;
    gap: 5px;
    margin: 8px 0;
    flex-wrap: wrap;
  }

  .mc-admin-form-inline input,
  .mc-admin-form-inline select {
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--mc-border);
    border-radius: 6px;
    background: var(--mc-surface2);
    color: var(--mc-text);
    font-family: inherit;
    font-size: 11px;
    outline: none;
    flex: 1;
    min-width: 70px;
  }

  .mc-admin-form-inline input:focus,
  .mc-admin-form-inline select:focus {
    border-color: var(--mc-blue);
    box-shadow: 0 0 0 2px rgba(37,99,235,0.12);
  }

  .mc-admin-users {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 8px;
  }

  .mc-admin-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: var(--mc-surface2);
    border: 1px solid var(--mc-border);
  }

  .mc-admin-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--mc-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    flex-shrink: 0;
  }

  .mc-admin-user[data-owner="true"] .mc-admin-avatar { background: var(--mc-green); }

  .mc-admin-info {
    flex: 1;
    min-width: 0;
  }

  .mc-admin-info span {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--mc-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mc-admin-info small {
    font-size: 10px;
    color: var(--mc-text3);
  }

  .mc-owner-tag {
    font-size: 10px;
    font-weight: 700;
    color: var(--mc-green);
    background: var(--mc-green-bg);
    padding: 2px 7px;
    border-radius: 10px;
    flex-shrink: 0;
  }

  /* ── SKELETON ── */
  .monitoring-skeleton {
    border-radius: 10px;
    background: linear-gradient(90deg, var(--mc-surface), var(--mc-surface2), var(--mc-surface));
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
  }

  @keyframes skeleton-pulse {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 100% 0%; }
  }

  .monitoring-skeleton-hero { min-height: 80px; margin: 20px 28px; }
  .monitoring-service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 20px 28px; }
  .monitoring-skeleton-card { min-height: 100px; }

  /* ── RESPONSIVE ── */
  @media (max-width: 860px) {
    .mc-header { padding: 12px 16px; }
    .mc-body { padding: 16px; }
    .mc-overview-grid { grid-template-columns: 1fr; }
    .mc-bottom-row { grid-template-columns: 1fr; }
    .mc-check-grid { grid-template-columns: 1fr; }
    .mc-incident-top { flex-direction: column; gap: 4px; }
    .mc-incident-footer-row { flex-direction: column; align-items: flex-start; }
  }


  /* ── TENANT PROFILE PAGE ── */
  @keyframes pulse { 0%,100%{opacity:.4} 50%{opacity:.8} }
  .tp-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; padding: 24px; min-height: 0; }
  @media (max-width: 800px) { .tp-layout { grid-template-columns: 1fr; } }

  .tp-sidebar { display: flex; flex-direction: column; gap: 0; }
  .tp-avatar  { width: 64px; height: 64px; border-radius: 50%; background: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 14px; flex-shrink: 0; }
  .tp-name    { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
  .tp-ref     { font-size: 12px; color: var(--text-muted); font-family: monospace; margin-bottom: 18px; }

  .tp-meta-block { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
  .tp-meta-row   { font-size: 12px; color: var(--text-secondary); display: flex; align-items: flex-start; gap: 7px; line-height: 1.5; }
  .tp-meta-icon  { font-size: 13px; flex-shrink: 0; margin-top: 1px; }

  .tp-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .tp-stat       { background: var(--surface-alt, rgba(255,255,255,0.04)); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; text-align: center; }
  .tp-stat-val   { font-size: 18px; font-weight: 700; color: var(--text); }
  .tp-stat-lbl   { font-size: 10px; color: var(--text-muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.05em; }

  .tp-main  { display: flex; flex-direction: column; min-width: 0; }
  .tp-tabs  { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
  .tp-tab   { padding: 9px 16px; font-size: 13px; font-weight: 500; color: var(--text-muted); background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; margin-bottom: -1px; border-radius: 0; transition: color 0.15s, border-color 0.15s; }
  .tp-tab:hover { color: var(--text); }
  .tp-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

  .tp-section       { display: flex; flex-direction: column; gap: 10px; }
  .tp-section-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); }
  .tp-empty         { font-size: 13px; color: var(--text-muted); font-style: italic; }

  .tp-table { width: 100%; border-collapse: collapse; font-size: 12px; }
  .tp-table th { text-align: left; padding: 6px 8px; color: var(--text-muted); font-weight: 600; font-size: 11px; border-bottom: 1px solid var(--border); }
  .tp-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); color: var(--text-secondary); vertical-align: middle; }
  .tp-table tr:last-child td { border-bottom: none; }

  .tp-activity-feed        { display: flex; flex-direction: column; gap: 20px; }
  .tp-activity-day-group   { display: flex; flex-direction: column; gap: 0; }
  .tp-activity-day-label   { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
  .tp-activity-item        { display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; }
  .tp-activity-dot         { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
  .tp-activity-dot.green   { background: #22c55e; }
  .tp-activity-dot.red     { background: #ef4444; }
  .tp-activity-dot.blue    { background: #60a5fa; }
  .tp-activity-dot.amber   { background: #fbbf24; }
  .tp-activity-dot.gray    { background: #64748b; }
  .tp-activity-body        { flex: 1; }
  .tp-activity-title       { font-size: 13px; font-weight: 600; color: var(--text); }
  .tp-activity-reason      { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
  .tp-activity-meta        { display: flex; gap: 6px; font-size: 11px; color: var(--text-muted); margin-top: 3px; flex-wrap: wrap; }
  .tp-activity-surface     { background: rgba(96,165,250,0.12); color: #60a5fa; border-radius: 4px; padding: 1px 5px; }

  .tp-member-row   { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-alt, rgba(255,255,255,0.03)); border: 1px solid var(--border); }
  .tp-member-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0; }

  /* ── SERVICE TABLE (compact, single block with day timeline) ── */
  .mc-service-table {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
  }

  .mc-svc-header {
    display: grid;
    grid-template-columns: 20px 140px 90px 1fr;
    gap: 0 12px;
    padding: 6px 16px;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border);
  }

  .mc-svc-timeline-head {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
    padding: 0 2px;
  }

  .mc-svc-row {
    display: grid;
    grid-template-columns: 20px 140px 90px 1fr;
    gap: 0 12px;
    align-items: center;
    padding: 7px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
  }

  .mc-svc-row:last-child { border-bottom: none; }
  .mc-svc-row:hover { background: var(--surface-alt); }

  .mc-svc-row[data-status="degraded"] { border-left: 3px solid var(--amber); }
  .mc-svc-row[data-status="down"] { border-left: 3px solid var(--red); }

  .mc-svc-icon {
    color: var(--text-muted);
    opacity: 0.45;
    display: flex;
    align-items: center;
  }

  .mc-svc-name {
    font-size: 12px;
    font-weight: 550;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mc-svc-status {
    font-size: 11px;
    font-weight: 600;
    color: var(--green);
    font-family: 'SF Mono', 'Fira Code', monospace;
  }

  .mc-svc-status[data-status="degraded"] { color: var(--amber); }
  .mc-svc-status[data-status="down"] { color: var(--red); }

  /* Day timeline dots */
  .mc-svc-timeline {
    display: flex;
    align-items: center;
    gap: 3px;
  }

  .mc-day-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
    cursor: default;
    transition: transform 0.1s;
  }

  .mc-day-dot:hover { transform: scale(1.3); }

  .mc-day-ok {
    background: #22c55e;
    opacity: 0.65;
  }

  .mc-day-error {
    background: #ef4444;
    opacity: 0.85;
  }

  .mc-day-today {
    outline: 1.5px solid var(--brand);
    outline-offset: 1px;
    opacity: 1;
  }

  /* Light mode overrides for service table */
  .mc-service-table {
    background: #ffffff;
    border-color: #e8e5e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  }

  .mc-svc-header {
    background: #faf9f7;
    border-bottom-color: #f0ede8;
  }

  .mc-svc-row {
    border-bottom-color: #f0ede8;
  }

  .mc-svc-row:hover { background: #faf9f7; }

  /* ── INFO STRIP (replaces 4 separate panels) ── */
  .mc-info-strip {
    display: flex;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
  }

  .mc-info-col {
    flex: 1;
    padding: 16px 18px;
    min-width: 0;
  }

  .mc-info-col-admin {
    flex: 1.4;
  }

  .mc-info-divider {
    width: 1px;
    background: var(--border);
    flex-shrink: 0;
  }

  .mc-info-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.09em;
    margin-bottom: 8px;
    opacity: 0.6;
  }

  .mc-info-stat-big {
    font-size: 28px;
    font-weight: 650;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1;
  }

  .mc-info-stat-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
    margin-bottom: 10px;
  }

  .mc-info-rows {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border);
    border-radius: 6px;
    overflow: hidden;
    margin-top: 8px;
  }

  .mc-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 8px;
    background: var(--surface-alt);
    font-size: 11px;
  }

  .mc-info-row span { color: var(--text-secondary); }
  .mc-info-row strong { color: var(--text); font-weight: 650; }

  /* Security score */
  .mc-info-security-score {
    font-size: 28px;
    font-weight: 650;
    color: var(--green);
    letter-spacing: -0.03em;
    line-height: 1;
  }

  .mc-info-security-score[data-ok="false"] {
    color: var(--amber);
  }

  .mc-info-checks {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
  }

  .mc-info-check {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    color: var(--text-secondary);
  }

  .mc-info-check[data-ok="false"] {
    color: var(--text-muted);
    opacity: 0.6;
  }

  .mc-info-check[data-ok="false"] .mc-check-dot {
    background: var(--amber);
  }

  /* Compact admin form */
  .mc-admin-form-inline {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    flex-wrap: wrap;
  }

  .mc-admin-form-inline input,
  .mc-admin-form-inline select {
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-alt);
    color: var(--text);
    font-family: inherit;
    font-size: 11px;
    outline: none;
    flex: 1;
    min-width: 80px;
  }

  .mc-admin-form-inline input:focus,
  .mc-admin-form-inline select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
  }

  /* Compact user list */
  .mc-user-list-compact {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  .mc-user-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 7px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
  }

  .mc-user-avatar-sm {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    flex-shrink: 0;
  }

  .mc-user-compact[data-owner="true"] .mc-user-avatar-sm {
    background: var(--green);
  }

  .mc-user-compact-info {
    flex: 1;
    min-width: 0;
  }

  .mc-user-compact-info span {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mc-user-compact-info small {
    font-size: 10px;
    color: var(--text-muted);
  }

  .mc-btn-xs {
    padding: 2px 7px;
    font-size: 13px;
    line-height: 1;
    border-radius: 5px;
    flex-shrink: 0;
  }

  /* Light mode overrides for info strip */
  .mc-info-strip {
    background: #ffffff;
    border-color: #e8e5e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  }

  .mc-info-divider { background: #f0ede8; }

  .mc-info-row { background: #faf9f7; }
  .mc-info-row:nth-child(even) { background: #ffffff; }

  .mc-info-rows { background: #f0ede8; }

  .mc-user-compact {
    background: #faf9f7;
    border-color: #e8e5e0;
  }

  .mc-admin-form-inline input,
  .mc-admin-form-inline select {
    background: #faf9f7;
    border-color: #e0ddd8;
    color: #2a2520;
  }

  /* Dark mode overrides for new components */
  [data-theme="dark"] .mc-service-table,
  [data-theme="dark"] .mc-info-strip {
    background: #161b22;
    border-color: #21262d;
  }

  [data-theme="dark"] .mc-svc-header,
  [data-theme="dark"] .mc-svc-row:hover,
  [data-theme="dark"] .mc-info-row {
    background: #0d1117;
  }

  [data-theme="dark"] .mc-svc-row { border-bottom-color: #21262d; }
  [data-theme="dark"] .mc-info-divider { background: #21262d; }
  [data-theme="dark"] .mc-info-rows { background: #21262d; }

  [data-theme="dark"] .mc-user-compact {
    background: #0d1117;
    border-color: #21262d;
  }

  [data-theme="dark"] .mc-admin-form-inline input,
  [data-theme="dark"] .mc-admin-form-inline select {
    background: #0d1117;
    border-color: #21262d;
    color: #e6edf3;
  }

  /* Responsive */
  @media (max-width: 860px) {
    .mc-header { padding: 12px 16px; }
    .mc-section { padding: 16px; }
    .mc-incident-top { flex-direction: column; gap: 4px; }
    .mc-incident-footer-row { flex-direction: column; align-items: flex-start; }
    .mc-info-strip { flex-direction: column; }
    .mc-info-divider { width: auto; height: 1px; }
    .mc-svc-row,
    .mc-svc-header { grid-template-columns: 20px 1fr 70px; }
    .mc-svc-timeline,
    .mc-svc-timeline-head { display: none; }
  }
