/* ============================================================
   Google Fonts Import
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;600;700;800&display=swap');

/* ============================================================
   Design-Tokens – CSS-Variablen (:root)
   Alle Farben, Abstände und Typografie-Werte zentral definiert.
   ============================================================ */
:root {
  /* Hauptfarben */
  --bg:              #F4F7FA;
  --surface:         #FFFFFF;
  --primary:         #1E527A;
  --primary-light:   #2A6FA0;
  --primary-dark:    #163D5A;
  --accent:          #F0901A;
  --accent-dark:     #D97D0E;

  /* Schweregrade */
  --error:           #E53E3E;
  --warning:         #F0901A;
  --notice:          #1E527A;
  --success:         #38A169;

  /* Hintergrundtöne für Schweregrade */
  --error-bg:        #FFF5F5;
  --warning-bg:      #FFFAF0;
  --notice-bg:       #EBF4FA;
  --success-bg:      #F0FFF4;

  /* Texte */
  --text:            #2D3748;
  --text-muted:      #718096;
  --text-light:      #A0AEC0;

  /* Rahmen */
  --border:          #E2E8F0;
  --border-focus:    var(--primary);

  /* Typografie */
  --font:            'Nunito Sans', sans-serif;

  /* Abstände */
  --gap:             1.5rem;
  --gap-sm:          0.75rem;

  /* Radien */
  --radius:          10px;
  --radius-sm:       6px;
  --radius-lg:       16px;

  /* Schatten */
  --shadow-sm:       0 1px 3px rgba(0,0,0,0.07);
  --shadow:          0 2px 8px rgba(0,0,0,0.09);
  --shadow-lg:       0 8px 24px rgba(0,0,0,0.13);

  /* Layout */
  --sidebar-width:   240px;

  /* Übergänge */
  --transition:      0.2s ease;
}

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

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
}

h1 { font-size: 1.75rem; font-weight: 800; color: var(--primary); }
h2 { font-size: 1.35rem; font-weight: 700; color: var(--primary); }
h3 { font-size: 1.05rem; font-weight: 700; color: var(--text); }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); text-decoration: underline; }

button { cursor: pointer; font-family: var(--font); }
input, textarea, select { font-family: var(--font); }
ul, ol { list-style: none; }

/* ============================================================
   App-Layout: Sidebar + Hauptinhalt
   ============================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar ------------------------------------------------ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--primary);
  color: white;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 1.4rem 1.5rem;
  font-size: 1rem;
  font-weight: 800;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}

.sidebar-logo .logo-icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.sidebar-section-label {
  padding: 1.2rem 1.5rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
}

.sidebar-nav { flex: 1; padding: 0.5rem 0; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.5rem;
  color: rgba(255,255,255,0.72);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  background: rgba(255,255,255,0.1);
  color: white;
  text-decoration: none;
}

.sidebar-nav a.active {
  background: rgba(255,255,255,0.13);
  color: white;
  border-left-color: var(--accent);
}

.sidebar-nav a svg { flex-shrink: 0; opacity: 0.8; }
.sidebar-nav a.active svg,
.sidebar-nav a:hover svg { opacity: 1; }

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
}

/* --- Hauptinhalt ------------------------------------------- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 2rem 2.5rem;
  max-width: 1300px;
}

/* ============================================================
   Seiten-Kopf
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header-info { flex: 1; min-width: 0; }
.page-header-info h1 { margin-bottom: 0.25rem; }
.page-subtitle { color: var(--text-muted); font-size: 0.9rem; }

.page-header-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-shrink: 0;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  transition: var(--transition);
  white-space: nowrap;
  line-height: 1.4;
}

.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--primary-light); color: white; text-decoration: none; }

.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover:not(:disabled) { background: var(--accent-dark); color: white; text-decoration: none; }

.btn-outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}
.btn-outline:hover:not(:disabled) { background: var(--primary); color: white; text-decoration: none; }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}
.btn-ghost:hover:not(:disabled) { background: var(--border); color: var(--text); text-decoration: none; }

.btn-danger { background: var(--error); color: white; }
.btn-danger:hover:not(:disabled) { background: #c53030; color: white; text-decoration: none; }

.btn-sm  { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn-lg  { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-icon { padding: 0.45rem; aspect-ratio: 1; }

/* ============================================================
   Badges / Status-Labels
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

.badge-error    { background: var(--error-bg);   color: var(--error);   }
.badge-warning  { background: var(--warning-bg); color: var(--warning); }
.badge-notice   { background: var(--notice-bg);  color: var(--notice);  }
.badge-success  { background: var(--success-bg); color: var(--success); }
.badge-running  { background: #EBF8FF;           color: #2B6CB0;        }
.badge-pending  { background: #F7FAFC;           color: var(--text-muted); }
.badge-finished { background: var(--success-bg); color: var(--success); }

/* ============================================================
   Karten (Cards)
   ============================================================ */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.card-sm  { padding: 1rem 1.25rem; }
.card-lg  { padding: 2rem; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title svg { color: var(--accent); }

/* ============================================================
   Projekt-Karten
   ============================================================ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--gap);
}

.project-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  border: 2px solid transparent;
  cursor: default;
}

.project-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.project-card-info { flex: 1; min-width: 0; }

.project-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-url {
  font-size: 0.8rem;
  color: var(--text-muted);
  word-break: break-all;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 0.4rem;
}

.project-meta-date { display: flex; align-items: center; gap: 0.3rem; }

.project-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.project-no-audit {
  text-align: center;
  padding: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ============================================================
   Score-Ring (SVG-basiert)
   ============================================================ */
.score-ring-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.score-ring-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  text-align: center;
}

/* Großer Ring im Report-Header */
.score-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.score-hero-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 700;
}

/* ============================================================
   Stat-Karten (Zählwerte)
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  text-align: center;
  border-top: 3px solid var(--border);
}

.stat-card.error-card   { border-top-color: var(--error); }
.stat-card.warning-card { border-top-color: var(--warning); }
.stat-card.notice-card  { border-top-color: var(--notice); }
.stat-card.success-card { border-top-color: var(--success); }

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.stat-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }

/* ============================================================
   Filter-Leiste
   ============================================================ */
.filter-bar {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.filter-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
}

.filter-btn {
  padding: 0.28rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: white;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: var(--transition);
  white-space: nowrap;
}

.filter-btn:hover { border-color: var(--primary); color: var(--primary); }

.filter-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.filter-btn.active.error   { border-color: var(--error);   background: var(--error);   }
.filter-btn.active.warning { border-color: var(--warning); background: var(--warning); }
.filter-btn.active.success { border-color: var(--success); background: var(--success); }

/* ============================================================
   Findings (aufklappbare Listenelemente)
   ============================================================ */
.findings-section { margin-bottom: 2.5rem; }

.findings-category-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--bg);
}

.findings-category-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.findings-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  background: var(--bg);
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
}

.finding-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.4rem;
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.finding-item:hover { box-shadow: var(--shadow-sm); }

/* Details-/Summary-Reset für eigenes Styling */
.finding-item summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: var(--surface);
  transition: background var(--transition);
}

.finding-item summary:hover   { background: #FAFBFC; }
.finding-item[open] summary   { background: #F7FAFC; border-bottom: 1px solid var(--border); }
.finding-item summary::-webkit-details-marker { display: none; }
.finding-item summary::marker { display: none; }

.finding-severity-bar {
  width: 3px;
  height: 28px;
  border-radius: 2px;
  flex-shrink: 0;
}

.finding-severity-bar.error   { background: var(--error); }
.finding-severity-bar.warning { background: var(--warning); }
.finding-severity-bar.notice  { background: var(--notice); }
.finding-severity-bar.passed  { background: var(--success); }

.finding-title { font-weight: 700; font-size: 0.88rem; flex: 1; min-width: 0; }

.finding-chevron {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--text-light);
  transition: transform var(--transition);
}

.finding-item[open] .finding-chevron { transform: rotate(180deg); }

.finding-body {
  padding: 1rem 1.25rem;
  background: #FAFBFC;
  font-size: 0.86rem;
  line-height: 1.6;
}

.finding-description { color: var(--text-muted); margin-bottom: 1rem; }

.finding-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.finding-value-box { background: var(--bg); border-radius: var(--radius-sm); padding: 0.65rem 0.85rem; }
.finding-value-box.current { border-left: 3px solid var(--error); }
.finding-value-box.recommended { border-left: 3px solid var(--success); }

.finding-value-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.finding-value-text {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
  word-break: break-word;
}

.finding-urls-section { margin-top: 0.75rem; }
.finding-urls-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.finding-url-list li {
  margin-bottom: 0.2rem;
}

.finding-url-list a {
  font-size: 0.82rem;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.finding-url-list a:hover { text-decoration: underline; }

/* ============================================================
   Fortschrittsbalken
   ============================================================ */
.progress-bar-wrap {
  background: var(--border);
  border-radius: 20px;
  height: 10px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 20px;
  transition: width 0.6s ease;
  min-width: 2px;
}

.progress-bar.accent { background: var(--accent); }

.progress-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ============================================================
   URL-Log (Fortschritts-Seite)
   ============================================================ */
.url-log {
  list-style: none;
  max-height: 320px;
  overflow-y: auto;
  border-radius: var(--radius-sm);
}

.url-log::-webkit-scrollbar { width: 4px; }
.url-log::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.url-log-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--bg);
  font-size: 0.83rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn { from { opacity: 0; transform: translateX(-4px); } to { opacity: 1; transform: none; } }

.http-badge {
  flex-shrink: 0;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  min-width: 2.5rem;
  text-align: center;
}

.http-badge.s2xx { background: var(--success-bg); color: var(--success); }
.http-badge.s3xx { background: var(--notice-bg);  color: var(--notice); }
.http-badge.s4xx { background: var(--error-bg);   color: var(--error); }
.http-badge.s5xx { background: var(--error-bg);   color: var(--error); }

.url-log-url { flex: 1; color: var(--text-muted); word-break: break-all; }

/* ============================================================
   Core Web Vitals
   ============================================================ */
.cwv-section { margin-bottom: 2rem; }

.cwv-strategy-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.25rem;
}

.cwv-tab-btn {
  padding: 0.55rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cwv-tab-btn:hover { color: var(--primary); }
.cwv-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.cwv-panel { display: none; }
.cwv-panel.active { display: block; }

.cwv-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.cwv-item {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cwv-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.cwv-item.good::before   { background: var(--success); }
.cwv-item.needs::before  { background: var(--warning); }
.cwv-item.poor::before   { background: var(--error); }

.cwv-metric-name {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.cwv-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.3rem;
}

.cwv-value.good  { color: var(--success); }
.cwv-value.needs { color: var(--warning); }
.cwv-value.poor  { color: var(--error); }

.cwv-unit  { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.cwv-label { font-size: 0.72rem; color: var(--text-light); margin-top: 0.25rem; }
.cwv-range { font-size: 0.7rem; color: var(--text-light); margin-top: 0.3rem; }

/* ============================================================
   AI-Empfehlung / Markdown
   ============================================================ */
.ai-card { border-left: 4px solid var(--accent); }

.ai-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.ai-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

/* Markdown-gerendeter Inhalt */
.markdown-content { font-size: 0.9rem; line-height: 1.75; color: var(--text); }
.markdown-content h2 { font-size: 1.05rem; color: var(--primary); margin: 1.25rem 0 0.5rem; }
.markdown-content h3 { font-size: 0.95rem; margin: 0.85rem 0 0.4rem; }
.markdown-content p  { margin-bottom: 0.75rem; }
.markdown-content ul,
.markdown-content ol { padding-left: 1.5rem; margin-bottom: 0.75rem; list-style: disc; }
.markdown-content li { margin-bottom: 0.3rem; }
.markdown-content code {
  background: var(--bg);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.84em;
  font-family: 'Courier New', monospace;
  color: var(--primary);
}
.markdown-content strong { font-weight: 800; color: var(--text); }

/* ============================================================
   Seiten-Detail: Meta-Daten-Raster
   ============================================================ */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
}

.meta-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}

.meta-item-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}

.meta-item-value {
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 600;
  word-break: break-word;
}

.meta-item-value.good  { color: var(--success); }
.meta-item-value.warn  { color: var(--warning); }
.meta-item-value.error { color: var(--error); }

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

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

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.25rem;
  line-height: 1;
  border-radius: 4px;
  transition: var(--transition);
}
.modal-close:hover { color: var(--text); background: var(--bg); }

/* ============================================================
   Formulare
   ============================================================ */
.form-group { margin-bottom: 1.1rem; }

.form-label {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  transition: border-color var(--transition);
  background: var(--surface);
  color: var(--text);
}

.form-input:focus { outline: none; border-color: var(--primary); }
.form-input::placeholder { color: var(--text-light); }
.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.3rem; }

.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* ============================================================
   Toast-Benachrichtigungen
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: #2D3748;
  color: white;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.86rem;
  font-weight: 600;
  animation: toastIn 0.3s ease;
  max-width: 300px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
}

.toast.success { background: var(--success); }
.toast.error   { background: var(--error); }
.toast.info    { background: var(--primary); }

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

/* ============================================================
   Ladezustand / Spinner
   ============================================================ */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
  gap: 1rem;
}

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

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

/* ============================================================
   Leer-Zustand (Empty State)
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  background: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: var(--text-light);
}

.empty-state-title { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 0.5rem; }
.empty-state-text  { font-size: 0.9rem; }

/* ============================================================
   Breadcrumb
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--primary); font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--text-light); }

/* ============================================================
   Report-Header
   ============================================================ */
.report-header {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}

.report-header-info { flex: 1; min-width: 200px; }
.report-header-score { flex-shrink: 0; }

.report-meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
}

.report-meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ============================================================
   Hilfklassen
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

.text-muted  { color: var(--text-muted); }
.text-small  { font-size: 0.82rem; }
.fw-bold     { font-weight: 700; }
.fw-extrabold { font-weight: 800; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* ============================================================
   Responsive Anpassungen
   ============================================================ */
@media (max-width: 1024px) {
  :root { --sidebar-width: 200px; }
  .main-content { padding: 1.5rem; }
  .cwv-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .app-layout { flex-direction: column; }

  .sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .sidebar-logo { flex-shrink: 0; border-bottom: none; border-right: 1px solid rgba(255,255,255,0.12); }
  .sidebar-nav { display: flex; flex-direction: row; padding: 0; flex: 1; }
  .sidebar-nav a { padding: 0.75rem 1rem; white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
  .sidebar-nav a.active { border-left: none; border-bottom-color: var(--accent); }
  .sidebar-section-label,
  .sidebar-footer { display: none; }

  .main-content { margin-left: 0; padding: 1rem; }

  .project-grid { grid-template-columns: 1fr; }
  .cwv-grid { grid-template-columns: 1fr; }
  .finding-values { grid-template-columns: 1fr; }
  .meta-grid { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .report-header { flex-direction: column; align-items: center; text-align: center; }
}

@media (max-width: 480px) {
  .meta-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-bar { flex-direction: column; align-items: flex-start; }
}
