/* RegMon Dashboard – regmon.css */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f5f7fa;
  color: #1a202c;
  line-height: 1.6;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
#header {
  background: #1a202c;
  color: #fff;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

#header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.subtitle {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-left: 0.25rem;
}

.controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
button, .primary, .danger {
  padding: 0.4rem 0.9rem;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
button:hover { opacity: 0.85; }

.primary { background: #3b82f6; color: #fff; }
.danger  { background: #ef4444; color: #fff; }

/* ── Toggle Switch ───────────────────────────────────────────────────────── */
#modeToggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: #cbd5e1;
}

.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  inset: 0;
  background: #475569;
  border-radius: 20px;
  transition: 0.3s;
  cursor: pointer;
}
.slider::before {
  content: "";
  position: absolute;
  height: 14px; width: 14px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}
input:checked + .slider { background: #3b82f6; }
input:checked + .slider::before { transform: translateX(16px); }

/* ── Update Status ───────────────────────────────────────────────────────── */
#updateStatus {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: #94a3b8;
}

.indicator {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #10b981;
  animation: pulse 2s infinite;
}

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

/* ── Error Box ───────────────────────────────────────────────────────────── */
.error {
  display: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 0.75rem 1.25rem;
  margin: 1rem 1.5rem 0;
  border-radius: 8px;
  font-size: 0.875rem;
}

/* ── Tiles ───────────────────────────────────────────────────────────────── */
#tiles {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 1.5rem 0;
  flex-wrap: wrap;
}

.tile {
  background: #fff;
  border-radius: 10px;
  padding: 1rem 1.5rem;
  min-width: 120px;
  border-left: 4px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.tile.green  { border-left-color: #10b981; }
.tile.yellow { border-left-color: #f59e0b; }
.tile.red    { border-left-color: #ef4444; }

.tile .source {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}
.tile .count {
  font-size: 2rem;
  font-weight: 800;
  color: #1a202c;
}

.tile-inprogress {
  font-size: 1rem;
  font-weight: 600;
  color: #64748b;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */
#tabs {
  display: flex;
  gap: 0.25rem;
  padding: 1rem 1.5rem 0;
  border-bottom: 2px solid #e2e8f0;
  margin: 1rem 1.5rem 0;
}

.tab {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: color 0.15s, background 0.15s;
}
.tab:hover { color: #1a202c; background: #f1f5f9; }
.tab.active {
  color: #3b82f6;
  border-bottom: 2px solid #3b82f6;
  margin-bottom: -2px;
}
.tab.hidden { display: none; }
/* Feature-Katalog: Modul nicht freigeschaltet – sichtbar, ausgegraut, erklärt sich per Klick. */
.tab.feature-off { opacity: 0.45; cursor: not-allowed; }
.tab.feature-off:hover { background: inherit; color: inherit; }
body.deep-scan-off .deep-scan-btn { display: none; }

/* ── Filter Bar ──────────────────────────────────────────────────────────── */
#filterBar {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 1.5rem;
  margin: 0 1.5rem;
  align-items: center;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: #64748b;
  cursor: pointer;
  user-select: none;
}

.filter-checkbox input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #3b82f6;
  cursor: pointer;
}

.filter-checkbox span {
  white-space: nowrap;
}

/* ── Main List ───────────────────────────────────────────────────────────── */
#main {
  margin: 0 1.5rem 2rem;
}

#listHeader {
  padding: 1rem 0 0.5rem;
}

#listHeader h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #374151;
}

.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #94a3b8;
  font-size: 0.875rem;
}

/* ── Table ───────────────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  font-size: 0.875rem;
}

thead th {
  background: #f8fafc;
  padding: 0.65rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}

tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.1s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
}

/* ── Pills ───────────────────────────────────────────────────────────────── */
.pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pill.green  { background: #dcfce7; color: #166534; }
.pill.yellow { background: #fef9c3; color: #854d0e; }
.pill.red    { background: #fee2e2; color: #991b1b; }
.pill.blue   { background: #dbeafe; color: #1e40af; }

/* ── Summary ─────────────────────────────────────────────────────────────── */
.summary {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.5;
  max-width: 600px;
}

/* ── Status Buttons ──────────────────────────────────────────────────────── */
.status-buttons {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.status-btn {
  padding: 0.25rem 0.6rem;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s;
}
.status-btn:hover      { background: #e2e8f0; }
.status-btn.done       { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.status-btn.in-progress{ background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.status-btn.irrelevant { background: #f1f5f9; color: #64748b; border-color: #cbd5e1; }
.status-btn.later      { background: #fef3c7; color: #92400e; border-color: #fde68a; }

/* ── Deterministisches Metadata-Enrichment ── */
.event-tags { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  background: #e2e8f0; color: #475569;
  font-size: 0.72rem; padding: 1px 7px;
  border-radius: 10px; font-weight: 500;
}

.event-attachments { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 8px; }
.att-link {
  font-size: 0.78rem; color: #3b82f6;
  text-decoration: none; white-space: nowrap;
}
.att-link:hover { text-decoration: underline; }

.event-dates { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 8px; }
.date-frist {
  font-size: 0.78rem; font-weight: 700;
  color: #dc2626; /* rot – eindeutige Frist */
}
.date-effective {
  font-size: 0.78rem; font-weight: 600;
  color: #2563eb; /* blau – Inkrafttreten */
}
.date-uncertain {
  font-size: 0.78rem; color: #94a3b8; /* grau – unsicher */
}

/* ── LLM-Tags ── */
.tag-doctype    { background: #dbeafe; color: #1e40af; }
.tag-fachbereich { background: #dcfce7; color: #166534; }
.tag-person     { background: #fef9c3; color: #854d0e; }
.tag-gesetz     { background: #ede9fe; color: #5b21b6; }
.tag-deadline   { background: #fee2e2; color: #991b1b; font-weight: 600; }

/* ── Deep Scan ── */
.deep-scan-btn {
  background: #f0f9ff; color: #0369a1;
  border: 1px solid #bae6fd; border-radius: 6px;
  padding: 3px 10px; font-size: 0.78rem;
  cursor: pointer; margin-top: 4px;
}
.deep-scan-btn:hover { background: #e0f2fe; }
.deep-scan-pending {
  font-size: 0.78rem; color: #6366f1;
  margin-top: 4px; font-style: italic;
}
.deep-scan-result {
  margin-top: 8px; padding: 8px 12px;
  background: #f8fafc; border-left: 3px solid #6366f1;
  border-radius: 4px; font-size: 0.82rem;
}
.deep-scan-label {
  font-weight: 600; color: #4f46e5;
  margin-bottom: 4px; font-size: 0.8rem;
}
.deep-scan-section { margin-top: 6px; }
.deep-scan-section p { margin: 2px 0; color: #374151; }
.deep-scan-action { border-left: 2px solid #f59e0b; padding-left: 6px; }
.event-impact { margin-top: 4px; font-size: 0.85em; color: #475569; }
.tag-removed { background: #fee2e2; color: #991b1b; }
.tag-auto { background: #e5e7eb; color: #374151; font-style: italic; }
body.dark .tag-removed { background: #7f1d1d; color: #fecaca; }
body.dark .tag-auto { background: #374151; color: #d1d5db; }
.ai-label { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 8px; font-size: 0.7em; font-weight: 600; background: #e0e7ff; color: #3730a3; vertical-align: middle; }
body.dark .event-impact { color: #94a3b8; }
body.dark .ai-label { background: #312e81; color: #c7d2fe; }
.deep-scan-deadline { border-left: 2px solid #dc2626; padding-left: 6px; }

/* ── Dark Mode (Tab „Dashboard"/Darstellung) ──────────────────────────────── */
/* Per JS auf <body> gesetzt, wenn display.dark_mode aktiv ist. Überschreibt
   gezielt die hellen Flächen; Pills/Tags behalten ihre Akzentfarben. */
body.dark {
  background: #0f172a;
  color: #e2e8f0;
}
body.dark .tile,
body.dark table {
  background: #1e293b;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
body.dark .tile { border-left-color: #334155; }
body.dark thead th {
  background: #0f172a;
  color: #94a3b8;
  border-bottom-color: #334155;
}
body.dark tbody tr { border-bottom-color: #283449; }
body.dark tbody tr:hover { background: #243049; }
body.dark .tab { color: #94a3b8; }
body.dark .tab:hover { color: #e2e8f0; background: #1e293b; }
body.dark .subtitle { color: #64748b; }
body.dark input,
body.dark select,
body.dark textarea {
  background: #1e293b;
  color: #e2e8f0;
  border-color: #334155;
}

/* Akzentfarbe: per JS via --accent gesetzt; Fallback = bestehendes Blau. */
:root { --accent: #3b82f6; }
.primary { background: var(--accent, #3b82f6); }
.tab.active { color: var(--accent, #3b82f6); border-bottom-color: var(--accent, #3b82f6); }

/* RegMon-Bildmarke (Logo C, 2026-09-28) im Seitenkopf */
h1 .brandmark{ width:1em; height:1em; vertical-align:-0.12em; margin-right:.35em; }
