/* ============================================
   Dashboard PRO — Styles
   ============================================ */

:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --border: #334155;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --green: #22c55e;
  --red: #ef4444;
  --orange: #f59e0b;
  --radius: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 24px;
}

/* Header */
header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

header h1 {
  font-size: 28px;
  font-weight: 700;
}

header .subtitle {
  color: var(--text-muted);
  font-size: 14px;
  flex: 1;
}

.period-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.period-selector label {
  color: var(--text-muted);
  font-size: 14px;
}

.period-selector select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kpi-card.accent {
  border-color: var(--orange);
  background: linear-gradient(135deg, var(--surface), rgba(245, 158, 11, 0.1));
}

.kpi-label {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value {
  font-size: 32px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.kpi-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* Charts */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
  margin-bottom: 32px;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.chart-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-muted);
}

/* Tables */
.table-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.table-section.critical {
  border-color: var(--red);
}

.table-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-muted);
}

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

#search-input {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  width: 300px;
}

#search-input::placeholder { color: var(--text-muted); }

.table-wrapper {
  overflow-x: auto;
}

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

thead th {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  cursor: pointer;
}

thead th.num { text-align: right; }

tbody td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }

tbody tr:hover { background: rgba(59, 130, 246, 0.05); }

/* Reichweite-Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.badge.critical { background: rgba(239, 68, 68, 0.2); color: var(--red); }
.badge.warning  { background: rgba(245, 158, 11, 0.2); color: var(--orange); }
.badge.ok       { background: rgba(34, 197, 94, 0.2); color: var(--green); }

/* Artikel-Detail */
.article-detail { padding: 16px 0; }
.article-detail.hidden { display: none; }

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

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-item.highlight {
  background: rgba(245, 158, 11, 0.1);
  border-radius: 8px;
  padding: 12px;
}

.detail-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-value {
  font-size: 18px;
  font-weight: 600;
}

/* Massenverarbeitung */
.mass-section { border-color: var(--accent); }

.mass-header p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.mass-input-row {
  display: flex;
  gap: 12px;
  margin: 16px 0;
  align-items: flex-start;
}

.mass-input-row textarea {
  flex: 1;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-family: monospace;
  font-size: 13px;
  resize: vertical;
}

.mass-input-row textarea::placeholder { color: var(--text-muted); }

.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary:hover { background: var(--accent-light); }

.mass-summary {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 8px;
}

.text-red { color: var(--red); font-weight: 600; }

.hidden { display: none; }

/* Zeilen-Farbgebung Massenverarbeitung */
.row-danger { background: rgba(239, 68, 68, 0.08); }
.row-danger td { color: var(--red); }
.row-warning { background: rgba(245, 158, 11, 0.06); }

.sync-info {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 16px;
}

/* Footer */
footer {
  text-align: center;
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 13px;
}

/* Loading */
.loading {
  color: var(--text-muted);
  font-style: italic;
  padding: 24px;
  text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
  .charts-row { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  #search-input { width: 100%; }
  .table-header { flex-direction: column; gap: 12px; }
  body { padding: 12px; }
}
