/* Trading CRM - ein Stil, ruhig, Arbeitswerkzeug (web-design-standard).
   Abstaende nur 8/16/24/32/48/64, ein Radius, eine Haarlinie, eine Schrift. */

@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s6: 48px; --s8: 64px;
  --radius: 12px;
  --bg: #f5f6f8;
  --flaeche: #ffffff;
  --flaeche-2: #f9fafb;
  --linie: #e2e5ea;
  --text: #141a22;
  --text-2: #586273;
  --akzent: #1d4ed8;
  --akzent-weich: #e8eefc;
  --gut: #15803d;
  --schlecht: #b42318;
  --warn-bg: #fff7e6;
  --warn-linie: #f3d9a4;
  --schatten: 0 1px 2px rgba(16, 24, 40, .04);
  --schatten-hoch: 0 8px 24px rgba(16, 24, 40, .08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116; --flaeche: #151a21; --flaeche-2: #1a2029; --linie: #262e3a;
    --text: #e8ecf2; --text-2: #98a2b3; --akzent: #7aa2ff; --akzent-weich: #1b2740;
    --gut: #4ade80; --schlecht: #f87171; --warn-bg: #2a2212; --warn-linie: #5a4618;
    --schatten: none; --schatten-hoch: 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.5; font-feature-settings: "cv11", "ss01";
}
a { color: var(--akzent); text-decoration: none; }
a:hover { text-decoration: none; opacity: .85; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 28px; line-height: 1.25; }
h2 { font-size: 18px; }
.zahl, td.num, .kpi-wert { font-variant-numeric: tabular-nums; }
.label {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2);
}
.leise { color: var(--text-2); }
.icon { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.75; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--s3); }
@media (max-width: 640px) { .container { padding: 0 20px; } }

/* Kopf */
.kopf { background: var(--flaeche); border-bottom: 1px solid var(--linie); position: sticky; top: 0; z-index: 10; }
.kopf-innen { display: flex; align-items: center; gap: var(--s3); height: 64px; }
.marke-wort { font-weight: 700; font-size: 17px; color: var(--text); white-space: nowrap; }
.nav { position: relative; display: flex; gap: var(--s1); overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--text-2); font-weight: 500; font-size: 15px; padding: var(--s1) 12px; border-radius: var(--radius); white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--flaeche-2); opacity: 1; }
.nav a[aria-current="page"] { color: var(--akzent); background: var(--akzent-weich); }
.nutzer { display: flex; align-items: center; gap: var(--s2); color: var(--text-2); font-size: 15px; white-space: nowrap; }
@media (max-width: 760px) { .nutzer-name { display: none; } .marke-wort { display: none; } }

/* Knoepfe und Felder */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s1);
  height: 40px; padding: 0 var(--s2); border-radius: var(--radius); border: 1px solid var(--linie);
  background: var(--flaeche); color: var(--text); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.knopf:hover { background: var(--flaeche-2); }
.knopf:disabled { opacity: .6; cursor: default; }
.knopf-haupt { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.knopf-haupt:hover { background: var(--akzent); opacity: .92; }
.knopf-icon { width: 40px; padding: 0; }
.feld, select.feld {
  height: 40px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--linie);
  background: var(--flaeche); color: var(--text); font: inherit; font-size: 16px; min-width: 0;
}
.feld:focus, .knopf:focus-visible, .nav a:focus-visible, th button:focus-visible {
  outline: 2px solid var(--akzent); outline-offset: 1px;
}
.suche { position: relative; flex: 1 1 260px; }
.suche .icon { position: absolute; left: 12px; top: 10px; color: var(--text-2); }
.suche .feld { width: 100%; padding-left: 40px; }

/* Seite */
main.container { padding-top: var(--s6); padding-bottom: var(--s8); }
.seitenkopf { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); }
.seitenkopf p { margin: var(--s1) 0 0; color: var(--text-2); }
.abschnitt { margin-top: var(--s6); }
.abschnitt > h2 { margin-bottom: var(--s2); }

.hinweis {
  border: 1px solid var(--warn-linie); background: var(--warn-bg); border-radius: var(--radius);
  padding: 12px var(--s2); margin-bottom: var(--s3); font-size: 15px;
}
.hinweis.beispiel { margin: 0; border-radius: 0; border-width: 0 0 1px; text-align: center; }

/* Karten */
.karte {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: var(--s4); box-shadow: var(--schatten);
}
@media (max-width: 640px) { .karte { padding: var(--s3); } }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { padding: var(--s3); }
.kpi-wert { font-size: 28px; font-weight: 600; margin-top: var(--s1); line-height: 1.2; }
.kpi-unter { font-size: 14px; color: var(--text-2); margin-top: 4px; }

.marken { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
@media (max-width: 1000px) { .marken { grid-template-columns: 1fr; } }
.marken-karte { display: flex; flex-direction: column; gap: var(--s3); transition: transform .2s, box-shadow .2s; }
@media (hover: hover) and (pointer: fine) {
  .marken-karte:hover { transform: translateY(-2px); box-shadow: var(--schatten-hoch); }
}
.marken-karte header { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); }
.titel-link { color: inherit; }
.mehr-link { color: var(--akzent); display: inline-flex; gap: 4px; align-items: center; }
.mehr-link .icon { width: 16px; height: 16px; }
.mini-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2) var(--s3); }
.mini-kpis .kpi-wert { font-size: 22px; margin-top: 4px; }
.stufen { display: grid; gap: var(--s1); }
.stufe-zeile { display: grid; grid-template-columns: 120px 1fr 40px; align-items: center; gap: 12px; font-size: 14px; }
.stufe-zeile .zahl { text-align: right; }
.balken { height: 8px; background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; }
.balken i { display: block; height: 100%; background: var(--akzent); transform-origin: left; transform: scaleX(0); transition: transform .6s ease-out; }
.stand { font-size: 14px; color: var(--text-2); border-top: 1px solid var(--linie); padding-top: var(--s2); }
.stand.alt { color: var(--schlecht); }

/* Filter */
.filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: var(--s2); }
.filter select.feld { flex: 1 1 170px; }
.filter .suche { flex: 2 1 280px; }
.zaehler { font-size: 14px; color: var(--text-2); margin-bottom: 12px; }

/* Tabellen */
.tabelle-rahmen { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--schatten); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 12px var(--s2); border-bottom: 1px solid var(--linie); white-space: nowrap; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--flaeche-2); }
th { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); background: var(--flaeche-2); position: sticky; top: 0; }
th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
th button::after { content: ""; width: 8px; }
th[aria-sort="ascending"] button::after { content: "\2191"; }
th[aria-sort="descending"] button::after { content: "\2193"; }
td.num, th.num { text-align: right; }
th.num button { flex-direction: row-reverse; }
.kunde b { font-weight: 500; display: block; }
.kunde span { font-size: 13px; color: var(--text-2); }
.status-verloren { color: var(--schlecht); }
.status-abgemeldet { color: var(--text-2); }
.leer { padding: var(--s6) var(--s3); text-align: center; color: var(--text-2); }
.leer b { display: block; color: var(--text); margin-bottom: 4px; font-weight: 600; }

.meter { display: inline-flex; gap: 2px; margin-right: var(--s1); vertical-align: middle; }
.meter i { width: 6px; height: 12px; border-radius: 2px; background: var(--linie); }
.meter i.an { background: var(--akzent); }

/* Login */
.login-seite { min-height: 100vh; display: grid; place-items: center; padding: var(--s3) 20px; }
.login-karte { width: 100%; max-width: 400px; }
.login-karte h1 { font-size: 24px; margin-bottom: 4px; }
.login-karte form { display: grid; gap: var(--s2); margin-top: var(--s3); }
.login-karte label { display: grid; gap: 4px; font-size: 14px; font-weight: 500; }
.login-karte .feld { width: 100%; }
.fehler { color: var(--schlecht); font-size: 14px; min-height: 0; margin: 0; }
.erfolg { color: var(--gut); font-size: 14px; margin: 0; }

.login-karte .klein { font-size: 14px; margin: 0; }
.qr { display: block; width: 200px; height: 200px; margin: 0 auto; background: #fff; border-radius: var(--radius); }
.feld-gruppe { display: grid; gap: 4px; font-size: 14px; font-weight: 500; }
.schluessel { border: 1px solid var(--linie); border-radius: var(--radius); background: var(--flaeche-2); padding: var(--s1) 12px; font-size: 15px; font-weight: 600; letter-spacing: .06em; font-variant-numeric: tabular-nums; word-break: break-word; user-select: all; }
.codes { list-style: none; padding: 0; margin: var(--s2) 0 var(--s3); display: grid; grid-template-columns: 1fr 1fr; gap: var(--s1); font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: .06em; }
.codes li { border: 1px solid var(--linie); border-radius: var(--radius); padding: var(--s1) 12px; text-align: center; background: var(--flaeche-2); }
#fertig .knopf { width: 100%; }

/* Team */
.team-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.team-form label { display: grid; gap: 4px; font-size: 14px; font-weight: 500; flex: 1 1 220px; }
.link-box { margin-top: var(--s2); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.link-box .feld { flex: 1 1 320px; font-size: 14px; }

/* Bewegung: sparsam, nur transform/opacity */
.rein { opacity: 0; transform: translateY(8px); transition: opacity .35s ease-out, transform .35s ease-out; }
.rein.da { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .rein, .balken i, .marken-karte { transition: none !important; }
  .rein { opacity: 1; transform: none; }
}
