/* ui.css — die Bausteine aus den Entwuerfen. Jeder hier genau einmal, damit Startseite,
   Profil, Stats, Forum und Backend nicht dreimal dieselbe Karte leicht verschieden bauen. */

/* ---------------------------------------------------------------- Karte */

.card {
  position: relative;
  background: linear-gradient(180deg, var(--card-top), var(--card-bottom));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
}
.card-pad  { padding: 20px 22px; }
.card-pad-lg { padding: 26px 28px; }
.card-flush { padding: 0; overflow: hidden; }
.card-hover { transition: border-color var(--t), transform var(--t), box-shadow var(--t); }
.card-hover:hover { border-color: var(--line-strong); transform: translateY(-2px);
                    box-shadow: var(--sh-card), 0 22px 44px -26px rgba(0,0,0,.9); }

/* Kopfzeile: Symbol + Titel links, Verweis rechts. Im Entwurf ueberall identisch aufgebaut. */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
             padding: 17px 22px; border-bottom: 1px solid var(--line-soft); }
.card-head h3 { display: flex; align-items: center; gap: 9px; font-size: 15.5px; font-weight: 800; }
.card-head h3 svg { width: 17px; height: 17px; color: var(--blue); flex: none; }
.card-more { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600;
             color: var(--txt-3); transition: color var(--t); }
.card-more:hover { color: var(--blue-lite); }
.card-more svg { width: 13px; height: 13px; }
.card-body { padding: 18px 22px; }

/* ---------------------------------------------------------------- Kennzahl-Kachel */

.kpi { display: flex; align-items: center; gap: 14px; padding: 17px 18px; }
.kpi-ico { width: 44px; height: 44px; border-radius: var(--r-sm); display: grid; place-items: center; flex: none;
           background: var(--blue-ghost); color: var(--blue); border: 1px solid var(--blue-line); }
.kpi-ico svg { width: 21px; height: 21px; }
.kpi-txt { min-width: 0; }
.kpi-lab { display: block; font-size: 12.5px; color: var(--txt-2); font-weight: 600; }
.kpi-val { display: block; font-family: var(--f-head); font-size: 25px; font-weight: 800; letter-spacing: -.03em; line-height: 1.2;
           font-variant-numeric: tabular-nums; }
.kpi-sub { display: block; font-size: 11.5px; font-weight: 700; color: var(--txt-3); margin-top: 1px;
           overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-sub.up   { color: var(--green); }
.kpi-sub.down { color: var(--red); }

.kpi-ico.g { background: rgba(34,197,94,.12);  color: var(--green);  border-color: rgba(34,197,94,.30); }
.kpi-ico.p { background: rgba(168,85,247,.12); color: var(--purple); border-color: rgba(168,85,247,.30); }
.kpi-ico.a { background: rgba(245,158,11,.12); color: var(--amber);  border-color: rgba(245,158,11,.30); }
.kpi-ico.r { background: rgba(239,68,68,.12);  color: var(--red);    border-color: rgba(239,68,68,.30); }
.kpi-ico.c { background: rgba(34,211,238,.12); color: var(--cyan);   border-color: rgba(34,211,238,.30); }

/* ---------------------------------------------------------------- Abzeichen */

.badge { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 9px;
         border-radius: var(--r-xs); font-size: 11px; font-weight: 800; letter-spacing: .02em;
         text-transform: uppercase; white-space: nowrap; }
.badge svg { width: 11px; height: 11px; }
.badge-blue   { background: rgba(47,144,255,.15);  color: var(--blue-lite); border: 1px solid rgba(47,144,255,.30); }
.badge-green  { background: rgba(34,197,94,.14);   color: #6ee7a0;          border: 1px solid rgba(34,197,94,.30); }
.badge-amber  { background: rgba(245,158,11,.14);  color: #fcd34d;          border: 1px solid rgba(245,158,11,.30); }
.badge-red    { background: rgba(239,68,68,.14);   color: #fca5a5;          border: 1px solid rgba(239,68,68,.30); }
.badge-purple { background: rgba(168,85,247,.14);  color: #d8b4fe;          border: 1px solid rgba(168,85,247,.30); }
.badge-gray   { background: rgba(148,163,184,.10); color: var(--txt-2);     border: 1px solid var(--line); }

/* Rang-Abzeichen mit Verlauf — "Premium" aus dem Profil-Entwurf. */
.rank { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px;
        border-radius: var(--r-sm); font-family: var(--f-head); font-weight: 800; font-size: 13.5px;
        color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.22) inset; }
.rank svg { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- Zustands-Punkt */

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block;
       background: var(--green); box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
.dot.off  { background: var(--txt-4); box-shadow: 0 0 0 3px rgba(106,124,166,.14); }
.dot.warn { background: var(--amber); box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.dot.bad  { background: var(--red);   box-shadow: 0 0 0 3px rgba(239,68,68,.18); }
.dot.live { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 3px rgba(34,197,94,.18); } 50% { box-shadow: 0 0 0 6px rgba(34,197,94,.05); } }

.state { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--txt-2); }

/* ---------------------------------------------------------------- Reiter */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-soft); overflow-x: auto; }
.tab { position: relative; height: 46px; padding: 0 16px; display: inline-flex; align-items: center; gap: 7px;
       font-size: 14px; font-weight: 600; color: var(--txt-3); white-space: nowrap;
       transition: color var(--t); }
.tab svg { width: 15px; height: 15px; }
.tab:hover { color: var(--txt-2); }
.tab.on { color: var(--blue-lite); }
.tab.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2.5px;
                 border-radius: 3px 3px 0 0; background: var(--blue); box-shadow: 0 0 12px var(--blue-glow); }

/* Reiter als Pillen (Stats-Filter) */
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { height: 34px; padding: 0 15px; display: inline-flex; align-items: center; gap: 7px;
        border-radius: var(--r-pill); font-size: 13px; font-weight: 600; color: var(--txt-2);
        background: var(--card-hi); border: 1px solid var(--line-soft); transition: all var(--t); }
.pill svg { width: 14px; height: 14px; }
.pill:hover { color: var(--txt); border-color: var(--line); }
.pill.on { background: var(--blue-ghost); border-color: var(--blue-line); color: var(--blue-lite); }
.pill.on[data-mode] { background: color-mix(in srgb, var(--m) 14%, transparent);
                      border-color: color-mix(in srgb, var(--m) 40%, transparent); color: var(--m); }

/* ---------------------------------------------------------------- Seitenleiste */

.snav { display: flex; flex-direction: column; gap: 2px; }
.snav-sec { padding: 16px 12px 7px; font-size: 10.5px; font-weight: 800; letter-spacing: .11em;
            text-transform: uppercase; color: var(--txt-4); }
.snav a { display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 12px;
          border-radius: var(--r-sm); font-size: 13.5px; font-weight: 600; color: var(--txt-2);
          position: relative; transition: background var(--t), color var(--t); }
.snav a svg { width: 17px; height: 17px; flex: none; color: var(--txt-3); transition: color var(--t); }
.snav a:hover { background: rgba(255,255,255,.035); color: var(--txt); }
.snav a:hover svg { color: var(--txt-2); }
.snav a.on { background: var(--blue-ghost); color: var(--blue-lite); }
.snav a.on svg { color: var(--blue); }
.snav a.on::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px;
                     border-radius: 0 3px 3px 0; background: var(--blue); }
.snav a .tail { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--txt-4); }

/* ---------------------------------------------------------------- Tabelle */

.table th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .06em;
            text-transform: uppercase; color: var(--txt-4); padding: 0 16px 11px; }
.table td { padding: 13px 16px; border-top: 1px solid var(--line-soft); font-size: 14px; vertical-align: middle; }
.table tbody tr { transition: background var(--t); }
.table tbody tr:hover { background: rgba(255,255,255,.022); }
.table .r { text-align: right; }
.table .c { text-align: center; }
.table-fix { table-layout: fixed; }

/* ---------------------------------------------------------------- Zeile mit Symbol */

.lrow { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.lrow + .lrow { border-top: 1px solid var(--line-soft); }
.lrow-ico { width: 34px; height: 34px; border-radius: var(--r-xs); display: grid; place-items: center; flex: none;
            background: var(--card-hi); border: 1px solid var(--line-soft); color: var(--txt-2); }
.lrow-ico svg { width: 16px; height: 16px; }
.lrow-txt { min-width: 0; flex: 1; }
.lrow-t1 { display: block; font-size: 13.5px; font-weight: 600; }
.lrow-t2 { display: block; font-size: 12px; color: var(--txt-3); }
.lrow-time { font-size: 11.5px; color: var(--txt-4); white-space: nowrap; flex: none; }

/* ---------------------------------------------------------------- Fortschritt */

.bar { height: 7px; border-radius: var(--r-pill); background: var(--inset); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: var(--r-pill);
           background: linear-gradient(90deg, color-mix(in srgb, var(--m, var(--blue)) 70%, white 6%), var(--m, var(--blue)));
           box-shadow: 0 0 10px -2px color-mix(in srgb, var(--m, var(--blue)) 60%, transparent);
           transition: width var(--t-slow); }
.bar-lg { height: 9px; }

/* ---------------------------------------------------------------- Bilder / Kopf */

.av { border-radius: var(--r-xs); overflow: hidden; flex: none; background: var(--card-hi);
      border: 1px solid var(--line-soft); }
.av-24 { width: 24px; height: 24px; } .av-28 { width: 28px; height: 28px; }
.av-32 { width: 32px; height: 32px; } .av-38 { width: 38px; height: 38px; }
.av-44 { width: 44px; height: 44px; } .av-56 { width: 56px; height: 56px; }

.who { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.who-name { display: inline-block; font-size: 13.5px; font-weight: 600; transition: color var(--t); }
a.who:hover .who-name { color: var(--blue-lite); }

/* ---------------------------------------------------------------- Seitenzahlen */

.pager { display: flex; align-items: center; gap: 6px; justify-content: center; }
.pager a, .pager span { min-width: 34px; height: 34px; padding: 0 10px; display: inline-flex; align-items: center;
  justify-content: center; border-radius: var(--r-xs); font-size: 13px; font-weight: 700; color: var(--txt-2);
  background: var(--card-hi); border: 1px solid var(--line-soft); transition: all var(--t); }
.pager a:hover { color: var(--txt); border-color: var(--line-strong); }
.pager .on { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: var(--sh-blue); }
.pager .gap { background: none; border: 0; color: var(--txt-4); }

/* ---------------------------------------------------------------- Leer / Laden */

.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 46px 20px; text-align: center; }
.empty svg { width: 34px; height: 34px; color: var(--txt-4); }
.empty p { font-size: 13.5px; color: var(--txt-3); max-width: 340px; }

.skel { background: linear-gradient(90deg, var(--card-hi) 25%, #18233d 37%, var(--card-hi) 63%);
        background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-xs); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------------------------------------------------------------- Hinweis-Blase */

.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-sm);
         background: var(--card-top); border: 1px solid var(--line-strong); box-shadow: var(--sh-pop);
         font-size: 13.5px; animation: toast-in .24s cubic-bezier(.2,.9,.3,1); }
.toast svg { width: 17px; height: 17px; flex: none; }
.toast.ok  svg { color: var(--green); }
.toast.bad svg { color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }

/* ---------------------------------------------------------------- Diagramme */

.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart-dot { opacity: 0; transition: opacity var(--t); }
.chart:hover .chart-dot { opacity: 1; }
.chart-tip { position: absolute; transform: translate(-50%, -140%); pointer-events: none; opacity: 0;
             padding: 6px 10px; border-radius: var(--r-xs); background: #0f1a30; border: 1px solid var(--line-strong);
             font-size: 12px; font-weight: 700; white-space: nowrap; box-shadow: var(--sh-pop); transition: opacity var(--t); }

/* ---------------------------------------------------------------- Auswahl-Menue */

.menu { position: relative; }
.menu-btn { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px;
            border-radius: var(--r-xs); background: var(--card-hi); border: 1px solid var(--line-soft);
            font-size: 12.5px; font-weight: 600; color: var(--txt-2); transition: border-color var(--t); }
.menu-btn:hover { border-color: var(--line-strong); color: var(--txt); }
.menu-btn svg { width: 13px; height: 13px; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 7px); min-width: 180px; z-index: 40;
            background: var(--card-top); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
            box-shadow: var(--sh-pop); padding: 6px; display: none; }
.menu.open .menu-pop { display: block; animation: toast-in .16s ease; }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px;
            border-radius: var(--r-xs); font-size: 13.5px; color: var(--txt-2); text-align: left; transition: background var(--t), color var(--t); }
.menu-pop a:hover, .menu-pop button:hover { background: rgba(255,255,255,.05); color: var(--txt); }
.menu-pop a svg, .menu-pop button svg { width: 15px; height: 15px; color: var(--txt-3); }
.menu-sep { height: 1px; background: var(--line-soft); margin: 5px 0; }
