/* ============================================================
   AUG.PRIEN × STAQ Portal v3.0
   Corporate Identity: Navy #0C2340 + Cyan #6EEBED
   Fonts: Inter / Outfit / JetBrains Mono
   Quelle: Aug. Prien Nachhaltigkeitsbericht 2024
   ============================================================ */

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

/* ------------------------------------------------------------
   1. Design Tokens
   ------------------------------------------------------------ */
:root {
  /* Aug. Prien Corporate Identity — aus Nachhaltigkeitsbericht 2024 */
  --ap-navy: #0C2340;
  --ap-navy-light: #1A3358;
  --ap-navy-dark: #081A30;
  --ap-cyan: #6EEBED;
  --ap-cyan-dark: #4BC8CA;
  --ap-cyan-light: #E0FAFB;
  --ap-gray-100: #F5F6F8;
  --ap-gray-200: #E8E9EB;
  --ap-gray-300: #D1D3D8;
  --ap-gray-400: #B4B7BC;
  --ap-gray-600: #6B7280;

  /* Aliase für bestehendes System */
  --ap-blue-900: var(--ap-navy);
  --ap-blue-700: var(--ap-navy-light);
  --ap-blue-500: var(--ap-cyan-dark);
  --ap-blue-300: var(--ap-cyan);
  --ap-blue-100: var(--ap-cyan-light);

  --bg: var(--ap-gray-100);
  --surface: #ffffff;
  --surface2: #FAFBFC;
  --surface-elevated: #ffffff;
  --border: var(--ap-gray-200);
  --border-light: var(--ap-gray-100);
  --text: var(--ap-navy);
  --text-secondary: #3D5068;
  --text-muted: var(--ap-gray-400);
  --accent: var(--ap-cyan);
  --accent-hover: var(--ap-cyan-dark);
  --accent-light: var(--ap-cyan-light);
  --accent-subtle: #F0FAFB;
  --green: #00875A;
  --green-light: #E6F7EF;
  --yellow: #B8860B;
  --yellow-light: #FFF8E6;
  --red: #C42B2B;
  --red-light: #FFF0F0;
  --purple: #5B3E96;
  --orange: #C75B00;
  --sidebar-bg: var(--ap-navy);
  --sidebar-surface: var(--ap-navy-light);
  --sidebar-text: #8BA3C4;
  --sidebar-active: #FFFFFF;
  --sidebar-hover: var(--ap-navy-light);
  --sidebar-accent: var(--ap-cyan);
  --topbar-height: 56px;
  --sidebar-width: 256px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.12);
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-display: 'Outfit', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
  --font: var(--font-body);
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent);
  color: #ffffff;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #999; }

/* ------------------------------------------------------------
   3. Portal Layout (CSS Grid)
   ------------------------------------------------------------ */
.portal-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--topbar-height) 1fr;
  min-height: 100vh;
  transition: grid-template-columns var(--transition-slow);
}

.portal-topbar {
  grid-column: 1 / -1;
}

.portal-sidebar {
  grid-row: 2;
  overflow-y: auto;
}

.portal-content {
  grid-row: 2;
  overflow-y: auto;
  padding: 28px 32px;
  background: linear-gradient(180deg, var(--bg) 0%, #fafaf8 100%);
}

/* ------------------------------------------------------------
   4. Topbar — Glassmorphism
   ------------------------------------------------------------ */
.portal-topbar {
  height: var(--topbar-height);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: relative;
  z-index: 100;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-brand .brand-sub {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 0.8rem;
}

.topbar-logo {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: -0.5px;
  color: var(--text);
}

.topbar-mandant {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 0.8rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.topbar-clock {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.topbar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  transition: transform var(--transition);
}

.topbar-badge:hover {
  transform: scale(1.05);
}

.topbar-notification {
  position: relative;
  font-size: 1.1rem;
  cursor: pointer;
  transition: color var(--transition);
}

.topbar-notification:hover {
  color: var(--text);
}

.topbar-notification .notification-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid white;
}

/* ------------------------------------------------------------
   5. Sidebar — Deep Black Premium
   ------------------------------------------------------------ */
.portal-sidebar {
  background: linear-gradient(180deg, var(--ap-blue-900) 0%, #0D2847 100%);
  color: var(--sidebar-text);
  position: relative;
}

.sidebar-header {
  height: 64px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--sidebar-active);
  letter-spacing: -0.5px;
}

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

.sidebar-sub {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #555;
  margin-top: 2px;
}

.sidebar-nav {
  padding-top: 12px;
}

.nav-section {
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 2.5px;
  color: #5A7A9E;
  padding: 24px 24px 8px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px 10px 24px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  color: var(--sidebar-text);
  text-decoration: none;
  border-left: 2px solid transparent;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  transform: translateX(2px);
  color: #d1d5db;
}

.nav-item.active {
  color: var(--sidebar-active);
  border-left: 2px solid var(--accent);
  background: rgba(59,130,246,0.08);
  font-weight: 600;
}

.nav-item-wow {
  position: relative;
  color: #c4b5fd;
  font-weight: 600;
}

.nav-item-wow::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 0;
  padding: 1px;
  background: linear-gradient(90deg, rgba(59,130,246,0.3), rgba(107,47,189,0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.nav-item-wow:hover {
  background: rgba(107,47,189,0.12);
  color: #e0d4fd;
}

.nav-icon {
  width: 16px;
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.6;
  transition: opacity var(--transition);
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  opacity: 1;
}

.nav-badge {
  position: absolute;
  right: 14px;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(204,28,28,0.4);
}

.sidebar-footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 12px 24px;
  font-size: 0.65rem;
  color: #5A7A9E;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ------------------------------------------------------------
   6. Cards — Elevated
   ------------------------------------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: -0.2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  background: var(--surface2);
  font-size: 0.8rem;
}

/* ------------------------------------------------------------
   7. KPI Cards — Data-Dense Premium
   ------------------------------------------------------------ */
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.kpi-card.kpi-green  { border-top-color: var(--green); }
.kpi-card.kpi-red    { border-top-color: var(--red); }
.kpi-card.kpi-yellow { border-top-color: var(--yellow); }
.kpi-card.kpi-purple { border-top-color: var(--purple); }

.kpi-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
  font-weight: 600;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text);
  line-height: 1.2;
}

.kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kpi-positive { color: var(--green); }
.kpi-positive::before { content: '\2191 '; }
.kpi-negative { color: var(--red); }
.kpi-negative::before { content: '\2193 '; }
.kpi-neutral  { color: var(--accent); }

/* ------------------------------------------------------------
   8. Badges — Refined Pill Design
   ------------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-blue   { background: #EBF0FF; color: #0047FF; border: 1px solid rgba(0,71,255,0.15); }
.badge-green  { background: var(--green-light); color: var(--green); border: 1px solid rgba(0,135,90,0.15); }
.badge-yellow { background: var(--yellow-light); color: var(--yellow); border: 1px solid rgba(194,120,3,0.15); }
.badge-red    { background: var(--red-light); color: var(--red); border: 1px solid rgba(204,28,28,0.15); }
.badge-purple { background: #f3e8ff; color: var(--purple); border: 1px solid rgba(107,47,189,0.15); }
.badge-orange { background: #fff7ed; color: var(--orange); border: 1px solid rgba(217,84,0,0.15); }

/* ------------------------------------------------------------
   9. Buttons — Crisp
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  transition: all var(--transition);
}

.btn:hover {
  background: var(--surface2);
  border-color: #ccc;
}

.btn-primary {
  background: var(--ap-cyan);
  color: var(--ap-navy);
  border-color: var(--ap-cyan);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(110,235,237,0.3);
}

.btn-primary:hover {
  background: var(--ap-cyan-dark);
  color: var(--ap-navy);
  box-shadow: 0 4px 12px rgba(110,235,237,0.25);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface2);
  border-color: var(--border);
}

.btn-danger {
  background: var(--red);
  color: white;
  border-color: var(--red);
  box-shadow: 0 1px 3px rgba(204,28,28,0.3);
}

.btn-danger:hover {
  background: #a51717;
  box-shadow: 0 4px 12px rgba(204,28,28,0.25);
  transform: translateY(-1px);
}

.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-lg { padding: 12px 24px; font-size: 14px; }

/* ------------------------------------------------------------
   10. Tables — Bloomberg-Style
   ------------------------------------------------------------ */
.table-base {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table-base th {
  text-align: left;
  padding: 10px 14px;
  background: var(--surface2);
  border-bottom: 2px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.table-base td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  font-feature-settings: 'tnum';
}

.table-base tr:hover {
  background: var(--accent-subtle);
}

.table-base .mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

.table-base .right {
  text-align: right;
  font-family: var(--font-mono);
}

/* ------------------------------------------------------------
   11. Forms — Refined
   ------------------------------------------------------------ */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-input,
.form-select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--surface);
  color: var(--text);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,71,255,0.08);
}

.form-input::placeholder {
  color: var(--text-muted);
}

/* ------------------------------------------------------------
   12. Section Titles
   ------------------------------------------------------------ */
.section-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: -0.3px;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

/* ------------------------------------------------------------
   13. Alerts — Subtle with Left Stripe
   ------------------------------------------------------------ */
.alert {
  padding: 12px 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.alert-green {
  background: var(--green-light);
  color: var(--green);
  border-left: 3px solid var(--green);
}

.alert-yellow {
  background: var(--yellow-light);
  color: var(--yellow);
  border-left: 3px solid var(--yellow);
}

.alert-red {
  background: var(--red-light);
  color: var(--red);
  border-left: 3px solid var(--red);
}

.alert-blue {
  background: var(--accent-light);
  color: var(--accent);
  border-left: 3px solid var(--accent);
}

/* ------------------------------------------------------------
   14. Tags — Minimal
   ------------------------------------------------------------ */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  letter-spacing: 0.3px;
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

/* ------------------------------------------------------------
   15. Progress Bar — Slim
   ------------------------------------------------------------ */
.progress-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-green  .progress-fill { background: var(--green); }
.progress-yellow .progress-fill { background: var(--yellow); }
.progress-red    .progress-fill { background: var(--red); }

/* ------------------------------------------------------------
   16. Modal — Premium Overlay
   ------------------------------------------------------------ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 520px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: fadeInUp 0.3s ease-out;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  margin-bottom: 16px;
  letter-spacing: -0.3px;
}

/* ------------------------------------------------------------
   17. Toast Notifications
   ------------------------------------------------------------ */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: var(--radius);
  color: white;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: toastIn 0.35s ease-out;
}

.toast-success { background: rgba(0,135,90,0.95); }
.toast-error   { background: rgba(204,28,28,0.95); }
.toast-info    { background: rgba(0,71,255,0.95); }

@keyframes toastIn {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ------------------------------------------------------------
   18. Animations
   ------------------------------------------------------------ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.animate-in   { animation: fadeInUp 0.4s ease-out both; }
.animate-fade { animation: fadeIn 0.3s ease-out both; }

/* ============================================================
   18b. Lifecycle Portal — Neue Komponenten
   ============================================================ */

/* Pulsierender Dot (Live Intake Sidebar) */
.nav-pulse {
  display: inline-block;
  width: 8px; height: 8px;
  background: #ef4444;
  border-radius: 50%;
  margin-left: auto;
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* Sidebar Lifecycle Separator */
.nav-section-highlight {
  color: var(--ap-blue-300) !important;
  letter-spacing: 0.12em;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 14px !important;
  margin-top: 8px;
}
.nav-item-lifecycle {
  background: rgba(74, 143, 212, 0.08);
  border-left: 3px solid var(--ap-blue-300);
}
.nav-item-lifecycle:hover {
  background: rgba(74, 143, 212, 0.15);
}

/* Live Intake — Idle State */
.intake-idle {
  text-align: center;
  padding: 60px 40px;
}
.intake-idle-dot {
  width: 16px; height: 16px;
  background: var(--green);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 0 12px rgba(5, 122, 85, 0.4);
}
.intake-idle h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 16px 0 8px;
  color: var(--text);
}
.intake-idle p {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.intake-countdown {
  width: 200px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 16px auto;
  overflow: hidden;
}
.intake-countdown-fill {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: width 1s linear;
}

/* Live Intake — Deal Card Animation */
@keyframes slideInFromTop {
  from { opacity: 0; transform: translateY(-40px); }
  to   { opacity: 1; transform: translateY(0); }
}
.intake-deal-card {
  animation: slideInFromTop 0.6s ease-out both;
  border: 2px solid var(--green);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 24px;
  box-shadow: var(--shadow-md);
}
.intake-deal-card .deal-badge-new {
  display: inline-block;
  background: var(--green);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Score Bar */
.score-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}
.score-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease-out;
}
.score-bar-fill.score-high { background: var(--green); }
.score-bar-fill.score-mid  { background: var(--yellow); }
.score-bar-fill.score-low  { background: var(--red); }

/* Übergabe Modal */
.uebergabe-modal .checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 0.85rem;
}
.uebergabe-modal .checklist-item input[type="checkbox"] {
  accent-color: var(--green);
}

/* Übergabe Checkmark Animation */
@keyframes checkmark {
  0% { transform: scale(0) rotate(-45deg); opacity: 0; }
  50% { transform: scale(1.2) rotate(0deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.uebergabe-success {
  text-align: center;
  padding: 40px;
}
.uebergabe-success .checkmark {
  font-size: 4rem;
  animation: checkmark 0.6s ease-out both;
}

/* Portfolio — NEU Badge */
.asset-card-new {
  border: 2px solid var(--green) !important;
  position: relative;
}
.asset-card-new::after {
  content: 'NEU';
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--green);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.05em;
}

/* Portfolio — CRREM Indicator */
.crrem-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 4px;
}
.crrem-ok      { background: var(--green); }
.crrem-warning { background: var(--yellow); }
.crrem-risk    { background: var(--red); }

/* KI-Assistent — Chat */
.chat-container {
  max-width: 800px;
  margin: 0 auto;
}
.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.chat-suggestion-btn {
  background: var(--ap-blue-100);
  color: var(--ap-blue-700);
  border: 1px solid var(--ap-blue-300);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}
.chat-suggestion-btn:hover {
  background: var(--ap-blue-300);
  color: white;
}
.chat-messages {
  min-height: 300px;
  max-height: 500px;
  overflow-y: auto;
  padding: 16px 0;
}
.chat-msg {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  animation: fadeInUp 0.3s ease-out both;
}
.chat-msg-user { justify-content: flex-end; }
.chat-msg-user .chat-bubble {
  background: var(--ap-blue-700);
  color: white;
  border-radius: 16px 16px 4px 16px;
}
.chat-msg-ai .chat-bubble {
  background: var(--surface2);
  color: var(--text);
  border-radius: 16px 16px 16px 4px;
  border: 1px solid var(--border);
}
.chat-bubble {
  padding: 12px 16px;
  max-width: 600px;
  font-size: 0.87rem;
  line-height: 1.6;
  white-space: pre-wrap;
}
.chat-input-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.chat-input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 0.87rem;
  font-family: var(--font-body);
  outline: none;
}
.chat-input:focus { border-color: var(--ap-blue-500); }
.chat-send-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--ap-blue-700);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background 0.2s;
}
.chat-send-btn:hover { background: var(--ap-blue-500); }

/* Dashboard — Live Pulse Widget */
.live-pulse-widget {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--green-light);
  border: 1px solid var(--green);
  border-radius: var(--radius);
  padding: 10px 16px;
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.live-pulse-widget:hover { box-shadow: var(--shadow-sm); }
.live-pulse-dot {
  width: 10px; height: 10px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

/* Dashboard — Lifecycle Tracker */
.lifecycle-tracker {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
}
.lifecycle-stage {
  flex: 1;
  text-align: center;
  position: relative;
  padding: 8px 4px;
  cursor: pointer;
  transition: background 0.2s;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
}
.lifecycle-stage:hover { background: var(--surface2); }
.lifecycle-stage-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.lifecycle-stage-count {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}
.lifecycle-arrow {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0 2px;
}

/* ------------------------------------------------------------
   19. Utility Classes
   ------------------------------------------------------------ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }

.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.text-muted    { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-sm       { font-size: 0.8rem; }
.text-xs       { font-size: 0.7rem; }
.font-mono     { font-family: var(--font-mono); }
.font-display  { font-family: var(--font-display); }
.fw-700        { font-weight: 700; }
.hidden        { display: none !important; }

/* ------------------------------------------------------------
   20. Print Styles
   ------------------------------------------------------------ */
@media print {
  .portal-sidebar,
  .portal-topbar,
  .no-print {
    display: none !important;
  }

  .portal-layout {
    display: block;
  }

  .portal-content {
    padding: 0;
  }

  .card, .kpi-card {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  body {
    background: white;
    color: black;
  }
}

/* ------------------------------------------------------------
   21. Responsive
   ------------------------------------------------------------ */
@media (max-width: 1280px) {
  .grid-5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1024px) {
  .portal-layout {
    grid-template-columns: 1fr;
  }

  .portal-sidebar {
    display: none;
  }

  .portal-content {
    padding: 20px 16px;
  }

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

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

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

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

  .portal-content {
    padding: 16px 12px;
  }
}
