/* Finder Zahlen — Stil übernommen aus ln-report (day/week/month.html), mobil erweitert */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #f1f5f9; --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --faint: #94a3b8;
  --line: #e2e8f0; --line-2: #f1f5f9; --card: #fff;
  --ae: #2563eb; --ae-ink: #1d4ed8; --ra: #10b981; --ra-ink: #059669; --neg: #dc2626;
  --hdr: linear-gradient(135deg, #1e3a8a 0%, #3730a3 55%, #4338ca 100%);
}
html { -webkit-text-size-adjust: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink); min-height: 100vh; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 14px 16px calc(28px + env(safe-area-inset-bottom)); }
button { font: inherit; cursor: pointer; }
.num, .kpi-value, .cust-val { font-variant-numeric: tabular-nums; }

/* Header */
.header { background: var(--hdr); color: #fff; border-radius: 16px; padding: 16px 22px 14px;
  margin-bottom: 14px; box-shadow: 0 6px 24px rgba(30,58,138,0.28); padding-top: calc(16px + env(safe-area-inset-top)); }
.header-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.header h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.header .company { font-size: 11px; opacity: 0.7; margin-top: 3px; letter-spacing: 0.3px; }
.user { display: flex; align-items: center; gap: 10px; font-size: 12px; opacity: 0.9; white-space: nowrap; }
.user form { display: inline; }
.btn-ghost { background: rgba(255,255,255,0.14); color: #fff; border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px; padding: 5px 10px; font-size: 12px; }
.btn-ghost:hover { background: rgba(255,255,255,0.24); }

.tabs { display: flex; gap: 6px; margin-top: 14px; background: rgba(255,255,255,0.12); padding: 4px;
  border-radius: 11px; width: fit-content; }
.tab { background: transparent; color: #fff; border: 0; border-radius: 8px; padding: 7px 16px;
  font-size: 13.5px; font-weight: 600; opacity: 0.85; }
.tab[aria-selected="true"] { background: #fff; color: #1e3a8a; opacity: 1; }
.navbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.nav-center { display: flex; align-items: center; gap: 8px; min-width: 0; }
.nav-btn { background: rgba(255,255,255,0.14); color: #fff; border: 1px solid rgba(255,255,255,0.25);
  border-radius: 9px; width: 36px; height: 36px; font-size: 18px; line-height: 1; flex: none; }
.nav-btn:disabled { opacity: 0.3; cursor: default; }
.subtitle { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.date-pick { position: relative; flex: none; }
.date-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.fresh { font-size: 11.5px; opacity: 0.85; margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; flex: none; }
.dot.warn { background: #fbbf24; } .dot.err { background: #f87171; }

/* Banner */
.banner { border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; display: none; }
.banner.show { display: block; }
.banner.warn { background: #fffbeb; border-left: 4px solid #f59e0b; color: #78350f; }
.banner.err { background: #fef2f2; border-left: 4px solid #ef4444; color: #7f1d1d; }

/* KPI-Karten */
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 14px; }
.kpi-card { background: var(--card); border-radius: 14px; padding: 16px 20px; box-shadow: 0 2px 14px rgba(0,0,0,0.06); border-left: 5px solid; }
.kpi-card.ra { border-left-color: var(--ra); } .kpi-card.ae { border-left-color: var(--ae); }
.kpi-label { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
.kpi-value { font-size: 30px; font-weight: 800; margin-top: 8px; letter-spacing: -1.2px; }
.kpi-card.ra .kpi-value { color: var(--ra-ink); } .kpi-card.ae .kpi-value { color: var(--ae-ink); }
.kpi-sub { font-size: 12px; color: var(--faint); margin-top: 6px; line-height: 1.5; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: 11.5px; background: var(--line-2); color: var(--ink-2); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.chip b { font-weight: 700; }
.chip .up { color: var(--ra-ink); } .chip .down { color: var(--neg); }

.data-note { font-size: 12px; color: #475569; background: #fff; border-radius: 10px; padding: 11px 16px; margin-bottom: 14px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.04); border-left: 3px solid var(--faint); }
.data-note strong { color: #1e293b; }

/* Sektionen */
.two-col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 14px; }
.section { background: var(--card); border-radius: 14px; padding: 16px 20px; box-shadow: 0 2px 14px rgba(0,0,0,0.06); margin-bottom: 14px; }
.two-col .section { margin-bottom: 0; }
.section h2 { font-size: 14px; font-weight: 700; color: var(--ink-2); margin-bottom: 12px; }
.section h2.ae { color: var(--ae-ink); } .section h2.ra { color: var(--ra-ink); }
.chart-container { position: relative; height: 240px; }
.chart-container.small { height: 200px; }

.cust { margin-bottom: 11px; }
.cust-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.cust-name { font-size: 13px; font-weight: 600; color: #1e293b; min-width: 0; overflow-wrap: anywhere; }
.cust-num { font-size: 10.5px; color: var(--faint); font-weight: 400; margin-left: 6px; }
.cust-val { font-size: 13px; font-weight: 800; white-space: nowrap; }
.cust-bar { height: 7px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.cust-bar > div { height: 100%; border-radius: 4px; }
.ae .cust-val { color: var(--ae-ink); } .ae .cust-bar > div { background: linear-gradient(90deg,#3b82f6,#2563eb); }
.ra .cust-val { color: var(--ra-ink); } .ra .cust-bar > div { background: linear-gradient(90deg,#34d399,#10b981); }
.empty { font-size: 13px; color: var(--faint); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 9px 12px; background: #f8fafc; color: var(--muted); font-weight: 700; text-transform: uppercase;
  font-size: 10.5px; letter-spacing: 0.5px; border-bottom: 2px solid var(--line); white-space: nowrap; }
th.num, td.num { text-align: right; white-space: nowrap; }
td { padding: 8px 12px; border-bottom: 1px solid var(--line-2); }
td:first-child { white-space: nowrap; }
tr.total td { font-weight: 800; background: #f8fafc; border-top: 2px solid #cbd5e1; }
tr.off td { color: var(--faint); }
tr.off td.ae-cell, tr.off td.ra-cell { color: var(--faint); font-weight: 400; }
.ae-cell { color: var(--ae-ink); font-weight: 700; } .ra-cell { color: var(--ra-ink); font-weight: 700; }
.delta-pos { color: var(--ra-ink); } .delta-neg { color: var(--neg); }
.tag-hol { font-size: 10.5px; color: var(--faint); margin-left: 6px; }

.assessment h2 { color: #1e3a8a; }
.assessment p { font-size: 13.5px; line-height: 1.65; color: var(--ink-2); }
.assessment p + p { margin-top: 6px; }

.loading { text-align: center; color: var(--faint); padding: 40px 0; font-size: 14px; }
.foot { text-align: center; font-size: 11px; color: var(--faint); margin-top: 8px; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 10px 40px rgba(15,23,42,0.12); }
.login-card .header { border-radius: 0; margin: 0; box-shadow: none; padding-top: 22px; }
.login-card form { padding: 22px; display: grid; gap: 14px; }
.login-card label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; display: grid; gap: 6px; }
.login-card input { font: inherit; font-size: 16px; padding: 11px 12px; border: 1px solid #cbd5e1; border-radius: 10px; color: var(--ink); text-transform: none; letter-spacing: 0; font-weight: 400; }
.login-card input:focus { outline: 2px solid #6366f1; outline-offset: 1px; border-color: transparent; }
.btn-primary { background: #1e3a8a; color: #fff; border: 0; border-radius: 10px; padding: 12px; font-weight: 700; font-size: 15px; }
.btn-primary:hover { background: #3730a3; }
.error { background: #fef2f2; color: #991b1b; border-radius: 10px; padding: 10px 12px; font-size: 13px; }

[hidden] { display: none !important; }

@media (max-width: 640px) {
  .wrap { padding: 10px 12px calc(24px + env(safe-area-inset-bottom)); }
  .header { padding: 14px 16px 12px; padding-top: calc(14px + env(safe-area-inset-top)); border-radius: 14px; }
  .header h1 { font-size: 19px; }
  .header .company { display: none; }
  .tabs { width: 100%; } .tab { flex: 1; padding: 8px 6px; }
  .kpi-grid, .two-col { grid-template-columns: 1fr; gap: 10px; }
  .kpi-value { font-size: 27px; }
  .section, .kpi-card { padding: 14px 16px; }
  th, td { padding: 7px 8px; }
  .hide-sm { display: none; }
  .chart-container { height: 210px; }
}
@media print {
  .tabs, .nav-btn, .user, .date-pick { display: none !important; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
