/* FlitzCall Dashboard — Custom Styles
   Brand: rot #e01e1e · gelb #ffd900 · tinte #0f0f10
*/

:root {
  --brand-red: #e01e1e;
  --brand-red-soft: #fef1f1;
  --brand-yellow: #ffd900;
  --brand-yellow-soft: #fff7d6;
  --ink: #0f0f10;
  --ink-soft: #2a2a2d;
  --muted: #6b6b70;
  --line: #e6e6e8;
  --bg-soft: #fafafa;
  --ok: #1f9e4a;
  --warn: #e59500;
  --bad: #c53030;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

/* Globale Pico-Overrides */
body {
  background: var(--bg-soft);
  color: var(--ink);
}

main.container { padding-top: 1.5rem; padding-bottom: 3rem; }

h1, h2, h3, h4 {
  color: var(--ink);
  letter-spacing: -0.01em;
}

h2 {
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--brand-red);
  display: inline-block;
  font-weight: 700;
}

h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--bg-soft);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--ink-soft);
}

/* ===== HEADER / NAV ===== */
header.container {
  background: var(--ink);
  max-width: none;
  width: 100%;
  padding: 0.75rem 1.5rem;
  margin: 0;
  border-bottom: 3px solid var(--brand-yellow);
}

header.container nav { max-width: 1200px; margin: 0 auto; }

header nav strong, header nav a {
  color: #fff;
}

.brand-mark {
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
}
.brand-mark .flitz { color: #fff; }
.brand-mark .call {
  color: var(--brand-yellow);
  margin-left: 2px;
}
.brand-mark .dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--brand-red);
  border-radius: 50%;
  margin-left: 4px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.brand-tagline {
  display: block;
  font-size: 0.72rem;
  color: #9e9e9e;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 2px;
}

header nav a {
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.15s;
}
header nav a:hover { background: rgba(255,255,255,0.08); }
header nav a.active-link {
  background: var(--brand-yellow);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

/* SIP-Status-Pill */
.sip-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.sip-pill.ok { background: rgba(31,158,74,0.2); color: #8ee4a4; }
.sip-pill.bad { background: rgba(197,48,48,0.2); color: #f8a6a6; }
.sip-pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
}
.sip-pill.ok .dot { animation: pulse 2s ease-in-out infinite; }

/* ===== KPI-TILES ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.875rem;
  margin-bottom: 1.5rem;
}

.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.95rem 1rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.12s, box-shadow 0.12s;
}
.kpi:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.kpi-unit {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
}

.kpi-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
}

.kpi.accent { border-left: 3px solid var(--brand-red); }
.kpi.accent-yellow { border-left: 3px solid var(--brand-yellow); }
.kpi.accent-ok { border-left: 3px solid var(--ok); }
.kpi.accent-warn { border-left: 3px solid var(--warn); }

.kpi.hero {
  background: var(--ink);
  color: #fff;
  border: none;
}
.kpi.hero .kpi-label { color: var(--brand-yellow); }
.kpi.hero .kpi-value { color: #fff; }
.kpi.hero .kpi-sub { color: #aaa; }

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #ebebee;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-success { background: #d9f5e0; color: #14683a; }
.badge-warning { background: #ffe9b8; color: #7a4500; }
.badge-danger  { background: #fcdada; color: #8a1919; }
.badge-info    { background: #d4e7ff; color: #1647a6; }
.badge-muted   { background: #e8e8ea; color: var(--muted); }
.badge-brand   { background: var(--brand-yellow); color: var(--ink); }

/* Tabellen-Zeilen */
table {
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
}
figure { margin: 0 0 1.5rem; overflow-x: auto; }
th {
  background: var(--bg-soft);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  padding: 0.6rem 0.75rem;
}
td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-soft); }

.row-success { box-shadow: inset 3px 0 0 var(--ok); }
.row-warning { box-shadow: inset 3px 0 0 var(--warn); }
.row-danger  { box-shadow: inset 3px 0 0 var(--bad); }
.row-muted   { opacity: 0.55; }

.price-cell {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--ink);
}
.special-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 3px;
  background: var(--brand-yellow-soft);
  color: #5a3c00;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid #f0d876;
}

/* ===== STUNDEN-HISTOGRAMM ===== */
.hour-chart {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1rem 1.25rem 0.75rem;
  margin-bottom: 1.5rem;
}
.hour-chart-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.hour-chart-peak { color: var(--brand-red); font-weight: 700; }
.hour-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 84px;
  width: 100%;
}
.hour-bar {
  flex: 1 1 0;
  background: var(--brand-red);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  position: relative;
  transition: background 0.15s;
}
.hour-bar:hover { background: var(--ink); }
.hour-bar-empty { background: var(--line); min-height: 2px; }
.hour-bar-peak { background: var(--ink); }
.hour-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.7rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.hour-labels span { flex: 1 1 0; text-align: left; }

/* ===== LIVE SECTION ===== */
.live-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.live-banner .live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--bad);
  animation: pulse 1.5s ease-in-out infinite;
}

.active-call-card {
  background: #fff;
  border-left: 4px solid var(--brand-red);
  border-radius: 4px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.92rem;
}
.active-call-card > div:first-child { flex: 1 1 200px; }
.active-call-card .call-meta { color: var(--muted); font-size: 0.82rem; }
.no-active {
  color: var(--muted);
  font-style: italic;
  padding: 1rem;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 4px;
  text-align: center;
}

/* ===== DATUMSFILTER ===== */
.date-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  background: #fff;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.date-filter input[type="date"] {
  width: auto;
  margin-bottom: 0;
  border: none;
  background: transparent;
  font-weight: 600;
  padding: 0 4px;
}
.date-filter label {
  margin-bottom: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

.count-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.75rem 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}
.count-bar strong { font-size: 1.1rem; color: var(--brand-red); }

/* ===== TRANSKRIPT ===== */
.call-header-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.meta-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.65rem 0.85rem;
}
.meta-card header {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
  padding: 0;
  margin-bottom: 4px;
  background: none;
  border: none;
}
.meta-card p {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}

.transcript {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 760px;
  margin: 1rem 0;
}
.transcript-entry { display: flex; flex-direction: column; }
.transcript-meta {
  display: flex;
  gap: 0.4rem;
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 2px;
  font-variant-numeric: tabular-nums;
}
.transcript-role { font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.transcript-bubble {
  padding: 8px 13px;
  border-radius: 10px;
  max-width: 78%;
  line-height: 1.4;
  font-size: 0.93rem;
}

.transcript-bot { align-items: flex-start; }
.transcript-bot .transcript-bubble {
  background: var(--ink);
  color: #fff;
  border-bottom-left-radius: 3px;
}
.transcript-bot .transcript-role { color: var(--brand-red); }

.transcript-caller { align-items: flex-end; }
.transcript-caller .transcript-bubble {
  background: var(--brand-yellow);
  color: var(--ink);
  border-bottom-right-radius: 3px;
  font-weight: 500;
}
.transcript-caller .transcript-role { color: #7a4500; }

.transcript-system { align-items: center; }
.transcript-system .transcript-bubble {
  background: transparent;
  color: var(--muted);
  font-style: italic;
  font-size: 0.82rem;
  padding: 2px 6px;
  border: 1px dashed var(--line);
  border-radius: 3px;
}

/* ===== INFO-BANNER ===== */
.info-panel {
  background: var(--brand-yellow-soft);
  border-left: 4px solid var(--brand-yellow);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: 0.88rem;
  margin: 1rem 0;
}
.cost-panel {
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
}
.cost-panel strong {
  color: var(--brand-yellow);
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

/* Footer */
footer.container {
  padding: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  margin-top: 3rem;
}

.muted { color: var(--muted); font-style: italic; }

/* Links */
a { color: var(--brand-red); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }

/* Zurück-Link */
.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.back-link::before { content: "← "; }

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
}

/* Small icons */
.i {
  display: inline-block;
  width: 14px; height: 14px;
  vertical-align: -2px;
  margin-right: 4px;
  opacity: 0.7;
}
