/* ==========================================================================
   QSL-Manager – Stylesheet (klares Blau, hell/dunkel, große Schrift für 60+)
   Hell = Standard. Dunkel automatisch per System ODER manuell (data-theme).
   ========================================================================== */

:root {
  --bg:#eef2f8; --surface:#ffffff; --surface-2:#f1f5fb; --surface-3:#e5edf8;
  --text:#13203a; --muted:#566884; --faint:#8190a8;
  --border:#dbe3f0; --border-strong:#c4d0e3;
  --primary:#1f5fd6; --primary-700:#16459e; --primary-050:#e9f1fe; --primary-100:#d6e5fc;
  --on-primary:#ffffff;
  --success:#16834a; --success-bg:#e3f5ea;
  --danger:#cf3b3b;  --danger-bg:#fcebeb;
  --warning:#9c6307; --warning-bg:#faeed5;
  --ring:rgba(31,95,214,.32);
  --banner-1:#16439c; --banner-2:#2f6fe0; --banner-3:#22a3c4;
  --shadow:0 1px 2px rgba(16,33,66,.06), 0 8px 24px rgba(16,33,66,.07);
  --radius:14px; --radius-sm:10px; --radius-pill:999px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#0d1623; --surface:#15202f; --surface-2:#1b2838; --surface-3:#243650;
    --text:#e8eefb; --muted:#9fb1c9; --faint:#7184a0;
    --border:#27384e; --border-strong:#36506c;
    --primary:#5b94f2; --primary-700:#3d78dd; --primary-050:#162840; --primary-100:#1d3a5c;
    --on-primary:#091426;
    --success:#3fc77f; --success-bg:#12301f;
    --danger:#f06a6a;  --danger-bg:#3a1b1b;
    --warning:#e3a23a; --warning-bg:#352712;
    --ring:rgba(91,148,242,.4);
    --banner-1:#0f2a55; --banner-2:#1b4f9c; --banner-3:#176b86;
    --shadow:0 1px 2px rgba(0,0,0,.35), 0 10px 28px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  --bg:#0d1623; --surface:#15202f; --surface-2:#1b2838; --surface-3:#243650;
  --text:#e8eefb; --muted:#9fb1c9; --faint:#7184a0;
  --border:#27384e; --border-strong:#36506c;
  --primary:#5b94f2; --primary-700:#3d78dd; --primary-050:#162840; --primary-100:#1d3a5c;
  --on-primary:#091426;
  --success:#3fc77f; --success-bg:#12301f;
  --danger:#f06a6a;  --danger-bg:#3a1b1b;
  --warning:#e3a23a; --warning-bg:#352712;
  --ring:rgba(91,148,242,.4);
  --banner-1:#0f2a55; --banner-2:#1b4f9c; --banner-3:#176b86;
  --shadow:0 1px 2px rgba(0,0,0,.35), 0 10px 28px rgba(0,0,0,.4);
}

* { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body {
  margin:0; background:var(--bg); color:var(--text);
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  font-size:17px; line-height:1.6;
}
h1,h2,h3 { line-height:1.25; margin:0 0 .5em; font-weight:600; letter-spacing:-.01em; }
h1 { font-size:1.5rem; } h2 { font-size:1.2rem; } h3 { font-size:1.02rem; }
a { color:var(--primary); text-decoration:none; }
a:hover { text-decoration:underline; }
.muted { color:var(--muted); }
.mono { font-family:ui-monospace,"SFMono-Regular",Menlo,Consolas,monospace; }
.center { text-align:center; }

.sprite { position:absolute; width:0; height:0; overflow:hidden; }
.ic { fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; vertical-align:-.18em; flex:0 0 auto; }

.skip-link {
  position:absolute; left:-999px; top:0; background:var(--primary); color:#fff;
  padding:10px 16px; border-radius:0 0 8px 0; z-index:100;
}
.skip-link:focus { left:0; }

/* --- Kopfbanner ---------------------------------------------------------- */
.topbar {
  background:linear-gradient(115deg,var(--banner-1),var(--banner-2) 55%,var(--banner-3));
  color:#fff;
}
.topbar-inner {
  max-width:1060px; margin:0 auto; padding:12px 20px;
  display:flex; align-items:center; gap:18px; flex-wrap:wrap;
}
.brand { display:flex; align-items:center; gap:12px; color:#fff; }
.brand:hover { text-decoration:none; }
.brand-logo { display:flex; }
.brand-text { display:flex; flex-direction:column; line-height:1.15; }
.brand-name { font-weight:600; font-size:1.12rem; }
.brand-sub { font-size:.78rem; opacity:.82; }
.topnav { display:flex; gap:4px; margin-left:6px; flex-wrap:wrap; }
.navlink {
  display:inline-flex; align-items:center; gap:7px; color:#fff;
  padding:8px 13px; border-radius:var(--radius-pill); font-size:.95rem; opacity:.86;
}
.navlink:hover { background:rgba(255,255,255,.14); opacity:1; text-decoration:none; }
.navlink.active { background:rgba(255,255,255,.2); opacity:1; font-weight:500; }
.topuser { margin-left:auto; display:flex; align-items:center; gap:10px; }
.icon-btn {
  display:inline-flex; align-items:center; justify-content:center;
  width:38px; height:38px; border-radius:var(--radius-pill);
  background:rgba(255,255,255,.14); color:#fff; border:0; cursor:pointer;
}
.icon-btn:hover { background:rgba(255,255,255,.26); }
.user-chip {
  display:inline-flex; align-items:center; gap:7px; color:#fff;
  background:rgba(255,255,255,.14); padding:7px 13px 7px 11px; border-radius:var(--radius-pill);
  font-weight:500; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:.92rem;
}
.user-chip:hover { background:rgba(255,255,255,.24); text-decoration:none; }
.logout-form { margin:0; }
.topbar .btn-ghost { color:#fff; border-color:rgba(255,255,255,.45); background:transparent; }
.topbar .btn-ghost:hover { background:rgba(255,255,255,.16); }

/* --- Layout -------------------------------------------------------------- */
.container { max-width:1060px; margin:0 auto; padding:24px 20px 56px; }
.container.narrow { max-width:520px; }
.stack > * + * { margin-top:18px; }
.grid-2 { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:18px; }
.page-head { display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; margin-bottom:18px; }

/* --- Karten / Panels ----------------------------------------------------- */
.card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); padding:20px 22px; box-shadow:var(--shadow);
}
.card-title { display:flex; align-items:center; gap:9px; font-size:.95rem; color:var(--muted); margin-bottom:14px; }
.card-title .ic { color:var(--primary); }

/* --- Hero (Dashboard) ---------------------------------------------------- */
.hero {
  display:flex; align-items:center; justify-content:space-between; gap:20px; flex-wrap:wrap;
  background:var(--surface); border:1px solid var(--border); box-shadow:var(--shadow);
  border-radius:18px; padding:22px 26px; margin-bottom:18px;
}
.hero-main { display:flex; align-items:center; gap:18px; }
.hero-badge {
  width:60px; height:60px; border-radius:16px; background:var(--primary-050); color:var(--primary);
  display:flex; align-items:center; justify-content:center; flex:0 0 auto;
}
.hero-num { font-size:2.9rem; font-weight:600; line-height:1; color:var(--primary); font-variant-numeric:tabular-nums; letter-spacing:-.02em; }
.hero-label { color:var(--muted); margin-top:5px; }
.hero-side { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }

/* --- Kennzahlen ---------------------------------------------------------- */
.metrics { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; }
.metric { background:var(--surface-2); border-radius:var(--radius-sm); padding:14px 16px; }
.metric .label { font-size:.82rem; color:var(--muted); }
.metric .value { font-size:1.85rem; font-weight:600; letter-spacing:-.01em; margin-top:2px; }
.metric .value.sm { font-size:1.3rem; }

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font:inherit; font-weight:500; cursor:pointer; border:1px solid transparent;
  border-radius:var(--radius-sm); padding:11px 18px; transition:filter .12s, background .12s;
}
.btn:hover { text-decoration:none; }
.btn:active { transform:translateY(1px); }
.btn-primary { background:var(--primary); color:var(--on-primary); }
.btn-primary:hover { filter:brightness(1.07); }
.btn-success { background:var(--success); color:#fff; }
.btn-success:hover { filter:brightness(1.07); }
.btn-ghost { background:var(--surface); color:var(--text); border-color:var(--border-strong); }
.btn-ghost:hover { background:var(--surface-2); }
.btn-danger { background:transparent; color:var(--danger); border-color:var(--danger); }
.btn-danger:hover { background:var(--danger-bg); }
.btn-sm { padding:8px 13px; font-size:.9rem; border-radius:var(--radius-pill); }
.btn-block { width:100%; }
.btn[disabled] { opacity:.55; cursor:not-allowed; }
.pill {
  display:inline-flex; align-items:center; gap:6px; border:1px solid var(--border-strong);
  background:var(--surface); border-radius:var(--radius-pill); padding:7px 14px; font-size:.9rem; cursor:pointer;
}
.icon-link { background:none; border:0; color:var(--faint); cursor:pointer; padding:6px; border-radius:8px; }
.icon-link:hover { color:var(--danger); background:var(--danger-bg); }

/* --- Formulare ----------------------------------------------------------- */
.field { margin-bottom:16px; }
.field > label { display:block; font-size:.9rem; color:var(--muted); margin-bottom:6px; }
input[type=text], input[type=password], input[type=email], input[type=number],
input[type=date], select, textarea {
  width:100%; font:inherit; color:var(--text); background:var(--surface);
  border:1px solid var(--border-strong); border-radius:var(--radius-sm);
  padding:12px 14px; min-height:48px;
}
textarea { min-height:90px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .pill:focus-visible,
.icon-btn:focus-visible, a:focus-visible {
  outline:none; box-shadow:0 0 0 4px var(--ring); border-color:var(--primary);
}
.input-icon { position:relative; }
.input-icon .ic { position:absolute; left:13px; top:50%; transform:translateY(-50%); color:var(--faint); }
.input-icon input { padding-left:42px; }
.hint { font-size:.82rem; color:var(--faint); margin-top:6px; }
.inline-fields { display:flex; gap:12px; flex-wrap:wrap; }
.inline-fields .field { flex:1; min-width:160px; }

.choice {
  display:flex; align-items:center; gap:12px; padding:13px 15px;
  border:1px solid var(--border); border-radius:var(--radius-sm); cursor:pointer; margin-bottom:10px;
}
.choice:hover { border-color:var(--border-strong); }
.choice.sel { border-color:var(--primary); background:var(--primary-050); }
.choice input { width:auto; min-height:0; }
.choice .c-main { font-weight:500; }
.choice .c-count { margin-left:auto; color:var(--muted); }

/* --- Hinweise / Alerts --------------------------------------------------- */
.alert { border-radius:var(--radius-sm); padding:13px 16px; margin-bottom:16px; border:1px solid transparent; }
.alert-success { background:var(--success-bg); color:var(--success); border-color:var(--success); }
.alert-danger  { background:var(--danger-bg);  color:var(--danger);  border-color:var(--danger); }
.alert-info    { background:var(--primary-050);color:var(--primary-700); border-color:var(--primary); }
.alert-warning { background:var(--warning-bg); color:var(--warning); border-color:var(--warning); }
.callout { display:flex; gap:10px; align-items:flex-start; }
.callout .ic { flex:0 0 auto; margin-top:2px; }

/* --- Badges -------------------------------------------------------------- */
.badge { display:inline-block; font-size:.78rem; padding:2px 9px; border-radius:var(--radius-pill); font-weight:500; }
.badge-manual { background:var(--primary-050); color:var(--primary-700); }
.badge-adif   { background:var(--success-bg); color:var(--success); }
.badge-admin  { background:var(--warning-bg); color:var(--warning); }

/* --- Tabellen ------------------------------------------------------------ */
.table { width:100%; border-collapse:collapse; font-size:.96rem; }
.table th { text-align:left; font-weight:500; color:var(--muted); font-size:.85rem; padding:8px 10px; border-bottom:1px solid var(--border); }
.table td { padding:11px 10px; border-bottom:1px solid var(--border); }
.table tr:last-child td { border-bottom:0; }
.table .num { text-align:right; font-variant-numeric:tabular-nums; }
.table-wrap { overflow-x:auto; }

/* --- Diagramme ----------------------------------------------------------- */
.barchart { display:flex; align-items:flex-end; gap:6px; height:210px; }
.bar-col { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:8px; height:100%; cursor:pointer; min-width:0; }
.bar-wrap { width:100%; display:flex; justify-content:center; align-items:flex-end; height:100%; }
.bar { width:64%; max-width:30px; background:var(--primary); border-radius:6px 6px 0 0; height:0; min-height:2px; transition:height .7s cubic-bezier(.2,.7,.2,1); }
.bar-col:hover .bar, .bar-col.sel .bar { background:var(--primary-700); }
.bar-label { font-size:.74rem; color:var(--faint); }
.bar-col.sel .bar-label { color:var(--primary); font-weight:500; }

.hbar-row { display:flex; align-items:center; gap:12px; margin-bottom:11px; }
.hbar-name { width:130px; flex:0 0 auto; font-size:.95rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hbar-track { flex:1; height:12px; background:var(--surface-3); border-radius:var(--radius-pill); overflow:hidden; }
.hbar-fill { height:100%; width:0; background:var(--primary); border-radius:var(--radius-pill); transition:width .8s cubic-bezier(.2,.7,.2,1); }
.hbar-val { width:52px; text-align:right; font-weight:500; font-variant-numeric:tabular-nums; }

.donut-wrap { display:flex; align-items:center; gap:18px; flex-wrap:wrap; }
.legend { flex:1; min-width:160px; }
.legend-row { display:flex; align-items:center; gap:9px; font-size:.95rem; margin-bottom:7px; }
.legend-dot { width:11px; height:11px; border-radius:3px; flex:0 0 auto; }
.legend-row .lv { margin-left:auto; color:var(--muted); font-variant-numeric:tabular-nums; }

.month-detail { margin-top:14px; padding-top:14px; border-top:1px solid var(--border); display:none; }
.month-detail.show { display:block; }
.chips { display:flex; flex-wrap:wrap; gap:7px; }
.chip { background:var(--surface-2); border-radius:var(--radius-pill); padding:3px 11px; font-size:.86rem; }
.chip b { font-weight:600; }

.feed-row { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 0; border-top:1px solid var(--border); }
.feed-row:first-of-type { border-top:0; }
.feed-left { display:flex; align-items:center; gap:11px; min-width:0; }
.feed-left .call { font-family:ui-monospace,Menlo,Consolas,monospace; font-weight:600; font-size:.95rem; }
.feed-right { display:flex; align-items:center; gap:9px; }
.feed-time { color:var(--faint); font-size:.82rem; width:74px; text-align:right; }

/* --- Login / schmale Seiten --------------------------------------------- */
.auth-wrap { max-width:430px; margin:6vh auto 0; }
.auth-card { background:var(--surface); border:1px solid var(--border); border-radius:18px; padding:28px 28px 26px; box-shadow:var(--shadow); }
.auth-head { text-align:center; margin-bottom:20px; }
.auth-badge { width:52px; height:52px; border-radius:15px; background:var(--primary-050); color:var(--primary); display:inline-flex; align-items:center; justify-content:center; margin-bottom:10px; }
.secret-box { font-family:ui-monospace,Menlo,Consolas,monospace; font-size:1.15rem; letter-spacing:2px; text-align:center; background:var(--surface-2); border:1px dashed var(--border-strong); border-radius:var(--radius-sm); padding:14px; word-break:break-all; }
.recovery { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; font-family:ui-monospace,Menlo,Consolas,monospace; }
.recovery span { background:var(--surface-2); border-radius:8px; padding:8px 10px; text-align:center; letter-spacing:1px; }

/* --- Footer -------------------------------------------------------------- */
.sitefoot { border-top:1px solid var(--border); background:var(--surface); }
.sitefoot-inner { max-width:1060px; margin:0 auto; padding:18px 20px; display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; font-size:.86rem; color:var(--muted); }

/* --- Responsiv ----------------------------------------------------------- */
@media (max-width:680px) {
  body { font-size:16px; }
  .topbar-inner { padding:10px 14px; gap:10px; }
  .brand-sub { display:none; }
  .navlink span { display:none; }
  .navlink { padding:9px 11px; }
  .container { padding:18px 14px 44px; }
  .hero-num { font-size:2.3rem; }
  .feed-time { width:auto; }
  .hbar-name { width:96px; }
}
@media (max-width:420px) {
  .user-chip span { display:none; }
}
