/* =====================================================================
   stackwatch-modern.css – MODERNE OPTIK (neu 09.11.2026, auf Wunsch von Peer)

   Peer: "optisch gefällt mir die neue statistikseite besser als die
   stackwatch seite. kannst du diese nicht genau in dem gleichen stil machen?
   es soll mehr spaß machen die daten zu sehen, übersichtlicher werden,
   moderner" – Umfang: komplette Neugestaltung, alle Seiten mit style.css.

   WIE: Diese Datei wird NACH css/style.css geladen und überschreibt nur das
   Aussehen (Farben, Karten, Kacheln, Tabellen, Chips). Die Struktur der
   Seiten bleibt. style.css bleibt unverändert.

   ZURÜCK ZUR ALTEN OPTIK: in den Seiten (stackwatch.php, automatisierungen.php,
   dev-sites.php, index.php, place-finder.php) die <link>-Zeile auf
   css/stackwatch-modern.css löschen. Sonst nichts.

   FARBEN: dieselben Töne wie in stackwatch-statistik.php. Grün/Orange/Rot
   bedeuten wie bisher Status (orange = Changelog-Stichwort, rot = Patchstack-
   bestätigt). Das Orange ist kräftiger als Bootstraps Gelb (#ffc107), weil
   es als Zahl und Text auf Weiß lesbar sein muss.
   ===================================================================== */

:root {
    --sw-ink:    #1d2433;
    --sw-mute:   #6b7385;
    --sw-line:   #e6e9f0;
    --sw-soft:   #f6f8fc;
    --sw-blue:   #4f6df5;
    --sw-green:  #2f9e44;
    --sw-orange: #f08c00;
    --sw-red:    #e03131;
    --sw-radius: 20px;
    --sw-shadow: 0 8px 28px rgba(31, 45, 90, .06);
    --sw-shadow-hover: 0 14px 34px rgba(31, 45, 90, .12);

    /* Bootstrap-Farben auf die neue Palette ziehen: Links, text-*, bg-*,
       Badges und Rahmen folgen damit automatisch. */
    --bs-primary: #4f6df5;     --bs-primary-rgb: 79, 109, 245;
    --bs-success: #2f9e44;     --bs-success-rgb: 47, 158, 68;
    --bs-warning: #f08c00;     --bs-warning-rgb: 240, 140, 0;
    --bs-danger:  #e03131;     --bs-danger-rgb: 224, 49, 49;
    --bs-link-color: #4f6df5;  --bs-link-color-rgb: 79, 109, 245;
    --bs-link-hover-color: #3b55d9; --bs-link-hover-color-rgb: 59, 85, 217;
    --bs-body-color: #1d2433;
}

/* ---------- Grundlage ---------- */
body {
    background:
        radial-gradient(1200px 500px at 85% -10%, #e9eeff 0%, rgba(233, 238, 255, 0) 60%),
        #f6f8fc;
    color: var(--sw-ink);
}
.page-header {
    font-weight: 800;
    letter-spacing: -.025em;
    color: var(--sw-ink);
}
.text-muted, .text-body-secondary { color: var(--sw-mute) !important; }

/* ---------- Knöpfe, Menüs, Eingaben ---------- */
.btn { border-radius: 999px; font-weight: 600; }
.btn-primary {
    --bs-btn-bg: #4f6df5; --bs-btn-border-color: #4f6df5;
    --bs-btn-hover-bg: #3b55d9; --bs-btn-hover-border-color: #3b55d9;
    --bs-btn-active-bg: #334acb; --bs-btn-active-border-color: #334acb;
    --bs-btn-focus-shadow-rgb: 79, 109, 245;
    box-shadow: 0 4px 12px rgba(79, 109, 245, .28);
}
.btn-outline-secondary, .btn-outline-dark, .btn-light {
    --bs-btn-border-color: var(--sw-line);
    background: #fff;
}
.dropdown-menu {
    border: 1px solid var(--sw-line);
    border-radius: 16px;
    box-shadow: 0 18px 44px rgba(31, 45, 90, .16);
    padding: .4rem;
}
.dropdown-item { border-radius: 10px; }
.form-control, .form-select {
    border-radius: 12px;
    border-color: var(--sw-line);
}
.form-control:focus, .form-select:focus {
    border-color: #9db0fa;
    box-shadow: 0 0 0 .2rem rgba(79, 109, 245, .15);
}
.alert { border: 0; border-radius: 14px; }

/* ---------- Etiketten (Badges) als Chips ---------- */
.badge { border-radius: 999px; }
.badge-outline, .results-table .badge-outline {
    border-radius: 999px;
    background: #fff;
}

/* ---------- Kopfkacheln ---------- */
.sw-kpis-box {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    margin: 1.5rem 0 2rem;
}
.sw-kpis { gap: 14px; }
.sw-kpis-heute {
    text-align: left;
    margin: 0 0 .7rem .25rem;
    color: var(--sw-mute);
}
.sw-kpis-box .sw-kpi.sw-kpi {
    background: #fff !important;
    border: 1px solid var(--sw-line) !important;
    border-radius: 18px !important;
    padding: 1.05rem 1.1rem .95rem !important;
    box-shadow: var(--sw-shadow);
    position: relative;
    overflow: hidden;
    flex-direction: column;
    align-items: flex-start !important;
    justify-content: flex-start;
    gap: .35rem !important;
    transition: transform .15s ease, box-shadow .15s ease;
    animation: swKpiIn .45s cubic-bezier(.2, .8, .2, 1) both;
}
/* Akzentstreifen oben in der Statusfarbe der Zahl (kein Eingriff ins Markup:
   :has() liest die vorhandene Klasse der Zahl). */
.sw-kpis-box .sw-kpi.sw-kpi::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    width: auto;
    height: 4px;
    background: var(--sw-line);
    display: block;
}
.sw-kpis-box .sw-kpi:has(.sw-kpi-num.text-success)::before { background: var(--sw-green); }
.sw-kpis-box .sw-kpi:has(.sw-kpi-num.text-warning)::before { background: var(--sw-orange); }
.sw-kpis-box .sw-kpi:has(.sw-kpi-num.text-danger)::before  { background: var(--sw-red); }
.sw-kpis-box .sw-kpi + .sw-kpi::before { display: block; }
.sw-kpis-box a.sw-kpi:hover,
.sw-kpis-box a.sw-kpi:focus-visible {
    transform: translateY(-3px);
    box-shadow: var(--sw-shadow-hover);
    background: #fff !important;
}
.sw-kpis-box .sw-kpi-num {
    font-size: 2.35rem !important;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}
.sw-kpis-box .sw-kpi-label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--sw-mute) !important;
    line-height: 1.25;
}
.sw-kpis-box .sw-kpi-chevron {
    position: absolute;
    top: .95rem;
    right: .9rem;
    margin: 0 !important;
    font-size: .7rem;
    opacity: .35;
}
@media (min-width: 1100px) and (max-width: 1599px) {
    .sw-kpis-eine-zeile .sw-kpi-chevron { display: block; }
}
@keyframes swKpiIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}
.sw-kpis > :nth-child(2) { animation-delay: .04s; }
.sw-kpis > :nth-child(3) { animation-delay: .08s; }
.sw-kpis > :nth-child(4) { animation-delay: .12s; }
.sw-kpis > :nth-child(5) { animation-delay: .16s; }
.sw-kpis > :nth-child(6) { animation-delay: .20s; }
.sw-kpis > :nth-child(7) { animation-delay: .24s; }

/* Mini-Verlauf je Kachel (swSpark() in lib/ui.php; Element ist per Inline-Style
   ausgeblendet, erst diese Regel blendet es ein). */
.sw-kpis-box .sw-kpi-spark {
    display: block !important;
    position: relative;
    align-self: stretch;
    height: 26px;
    margin-top: .5rem;
}
.sw-kpi-spark svg { display: block; width: 100%; height: 100%; overflow: visible; }
.sw-kpi-spark i {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px #fff;
    transform: translate(-50%, -50%);
}

/* Statuszeile "Lauf & Zugänge" als eigene Karte unter den Kacheln */
.sw-kpis-status {
    background: #fff;
    border: 1px solid var(--sw-line);
    border-top: 1px solid var(--sw-line);
    border-radius: 16px;
    box-shadow: var(--sw-shadow);
    margin-top: .9rem;
    padding: .6rem 1.1rem .7rem;
}
/* Aufklapp-Pfeil rechts in der Summary (10.11.2026, Peer): wie bei den Kacheln,
   dreht sich beim Oeffnen nach oben. */
.sw-kpis-status > summary .sw-status-chevron {
    margin-left: auto;
    font-size: .7rem;
    color: var(--sw-mute);
    opacity: .5;
    transition: transform .15s;
}
.sw-kpis-status > summary:hover .sw-status-chevron { opacity: .8; }
.sw-kpis-status[open] > summary .sw-status-chevron { transform: rotate(180deg); }
.sw-kpis-status-warning > summary .sw-kpis-status-summary-text { color: #b36b00; }
.sw-kpis-status-error > summary .sw-kpis-status-summary-text   { color: var(--sw-red); }

/* ---------- Bereiche als Karten ---------- */
.sw-section {
    background: #fff;
    border: 1px solid var(--sw-line);
    border-radius: var(--sw-radius);
    box-shadow: var(--sw-shadow);
    padding: 1.2rem 1.35rem 1.1rem;
    margin-bottom: 1.35rem !important;
}
.sw-section + .sw-section {
    border-top: 1px solid var(--sw-line);
    padding-top: 1.2rem;
}
.sw-section-title {
    font-size: 1.12rem !important;
    font-weight: 800 !important;
    text-transform: none !important;
    letter-spacing: -.015em;
    color: var(--sw-ink);
    margin-bottom: .85rem !important;
}
.sw-section-title .sw-section-meta {
    font-size: .8rem;
    font-weight: 400;
    color: var(--sw-mute);
}
/* Die Zahl vor der Überschrift als runde Marke in der Statusfarbe. */
.sw-section-zahl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    height: 2.1rem;
    padding: 0 .55rem;
    border-radius: 999px;
    font-size: 1.05rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    background: color-mix(in srgb, currentColor 13%, #fff);
}
.sw-section .sw-section-title a {
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    font-size: .85rem;
}

/* Hinweiskarten innerhalb der Bereiche: flache, getönte Fläche statt Rahmen
   in der Karte in der Karte. */
.sw-section .rounded-4.bg-white.border {
    background: var(--sw-soft) !important;
    border: 0 !important;
    border-radius: 14px !important;
    margin-bottom: .75rem !important;
}
/* Tabellen-Container ohne eigene Karte */
.sw-section .dev-card {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
    height: auto;
    overflow: visible;
}
.sw-section-detail > summary,
.sw-section details > summary {
    color: var(--sw-mute);
}
.sw-section-detail > summary:hover { color: var(--sw-ink) !important; }

/* ---------- Tabellen ---------- */
.results-table {
    border-radius: 14px;
    box-shadow: 0 0 0 1px var(--sw-line);
}
.results-table th,
.results-table td {
    border-right: 0;
    border-bottom: 1px solid #eef1f6;
}
.results-table th:first-child,
.results-table td:first-child { border-left: 0; }
.results-table thead th {
    background: var(--sw-soft);
    color: var(--sw-mute);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    border-top: 0;
    border-bottom: 1px solid var(--sw-line);
    padding-top: .65em;
    padding-bottom: .65em;
}
.results-table thead th:first-child { border-top-left-radius: 14px; }
.results-table thead th:last-child  { border-top-right-radius: 14px; }
.results-table tbody tr:last-child > td { border-bottom: 0; }
.results-table tbody tr:last-child > td:first-child { border-bottom-left-radius: 14px; }
.results-table tbody tr:last-child > td:last-child  { border-bottom-right-radius: 14px; }
.results-table td { padding-top: .62em; padding-bottom: .62em; }
.results-table tbody tr:not([class*="sw-row-"]):not(.sw-tag-band):not(.sw-tag-gap):hover > td {
    background: #fafbff;
}
.results-table a { text-decoration-color: rgba(79, 109, 245, .35); }

/* Keine graue Tönung mehr für heutige Zeilen (09.11.2026, Peer: "für heute
   entfernen"). Den Tag markieren das HEUTE-Band und die Trennlinie darunter;
   Zeilen mit Statusfarbe (crit/warn/ok) bleiben unberührt. */
.results-table tr.sw-row-heute:not([class*="sw-row-crit"]):not(.sw-row-warn):not(.sw-row-ok) > td {
    background-color: transparent;
}

/* EINHEITLICHE FARBSPRACHE (09.11.2026, Peer: "ich will das quasi am liebsten
   wenn möglich immer gleich haben"). Überall dasselbe Muster:
     - Zeile bleibt weiß (keine Tönung),
     - Zeilen mit Status tragen einen 3-px-Balken am Zeilenanfang
       (rot = crit, orange = warn, grün = ok),
     - die Kernangabe der Zeile ist eine Pille in derselben Farbe
       (Pagescreen: Prozent, Changelog: Version, Rybbit: Tage, GSC: Grund).
   AUSNAHME: sw-row-crit-fill (offene, von Patchstack bestätigte Funde)
   behält die rote Fläche, damit sie hervorsticht (Peer, 17.08.2026). */
.results-table tr:is(.sw-row-crit, .sw-row-warn, .sw-row-ok):not(.sw-row-crit-fill) > td {
    background: transparent;
}
.results-table tr.sw-row-crit:not(.sw-row-crit-fill) > td:first-child { box-shadow: inset 3px 0 0 var(--sw-red); }
.results-table tr.sw-row-warn:not(.sw-row-crit-fill) > td:first-child { box-shadow: inset 3px 0 0 var(--sw-orange); }
.results-table tr.sw-row-ok > td:first-child                         { box-shadow: inset 3px 0 0 var(--sw-green); }

/* PILLE = Kernangabe bzw. Einzelangabe (09.11.2026, Peer: "manchmal fett in
   gelb manchmal nicht ... mache es einheitlich"). EINE Pille für alle Bereiche:
   gleiche Größe, gleiche Schriftstärke (600), nur die Farbe wechselt.
   Markup: <span class="sw-pille sw-pille-rot|gelb|gruen">. Die Changelog-Version
   (strong.sw-ver-markiert, Klasse kommt aus der bestehenden Logik) ist darauf
   abgebildet. */
.sw-pille,
.results-table strong.sw-ver-markiert {
    display: inline-block;
    padding: .12em .7em;
    border-radius: 999px;
    font-weight: 600;
    font-size: .92em;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
}
.sw-pille-rot,
.results-table strong.sw-ver-markiert.text-danger {
    background: rgba(var(--bs-danger-rgb), .13);
    color: #c92a2a !important;
}
.sw-pille-gelb,
.results-table strong.sw-ver-markiert.text-warning {
    background: rgba(var(--bs-warning-rgb), .16);
    color: #a85f00 !important;
}
.sw-pille-grau {
    background: rgba(29, 36, 51, .07);
    color: #4a5368 !important;
}
.sw-pille-gruen {
    background: rgba(var(--bs-success-rgb), .13);
    color: #2b8a3e !important;
}
.results-table .sw-detail { margin: 2px 0; }

/* Outline-Badges (Risk, Prio, SLA …) im gleichen Farbton wie die Pillen. */
.badge-outline-danger  { color: #c92a2a; border-color: rgba(var(--bs-danger-rgb), .6); }
.badge-outline-warning { color: #a85f00; border-color: rgba(var(--bs-warning-rgb), .7); }
.badge-outline-success { color: #2b8a3e; border-color: rgba(var(--bs-success-rgb), .6); }

/* Tagesbänder: gleiche Sprache wie die Köpfe */
.results-table.results-table tbody tr.sw-tag-band > td {
    background: var(--sw-soft);
    border-bottom: 1px solid #eef1f6;
}
.results-table.results-table tbody tr.sw-tag-klapp:hover > td { background: #eef2fb; }

/* Zeilenfarben: nur die rote Fläche offener Patchstack-Funde bleibt (siehe
   EINHEITLICHE FARBSPRACHE oben). */
.results-table tr.sw-row-crit-fill > td { background: rgba(var(--bs-danger-rgb), .16); }

/* Grüner Balken ab gestern/älter abgeschwächt (10.11.2026, Peer: "auch das grün
   abgeschwächt"); die Pille wird über sw-row-grau (style.css) blasser. */
.results-table tr.sw-row-ok.sw-row-grau > td:first-child { box-shadow: inset 3px 0 0 rgba(47, 158, 68, .4); }

/* Changelog: auch offene Patchstack-Funde ohne rote Fläche, nur roter Balken
   (09.11.2026, Peer: "dann färben wir die hintergründe der zeilen gar nicht
   mehr ein sondern nur vorne wie bei den anderen"). */
#sec-updates .results-table tr.sw-row-crit-fill > td,
#sec-updates .results-table tr.sw-row-heute.sw-row-crit-fill > td { background: transparent; }
#sec-updates .results-table tr.sw-row-crit-fill > td:first-child { box-shadow: inset 3px 0 0 var(--sw-red); }

/* ---------- Kleinteile ---------- */
.sw-badge-header { border-radius: 999px; }
footer, .sw-footer { color: var(--sw-mute); }
a.sw-kpi-link { text-decoration: none; }

/* ---------- Handy ---------- */
@media (max-width: 640px) {
    .sw-section { padding: 1rem 1rem .9rem; border-radius: 16px; }
    .sw-kpis-box .sw-kpi-num { font-size: 1.9rem !important; }
    .sw-section-title { font-size: 1.02rem !important; }
}

@media (prefers-reduced-motion: reduce) {
    .sw-kpis-box .sw-kpi.sw-kpi { animation: none; transition: none; }
}

/* Hinweisboxen in der Palette statt Bootstrap-Cyan */
.alert-info    { background: #eaf0ff; color: #2a3f9e; }
.alert-warning { background: #fff4e0; color: #8a5200; }
.alert-danger  { background: #fdeaea; color: #a32424; }
.alert-success { background: #e8f6ec; color: #226b34; }
