/* ============================================================
   DPR Executive PM Copilot – Corporate Design System
   DPR Deutscher Prüfdienst für Betriebssicherheit GmbH
   ============================================================ */

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

/* ── CSS Variables ───────────────────────────────── */
:root {
  /* Primary DPR Grün */
  --dpr-green:        #0dd18c;
  --dpr-green-dark:   #0aaa72;
  --dpr-green-deep:   #088a5c;
  --dpr-green-light:  #d0f7eb;
  --dpr-green-glow:   rgba(13, 209, 140, 0.18);

  /* Hintergründe */
  --bg-page:          #f4f5f7;
  --bg-card:          #ffffff;
  --bg-topbar:        #0f1923;
  --bg-hero:          #0f1923;
  --bg-hatch:         #e8eaed;

  /* Texte */
  --text-primary:     #1a2332;
  --text-secondary:   #5a6a7a;
  --text-muted:       #8a9bac;
  --text-on-dark:     #ffffff;
  --text-topbar:      rgba(255, 255, 255, 0.88);

  /* Rahmen */
  --border-card:      #eaecef;
  --border-default:   #e2e6ea;

  /* Border-Radii */
  --r-sm:    6px;
  --r-md:   12px;
  --r-lg:   18px;
  --r-xl:   24px;

  /* Schatten */
  --shadow-card:      0 4px 20px rgba(0,0,0,0.07);
  --shadow-hover:     0 8px 32px rgba(13,209,140,0.15);
  --shadow-modal:     0 20px 60px rgba(0,0,0,0.25);
  --shadow-topbar:    0 2px 16px rgba(0,0,0,0.25);

  /* Transitions */
  --trans:    0.22s cubic-bezier(0.4, 0, 0.2, 1);

  /* Badge Colors */
  --badge-live-bg:    #ecfdf5; --badge-live-fg:    #059669;
  --badge-warn-bg:    #fef9ec; --badge-warn-fg:    #b45309;
  --badge-crit-bg:    #fef2f2; --badge-crit-fg:    #dc2626;
  --badge-info-bg:    #fffbeb; --badge-info-fg:    #d97706;
  --badge-termin-bg:  #eef2ff; --badge-termin-fg:  #4f46e5;
  --badge-green-bg:   #d0f7eb; --badge-green-fg:   #088a5c;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  background: var(--bg-page);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-page); }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Topbar ────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 60px;
  background: var(--bg-topbar);
  border-bottom: 2px solid var(--dpr-green);
  box-shadow: var(--shadow-topbar);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.topbar-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--dpr-green);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-topbar);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.topbar-name {
  color: var(--text-on-dark);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.topbar-name span {
  color: var(--dpr-green);
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 32px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  color: var(--text-topbar);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: var(--trans);
  white-space: nowrap;
}

.nav-link i { font-size: 12px; opacity: 0.8; }

.nav-link:hover,
.nav-link.active {
  background: rgba(255,255,255,0.08);
  color: var(--dpr-green);
}

.nav-link.active { background: rgba(13,209,140,0.12); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  flex-shrink: 0;
}

.topbar-time {
  font-size: 12px;
  color: var(--text-topbar);
  opacity: 0.75;
}

.topbar-greeting {
  font-size: 13px;
  color: var(--dpr-green);
  font-weight: 500;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--dpr-green);
  color: var(--bg-topbar);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sync-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-topbar);
  opacity: 0.7;
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dpr-green);
  animation: pulse 2s infinite;
}

.sync-dot.warning { background: #f59e0b; }
.sync-dot.error { background: #ef4444; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-on-dark);
  border-radius: 1px;
  transition: var(--trans);
}

/* ── Hero Section ──────────────────────────────────── */
.hero {
  background: var(--bg-hero);
  padding: 28px 24px 24px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--dpr-green), transparent);
}

.hero-deco {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero-deco-1 {
  width: 400px; height: 400px;
  top: -200px; right: -100px;
  background: radial-gradient(circle, rgba(13,209,140,0.06) 0%, transparent 70%);
}

.hero-deco-2 {
  width: 250px; height: 250px;
  bottom: -100px; left: 40%;
  background: radial-gradient(circle, rgba(13,209,140,0.04) 0%, transparent 70%);
}

.hero-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--dpr-green);
  margin-bottom: 8px;
}

.hero-title {
  font-size: clamp(20px, 3.5vw, 28px);
  font-weight: 700;
  color: var(--text-on-dark);
  margin-bottom: 6px;
  line-height: 1.3;
}

.hero-subtitle {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 20px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Main Layout ───────────────────────────────────── */
.main-content {
  padding: 20px 24px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ── Section Headers ───────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title i {
  color: var(--dpr-green);
  font-size: 15px;
}

.section-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--dpr-green);
  margin-bottom: 4px;
}

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

/* ── Cards / Kacheln ───────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-card);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: var(--trans);
  animation: fadeInUp 0.5s ease both;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--dpr-green);
}

.card-sm {
  padding: 16px 18px;
}

/* Stat Cards */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-card);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: var(--trans);
  animation: fadeInUp 0.5s ease both;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--accent-color, var(--dpr-green));
}

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

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-icon {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: var(--icon-bg, var(--dpr-green-light));
  color: var(--icon-color, var(--dpr-green-deep));
}

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: var(--trans);
  white-space: nowrap;
}

.btn-primary {
  background: var(--dpr-green);
  color: var(--bg-topbar);
  box-shadow: 0 2px 8px rgba(13,209,140,0.3);
}

.btn-primary:hover {
  background: var(--dpr-green-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13,209,140,0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border-default);
}

.btn-secondary:hover {
  background: #f1f5f9;
  color: var(--text-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--dpr-green);
  padding: 6px 12px;
  font-size: 12px;
}

.btn-ghost:hover { background: var(--dpr-green-light); }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--r-sm);
  justify-content: center;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-default);
}
.btn-icon:hover { background: var(--bg-page); color: var(--text-primary); }

/* ── Inputs ────────────────────────────────────────── */
.input, .select {
  background: #f8fafc;
  border: 1.5px solid var(--border-default);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
  transition: var(--trans);
  width: 100%;
}

.input:focus, .select:focus {
  outline: none;
  border-color: var(--dpr-green);
  box-shadow: 0 0 0 3px rgba(13,209,140,0.12);
}

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
}

.input-icon-wrap .input { padding-left: 36px; }

/* ── Badges / Labels ───────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-green    { background: var(--badge-live-bg);   color: var(--badge-live-fg); }
.badge-orange   { background: var(--badge-warn-bg);   color: var(--badge-warn-fg); }
.badge-red      { background: var(--badge-crit-bg);   color: var(--badge-crit-fg); }
.badge-yellow   { background: var(--badge-info-bg);   color: var(--badge-info-fg); }
.badge-blue     { background: var(--badge-termin-bg); color: var(--badge-termin-fg); }
.badge-dpr      { background: var(--badge-green-bg);  color: var(--badge-green-fg); }
.badge-gray     { background: var(--bg-hatch);        color: var(--text-secondary); }

/* Priority Badges */
.badge-p1 { background: var(--badge-crit-bg); color: var(--badge-crit-fg); }
.badge-p2 { background: var(--badge-warn-bg); color: var(--badge-warn-fg); }
.badge-p3 { background: var(--badge-info-bg); color: var(--badge-info-fg); }
.badge-p4 { background: var(--bg-hatch);      color: var(--text-muted); }

/* ── Priority Bar ──────────────────────────────────── */
.priority-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--border-default);
  overflow: hidden;
}

.priority-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: var(--trans);
}

/* ── List Items ────────────────────────────────────── */
.list-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-card);
  transition: var(--trans);
  cursor: pointer;
}

.list-item:last-child { border-bottom: none; }
.list-item:hover { background: rgba(13,209,140,0.03); margin: 0 -4px; padding-left: 4px; padding-right: 4px; border-radius: 6px; }

.list-item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.list-item-body { flex: 1; min-width: 0; }

.list-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.list-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

/* ── Signal / Source Type Colors ───────────────────── */
.source-email    { background: #fff3cd; color: #856404; }
.source-teams    { background: #cfe2ff; color: #084298; }
.source-calendar { background: #d1e7dd; color: #0f5132; }
.source-sharepoint { background: #e0cffc; color: #432874; }

/* ── Risk Levels ───────────────────────────────────── */
.risk-critical { border-left: 4px solid #dc2626; }
.risk-high     { border-left: 4px solid #f59e0b; }
.risk-medium   { border-left: 4px solid #3b82f6; }
.risk-low      { border-left: 4px solid #10b981; }

/* ── Status Colors ─────────────────────────────────── */
.status-on-track   { color: var(--badge-live-fg); }
.status-at-risk    { color: var(--badge-crit-fg); }
.status-delayed    { color: var(--badge-warn-fg); }
.status-completed  { color: var(--text-muted); }

/* ── Progress Bar ──────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--border-default);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--dpr-green);
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* ── AI Insight Box ────────────────────────────────── */
.ai-insight {
  background: var(--dpr-green-light);
  border: 1px solid var(--dpr-green);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--dpr-green-deep);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
}

.ai-insight i { flex-shrink: 0; margin-top: 1px; }

/* ── Divider ───────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border-card);
  margin: 16px 0;
}

/* ── Empty State ───────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 36px; margin-bottom: 12px; color: var(--border-default); }
.empty-state p { font-size: 14px; }

/* ── Tabs ──────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border-card);
  margin-bottom: 18px;
}

.tab {
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  transition: var(--trans);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.tab:hover { color: var(--text-primary); }
.tab.active {
  color: var(--dpr-green);
  border-bottom-color: var(--dpr-green);
  font-weight: 600;
}

/* ── Filter Bar ────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid var(--border-default);
  color: var(--text-secondary);
  background: var(--bg-card);
  transition: var(--trans);
}

.filter-chip:hover { border-color: var(--dpr-green); color: var(--dpr-green); }
.filter-chip.active {
  background: var(--dpr-green-light);
  border-color: var(--dpr-green);
  color: var(--dpr-green-deep);
}

/* ── Topbar Notification Badge ──────────────────────── */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--badge-crit-fg);
  color: white;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
}

/* ── MS Connection Status ───────────────────────────── */
.ms-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 500;
}

.ms-status.connected { background: var(--badge-live-bg); color: var(--badge-live-fg); }
.ms-status.warning   { background: var(--badge-warn-bg); color: var(--badge-warn-fg); }
.ms-status.error     { background: var(--badge-crit-bg); color: var(--badge-crit-fg); }

/* ── Hatch Background ───────────────────────────────── */
.hatch-bg {
  background-color: var(--bg-hatch);
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 5px,
    rgba(0,0,0,0.04) 5px,
    rgba(0,0,0,0.04) 6px
  );
}

/* ── Modal ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,18,30,0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px 24px;
  animation: slideUp 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Sidebar Layout ────────────────────────────────── */
.page-layout {
  display: flex;
  min-height: calc(100vh - 60px);
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border-card);
  padding: 16px 0;
}

.page-main {
  flex: 1;
  min-width: 0;
}

/* ── Briefing Box ──────────────────────────────────── */
.briefing-box {
  background: linear-gradient(135deg, var(--bg-topbar) 0%, #162232 100%);
  border-radius: var(--r-lg);
  padding: 20px;
  color: var(--text-on-dark);
  border: 1px solid rgba(13,209,140,0.2);
  position: relative;
  overflow: hidden;
}

.briefing-box::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(13,209,140,0.12) 0%, transparent 70%);
}

/* ── Waiting-for Countdown ──────────────────────────── */
.wait-days {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.wait-days.overdue { color: var(--badge-crit-fg); }
.wait-days.warning { color: var(--badge-warn-fg); }
.wait-days.ok      { color: var(--badge-info-fg); }

/* ── Log Entry ──────────────────────────────────────── */
.log-entry {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-card);
  font-size: 13px;
}

.log-entry:last-child { border-bottom: none; }

.log-type-badge {
  flex-shrink: 0;
  width: 52px;
  text-align: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.log-type-job     { background: var(--badge-termin-bg); color: var(--badge-termin-fg); }
.log-type-event   { background: var(--dpr-green-light); color: var(--dpr-green-deep); }
.log-type-ai      { background: #f3e8ff;                color: #6b21a8; }
.log-type-error   { background: var(--badge-crit-bg);   color: var(--badge-crit-fg); }
.log-type-warning { background: var(--badge-warn-bg);   color: var(--badge-warn-fg); }

/* ── Automation Stufen ──────────────────────────────── */
.automation-level {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.automation-step {
  padding: 12px;
  border-radius: var(--r-md);
  border: 2px solid var(--border-default);
  cursor: pointer;
  transition: var(--trans);
  text-align: center;
}

.automation-step.active {
  border-color: var(--dpr-green);
  background: var(--dpr-green-light);
}

.automation-step:hover { border-color: var(--dpr-green-dark); }

/* ── Footer ─────────────────────────────────────────── */
footer {
  background: var(--bg-topbar);
  border-top: 2px solid var(--dpr-green);
  padding: 16px 24px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

footer span { color: var(--dpr-green); }

/* ── Animations ─────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(0.85); opacity: 0.6; }
}

/* Staggered Card Delays */
.card:nth-child(1), .stat-card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2), .stat-card:nth-child(2) { animation-delay: 0.10s; }
.card:nth-child(3), .stat-card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4), .stat-card:nth-child(4) { animation-delay: 0.20s; }
.card:nth-child(5), .stat-card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6), .stat-card:nth-child(6) { animation-delay: 0.30s; }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2-1 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .topbar { padding: 0 16px; }
  .topbar-nav { display: none; }
  .topbar-nav.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 60px; left: 0; right: 0;
    background: var(--bg-topbar);
    padding: 12px 16px;
    border-bottom: 2px solid var(--dpr-green);
    z-index: 999;
    gap: 2px;
  }
  .topbar-nav.open .nav-link { padding: 10px 14px; }
  .hamburger { display: flex; }
  .topbar-greeting { display: none; }
  .topbar-time { display: none; }

  .hero { padding: 20px 16px 18px; }
  .main-content { padding: 16px; }

  .grid-3, .grid-2, .grid-1-1-1 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }

  .sidebar { display: none; }
  .automation-level { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .topbar-name { display: none; }
  .list-item-title { font-size: 12px; }
  .filter-bar { gap: 6px; }
}

/* Touch devices */
@media (hover: none) {
  .card:hover, .stat-card:hover {
    transform: scale(0.97);
    box-shadow: var(--shadow-card);
    border-color: var(--border-card);
  }
}

/* ── Workflow Tabs ──────────────────────────────────── */
.wf-tab { transition: var(--trans); }
.wf-tab:hover { background: rgba(13,209,140,0.07) !important; color: var(--dpr-green) !important; }

/* ── Utility Classes ────────────────────────────────── */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-4  { gap: 4px; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mb-4   { margin-bottom: 4px; }
.mb-8   { margin-bottom: 8px; }
.mb-12  { margin-bottom: 12px; }
.mb-16  { margin-bottom: 16px; }
.mb-20  { margin-bottom: 20px; }
.mb-24  { margin-bottom: 24px; }
.mt-4   { margin-top: 4px; }
.mt-8   { margin-top: 8px; }
.mt-12  { margin-top: 12px; }
.mt-16  { margin-top: 16px; }
.w-full { width: 100%; }
.text-sm    { font-size: 12px; }
.text-xs    { font-size: 11px; }
.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-green     { color: var(--dpr-green); }
.text-red       { color: var(--badge-crit-fg); }
.text-orange    { color: var(--badge-warn-fg); }
.font-bold   { font-weight: 700; }
.font-semi   { font-weight: 600; }
.font-medium { font-weight: 500; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hidden { display: none; }
.relative { position: relative; }
.flex-1 { flex: 1; min-width: 0; }

/* ============================================================
   AUTH – Login & Setup Seiten
   ============================================================ */

/* Hintergrund */
.auth-bg {
  min-height: 100vh;
  background: var(--bg-topbar);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow: hidden;
}
.auth-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 20%, rgba(13,209,140,0.07) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(13,209,140,0.05) 0%, transparent 60%);
  pointer-events: none;
}

/* Container */
.auth-container {
  width: 100%;
  max-width: 460px;
  position: relative;
  z-index: 1;
}

/* Logo & Header */
.auth-header {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--dpr-green);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  border-radius: 16px;
  margin: 0 auto 12px;
  box-shadow: 0 4px 20px var(--dpr-green-glow);
}
.auth-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
}
.auth-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

/* Alerts */
.auth-alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.auth-alert-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.auth-alert-success {
  background: var(--dpr-green-light);
  color: var(--dpr-green-deep);
  border: 1px solid var(--dpr-green);
}

/* Login-Card */
.auth-card {
  background: #1a2635;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 16px;
}
.auth-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Section Labels */
.auth-section {
  margin-bottom: 16px;
}
.auth-section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
}
.auth-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin: 6px 0 0;
  text-align: center;
}

/* Microsoft Login Button */
.btn-ms-login {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 20px;
  background: #0078d4;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-ms-login:hover:not(:disabled) { background: #006cbf; }
.btn-ms-login:disabled { opacity: 0.5; cursor: not-allowed; }

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}

/* Demo User Buttons */
.auth-demo-options {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.auth-demo-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  text-align: left;
}
.auth-demo-btn:hover { border-color: rgba(13,209,140,0.4); background: rgba(13,209,140,0.06); }
.auth-demo-btn.active { border-color: var(--dpr-green); background: rgba(13,209,140,0.08); }
.demo-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--dpr-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Demo Login Button */
.btn-demo-login {
  width: 100%;
  padding: 10px 20px;
  background: rgba(13,209,140,0.15);
  border: 1.5px solid var(--dpr-green);
  border-radius: 8px;
  color: var(--dpr-green);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-demo-login:hover { background: rgba(13,209,140,0.25); }

/* Setup Hint & Features */
.auth-setup-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.auth-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 16px;
}
.auth-feature-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  font-size: 11px;
  color: var(--text-muted);
}
.auth-feature-chip i { color: var(--dpr-green); font-size: 10px; }
.auth-footer-note {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
}

/* ── Setup Seite ─────────────────────────────────────────── */
.setup-container {
  width: 100%;
  max-width: 700px;
  position: relative;
  z-index: 1;
}
.setup-header {
  text-align: center;
  margin-bottom: 20px;
}
.setup-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 16px;
  transition: color 0.2s;
}
.setup-back-btn:hover { color: var(--dpr-green); }

/* Status Banner */
.setup-status-banner {
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
}
.setup-status-ok   { background: rgba(13,209,140,0.12); color: var(--dpr-green); border: 1px solid rgba(13,209,140,0.3); }
.setup-status-demo { background: rgba(245,158,11,0.10); color: #f59e0b; border: 1px solid rgba(245,158,11,0.3); }

/* Cards */
.setup-card {
  background: #1a2635;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  overflow: hidden;
}
.setup-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.setup-copy-btn {
  margin-left: auto;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 12px;
  transition: all 0.2s;
}
.setup-copy-btn:hover { color: var(--dpr-green); border-color: var(--dpr-green); }

/* Env Code Block */
.setup-env-code {
  background: rgba(0,0,0,0.3);
  padding: 14px 16px;
  font-size: 11.5px;
  line-height: 1.7;
  color: #c9d7e3;
  font-family: 'Fira Code', 'Courier New', monospace;
  white-space: pre;
  overflow-x: auto;
  margin: 0;
  border-radius: 0 0 12px 12px;
}
.setup-env-box {
  background: #141e2c;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  overflow: hidden;
  margin: 8px 0;
}
.setup-env-header {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
}

/* Schritt-für-Schritt */
.setup-steps { display: flex; flex-direction: column; gap: 8px; }

.setup-step {
  background: #1a2635;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.setup-step:hover { border-color: rgba(255,255,255,0.15); }
.setup-step-done { opacity: 0.7; }

.setup-step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}
.setup-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.setup-step-title {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.setup-done-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  background: rgba(13,209,140,0.15);
  color: var(--dpr-green);
  border-radius: 4px;
}
.setup-chevron {
  color: var(--text-muted);
  font-size: 12px;
  transition: transform 0.2s;
}
.setup-step-body {
  padding: 0 16px 16px;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.setup-step-body > * { margin-top: 12px; }

/* Listen */
.setup-list {
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.9;
  margin: 0;
}
.setup-list li { margin-bottom: 2px; }

/* Code inline */
.setup-code {
  background: rgba(13,209,140,0.1);
  color: var(--dpr-green);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
}
.setup-link {
  color: var(--dpr-green);
  text-decoration: none;
}
.setup-link:hover { text-decoration: underline; }

/* Permissions */
.setup-permissions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.setup-permission-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 3px 0;
  color: var(--text-secondary);
}
.setup-permission-row i { flex-shrink: 0; }

/* Values */
.setup-values { display: flex; flex-direction: column; gap: 6px; }
.setup-value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  font-size: 12px;
}
.setup-value-label { font-weight: 600; color: #fff; }
.setup-value-hint { color: var(--text-muted); }

/* Warning & Info Boxes */
.setup-warning {
  padding: 10px 12px;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 8px;
  font-size: 12px;
  color: #f59e0b;
}
.setup-info {
  padding: 10px 12px;
  background: rgba(13,209,140,0.08);
  border: 1px solid rgba(13,209,140,0.2);
  border-radius: 8px;
  font-size: 12px;
  color: var(--dpr-green);
}

/* Endpoints */
.setup-endpoints { padding: 8px 16px 12px; }
.setup-endpoint-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12px;
}
.setup-endpoint-row:last-child { border-bottom: none; }
.setup-endpoint-name {
  width: 160px;
  flex-shrink: 0;
  font-weight: 600;
  color: #fff;
}
.setup-endpoint-code {
  color: var(--dpr-green);
  font-family: 'Courier New', monospace;
  font-size: 11px;
  word-break: break-all;
}

/* Test Connection */
.btn-test-connection {
  padding: 9px 18px;
  background: var(--dpr-green);
  color: #0f1923;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-test-connection:hover { background: var(--dpr-green-dark); }

.setup-test-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.setup-test-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.setup-test-row i { flex-shrink: 0; }

/* Toast */
.auth-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  align-items: center;
  gap: 6px;
}
.auth-toast-show { transform: translateY(0); opacity: 1; }
.auth-toast-success { background: var(--dpr-green); color: #0f1923; }
.auth-toast-error   { background: #dc2626; color: #fff; }
.auth-toast-info    { background: #1a2635; color: #fff; border: 1px solid rgba(255,255,255,0.15); }

/* Responsive Auth */
@media (max-width: 480px) {
  .auth-container, .setup-container { max-width: 100%; }
  .auth-demo-options { flex-direction: column; }
  .setup-endpoint-row { flex-direction: column; align-items: flex-start; gap: 3px; }
  .setup-endpoint-name { width: auto; }
}

/* ── User Dropdown Menu ──────────────────────────────────── */
.topbar-user {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s;
}
.topbar-user:hover { background: rgba(255,255,255,0.08); }

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 48px;
  background: #1a2635;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  min-width: 220px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 1000;
  overflow: hidden;
  animation: dropdownFadeIn 0.15s ease;
}
@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.04);
}
.user-dropdown-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--dpr-green);
  color: #0f1923;
  font-weight: 700;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-dropdown-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 0;
}
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-primary);
  width: 100%;
  text-align: left;
  cursor: default;
}
.user-dropdown-item-success {
  color: var(--dpr-green);
}
.user-dropdown-btn {
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.user-dropdown-btn:hover {
  background: rgba(255,255,255,0.06);
}
