/* ==============================================================================
   SecTepe.Comm - Unified Web UI
   Re-gebunden an das SecTepe-Markendesign (Coral/Schwarz/Weiß, Gugi + Inter).
   Tokens basieren auf colors_and_type.css (Design-System).
   ============================================================================== */

@import url("colors_and_type.css");

/* --- CSS Variables (Light Theme) --- */
:root {
  --bg-primary: var(--sec-n-50);
  --bg-secondary: var(--sec-white);
  --bg-sidebar: var(--sec-black);
  --bg-sidebar-hover: var(--sec-n-700);
  /* coral-300 mit weissem Text (--text-sidebar-active=#fff) erreicht
     nur ~2.2:1 — WCAG 2.1 AA fordert 4.5:1 fuer Normaltext. coral-600
     liefert ~6.7:1 und behaelt den Marken-Coral als Tonalitaet. */
  --bg-sidebar-active: var(--sec-coral-600);
  --bg-card: var(--sec-white);
  --bg-card-hover: var(--sec-n-100);

  --text-primary: var(--sec-black);
  --text-secondary: var(--sec-n-600);
  --text-sidebar: var(--sec-n-400);
  --text-sidebar-active: #ffffff;

  --accent-chat: var(--sec-coral-300);
  --accent-email: var(--sec-n-700);
  --accent-video: var(--sec-coral-500);
  --accent-phone: var(--sec-n-500);
  --accent-warmup: var(--sec-coral-400);
  --accent-outreach: var(--sec-n-600);
  --accent-remote: var(--sec-coral-600);
  --accent-primary: var(--sec-coral-300);

  --border-color: var(--sec-n-200);
  --shadow-sm: var(--sec-shadow-1);
  --shadow-md: var(--sec-shadow-2);
  --shadow-lg: var(--sec-shadow-3);

  --sidebar-width: 240px;
  --sidebar-collapsed-width: 64px;
  --transition: 0.2s ease;
  --radius: 12px;
  --radius-lg: 16px;
}

/* --- Dark Theme --- */
[data-theme="dark"] {
  --bg-primary: var(--sec-n-900);
  --bg-secondary: var(--sec-n-800);
  --bg-sidebar: #000000;
  --bg-sidebar-hover: var(--sec-n-700);
  /* WCAG-AA Kontrast (siehe :root-Begruendung). */
  --bg-sidebar-active: var(--sec-coral-600);
  --bg-card: var(--sec-n-800);
  --bg-card-hover: var(--sec-n-700);

  --text-primary: var(--sec-white);
  --text-secondary: var(--sec-n-300);
  --text-sidebar: var(--sec-n-400);
  --text-sidebar-active: #ffffff;

  --border-color: var(--sec-n-700);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.55);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--sec-font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
}

a {
  text-decoration: none;
  color: inherit;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  height: 100dvh;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  transition: width var(--transition), min-width var(--transition);
  z-index: 100;
  overflow: hidden;
}

/* --- Scrollable nav area --- */
.sidebar-nav-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.sidebar-nav-scroll::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.sidebar-nav-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
  min-width: var(--sidebar-collapsed-width);
  overflow: visible;
}

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  overflow: hidden;
}

.logo-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: var(--sec-coral-300);
  color: var(--sec-black);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  overflow: hidden;
}

.logo-icon img {
  width: 22px;
  height: 22px;
}

.logo-text {
  font-family: var(--sec-font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-sidebar-active);
}

.logo-accent {
  color: var(--accent-primary);
}

.sidebar.collapsed .logo-text {
  opacity: 0;
  visibility: hidden;
}

/* --- Navigation --- */
.nav-section {
  padding: 12px 8px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-sidebar);
  padding: 4px 12px 8px;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar.collapsed .nav-section-title {
  opacity: 0;
  height: 0;
  padding: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-sidebar);
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}

/* Service-Status-Dot: 8px-Kreis vor jedem nav-item, das eine externe URL hat.
   Zustaende: unknown (grau, default), up (gruen), down (rot). Wird per JS in
   index.html befuellt und alle 60s aktualisiert. */
.status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #888;
  margin: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2) inset;
  transition: background-color 200ms ease;
}
.status-dot.status-up   { background: #22c55e; box-shadow: 0 0 4px rgba(34, 197, 94, 0.6); }
.status-dot.status-down { background: #ef4444; box-shadow: 0 0 4px rgba(239, 68, 68, 0.6); }
.sidebar.collapsed .status-dot { display: none; }

/* External-window indicator for nav-items that can't be iframed and
   are therefore routed through window.open().  Small ↗ glyph next to
   the label, dimmed so it doesn't compete with the active-highlight. */
.nav-item-external .nav-label::after,
.mobile-nav-item.nav-item-external::after {
  content: "↗";
  margin-left: 6px;
  font-size: 0.82em;
  opacity: 0.65;
  vertical-align: middle;
}
.sidebar.collapsed .nav-item-external .nav-label::after {
  content: "";
}

.nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-sidebar-active);
}

.nav-item.active {
  background: var(--bg-sidebar-active);
  /* --bg-sidebar-active is coral-600 (#B83E39) since the main-merge,
     so white text gives ~6.45:1 contrast (AA pass for normal text).
     Black would only be 3.78:1 - fails axe color-contrast on /dashboard. */
  color: var(--text-sidebar-active);
}

.nav-icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
}

.nav-label {
  font-size: 14px;
  font-weight: 500;
}

.sidebar.collapsed .nav-label {
  opacity: 0;
  visibility: hidden;
}

.nav-badge {
  background: var(--sec-coral-500);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: auto;
  min-width: 20px;
  text-align: center;
}

.sidebar.collapsed .nav-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  margin: 0;
  padding: 1px 4px;
  font-size: 10px;
}

/* Tooltip for collapsed sidebar */
.sidebar.collapsed .nav-item:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(var(--sidebar-collapsed-width) + 8px);
  background: var(--bg-sidebar);
  color: var(--text-sidebar-active);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  z-index: 200;
}

/* --- Sidebar Footer --- */
.sidebar-footer {
  margin-top: auto;
  padding: 12px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* --- Intercom: Benutzer-Info-Widget --- */
.user-info-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--text-sidebar);
  overflow: hidden;
}

.user-info-widget .nav-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  opacity: 0.75;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.85;
}

.sidebar.collapsed .user-name {
  display: none;
}

.sidebar-footer > .theme-toggle,
.sidebar-footer > .sidebar-collapse-btn {
  /* keep buttons in a row */
  flex-direction: row;
}

/* Row of buttons within footer */
.sidebar-footer-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.sidebar.collapsed .sidebar-footer-buttons {
  display: none;
}

.theme-toggle,
.sidebar-collapse-btn {
  background: none;
  border: none;
  color: var(--text-sidebar);
  cursor: pointer;
  padding: 10px;
  border-radius: var(--radius);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover,
.sidebar-collapse-btn:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-sidebar-active);
}

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
.sun-icon { display: none; }
.moon-icon { display: block; }

.sidebar.collapsed .sidebar-collapse-btn {
  align-self: center;
}

.sidebar.collapsed .sidebar-collapse-btn svg {
  transform: rotate(180deg);
}

.sidebar.collapsed .nav-item {
  overflow: visible;
}

/* --- Main Content --- */
.content {
  flex: 1;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  transition: margin-left var(--transition);
}

/* --- Views --- */
.view {
  display: none;
  height: 100%;
}

.view.active {
  display: block;
}

/* --- Dashboard --- */
#view-dashboard {
  padding: 32px;
  overflow-y: auto;
}

.view-header {
  margin-bottom: 32px;
}

.view-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.view-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
}

/* --- Dashboard Grid --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.dashboard-card:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.card-icon svg {
  width: 28px;
  height: 28px;
}

.card-icon-chat { background: var(--sec-n-100); color: var(--accent-chat); }
.card-icon-email { background: var(--sec-n-100); color: var(--accent-email); }
.card-icon-video { background: var(--sec-n-100); color: var(--accent-video); }
.card-icon-phone { background: var(--sec-n-100); color: var(--accent-phone); }
.card-icon-erp { background: var(--sec-n-100); color: var(--sec-n-700); }
.card-icon-files { background: var(--sec-n-100); color: var(--sec-n-700); }
.card-icon-wiki { background: var(--sec-n-100); color: var(--sec-n-700); }
.card-icon-dms { background: var(--sec-n-100); color: var(--sec-n-700); }
.card-icon-vault   { background: var(--sec-n-100); color: var(--sec-n-700); }
.card-icon-monitoring { background: var(--sec-n-100); color: var(--sec-n-700); }
.card-icon-security { background: var(--sec-coral-50); color: var(--sec-coral-600); }
.card-icon-warmup { background: var(--sec-coral-50); color: var(--accent-warmup); }
.card-icon-outreach { background: var(--sec-n-100); color: var(--accent-outreach); }
.card-icon-remote { background: var(--sec-coral-50); color: var(--accent-remote); }

.card-content h2.card-h {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.card-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.card-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sec-n-400);
}

.status-dot.online { background: var(--sec-success); }
.status-dot.offline { background: var(--sec-danger); }
.status-dot.checking { background: var(--sec-warning); animation: pulse 1.5s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.status-text {
  color: var(--text-secondary);
}

.card-action {
  font-size: 14px;
  font-weight: 600;
  /* coral-300 als Fließtext-Farbe auf Weiss bringt nur ~2.18:1 — zu wenig
     fuer WCAG 2.1 AA. Coral-700 ist die dunklere Marken-Variante und
     liefert ~11:1, ohne den Brand-Look zu verlieren. */
  color: var(--sec-coral-700);
  margin-top: auto;
}

/* --- Quick Actions --- */
.quick-actions {
  margin-bottom: 40px;
}

.quick-actions h2,
.system-info h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  transition: all var(--transition);
  font-family: inherit;
}

.quick-action-btn:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-sm);
}

.quick-action-btn svg {
  width: 20px;
  height: 20px;
  min-width: 20px;
  color: var(--accent-primary);
}

/* --- System Info --- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.info-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 14px 18px;
}

.info-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.info-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* --- iFrame Container --- */
.iframe-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: var(--bg-secondary);
}

.iframe-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--bg-primary);
  z-index: 10;
  transition: opacity 0.3s ease;
}

.iframe-loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.iframe-loading p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* --- Mobile Navigation --- */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-sidebar);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 100;
  padding: 4px 0;
  padding-bottom: env(safe-area-inset-bottom, 4px);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.mobile-nav::-webkit-scrollbar {
  display: none;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  color: var(--text-sidebar);
  font-size: 11px;
  transition: color var(--transition);
  flex: 0 0 auto;
  min-width: 64px;
}

.mobile-nav-item.active {
  color: var(--accent-primary);
}

.mobile-nav-item svg {
  width: 22px;
  height: 22px;
}

button.mobile-nav-item {
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .mobile-nav {
    display: flex;
    justify-content: flex-start;
  }

  .content {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }

  #view-dashboard {
    padding: 20px 16px;
  }

  .view-header h1 {
    font-size: 22px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .quick-actions-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* --- Focus visible --- */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* --- Selection --- */
::selection {
  background: var(--sec-coral-100);
  color: var(--sec-fg);
}

/* ==============================================================================
   SecTepe.Comm - Native View Component Styles
   ============================================================================== */

/* --- Native View Container --- */
.native-view {
  padding: 24px 32px;
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  overflow-y: auto;
}

/* --- Loading --- */
.sc-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  gap: 16px;
  color: var(--text-secondary);
}

/* --- Empty State --- */
.sc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  gap: 12px;
  color: var(--text-secondary);
}

.sc-empty svg { opacity: 0.4; }

/* --- Error --- */
.sc-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--sec-danger) 8%, transparent);
  color: var(--sec-danger);
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--sec-danger) 20%, transparent);
  margin: 8px 0;
}

/* --- Alert --- */
.sc-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  margin: 8px 0;
}

.sc-alert--success {
  background: color-mix(in srgb, var(--sec-success) 8%, transparent);
  color: var(--sec-success);
  border-color: color-mix(in srgb, var(--sec-success) 20%, transparent);
}

[data-theme="dark"] .sc-alert--success {
  color: color-mix(in srgb, var(--sec-success) 65%, white);
}

.sc-alert--danger {
  background: color-mix(in srgb, var(--sec-danger) 8%, transparent);
  color: var(--sec-danger);
  border-color: color-mix(in srgb, var(--sec-danger) 20%, transparent);
}

[data-theme="dark"] .sc-alert--danger {
  color: var(--sec-coral-200);
}

/* --- Badge --- */
.sc-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.sc-badge--default { background: var(--bg-primary); color: var(--text-secondary); border: 1px solid var(--border-color); }
.sc-badge--success { background: color-mix(in srgb, var(--sec-success) 10%, transparent); color: var(--sec-success); }
.sc-badge--warning { background: color-mix(in srgb, var(--sec-warning) 12%, transparent); color: var(--sec-warning); }
.sc-badge--danger { background: var(--sec-coral-50); color: var(--sec-danger); }
.sc-badge--info { background: var(--sec-coral-50); color: var(--sec-coral-700); }
.sc-badge--primary { background: var(--sec-coral-50); color: var(--accent-primary); }

/* --- Card --- */
.sc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.sc-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.sc-card__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.sc-card__actions { display: flex; gap: 8px; }
.sc-card__body { padding: 20px; }

/* --- Stat Card --- */
.sc-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.sc-stat__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: currentColor;
  opacity: 0.1;
}

.sc-stat__icon svg { width: 24px; height: 24px; opacity: 10; }
.sc-stat__content { display: flex; flex-direction: column; gap: 2px; }
.sc-stat__value { font-size: 28px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.sc-stat__suffix { font-size: 16px; font-weight: 400; color: var(--text-secondary); margin-left: 2px; }
.sc-stat__label { font-size: 13px; color: var(--text-secondary); }
.sc-stat__trend { font-size: 12px; font-weight: 500; }
.sc-stat__trend--up { color: var(--sec-success); }
.sc-stat__trend--down { color: var(--sec-danger); }

.sc-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* --- Table --- */
.sc-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.sc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.sc-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.sc-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.sc-table tbody tr:last-child td { border-bottom: none; }

.sc-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.sc-table__clickable { cursor: pointer; }

/* --- Pagination --- */
.sc-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.sc-pagination__buttons { display: flex; align-items: center; gap: 8px; }
.sc-pagination__current { font-weight: 500; color: var(--text-primary); }

/* --- Tabs --- */
.sc-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 24px;
  overflow-x: auto;
}

.sc-tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
}

.sc-tab:hover { color: var(--text-primary); }
.sc-tab--active { color: var(--accent-primary); border-bottom-color: var(--accent-primary); }
.sc-tab__count { background: var(--bg-primary); padding: 1px 6px; border-radius: 10px; font-size: 11px; margin-left: 4px; }

/* --- Button (SecTepe-Pillen, Gugi/Inter) --- */
.sc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--sec-radius-pill);
  font-family: var(--sec-font-sans);
  font-size: 14px;
  font-weight: var(--sec-fw-semibold);
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.sc-btn:hover { background: var(--bg-card-hover); }
.sc-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.sc-btn--primary { background: var(--sec-coral-300); color: var(--sec-black); border-color: var(--sec-coral-300); }
.sc-btn--primary:hover { background: var(--sec-coral-400); border-color: var(--sec-coral-400); }
.sc-btn--danger { background: var(--sec-coral-500); color: #fff; border-color: var(--sec-coral-500); }
.sc-btn--danger:hover { background: var(--sec-coral-600); border-color: var(--sec-coral-600); }
.sc-btn--success { background: var(--sec-success, #2E8B6B); color: #fff; border-color: var(--sec-success, #2E8B6B); }
.sc-btn--success:hover { filter: brightness(0.95); }
.sc-btn--sm { padding: 4px 10px; font-size: 12px; }
.sc-btn--lg { padding: 12px 24px; font-size: 16px; }

.sc-btn svg { width: 16px; height: 16px; }

/* --- Form Fields --- */
.sc-field {
  margin-bottom: 16px;
}

.sc-field__label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.sc-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color var(--transition);
}

.sc-input:focus {
  border-color: var(--accent-primary);
  outline: none;
  box-shadow: var(--sec-shadow-focus);
}

.sc-textarea { resize: vertical; min-height: 80px; font-family: inherit; }
.sc-field__help { display: block; font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* --- Modal --- */
.sc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.sc-modal-overlay--visible { display: flex; }

.sc-modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.sc-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.sc-modal__header h3 { font-size: 18px; font-weight: 600; }

.sc-modal__close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0 4px;
}

.sc-modal__body { padding: 20px; overflow-y: auto; }
.sc-modal__footer { padding: 16px 20px; border-top: 1px solid var(--border-color); display: flex; gap: 8px; justify-content: flex-end; }

/* --- Progress Bar --- */
.sc-progress {
  width: 100%;
  height: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.sc-progress__bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.sc-progress__label {
  position: absolute;
  right: 0;
  top: -20px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* --- Charts --- */
.sc-chart-container {
  padding: 16px 0;
}

.sc-chart-container--donut {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.sc-chart__title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.sc-chart__label {
  font-size: 11px;
  fill: var(--text-secondary);
}

.sc-chart__value {
  font-size: 11px;
  fill: var(--text-primary);
  font-weight: 500;
}

.sc-chart__center {
  font-size: 20px;
  font-weight: 700;
  fill: var(--text-primary);
}

.sc-chart__legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sc-chart__legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.sc-chart__legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* --- Login --- */
.sc-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 24px;
}

.sc-login__card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 400px;
}

.sc-login__title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.sc-login__subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.sc-login__form { display: flex; flex-direction: column; }
.sc-login__form .sc-btn { margin-top: 8px; justify-content: center; }
.sc-login__error { color: var(--sec-danger); font-size: 13px; margin-bottom: 8px; padding: 8px; background: var(--sec-coral-50); border-radius: var(--radius); }

/* --- View Header --- */
.sc-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.sc-view-header__title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.sc-view-header__subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.sc-view-header__actions { display: flex; gap: 8px; }

/* --- Search Bar --- */
.sc-search {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.sc-search .sc-input { max-width: 400px; }

/* --- Chat Layout --- */
.sc-chat-layout {
  display: flex;
  height: calc(100vh - 150px);
  height: calc(100dvh - 150px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.sc-chat-sidebar {
  width: 260px;
  min-width: 260px;
  border-right: 1px solid var(--border-color);
  background: var(--bg-secondary);
  overflow-y: auto;
}

.sc-chat-sidebar__title {
  padding: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.sc-chat-channel {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition);
}

.sc-chat-channel:hover { background: var(--bg-card-hover); }
.sc-chat-channel--active { background: var(--sec-coral-50); border-left: 3px solid var(--accent-primary); }

.sc-chat-channel__name { font-weight: 500; color: var(--text-primary); font-size: 14px; }
.sc-chat-channel__desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sc-chat-main { flex: 1; display: flex; flex-direction: column; }

.sc-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.sc-chat-message {
  margin-bottom: 16px;
}

.sc-chat-message__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.sc-chat-message__author { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.sc-chat-message__time { font-size: 12px; color: var(--text-secondary); }
.sc-chat-message__body { font-size: 14px; color: var(--text-primary); line-height: 1.5; }

.sc-chat-input {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.sc-chat-input__note {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  padding: 8px;
}

.sc-chat-input__note a { color: var(--accent-primary); text-decoration: underline; }

/* --- Service Info Fallback --- */
.sc-service-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  gap: 16px;
  text-align: center;
}

.sc-service-fallback__icon svg { width: 64px; height: 64px; color: var(--text-secondary); opacity: 0.3; }
.sc-service-fallback__title { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.sc-service-fallback__desc { font-size: 14px; color: var(--text-secondary); max-width: 500px; }
.sc-service-fallback .sc-btn { margin-top: 8px; }

/* --- Wiki Content --- */
.sc-wiki-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  line-height: 1.8;
  font-size: 15px;
}

.sc-wiki-content h1, .sc-wiki-content h2, .sc-wiki-content h3 {
  margin-top: 24px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.sc-wiki-content p { margin-bottom: 12px; }
.sc-wiki-content code { background: var(--bg-primary); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.sc-wiki-content pre { background: var(--bg-primary); padding: 16px; border-radius: var(--radius); overflow-x: auto; margin: 12px 0; }
.sc-wiki-content img { max-width: 100%; border-radius: var(--radius); }
.sc-wiki-content a { color: var(--accent-primary); }

/* --- Grid Layouts --- */
.sc-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.sc-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sc-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

@media (max-width: 1024px) {
  .sc-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .sc-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .native-view { padding: 16px; }
  .sc-grid-2, .sc-grid-3, .sc-grid-4 { grid-template-columns: 1fr; }
  .sc-chat-layout { flex-direction: column; height: calc(100vh - 200px); height: calc(100dvh - 200px - env(safe-area-inset-bottom, 0px)); }
  .sc-chat-sidebar { width: 100%; min-width: 100%; max-height: 200px; border-right: none; border-bottom: 1px solid var(--border-color); }
  .sc-view-header { flex-direction: column; align-items: flex-start; }
  .sc-stats-grid { grid-template-columns: 1fr; }
  .sc-chart-container--donut { flex-direction: column; }
}

/* =============================================================================
   Web UI v2 – Neue Komponenten (Benachrichtigungen, Suche, Favoriten, i18n)
   ============================================================================= */

/* --- Neue Accent-Farben fuer AI & Automatisierung (SecTepe-Brand) --- */
:root {
  --accent-ai: var(--sec-coral-500);
  --accent-automation: var(--sec-n-600);
  --accent-ats: var(--sec-coral-400);
}

/* --- Icon-Button (generisch) --- */
.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-sidebar);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
  position: relative;
}

.icon-btn:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-sidebar-active);
}

/* --- Benachrichtigungs-Wrapper --- */
.notification-wrapper {
  position: relative;
}

.notification-btn {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--sec-coral-500);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9999px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}

/* --- App-Switcher (Waffle) & Konto-/Einstellungs-Panel (Säule A) --- */
.app-switcher-wrapper,
.settings-wrapper {
  position: relative;
}

.app-switcher-panel,
.settings-panel {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: 320px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: none;
  flex-direction: column;
  max-height: 460px;
  overflow: hidden;
}

.settings-panel {
  width: 280px;
}

.app-switcher-panel.open,
.settings-panel.open {
  display: flex;
}

.app-switcher-header,
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.app-switcher-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 12px;
  overflow-y: auto;
}

.app-switcher-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 12px;
  text-align: center;
  transition: background var(--transition);
}

.app-switcher-item:hover {
  background: var(--bg-primary);
}

.app-switcher-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-primary);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.app-switcher-label {
  line-height: 1.2;
  word-break: break-word;
}

.user-info-widget {
  cursor: pointer;
}

.settings-identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.settings-name {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-email {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  display: flex;
  flex-direction: column;
}

.settings-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  text-align: left;
  transition: background var(--transition);
}

.settings-item:hover {
  background: var(--bg-primary);
}

.settings-item-danger {
  color: var(--sec-coral-600, #d6453d);
}

/* --- Benachrichtigungs-Panel --- */
.notification-panel {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: 300px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: none;
  flex-direction: column;
  max-height: 400px;
  overflow: hidden;
}

.notification-panel.open {
  display: flex;
}

.notification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.notifications-clear-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: var(--radius);
}

.notifications-clear-btn:hover { color: var(--text-primary); background: var(--bg-card-hover); }

.notification-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
}

.notification-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notification-item:last-child { border-bottom: none; }
.notification-item { position: relative; }
.notification-text { font-size: 13px; color: var(--text-primary); }
.notification-time { font-size: 11px; color: var(--text-secondary); }
.notification-empty { padding: 16px; text-align: center; color: var(--text-secondary); font-size: 13px; }
/* Mute-Button je Quelle: erscheint dezent beim Hover oben rechts. */
.notification-mute {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; cursor: pointer;
  font-size: 13px; line-height: 1; padding: 2px 4px; border-radius: 4px;
  opacity: 0; transition: opacity 0.15s ease;
}
.notification-item:hover .notification-mute,
.notification-mute:focus { opacity: 0.7; }
.notification-mute:hover { opacity: 1; background: var(--bg-card-hover); }
/* Verwaltung stummgeschalteter Quellen am Panel-Ende. */
.notification-muted { padding: 8px 12px; border-top: 1px solid var(--border-color); }
.notification-muted-title { font-size: 11px; color: var(--text-secondary); margin-bottom: 6px; }
.muted-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.muted-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg-card-hover); border: 1px solid var(--border-color);
  color: var(--text-primary); cursor: pointer;
  font-size: 12px; line-height: 1; padding: 4px 8px; border-radius: 999px;
}
.muted-chip:hover { border-color: var(--text-secondary); }
.muted-chip-x { font-size: 14px; color: var(--text-secondary); }
/* E-Mail-Digest-Frequenz am Panel-Ende. */
.notification-digest { padding: 8px 12px; border-top: 1px solid var(--border-color); }
.notification-digest-label { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.notification-digest-select {
  background: var(--bg-card-hover); border: 1px solid var(--border-color);
  color: var(--text-primary); border-radius: 6px; padding: 2px 6px; font-size: 12px;
}
.notification-info .notification-text::before { content: 'ℹ '; }
.notification-warning .notification-text::before { content: '⚠ '; color: var(--sec-warning); }
.notification-error .notification-text::before { content: '✗ '; color: var(--sec-danger); }
.notification-success .notification-text::before { content: '✓ '; color: var(--sec-success); }

/* Anklickbare Eintraege (mit Entity) → Deep-Link in die Ziel-App. */
.notification-clickable { cursor: pointer; }
.notification-clickable:hover,
.notification-clickable:focus-visible {
  background: var(--hover-bg, rgba(0, 0, 0, 0.04));
  outline: none;
}
/* Ungelesene Eintraege optisch hervorheben (Coral-Markierung links). */
.notification-unread { box-shadow: inset 3px 0 0 0 var(--sec-coral, #ff908b); }
.notification-unread .notification-text { font-weight: 600; }

/* --- Globale Suche Overlay --- */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}

.search-overlay.open {
  display: flex;
}

.search-modal {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
}

.search-icon { width: 20px; height: 20px; color: var(--text-secondary); flex-shrink: 0; }

.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  color: var(--text-primary);
}

.search-input::placeholder { color: var(--text-secondary); }

.search-results {
  list-style: none;
  max-height: 360px;
  overflow-y: auto;
}

.search-result-item {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition);
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-card-hover); }
.search-no-results { padding: 16px; text-align: center; color: var(--text-secondary); font-size: 13px; }

/* --- Gespeicherte / zuletzt genutzte Suchen (Schritt 3) --- */
.search-saved-item, .search-recent-item { display: flex; align-items: center; gap: 8px; }
.search-saved-item .search-result-label,
.search-recent-item .search-result-label {
  flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-saved-del {
  flex: 0 0 auto; background: none; border: none; color: var(--text-secondary);
  cursor: pointer; font-size: 18px; line-height: 1; padding: 0 6px; border-radius: 4px;
}
.search-saved-del:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.search-save-row .search-result-label { font-weight: 500; }

/* --- Favoriten-Bereich --- */
.favorites-section {
  margin-top: 32px;
}

.favorites-section h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.favorites-hint {
  color: var(--text-secondary);
  font-size: 13px;
  padding: 8px 0;
}

.favorite-btn.is-favorite {
  color: var(--sec-warning);
}

.favorite-btn.is-favorite svg {
  fill: var(--sec-warning);
  stroke: var(--sec-warning);
}

/* --- Admin-Bereich --- */
.admin-section {
  margin-top: 32px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--sec-coral-400);
  border-radius: var(--radius-lg);
}

.admin-section h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text-primary);
}

.admin-section-hint {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0 0 16px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.admin-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-primary);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.admin-card:hover {
  transform: translateY(-1px);
  border-color: var(--sec-coral-400);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.admin-card-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--sec-coral-50);
  color: var(--sec-coral-600);
  flex-shrink: 0;
}

.admin-card-body {
  flex: 1;
  min-width: 0;
}

.admin-card-body h2.card-h {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 2px;
  color: var(--text-primary);
}

.admin-card-body p {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-card-action {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* --- Dashboard Card Farben fuer neue Dienste --- */
.card-icon-ai {
  background: linear-gradient(135deg, var(--sec-coral-400), var(--sec-coral-600));
  color: #fff;
}

.card-icon-automation {
  background: linear-gradient(135deg, var(--sec-n-600), var(--sec-n-800));
  color: #fff;
}

/* --- Responsive: Benachrichtigungs-Panel --- */
@media (max-width: 480px) {
  .notification-panel { width: 260px; }
  .search-modal { max-width: calc(100vw - 32px); }
}

/* =============================================================================
   Dashboard v2 – Service-Tiles, Stat-Row, Schnellzugriff-Grid
   ============================================================================= */

/* --- Stat Row --- */
.dash-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

.dash-stats-row .sc-stat-card {
  flex: 1 1 160px;
  min-width: 140px;
}

/* === Anstehende Besprechungen (Dashboard-Widget) ====================== */
.dash-meetings { margin-top: 1.25rem; }

.dash-meetings__card { padding: 4px 0; }

/* --- Activity-Timeline (Schritt 4) --- */
.dash-activity { margin-top: 1.25rem; }
.dash-activity__card { padding: 4px 0; }
.dash-activity__list { list-style: none; margin: 0; padding: 0; }
.dash-activity__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
}
.dash-activity__item:last-child { border-bottom: none; }
.dash-activity__item.is-clickable { cursor: pointer; }
.dash-activity__item.is-clickable:hover { background: var(--bg-card-hover); }
.dash-activity__dot {
  flex: 0 0 auto;
  width: 8px; height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--text-secondary);
}
.dash-activity__item--success .dash-activity__dot { background: var(--success, #2ecc71); }
.dash-activity__item--warning .dash-activity__dot { background: var(--warning, #f1c40f); }
.dash-activity__item--error   .dash-activity__dot { background: var(--danger, #e74c3c); }
.dash-activity__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dash-activity__title { color: var(--text-primary); font-size: 14px; }
.dash-activity__meta { color: var(--text-secondary); font-size: 12px; }

.dash-meetings__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dash-meeting {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--sec-n-100, #eee);
}
.dash-meeting:last-child { border-bottom: 0; }

.dash-meeting__time {
  flex: 0 0 auto;
  min-width: 88px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--accent-primary, #2bbc8a);
}

.dash-meeting__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.dash-meeting__title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-meeting__title svg { vertical-align: -2px; color: var(--accent-video, #6c5ce7); }
.dash-meeting__meta {
  font-size: 0.85em;
  color: var(--sec-n-500, #888);
}

.dash-meeting__join {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.85em;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: var(--accent-video, #6c5ce7);
}
.dash-meeting__join:hover { filter: brightness(1.07); }

/* --- Gruppen-Label --- */
.dash-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
  margin: 16px 0 8px;
}

/* --- Service Tile Grid --- */
.dash-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

/* --- Service Tile --- */
.dash-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--border-color);
  border-radius: var(--radius);
  padding: 12px 14px;
  padding-right: 28px;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.dash-tile:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-sm);
  border-color: var(--accent-primary);
}

/* Status-Akzent am linken Rand (von updateServiceTile gepflegt). */
.dash-tile--healthy   { border-left-color: var(--sec-success); }
.dash-tile--unhealthy { border-left-color: var(--sec-danger); }
.dash-tile--checking  { border-left-color: var(--border-color); }

/* Icon + Name in einer Kopfzeile. */
.dash-tile__head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dash-tile__icon {
  flex-shrink: 0;
  color: var(--accent-primary);
}

.dash-tile__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Favoriten-Stern (oben rechts) + Open-in-Tab-Button. */
.dash-tile__fav {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  opacity: 0.45;
  transition: opacity var(--transition), color var(--transition);
}

.dash-tile:hover .dash-tile__fav { opacity: 0.85; }
.dash-tile__fav:hover { color: var(--accent-primary); opacity: 1; }
.dash-tile__fav.is-active { opacity: 1; color: var(--sec-warning, #f5b301); }
.dash-tile__fav.is-active svg { fill: currentColor; }

.dash-tile__open {
  margin-left: auto;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  opacity: 0;
  transition: opacity var(--transition), color var(--transition);
}

.dash-tile:hover .dash-tile__open { opacity: 0.75; }
.dash-tile__open:hover { color: var(--accent-primary); opacity: 1; }

/* --- Filterleiste --- */
.dash-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 10px 0 6px;
}

.dash-filter-group {
  display: flex;
  gap: 4px;
}

.dash-filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.dash-filter-btn:hover { border-color: var(--accent-primary); color: var(--text-primary); }
.dash-filter-btn.is-active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

.dash-filter-input {
  flex: 1 1 180px;
  min-width: 140px;
  max-width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
}

.dash-filter-input:focus { outline: none; border-color: var(--accent-primary); }

.dash-tile__status-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-tile__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dash-tile__dot--online   { background: var(--sec-success); }
.dash-tile__dot--offline  { background: var(--sec-danger); }
.dash-tile__dot--checking {
  background: var(--border-color);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

.dash-tile__status {
  font-size: 12px;
  color: var(--text-secondary);
}

.dash-tile__badge {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--sec-n-100);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  font-size: 11px;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Schnellzugriff Grid (Dashboard v2) --- */
.dash-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.dash-action {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  transition: all var(--transition);
  font-family: inherit;
  text-align: left;
}

.dash-action:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.dash-action svg {
  flex-shrink: 0;
  color: var(--accent-primary);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .dash-tile-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .dash-actions-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .dash-stats-row .sc-stat-card { flex: 1 1 120px; }
}

/* === Kontext-Panel (Phase 4 – Unified Entity Graph) === */
.sc-context-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--bg-card-hover);
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.2s ease;
  z-index: 40;
}
.sc-context-panel.is-open {
  transform: translateX(0);
}
.sc-context-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--bg-card-hover);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}
.sc-context-close {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  opacity: 0.6;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.sc-context-close:hover {
  opacity: 1;
  background: var(--bg-card-hover);
}
.sc-context-state {
  padding: 12px 16px;
  color: var(--text-primary);
  opacity: 0.6;
  font-size: 12px;
}
/* Dokument-Repraesentationen (document-hub) — pro System eine Zeile mit
   Zustand; verlinkte Eintraege oeffnen die jeweilige Form in neuem Tab. */
.sc-context-reps {
  padding: 0 8px;
}
.sc-context-reps:empty {
  display: none;
}
.sc-context-reps-head {
  padding: 8px 8px 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.6;
  color: var(--text-primary);
}
.sc-context-rep {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text-primary);
}
.sc-context-rep.is-link {
  cursor: pointer;
}
.sc-context-rep.is-link:hover {
  background: var(--bg-card-hover);
}
.sc-context-rep-sys {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sc-context-rep-state {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 10px;
  background: var(--bg-card-hover);
  opacity: 0.85;
  white-space: nowrap;
}
.sc-context-rep-state[data-state="failed"],
.sc-context-rep-state[data-state="quarantined"] {
  color: #b91c1c;
}
.sc-context-rep-state[data-state="completed"],
.sc-context-rep-state[data-state="signed"] {
  color: #15803d;
}

.sc-context-list {
  list-style: none;
  margin: 0;
  padding: 0 8px 16px;
  overflow-y: auto;
  flex: 1;
}
.sc-context-item {
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-primary);
}
.sc-context-item:hover {
  background: var(--bg-card-hover);
}
.sc-context-item-title {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sc-context-item-meta {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.7;
}
.sc-context-type {
  background: var(--bg-card-hover);
  padding: 1px 6px;
  border-radius: 10px;
  font-family: ui-monospace, monospace;
}
.sc-context-relation {
  color: var(--accent-primary);
}

@media (max-width: 768px) {
  .sc-context-panel { width: 100%; }
}

/* === Globale Suche – Sektionen, Entity-Hits (Phase 5) === */
.search-section-header {
  padding: 8px 14px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.5;
  cursor: default;
}
.search-section-header:hover {
  background: transparent !important;
}
.search-result-entity {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 2px;
  align-items: start;
  padding: 8px 14px;
}
.search-result-type {
  grid-row: 1 / span 2;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card-hover);
  color: var(--text-primary);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
}
.search-type-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.search-result-label {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result-snippet {
  grid-column: 2;
  font-size: 12px;
  opacity: 0.7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result-snippet mark {
  background: var(--sec-coral-100);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

/* === Filter-Chips fuer Ctrl+K (P5b) === */
.search-filters {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 14px 4px;
  border-top: 1px solid var(--border-color);
}
.search-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.search-filter-row:empty { display: none; }
.search-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.search-filter-chip[data-filter-source] {
  font-family: ui-monospace, monospace;
}
.search-filter-chip:hover { background: var(--bg-card-hover); }
.search-filter-chip.active {
  background: var(--brand, var(--sec-coral-300));
  color: #fff;
  border-color: var(--brand, var(--sec-coral-300));
}

/* Source-Badge zusaetzlich zum Type-Badge im Treffer. */
.search-result-source {
  grid-row: 1 / span 2;
  align-self: center;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-family: ui-monospace, monospace;
  text-transform: lowercase;
  margin-left: 4px;
}

/* Service-Treffer werden sekundaer unter den Inhalts-Treffern dargestellt. */
.search-section-secondary { opacity: 0.65; }
li.search-section-secondary.search-result-item { font-size: 12px; }

/* Loading-State (animierte Punkte) und Error-State (Retry) im Result-Frame. */
.search-loading {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px;
  color: var(--text-secondary);
  font-size: 13px;
}
.search-loading-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-secondary);
  opacity: 0.4;
  animation: search-loading-pulse 1.2s infinite ease-in-out;
}
.search-loading-dot:nth-child(2) { animation-delay: 0.15s; }
.search-loading-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes search-loading-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}
.search-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text-secondary);
  font-size: 13px;
  border-top: 1px solid var(--border-color);
}
.search-retry-btn {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
}
.search-retry-btn:hover { background: var(--bg-card-hover); }

/* === Kontext-Panel AI-Button (Phase 6) === */
.sc-context-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sc-context-ai {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-primary);
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.03em;
}
.sc-context-ai:hover {
  filter: brightness(1.1);
}
.sc-context-ai svg {
  opacity: 0.9;
}

/* === KI-Admin-Assistent (admin-ai) =================================== */
.admin-ai .aai-head { margin-bottom: 16px; }
.admin-ai .aai-grid {
  display: grid; grid-template-columns: minmax(280px, 1fr) 2fr; gap: 16px;
}
@media (max-width: 900px) {
  .admin-ai .aai-grid { grid-template-columns: 1fr; }
}
.admin-ai .aai-pane-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.admin-ai .aai-pane-head h2 { margin: 0; font-size: 16px; }
.admin-ai .aai-pane-head .aai-refresh { margin-left: auto; }
.admin-ai .aai-findings-pane,
.admin-ai .aai-chat-pane {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: 8px; padding: 16px;
}
.admin-ai .aai-empty, .admin-ai .aai-error { color: var(--text-secondary, var(--text-primary)); }
.admin-ai .aai-error { color: var(--sec-danger); }

.admin-ai .aai-finding {
  border-left: 3px solid var(--border-color);
  padding: 8px 12px; margin-bottom: 8px;
  background: var(--bg-card-hover);
  border-radius: 4px;
}
.admin-ai .aai-critical { border-left-color: var(--sec-danger); }
.admin-ai .aai-warning  { border-left-color: var(--sec-warning); }
.admin-ai .aai-info     { border-left-color: var(--sec-info); }
.admin-ai .aai-finding-head { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.admin-ai .aai-finding-body { font-size: 13px; line-height: 1.4; }

.admin-ai .aai-badge {
  display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 6px;
  border-radius: 3px; background: var(--bg-card); border: 1px solid var(--border-color);
  color: var(--text-primary); letter-spacing: 0.04em;
}
.admin-ai .aai-sev {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 2px 6px; border-radius: 3px;
}
.admin-ai .aai-sev-critical { background: var(--sec-danger); color: #fff; }
.admin-ai .aai-sev-warning  { background: var(--sec-warning); color: #000; }
.admin-ai .aai-sev-info     { background: var(--sec-info); color: #fff; }

.admin-ai .aai-thread {
  height: 360px; overflow-y: auto; padding: 8px;
  background: var(--bg-card-hover); border-radius: 6px; margin-bottom: 12px;
}
.admin-ai .aai-msg {
  margin-bottom: 8px; padding: 8px 10px; border-radius: 6px;
  white-space: pre-wrap; word-break: break-word;
}
.admin-ai .aai-msg-user { background: var(--accent-primary); color: #000; align-self: flex-end; }
.admin-ai .aai-msg-assistant { background: var(--bg-card); border: 1px solid var(--border-color); }
.admin-ai .aai-typing { opacity: 0.6; }

.admin-ai .aai-tool {
  font-family: ui-monospace, monospace; font-size: 12px; opacity: 0.85;
  padding: 4px 8px; margin-bottom: 4px; background: transparent;
  border-left: 2px solid var(--accent-primary);
}
.admin-ai .aai-tool-name { font-weight: 600; }
.admin-ai .aai-tool-result {
  font-family: ui-monospace, monospace; font-size: 12px;
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: 4px; padding: 6px 8px; margin-bottom: 6px; overflow-x: auto;
}
.admin-ai .aai-tool-result pre { margin: 4px 0 0; white-space: pre-wrap; }

.admin-ai .aai-form { display: flex; gap: 8px; }
.admin-ai .aai-form input {
  flex: 1; padding: 8px 12px; border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-card); color: var(--text-primary);
}

/* === Copilot (End-User-Assistent) =================================== */
.copilot .cop-head { margin-bottom: 16px; }
.copilot .cop-tabs { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.copilot .cop-tab {
  padding: 6px 12px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--bg-card); color: var(--text-primary); font-size: 13px;
}
.copilot .cop-tab-active {
  background: var(--accent-primary); color: #000; border-color: var(--accent-primary);
}
.copilot .cop-thread {
  height: 420px; overflow-y: auto; padding: 8px;
  background: var(--bg-card-hover); border-radius: 6px; margin-bottom: 12px;
}
.copilot .cop-msg {
  margin-bottom: 8px; padding: 8px 10px; border-radius: 6px;
  white-space: pre-wrap; word-break: break-word;
}
.copilot .cop-msg-user { background: var(--accent-primary); color: #000; }
.copilot .cop-msg-assistant { background: var(--bg-card); border: 1px solid var(--border-color); }
.copilot .cop-typing { opacity: 0.6; }
.copilot .cop-error { color: var(--sec-danger); }
.copilot .cop-form { display: flex; gap: 8px; }
.copilot .cop-form input {
  flex: 1; padding: 8px 12px; border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-card); color: var(--text-primary);
}

.aai-dialog {
  border: 1px solid var(--border-color); border-radius: 8px;
  background: var(--bg-card); color: var(--text-primary); max-width: 500px;
}
.aai-dialog::backdrop { background: rgba(0, 0, 0, 0.4); }
.aai-confirm h3 { margin: 0 0 12px; }
.aai-confirm .aai-args {
  background: var(--bg-card-hover); border-radius: 4px; padding: 8px;
  font-size: 12px; white-space: pre-wrap; word-break: break-all;
}
.aai-confirm .aai-warn { color: var(--sec-warning); font-size: 12px; margin: 8px 0; }
.aai-confirm menu { display: flex; gap: 8px; justify-content: flex-end; padding: 0; margin: 12px 0 0; }

/* Severity-Filter-Leiste ueber der Findings-Liste */
.admin-ai .aai-summary {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px;
}
.admin-ai .aai-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 4px 10px; border-radius: 999px; cursor: pointer;
  background: var(--bg-card); color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.admin-ai .aai-chip-n {
  font-weight: 700; font-size: 11px; opacity: 0.85;
}
.admin-ai .aai-chip-active { outline: 2px solid var(--accent-primary); outline-offset: -1px; }
.admin-ai .aai-chip-critical .aai-chip-n { color: var(--sec-danger); }
.admin-ai .aai-chip-warning .aai-chip-n { color: var(--sec-warning); }
.admin-ai .aai-chip-info .aai-chip-n { color: var(--sec-info); }

/* Findings: Aktionszeile + aufklappbare Rohdaten */
.admin-ai .aai-finding-actions {
  display: flex; gap: 8px; align-items: center; margin-top: 8px;
}
.admin-ai .sc-btn-sm { font-size: 12px; padding: 4px 10px; }
.admin-ai .aai-link {
  background: none; border: none; cursor: pointer; padding: 0;
  font-size: 12px; color: var(--accent-primary); text-decoration: underline;
}
.admin-ai .aai-finding-details {
  margin: 8px 0 0; padding: 8px; font-size: 11px; line-height: 1.4;
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: 4px; overflow-x: auto; white-space: pre-wrap; word-break: break-word;
  max-height: 240px; overflow-y: auto;
}
.admin-ai .aai-finding-details[hidden] { display: none; }

/* Marker fuer per-Klick gestartete Analyse-Anfragen im Chat */
.admin-ai .aai-analyze-tag {
  display: inline-block; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 1px 6px; border-radius: 3px; margin-right: 4px;
  background: var(--accent-primary); color: #000;
}
.admin-ai .aai-msg-assistant strong { color: var(--text-primary); }
.admin-ai .aai-msg-assistant code {
  font-family: ui-monospace, monospace; font-size: 12px;
  background: var(--bg-card-hover); padding: 1px 4px; border-radius: 3px;
}

/* === Meine Geraete (MDM-Selfservice) === */
.dev-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  padding: 24px;
  margin: 16px;
}
.dev-card h2 { margin: 0; font-size: 20px; font-weight: 600; }
.dev-sr-only {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.dev-sr-status {
  position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden;
}
.dev-header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px; margin-bottom: 8px;
}
.dev-toolbar { display: flex; gap: 12px; align-items: center; }
.dev-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-secondary, #6b7280); cursor: pointer;
}
.dev-toggle input { margin: 0; }
.dev-help {
  /* gray-600 (#4b5563) gives ~7:1 on white — comfortably above WCAG AA. */
  font-size: 13px; color: var(--text-secondary, #4b5563); margin: 8px 0 16px;
}
.dev-help a { color: var(--accent-color, #c2410c); text-decoration: underline; }
.dev-help code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg-card-hover, #f3f4f6); padding: 1px 5px;
  border-radius: 4px;
}
.dev-empty {
  padding: 32px 16px; text-align: center;
  color: var(--text-secondary, #4b5563);
}
.dev-empty-icon { width: 48px; height: 48px; margin: 0 auto 12px; opacity: 0.5; }
.dev-empty h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.dev-empty p { max-width: 480px; margin: 0 auto 16px; font-size: 14px; line-height: 1.5; }
/* Skeleton-Loader fuer das initiale Pagewide-Loading. */
@keyframes dev-skel-shimmer {
  0%   { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}
.dev-skel {
  display: inline-block; height: 14px; border-radius: 4px;
  background: linear-gradient(90deg,
    var(--bg-card-hover, #f3f4f6) 0%,
    var(--border-color-soft, #e5e7eb) 50%,
    var(--bg-card-hover, #f3f4f6) 100%);
  background-size: 400px 100%;
  animation: dev-skel-shimmer 1.4s ease-in-out infinite;
}
.dev-skel-xs { width: 50px; }
.dev-skel-sm { width: 90px; }
.dev-skel-md { width: 140px; }
@media (prefers-reduced-motion: reduce) {
  .dev-skel { animation: none; }
}
.dev-error {
  background: var(--sec-warning-bg, #fef3c7);
  color: var(--sec-warning-text, #92400e);
  border: 1px solid var(--sec-warning, #f59e0b);
  border-radius: 6px; padding: 10px 14px; margin: 8px 0;
  font-size: 13px;
}
.dev-table-wrap { overflow-x: auto; }
.dev-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.dev-table thead th {
  text-align: left; padding: 8px 10px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  color: var(--text-secondary, #6b7280); font-weight: 500;
}
.dev-table tbody td {
  padding: 10px;
  border-bottom: 1px solid var(--border-color-soft, #f3f4f6);
  vertical-align: middle;
}
.dev-table tbody tr:last-child td { border-bottom: none; }
.dev-table code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}
.dev-muted { color: var(--text-tertiary, #6b7280); }
.dev-row-revoking td {
  opacity: 0.45;
  transition: opacity 200ms ease-out;
}
.dev-badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.4px;
}
.dev-badge-corp { background: #dbeafe; color: #1e40af; }
.dev-badge-byod { background: #fef3c7; color: #92400e; }
.dev-badge-active { background: #d1fae5; color: #065f46; }
.dev-badge-revoked { background: #fee2e2; color: #991b1b; }
.dev-btn-revoke,
.dev-btn-secondary,
.dev-btn-primary {
  cursor: pointer;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-color, #e5e7eb);
  background: var(--bg-card-hover, #f9fafb);
  color: var(--text-primary, #111827);
}
.dev-btn-revoke {
  border-color: #fecaca;
  background: #fff;
  color: #991b1b;
}
.dev-btn-revoke:hover { background: #fee2e2; }
.dev-btn-primary {
  background: var(--accent-color, #ff6b6b);
  border-color: var(--accent-color, #ff6b6b);
  color: #fff;
}
.dev-btn-primary:hover { filter: brightness(0.95); }
.dev-btn-secondary:hover { background: var(--bg-card, #fff); }

/* ==============================================================================
   A11y: Skip-Link + Visually-Hidden + Toast/Live-Region
   ============================================================================== */

/* Bei Tab vom Body-Anfang sichtbar; sonst off-screen. */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10000;
  padding: 8px 16px;
  background: var(--accent-primary, #c2410c);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 6px 0;
  transform: translateY(-150%);
  transition: transform 120ms ease;
}
.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--accent-primary, #c2410c);
  outline-offset: 2px;
}

/* Universelle visually-hidden-Klasse für Form-Labels, die nur Screen-Reader
   sehen sollen. Ergänzt das spezifische .dev-sr-only. */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Toast-Stack rechts unten. role="status" + aria-live="polite" wird vom
   toast.js-Modul am Container gesetzt. */
.sc-toast-region {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 40px));
}
.sc-toast {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.4;
  color: #fff;
  background: #1f2937;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: sc-toast-in 160ms ease-out;
}
.sc-toast--info    { background: #1e40af; }
.sc-toast--success { background: #065f46; }
.sc-toast--warning { background: #92400e; }
.sc-toast--danger  { background: #991b1b; }

@keyframes sc-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .sc-toast { animation: none; }
  .skip-link { transition: none; }
}

/* ==============================================================================
   Welcome-Tour, Help-Modal, Support-Modal, Maintenance-Banner, Skeleton.
   Kein bg-Token-Override; nutzt vorhandene CSS-Variablen aus :root + dark-Theme.
   ============================================================================== */

/* --- Skeleton --- */
.sc-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  min-height: 80px;
}
.sc-skeleton__row {
  display: flex;
  gap: 10px;
}
.sc-skeleton__bar {
  flex: 1;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--bg-card-hover, #eee) 0%,
    var(--bg-secondary, #f6f6f6) 50%,
    var(--bg-card-hover, #eee) 100%
  );
  background-size: 200% 100%;
  animation: sc-skel-shimmer 1.4s ease-in-out infinite;
}
@keyframes sc-skel-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sc-skeleton__bar { animation: none; }
}

/* --- Error mit Retry --- */
.sc-error { align-items: flex-start; }
.sc-error__body { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sc-error__code {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  opacity: 0.8;
}
.sc-error__msg { font-size: 14px; line-height: 1.4; }
.sc-error__actions { display: flex; gap: 8px; margin-top: 6px; }

/* --- Maintenance-Banner --- */
.sc-maintenance {
  position: relative;
  z-index: 50;
  width: 100%;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.4;
}
.sc-maintenance--warning { background: #fef3c7; color: #78350f; }
.sc-maintenance--critical { background: #fee2e2; color: #7f1d1d; }
[data-theme="dark"] .sc-maintenance--warning { background: #4a3514; color: #fde68a; }
[data-theme="dark"] .sc-maintenance--critical { background: #4a1d1d; color: #fecaca; }
.sc-maintenance__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.sc-maintenance__title { font-weight: 600; }
.sc-maintenance__when { opacity: 0.85; font-variant-numeric: tabular-nums; }
.sc-maintenance__dismiss {
  margin-left: auto;
  background: transparent;
  border: 0;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.sc-maintenance__dismiss:hover { background: rgba(0, 0, 0, 0.08); }
.sc-maintenance__dismiss:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* --- Welcome-Tour Overlay --- */
.sc-welcome-overlay,
.sc-help-overlay,
.sc-support-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9500;
  padding: 16px;
}
.sc-welcome-overlay--visible,
.sc-help-overlay--visible,
.sc-support-overlay--visible {
  display: flex;
}
.sc-welcome,
.sc-help,
.sc-support {
  background: var(--bg-card);
  color: var(--text-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: min(560px, 100%);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sc-help { width: min(640px, 100%); }
.sc-welcome__head,
.sc-help__head,
.sc-support__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}
.sc-welcome__head h2,
.sc-help__head h2,
.sc-support__head h2 {
  flex: 1;
  font-size: 18px;
  margin: 0;
}
.sc-welcome__skip,
.sc-help__close,
.sc-support__close {
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 6px;
}
.sc-help__close,
.sc-support__close { font-size: 22px; line-height: 1; }
.sc-welcome__skip:hover,
.sc-help__close:hover,
.sc-support__close:hover { background: var(--bg-card-hover); }
.sc-welcome__skip:focus-visible,
.sc-help__close:focus-visible,
.sc-support__close:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.sc-welcome__body { padding: 20px; min-height: 140px; }
.sc-welcome__step-title { font-size: 16px; margin-bottom: 8px; }
.sc-welcome__step-text { color: var(--text-secondary); line-height: 1.5; }
.sc-welcome__foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
}
.sc-welcome__dots { display: flex; gap: 6px; flex: 1; }
.sc-welcome__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-color);
  transition: background var(--transition);
}
.sc-welcome__dot--active { background: var(--accent-primary); }
.sc-welcome__nav { display: flex; gap: 8px; }

/* --- Help-Modal --- */
.sc-help__search { padding: 12px 20px; border-bottom: 1px solid var(--border-color); }
.sc-help__search input {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
}
.sc-help__list {
  list-style: none;
  margin: 0;
  padding: 8px 12px;
  overflow-y: auto;
  flex: 1;
}
.sc-help__item {
  padding: 12px;
  border-radius: var(--radius);
}
.sc-help__item + .sc-help__item { border-top: 1px solid var(--border-color); border-radius: 0; }
.sc-help__item-title { font-size: 14px; margin: 0 0 4px; }
.sc-help__item-body { color: var(--text-secondary); font-size: 13px; line-height: 1.5; margin: 0; }
.sc-help__item-actions { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.sc-help__empty { padding: 24px; text-align: center; color: var(--text-secondary); }
.sc-help__foot {
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
}

/* --- Support-Modal --- */
.sc-support__intro { padding: 12px 20px 0; color: var(--text-secondary); font-size: 13px; }
.sc-support__form { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.sc-field--inline { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 0; }
.sc-support__actions { display: flex; gap: 8px; justify-content: flex-end; }
.sc-support__status { font-size: 13px; min-height: 18px; margin: 0; }
.sc-support__status--ok { color: #166534; }
.sc-support__status--err { color: #b91c1c; }
[data-theme="dark"] .sc-support__status--ok { color: #86efac; }
[data-theme="dark"] .sc-support__status--err { color: #fca5a5; }
.sc-support__mailto {
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: underline;
  align-self: flex-start;
}

/* Nur neuer Button-Modifier — die Basis-`.sc-btn`-Stile leben weiter
   oben in dieser Datei und werden nicht ueberschrieben. */
.sc-btn--ghost { background: transparent; }
.sc-btn--ghost:hover { background: var(--bg-card-hover); }

/* Mobile adjustments */
@media (max-width: 600px) {
  .sc-welcome,
  .sc-help,
  .sc-support {
    width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .sc-maintenance__inner { font-size: 12px; }
}

/* ===================================================================== */
/* Kalender (native View) — webui/src/js/views/calendar.js               */
/* ===================================================================== */
.sc-cal { display: flex; flex-direction: column; gap: 16px; }

.sc-cal__bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.sc-cal__nav { display: flex; align-items: center; gap: 8px; }
.sc-cal__title {
  margin: 0 4px; font-size: 20px; font-weight: 700; color: var(--sec-fg);
  min-width: 9.5em;
}
.sc-cal__btn, .sc-cal__today {
  cursor: pointer; border: 1px solid var(--sec-border);
  background: var(--sec-bg); color: var(--sec-fg);
  border-radius: 8px; line-height: 1; transition: background .15s, border-color .15s;
}
.sc-cal__btn { width: 34px; height: 34px; font-size: 20px; }
.sc-cal__today { height: 34px; padding: 0 14px; font-size: 13px; font-weight: 600; }
.sc-cal__btn:hover, .sc-cal__today:hover {
  background: var(--sec-coral-50); border-color: var(--sec-coral);
}
.sc-cal__nc {
  font-size: 13px; font-weight: 600; color: var(--sec-coral-600);
  text-decoration: none;
}
.sc-cal__nc:hover { text-decoration: underline; }

.sc-cal__body { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 1100px) {
  .sc-cal__body { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
}
.sc-cal__main { position: relative; min-width: 0; }

.sc-cal__weekhead, .sc-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.sc-cal__weekhead { gap: 4px; margin-bottom: 4px; }
.sc-cal__wd {
  text-align: center; font-size: 12px; font-weight: 700;
  color: var(--sec-fg-muted); padding: 4px 0; text-transform: uppercase;
}
.sc-cal__grid {
  gap: 4px; border: 1px solid var(--sec-border); border-radius: 12px;
  padding: 4px; background: var(--sec-bg-warm);
}
.sc-cal__cell {
  min-height: 96px; background: var(--sec-bg); border: 1px solid transparent;
  border-radius: 8px; padding: 4px 5px; display: flex; flex-direction: column;
  gap: 3px; cursor: pointer; overflow: hidden; transition: border-color .12s, box-shadow .12s;
}
.sc-cal__cell:hover { border-color: var(--sec-coral); }
.sc-cal__cell:focus-visible { outline: 2px solid var(--sec-coral); outline-offset: 1px; }
.sc-cal__cell.is-other { background: transparent; }
.sc-cal__cell.is-other .sc-cal__daynum { color: var(--sec-fg-subtle, var(--sec-fg-muted)); opacity: .55; }
.sc-cal__cell.is-selected { border-color: var(--sec-coral); box-shadow: 0 0 0 1px var(--sec-coral) inset; }
.sc-cal__daynum { font-size: 13px; font-weight: 600; color: var(--sec-fg); align-self: flex-end; }
.sc-cal__cell.is-today .sc-cal__daynum {
  background: var(--sec-coral); color: #fff; border-radius: 999px;
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
}
.sc-cal__chips { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sc-cal__chip {
  font-size: 11px; line-height: 1.35; color: var(--sec-fg);
  background: var(--sec-coral-100); border-left: 3px solid var(--sec-coral);
  border-radius: 4px; padding: 1px 5px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}
.sc-cal__chip b { font-weight: 700; }
.sc-cal__chip.is-video { background: var(--sec-coral-50); border-left-color: var(--sec-accent); }
.sc-cal__chip.is-cancelled { text-decoration: line-through; opacity: .55; }
.sc-cal__chip-ico { margin-right: 2px; }
.sc-cal__more { font-size: 11px; color: var(--sec-coral-600); font-weight: 600; padding-left: 2px; }

.sc-cal__detail {
  border: 1px solid var(--sec-border); border-radius: 12px;
  padding: 14px 16px; background: var(--sec-bg);
}
.sc-cal__detail--empty { display: flex; align-items: center; min-height: 80px; }
.sc-cal__detail-title { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--sec-fg); }
.sc-cal__evlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sc-cal__ev { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; border-top: 1px solid var(--sec-border); }
.sc-cal__ev:first-child { border-top: none; }
.sc-cal__ev-time { font-size: 12px; font-weight: 700; color: var(--sec-coral-600); white-space: nowrap; min-width: 5.5em; }
.sc-cal__ev-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.sc-cal__ev-title { font-size: 13px; font-weight: 600; color: var(--sec-fg); }
.sc-cal__ev-meta { font-size: 12px; color: var(--sec-fg-muted); }
.sc-cal__ev.is-cancelled .sc-cal__ev-title { text-decoration: line-through; opacity: .6; }
.sc-cal__join {
  font-size: 12px; font-weight: 600; color: #fff; background: var(--sec-coral);
  padding: 3px 10px; border-radius: 6px; text-decoration: none; white-space: nowrap;
}
.sc-cal__join:hover { background: var(--sec-coral-600); }

.sc-cal__loading {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center;
  justify-content: center; gap: 10px; font-size: 13px; color: var(--sec-fg-muted);
  background: color-mix(in srgb, var(--sec-bg) 70%, transparent); border-radius: 12px;
}
.sc-cal__spinner {
  width: 16px; height: 16px; border: 2px solid var(--sec-border);
  border-top-color: var(--sec-coral); border-radius: 50%;
  animation: sc-cal-spin .7s linear infinite;
}
@keyframes sc-cal-spin { to { transform: rotate(360deg); } }
.sc-cal__errnote {
  font-size: 13px; color: var(--sec-danger); background: var(--sec-coral-50);
  border: 1px solid var(--sec-danger); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px;
}

@media (max-width: 640px) {
  .sc-cal__cell { min-height: 68px; }
  .sc-cal__chip { font-size: 10px; }
  .sc-cal__title { font-size: 17px; min-width: 0; }
}

/* Kalender — Aktionen, editierbare Zeilen, Modal-Formular */
.sc-cal__actions { display: flex; align-items: center; gap: 12px; }
.sc-cal__new {
  cursor: pointer; border: none; background: var(--sec-coral); color: #fff;
  font-size: 13px; font-weight: 600; height: 34px; padding: 0 14px;
  border-radius: 8px; transition: background .15s;
}
.sc-cal__new:hover { background: var(--sec-coral-600); }

.sc-cal__detail-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sc-cal__detail-head .sc-cal__detail-title { margin: 0; }
.sc-cal__addday {
  cursor: pointer; border: 1px solid var(--sec-border); background: var(--sec-bg);
  color: var(--sec-coral-600); width: 28px; height: 28px; border-radius: 8px;
  font-size: 18px; line-height: 1; flex: none;
}
.sc-cal__addday:hover { background: var(--sec-coral-50); border-color: var(--sec-coral); }

.sc-cal__ev.is-editable { cursor: pointer; border-radius: 6px; transition: background .12s; }
.sc-cal__ev.is-editable:hover { background: var(--sec-coral-50); }

.sc-cal__overlay {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center;
  justify-content: center; padding: 16px;
  background: color-mix(in srgb, var(--sec-black, #000) 45%, transparent);
}
.sc-cal__modal {
  width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto;
  background: var(--sec-bg); border: 1px solid var(--sec-border);
  border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}
.sc-cal__modal-head { display: flex; align-items: center; justify-content: space-between; }
.sc-cal__modal-head h3 { margin: 0; font-size: 17px; font-weight: 700; color: var(--sec-fg); }
.sc-cal__modal-x {
  cursor: pointer; border: none; background: transparent; color: var(--sec-fg-muted);
  font-size: 24px; line-height: 1; padding: 0 4px;
}
.sc-cal__modal-x:hover { color: var(--sec-fg); }

.sc-cal__field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--sec-fg); }
.sc-cal__field > span { font-weight: 600; color: var(--sec-fg-muted); }
.sc-cal__field input, .sc-cal__field select, .sc-cal__field textarea {
  border: 1px solid var(--sec-border); border-radius: 8px; padding: 8px 10px;
  font-size: 14px; color: var(--sec-fg); background: var(--sec-bg); font-family: inherit;
}
.sc-cal__field input:focus, .sc-cal__field select:focus, .sc-cal__field textarea:focus {
  outline: none; border-color: var(--sec-coral); box-shadow: 0 0 0 2px var(--sec-coral-100);
}
.sc-cal__field textarea { resize: vertical; }
.sc-cal__row { display: grid; grid-template-columns: 1fr 110px; gap: 10px; }
.sc-cal__row .sc-cal__time[hidden] { display: none; }
.sc-cal__check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sec-fg); cursor: pointer; }

.sc-cal__modal-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.sc-cal__modal-actions { display: flex; gap: 8px; }
.sc-cal__save, .sc-cal__cancel, .sc-cal__del {
  cursor: pointer; border-radius: 8px; height: 36px; padding: 0 16px; font-size: 14px; font-weight: 600;
}
.sc-cal__save { border: none; background: var(--sec-coral); color: #fff; }
.sc-cal__save:hover { background: var(--sec-coral-600); }
.sc-cal__save:disabled { opacity: .6; cursor: default; }
.sc-cal__cancel { border: 1px solid var(--sec-border); background: var(--sec-bg); color: var(--sec-fg); }
.sc-cal__cancel:hover { background: var(--sec-bg-warm); }
.sc-cal__del { border: 1px solid var(--sec-danger); background: transparent; color: var(--sec-danger); }
.sc-cal__del:hover { background: var(--sec-coral-50); }

@media (max-width: 640px) {
  .sc-cal__row { grid-template-columns: 1fr; }
}
