/* ══════════════════════════════════════════════════════════════════════════
   Reklamations-Dashboard — eigenstaendige Sicht fuer Manager + GF
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Hausfarbe und Abstufungen */
  --d-primary: #00a7b7;
  --d-primary-dark: #008b9a;
  --d-primary-darker: #006b76;
  --d-primary-light: #cdf0f3;
  --d-primary-lighter: #e6f7f9;
  --d-primary-soft: rgba(0, 167, 183, 0.10);

  /* Neutrale Tonleiter */
  --d-bg: #f6f8f9;
  --d-card: #ffffff;
  --d-border: #e6ebee;
  --d-border-strong: #d4dadd;
  --d-text: #0f1f23;
  --d-muted: #6b7a80;

  /* Status (semantisch, bewusst nicht in Hausfarbe) */
  --d-success: #10b981;
  --d-warning: #f59e0b;
  --d-error: #ef4444;

  --d-radius: 14px;
  --d-radius-sm: 8px;
  --d-shadow: 0 1px 2px rgba(15, 31, 35, 0.04), 0 1px 3px rgba(15, 31, 35, 0.06);
  --d-shadow-md: 0 4px 16px rgba(15, 31, 35, 0.08);
  --d-shadow-lg: 0 16px 40px rgba(0, 107, 118, 0.18);

  --d-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: var(--d-font); background: var(--d-bg); color: var(--d-text); }

/* ── Login-Seite ────────────────────────────────────────────────────────── */
.login-body {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 18% 20%, rgba(255,255,255,0.18), transparent 45%),
    radial-gradient(circle at 82% 80%, rgba(0,107,118,0.45), transparent 50%),
    var(--d-primary);
  padding: 24px;
  font-family: var(--d-font);
}
.login-card {
  background: white;
  border-radius: 18px;
  padding: 44px 36px 36px;
  width: 100%; max-width: 420px;
  box-shadow: var(--d-shadow-lg);
}
.login-brand {
  font-size: 11px; color: var(--d-primary); margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700;
}
.login-card h1 { font-size: 24px; margin: 0 0 8px; letter-spacing: -0.01em; }
.login-sub { color: var(--d-muted); font-size: 14px; margin: 0 0 26px; }

.form-row { margin-bottom: 14px; }
.form-row label {
  display: block; font-size: 12px; color: var(--d-muted); margin-bottom: 6px;
  font-weight: 500;
}
.form-row input {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--d-border);
  border-radius: var(--d-radius-sm); font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: white;
}
.form-row input:focus {
  outline: none;
  border-color: var(--d-primary);
  box-shadow: 0 0 0 3px var(--d-primary-soft);
}

.login-error {
  background: #fee2e2; color: var(--d-error);
  padding: 10px 14px; border-radius: var(--d-radius-sm); font-size: 14px;
  margin-bottom: 14px;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 20px; border-radius: var(--d-radius-sm); border: none;
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background 0.15s, color 0.15s, transform 0.05s;
  text-decoration: none;
}
.btn-primary {
  background: var(--d-primary);
  color: white;
  box-shadow: 0 1px 2px rgba(0, 107, 118, 0.25);
}
.btn-primary:hover { background: var(--d-primary-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--d-muted); }
.btn-ghost:hover { color: var(--d-text); background: var(--d-bg); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ══════════════════════════════════════════════════════════════════════
   Dashboard-Layout (Sidebar + Main)
   ══════════════════════════════════════════════════════════════════════ */

.dash-body {
  display: flex;
  min-height: 100vh;
  font-family: var(--d-font);
  color: var(--d-text);
}

.dash-sidebar {
  width: 248px;
  flex-shrink: 0;
  background: white;
  border-right: 1px solid var(--d-border);
  display: flex; flex-direction: column;
  padding: 24px 16px 20px;
}
.dash-brand {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  color: var(--d-primary); text-transform: uppercase;
}
.dash-product {
  font-size: 17px; font-weight: 700; margin-top: 2px;
  margin-bottom: 28px; line-height: 1.2;
  color: var(--d-text);
}

.dash-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.dash-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px;
  color: var(--d-muted); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: background 0.1s, color 0.1s;
  position: relative;
}
.dash-nav a:hover { background: var(--d-bg); color: var(--d-text); }
.dash-nav a.active {
  background: var(--d-primary-soft);
  color: var(--d-primary-darker);
  font-weight: 600;
}
.dash-nav a.active::before {
  content: '';
  position: absolute; left: -16px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--d-primary);
}
.dash-nav .ico { font-size: 16px; opacity: 0.85; }

.dash-user {
  border-top: 1px solid var(--d-border);
  padding-top: 16px;
  margin-top: 12px;
}
.dash-user-name { font-weight: 600; font-size: 14px; }
.dash-user-rolle {
  font-size: 12px; color: var(--d-muted);
  margin-bottom: 10px;
}

.dash-main {
  flex: 1;
  padding: 36px 40px;
  overflow-y: auto;
  background: var(--d-bg);
}
.dash-loading { color: var(--d-muted); }

.dash-h1 {
  font-size: 26px; margin: 0 0 4px;
  letter-spacing: -0.015em; font-weight: 700;
}
.dash-sub {
  color: var(--d-muted); font-size: 14px;
  margin: 0 0 28px;
}

/* ── KPI-Kacheln ──────────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: white;
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius);
  padding: 20px 22px;
  box-shadow: var(--d-shadow);
  transition: box-shadow 0.15s, transform 0.15s;
}
.kpi-card:hover { box-shadow: var(--d-shadow-md); transform: translateY(-1px); }
.kpi-label {
  font-size: 11px; color: var(--d-muted);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
}
.kpi-value {
  font-size: 34px; font-weight: 700; line-height: 1.1;
  margin-top: 6px; letter-spacing: -0.02em;
  color: var(--d-text);
}
.kpi-value.warn { color: var(--d-warning); }
.kpi-value.error { color: var(--d-error); }
.kpi-value.success { color: var(--d-success); }
.kpi-value.info { color: var(--d-primary); }

/* ── SLA-Ampel ────────────────────────────────────────────────────────── */
.sla-ampel {
  background: white;
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius);
  padding: 20px 22px;
  margin-bottom: 24px;
  box-shadow: var(--d-shadow);
}
.sla-ampel h2 {
  font-size: 11px; margin: 0 0 14px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--d-muted); font-weight: 600;
}
.sla-ampel-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; font-size: 14px;
  cursor: pointer;
  border-radius: var(--d-radius-sm);
  margin: 0 -8px; padding-left: 8px; padding-right: 8px;
  transition: background 0.1s;
}
.sla-ampel-row:hover { background: var(--d-bg); }
.sla-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.sla-dot.green { background: var(--d-success); }
.sla-dot.yellow { background: var(--d-warning); }
.sla-dot.red { background: var(--d-error); }

/* ── Reklamations-Tabelle ─────────────────────────────────────────────── */
.dash-card {
  background: white;
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius);
  padding: 0;
  margin-bottom: 24px;
  box-shadow: var(--d-shadow);
  overflow: hidden;
}
.dash-card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--d-border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.dash-card-header h2 {
  margin: 0; font-size: 11px; font-weight: 600;
  color: var(--d-muted); text-transform: uppercase; letter-spacing: 0.08em;
}
.filter-row {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.filter-row select {
  padding: 7px 30px 7px 12px; border: 1px solid var(--d-border); border-radius: var(--d-radius-sm);
  font-size: 13px; background: white; font-family: inherit;
  color: var(--d-text);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7a80' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}
.filter-row select:focus { outline: none; border-color: var(--d-primary); box-shadow: 0 0 0 3px var(--d-primary-soft); }

.rekl-table { width: 100%; border-collapse: collapse; }
.rekl-table th {
  text-align: left; padding: 12px 18px; font-size: 11px;
  color: var(--d-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--d-border);
  background: var(--d-bg);
}
.rekl-table td {
  padding: 14px 18px; font-size: 14px;
  border-bottom: 1px solid var(--d-border);
  vertical-align: middle;
}
.rekl-table tr { cursor: pointer; transition: background 0.1s; }
.rekl-table tbody tr:hover { background: var(--d-primary-lighter); }
.rekl-table tr:last-child td { border-bottom: none; }

.prio-circle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  color: white; font-weight: 700; font-size: 13px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.status-pill {
  display: inline-block; padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.sla-zeit { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--d-muted); }
.sla-zeit.warn { color: var(--d-warning); font-weight: 600; }
.sla-zeit.error { color: var(--d-error); font-weight: 600; }

/* ── Charts ─────────────────────────────────────────────────────────────── */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.chart-card {
  background: white;
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius);
  padding: 22px 24px 24px;
  box-shadow: var(--d-shadow);
}
.chart-card h2 {
  margin: 0 0 16px; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--d-muted); font-weight: 600;
}
.chart-canvas-wrap {
  position: relative;
  height: 280px;
}

/* ── Detail-Seite ────────────────────────────────────────────────────── */
.detail-back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--d-primary); text-decoration: none;
  font-size: 14px; font-weight: 500;
  margin-bottom: 16px;
  transition: color 0.1s;
}
.detail-back:hover { color: var(--d-primary-dark); }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}
.detail-card {
  background: white;
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius);
  padding: 18px 22px;
  margin-bottom: 16px;
  box-shadow: var(--d-shadow);
}
.detail-card-label {
  font-size: 11px; color: var(--d-muted);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
  margin-bottom: 6px;
}
.detail-card-value { font-size: 15px; line-height: 1.55; }
.detail-card-meta { font-size: 13px; color: var(--d-muted); margin-top: 6px; }

.detail-foto-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-top: 4px;
}
.detail-foto-grid img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: var(--d-radius-sm); border: 1px solid var(--d-border);
  cursor: pointer;
  transition: transform 0.15s;
}
.detail-foto-grid img:hover { transform: scale(1.03); }

/* ── KI-Insights ─────────────────────────────────────────────────────── */
.insights-card {
  border-left: 4px solid var(--d-primary);
  background: linear-gradient(135deg, white 60%, var(--d-primary-lighter) 100%);
}
.insights-card .dash-card-header { border-bottom-color: var(--d-primary-light); }
.insights-card h3 {
  color: var(--d-primary-darker);
  font-weight: 600;
  margin-top: 12px;
}
.insights-card ul, .insights-card ol {
  color: var(--d-text);
}

/* ── Empty-State ──────────────────────────────────────────────────────── */
.empty-state {
  padding: 48px 24px;
  text-align: center;
}
.empty-icon {
  font-size: 42px;
  margin-bottom: 12px;
  opacity: 0.7;
}
.empty-title {
  font-size: 16px; font-weight: 600;
  color: var(--d-text);
  margin-bottom: 4px;
}
.empty-sub {
  color: var(--d-muted); font-size: 13px;
  max-width: 380px;
  margin: 0 auto;
}

/* ── NEU-Badge ────────────────────────────────────────────────────────── */
.neu-badge {
  display: inline-block;
  background: var(--d-primary);
  color: white;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
}

@media (max-width: 900px) {
  .dash-sidebar {
    width: 100%; min-height: auto;
    flex-direction: row; padding: 12px 16px;
    align-items: center;
    border-right: none; border-bottom: 1px solid var(--d-border);
  }
  .dash-product { display: none; }
  .dash-brand { display: none; }
  .dash-nav { flex-direction: row; gap: 8px; }
  .dash-nav a { padding: 6px 10px; font-size: 13px; }
  .dash-user { border: none; padding-top: 0; margin-left: auto; }
  .dash-body { flex-direction: column; }
  .dash-main { padding: 20px 16px; }
  .chart-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}
