/*
 * Moderne Oberfläche (Branch redesign), angelehnt an das SmartPi-Dashboard:
 * Icon-Seitenleiste, schlanke Kopfleiste, Karten auf hellem Grund, Montserrat/Oxanium.
 * Liegt nach main.css und überschreibt nur das Aussehen, nicht die Seitenstruktur.
 */

@font-face {
    font-family: "Montserrat";
    src: url("/fonts/montserrat/montserrat-regular.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: "Montserrat";
    src: url("/fonts/montserrat/montserrat-bold.woff2") format("woff2");
    font-weight: 600 700;
    font-display: swap;
}
@font-face {
    font-family: "Montserrat";
    src: url("/fonts/montserrat/montserrat-light.woff2") format("woff2");
    font-weight: 300;
    font-display: swap;
}
@font-face {
    font-family: "Oxanium";
    src: url("/fonts/oxanium/oxanium-latin.woff2") format("woff2");
    font-weight: 400 700;
    font-display: swap;
}

:root {
    --ui-green: #2d923e;
    --ui-green-dark: #23752f;
    --ui-green-soft: #e8f4ea;
    --ui-bg: #f7f6fb;
    --ui-card: #ffffff;
    --ui-border: #e6e8ec;
    --ui-text: #1f2933;
    --ui-muted: #6b7280;
    --ui-radius: 12px;
    --ui-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 12px rgba(16, 24, 40, 0.06);
    --ui-sidebar-w: 72px;
    --ui-topbar-h: 56px;

    --bs-body-font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-color: var(--ui-text);
    --bs-link-color: var(--ui-green);
    --bs-link-color-rgb: 45, 146, 62;
    --bs-link-hover-color: var(--ui-green-dark);
    --bs-link-hover-color-rgb: 35, 117, 47;
}

/* Markenfarben je OEM (Body-Klasse oem-<name> aus oem.ini) */
body.oem-qbatt {
    --ui-chart-brand: #005ca4; /* ersetzt das enerserve-Grün #10872E in Diagrammen und Tacho */
    --ui-green: #005ca4;
    --ui-green-dark: #004a85;
    --ui-green-soft: #e6eff7;
    --bs-link-color: #005ca4;
    --bs-link-color-rgb: 0, 92, 164;
    --bs-link-hover-color: #004a85;
    --bs-link-hover-color-rgb: 0, 74, 133;
}

/* Q3-Logo ist breit (175x40): in der Seitenleiste nur das Symbol, in der Kopfleiste ganz */
body.oem-qbatt #ui-sidebar .navbar-logo {
    object-fit: cover;
    object-position: left center;
}

body.oem-qbatt #navigation .navbar-logo {
    width: auto;
    height: 32px;
}

body {
    background: var(--ui-bg);
    padding-top: var(--ui-topbar-h);
    font-family: var(--bs-body-font-family);
    color: var(--ui-text);
}

a { color: var(--ui-green); }
a:hover { color: var(--ui-green-dark); }

/* ---------- Kopfleiste ---------- */

.navbar-background {
    min-height: var(--ui-topbar-h);
    background: #ffffff;
    background-image: none;
    border-bottom: 1px solid var(--ui-border);
    box-shadow: none;
}

.navbar-background .nav-link {
    color: var(--ui-muted);
    text-shadow: none;
    border-radius: 8px;
}

.navbar-background .nav-link:hover,
.navbar-background .nav-link:focus,
.navbar-background .nav-link.show {
    color: var(--ui-green);
    background-color: var(--ui-green-soft);
}

/* Das Logo ist bereits ein grünes Quadrat mit weißem e */
.navbar-logo {
    height: 40px;
    width: 40px;
    padding: 0 !important;
    margin: 0 16px;
}

.ui-topbar-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--ui-text);
}

/* Login in der Kopfleiste (Gäste auf Seiten mit Standard-Layout, z. B. Passwort vergessen) */
#navbar-main form {
    gap: 8px 10px !important;
    font-size: 0.85rem;
    color: var(--ui-muted);
}

#navbar-main form input {
    width: 170px !important;
    margin: 0;
}

@media (max-width: 991.98px) {
    #navbar-main form {
        flex-direction: column;
        align-items: stretch !important;
        padding: 8px 16px 16px;
    }

    #navbar-main form input { width: 100% !important; }

    /* Aufgeklappte Kopfleiste sauber vom Inhalt trennen */
    .navbar-background .navbar-collapse.show,
    .navbar-background .navbar-collapse.collapsing {
        border-top: 1px solid var(--ui-border);
        box-shadow: 0 12px 24px rgba(16, 24, 40, 0.08);
    }
}

/* Auf schmalen Bildschirmen Abstand der Karten zum Rand */
@media (max-width: 767.98px) {
    .ui-tabs.ui-widget-content { width: auto; margin-left: 12px; margin-right: 12px; }
}

/* ---------- Dropdowns ---------- */

.dropdown-menu {
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(16, 24, 40, 0.12);
    padding: 6px;
}

.dropdown-item,
.dropdown-menu > li > a {
    border-radius: 6px;
    padding: 6px 12px;
}

.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus,
.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover {
    color: var(--ui-green-dark);
    background: var(--ui-green-soft);
    background-image: none;
}

/* ---------- Seitenleiste (ab 992px) ---------- */

#ui-sidebar { display: none; }

/* Gäste (Startseite, Login): Logo und Titel in der Kopfleiste */
.ui-topbar-title { display: inline-block; margin-left: 12px; margin-right: auto; }

@media (min-width: 992px) {
    body.ui-with-sidebar { padding-left: var(--ui-sidebar-w); }

    /* Mit Seitenleiste behält die Kopfleiste nur den Titel; das Menü steht links */
    .ui-with-sidebar #navigation .navbar-logo,
    .ui-with-sidebar #navigation .navbar-toggler,
    .ui-with-sidebar #navigation #navbar-main { display: none !important; }
    .ui-with-sidebar #navigation,
    .ui-with-sidebar #footer { left: var(--ui-sidebar-w); width: auto; right: 0; }
    .ui-with-sidebar .ui-topbar-title { margin-left: 24px; }

    #ui-sidebar {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: var(--ui-sidebar-w);
        padding-top: 8px;
        background: #ffffff;
        border-right: 1px solid var(--ui-border);
        z-index: 1035;
    }

    #ui-sidebar .navbar-logo { margin: 0 0 24px; }

    #ui-sidebar .navbar-nav {
        flex-direction: column;
        align-items: center;
        gap: 6px;
        width: 100%;
        margin: 0 !important;
    }

    #ui-sidebar .nav-item { position: relative; }

    /* Nur Icons, der Text dient als Tooltip und steht im Untermenü als Überschrift */
    #ui-sidebar .nav-item > .nav-link {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        font-size: 0;
        color: var(--ui-green);
        border-radius: 10px;
    }

    #ui-sidebar .nav-item > .nav-link::before {
        font-family: "bootstrap-icons";
        font-size: 22px;
        line-height: 1;
        content: "\F28A"; /* circle */
    }

    #ui-sidebar .nav-item > .dropdown-toggle::after { display: none; }

    #ui-sidebar .nav-item > .nav-link:hover,
    #ui-sidebar .nav-item.ui-open > .nav-link,
    #ui-sidebar .nav-item.ui-active > .nav-link {
        background: var(--ui-green-soft);
        color: var(--ui-green-dark);
    }

    #ui-sidebar .nav-item.ui-active > .nav-link {
        box-shadow: inset 3px 0 0 var(--ui-green);
    }

    /* Untermenüs klappen rechts neben der Leiste auf */
    #ui-sidebar .dropdown-menu {
        position: absolute;
        top: 0;
        left: calc(100% + 10px);
        margin: 0;
        min-width: 240px;
    }

    /* Öffnen/Schließen steuert theme.js (Hover mit Verzögerung, Klick) */
    #ui-sidebar .dropdown.ui-open > .dropdown-menu { display: block; }

    #ui-sidebar .ui-menu-title {
        display: block;
        padding: 6px 12px 8px;
        font-size: 0.75rem;
        font-weight: 600;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--ui-muted);
    }

    /* Einzelne Einträge ohne Untermenü bekommen den Titel als Tooltip */
    #ui-sidebar .nav-item:not(.dropdown) > .nav-link[title]:hover::after {
        content: attr(title);
        position: absolute;
        left: calc(100% + 10px);
        top: 50%;
        transform: translateY(-50%);
        padding: 6px 10px;
        font-size: 0.8rem;
        font-family: var(--bs-body-font-family);
        white-space: nowrap;
        color: #fff;
        background: #1f2933;
        border-radius: 6px;
        pointer-events: none;
    }

    #ui-sidebar .nav-item:has(a[href*="/login/logout"]) { margin-top: auto; }
    #ui-sidebar .navbar-nav { flex: 1; padding-bottom: 16px; }

    /* Icons je Menügruppe (nach den Zielen der Links, unabhängig von der Sprache) */
    #ui-sidebar .nav-item:has(a[href*="/plantlist/"]) > .nav-link::before { content: "\F3FC"; } /* grid */
    #ui-sidebar .nav-item:has(> a[href*="/plant/view/overview"]) > .nav-link::before { content: "\F580"; } /* speedometer2 */
    #ui-sidebar .nav-item:has(a[href*="/plant/day/"]) > .nav-link::before { content: "\F5A2"; } /* sun */
    #ui-sidebar .nav-item:has(a[href*="/plant/month/"]) > .nav-link::before { content: "\F17E"; } /* bar-chart */
    #ui-sidebar .nav-item:has(a[href*="/plant/year/"]) > .nav-link::before { content: "\F214"; } /* calendar3 */
    #ui-sidebar .nav-item:has(a[href*="/plant/total/"]) > .nav-link::before { content: "\F673"; } /* graph-up-arrow */
    #ui-sidebar .nav-item:has(a[href*="/plant/status/"]) > .nav-link::before { content: "\F66B"; } /* activity */
    #ui-sidebar .nav-item:has(a[href*="/configuration/"]) > .nav-link::before { content: "\F56B"; } /* sliders */
    #ui-sidebar .nav-item:has(a[href*="/login/logout"]) > .nav-link::before { content: "\F1C3"; } /* box-arrow-right */
}

/* ---------- Seitenkopf (Brotkrümel) ---------- */

/* flow-root umschließt die gefloateten Brotkrümel, sonst weicht die Inhaltszeile daneben aus */
.page-header {
    display: flow-root;
    margin: 24px 24px 8px;
}

.breadcrump {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ui-text);
}

.breadcrump a { text-decoration: none; }

/* ---------- Karten ---------- */

.well,
#graphbox,
.ui-card {
    background: var(--ui-card) !important;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow);
}

#graphbox { padding-top: 12px; padding-bottom: 12px; }

#sidebar-landing {
    background: transparent !important;
}

/* Seitenboxen rechts: Farbbalken der Gerätezeilen (.wsr_box) bleiben am Rand,
   alles andere bekommt denselben Abstand wie deren Text (5px Balken + 5px). */
.well.sidebar-nav > *:not(.wsr_box) {
    padding-left: 10px;
    padding-right: 10px;
}

.well.sidebar-nav .wsr_box { padding-right: 10px; }

.well h4 {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 4px 0;
}

.well .sidebartitle h4 { font-size: 1.05rem; }

/* Große Werte in Oxanium wie die Kennzahlen der Vorlage */
.well .info b,
.well .info strong,
.contentInfoBox h1,
.contentInfoBox h2,
.title h1 {
    font-family: "Oxanium", var(--bs-body-font-family);
}

/* ---------- Übersicht (Zusammenfassung) ---------- */

.overview_box {
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    background: var(--ui-card);
    box-shadow: var(--ui-shadow);
    padding: 16px !important; /* das alte Raster setzt den seitlichen Abstand sonst auf 0 */
    transition: box-shadow 0.2s, transform 0.2s;
}

.overview_box:hover {
    box-shadow: 0 2px 4px rgba(16, 24, 40, 0.06), 0 12px 24px rgba(16, 24, 40, 0.1);
    transform: translateY(-2px);
}

.overview_box .title h1 {
    float: none !important;
    margin: 0 0 12px;
    font-family: var(--bs-body-font-family);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ui-text);
}

.overview_data {
    background: var(--ui-card);
}

/* Kennzahlen dauerhaft als kleine Leiste unter dem Diagramm (statt hochfahrender Tafel).
   Die Tafel ist statisch positioniert, die alte Hover-Animation auf „top“ wirkt dadurch nicht. */
.overview_box [id$="wrapper"] {
    overflow: hidden;
}

.overview_box [id$="wrapper"]:has(> .overview_data) {
    display: flex;
    flex-direction: column;
    height: auto !important;
    overflow: visible;
}

.overview_box [id$="wrapper"]:has(> .overview_data) > .overview_chart {
    flex: none;
    height: 260px;
}

.overview_box .overview_data {
    position: static !important;
    height: auto;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--ui-border);
    background: transparent;
}

.overview_box .overview_data table {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px 16px;
    width: 100%;
}

.overview_box .overview_data tbody { display: contents; }

.overview_box .overview_data tr {
    display: flex;
    flex-direction: column;
}

.overview_box .overview_data th,
.overview_box .overview_data td {
    width: auto !important;
    padding: 0;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--ui-muted);
    text-align: left;
}

.overview_box .overview_data th + th,
.overview_box .overview_data td + td {
    font-family: "Oxanium", var(--bs-body-font-family);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ui-text);
}

/* Galerie „Ihre Anlage“ */
#fotochart {
    position: relative;
    height: 100%;
    overflow: hidden;
    border-radius: 10px;
    background: #eef0f3;
}

#plantgallery,
#plantgallery .carousel-inner,
#plantgallery .carousel-item {
    height: 100%;
}

#plantgallery .carousel-item img,
#fotochart .ui-plantimage {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#plantgallery .carousel-indicators {
    margin-bottom: 64px;
}

#plantgallery .carousel-indicators [data-bs-target] {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.ui-photo-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    padding: 28px 16px 12px;
    color: #ffffff;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
    pointer-events: none;
}

.ui-photo-address {
    font-weight: 600;
    margin-bottom: 4px;
}

.ui-photo-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    font-size: 0.8rem;
    opacity: 0.9;
}

.ui-photo-facts b {
    font-family: "Oxanium", var(--bs-body-font-family);
    font-size: 0.95rem;
}

/* ---------- Installations-Assistent ---------- */

/* Die alte Überschrift „Schritt n“ ersetzt die Schrittanzeige */
.ui-wizard-steps + .jumbotron.subhead { display: none; }

.jumbotron.subhead {
    margin: 0;
    padding: 24px 24px 8px;
    background: none;
    color: var(--ui-text);
    text-shadow: none;
    box-shadow: none;
}

.jumbotron.subhead::after { display: none; }

.jumbotron.subhead h1 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
}

/* Schrittanzeige: 1 Gerät – 2 Zugang – 3 Anlage – 4 Fertig */
.ui-wizard-steps {
    display: flex;
    max-width: 720px;
    margin: 32px auto 8px;
    padding: 0 16px;
    list-style: none;
    counter-reset: none;
}

.ui-wizard-steps li {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--ui-muted);
}

/* Verbindungslinie zum vorherigen Schritt */
.ui-wizard-steps li + li::before {
    content: "";
    position: absolute;
    top: 15px;
    right: calc(50% + 20px);
    left: calc(-50% + 20px);
    height: 2px;
    background: var(--ui-border);
}

.ui-wizard-steps li.done::before,
.ui-wizard-steps li.current::before { background: var(--ui-green); }

.ui-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 2px solid var(--ui-border);
    border-radius: 50%;
    background: #ffffff;
    font-weight: 600;
    color: var(--ui-muted);
}

.ui-wizard-steps li.current .ui-step-num {
    border-color: var(--ui-green);
    color: var(--ui-green-dark);
    box-shadow: 0 0 0 4px var(--ui-green-soft);
}

.ui-wizard-steps li.current .ui-step-label {
    font-weight: 600;
    color: var(--ui-text);
}

.ui-wizard-steps li.done .ui-step-num {
    border-color: var(--ui-green);
    background: var(--ui-green);
    color: transparent;
    position: relative;
}

.ui-wizard-steps li.done .ui-step-num::after {
    content: "\F633"; /* check-lg */
    position: absolute;
    font-family: "bootstrap-icons";
    font-size: 16px;
    color: #ffffff;
}

/* Karte mit dem Formular des Schritts */
.wizard_contend {
    max-width: 720px;
    margin: 16px auto 48px;
    padding: 24px 28px;
    background: var(--ui-card);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow);
}

.wizard_contend dl.zend_form { margin: 0; }

.wizard_contend dl.zend_form dt {
    margin: 14px 0 4px;
    font-weight: 500;
}

.wizard_contend dl.zend_form dt:first-child { margin-top: 0; }

.wizard_contend dl.zend_form dt label {
    font-size: 0.85rem;
    color: var(--ui-muted);
}

.wizard_contend dl.zend_form dd { margin: 0; }

.wizard_contend dl.zend_form dd input[type="text"],
.wizard_contend dl.zend_form dd input[type="password"],
.wizard_contend dl.zend_form dd select {
    box-sizing: border-box;
    width: 100%;
    max-width: 440px;
    height: auto;
    padding: 9px 12px;
}

/* Auswahl als anklickbare Karten (Schritt 2: Neukunde / bestehender Account) */
.ui-choice-question {
    margin: 0 0 10px;
    font-weight: 600;
}

.ui-choice {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 440px;
    margin: 0 0 8px;
    padding: 12px 14px;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}

.ui-choice:hover { border-color: var(--ui-green); }

.ui-choice:has(input:checked) {
    border-color: var(--ui-green);
    background: var(--ui-green-soft);
}

.ui-choice input { margin: 0; }

/* Weiter/Zurück unten rechts, „Weiter“ als Hauptaktion */
.wizard_contend #submit-label { display: none; }

.wizard_contend #submit-element {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--ui-border);
}

.wizard_contend #submit-element .ui-button:last-child {
    background: var(--ui-green);
    border-color: var(--ui-green);
    color: #ffffff;
}

.wizard_contend #submit-element .ui-button:last-child:hover {
    background: var(--ui-green-dark);
    border-color: var(--ui-green-dark);
}

/* Wechselrichter-Liste in Schritt 3 */
.wizard_contend .tablelist {
    width: 100%;
    margin: 16px 0 0;
    font-size: 0.85rem;
    border-collapse: collapse;
}

.wizard_contend .tablelist th {
    padding: 8px;
    background: #f9fafb;
    color: var(--ui-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--ui-border);
}

.wizard_contend .tablelist td {
    padding: 6px 8px;
    border-bottom: 1px solid #eef0f3;
}

.wizard_contend .tablelist td input[type="text"] { width: 4em; }

/* ---------- Schaltflächen (jQuery UI) ---------- */

.ui-button,
.ui-widget .ui-button,
.ui-state-default,
.ui-widget-content .ui-state-default {
    background: #ffffff;
    background-image: none;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    color: var(--ui-text);
    font-family: var(--bs-body-font-family);
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    text-shadow: none;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.ui-button:hover,
.ui-state-hover,
.ui-widget-content .ui-state-hover,
.ui-state-focus {
    background: var(--ui-green-soft);
    background-image: none;
    border-color: var(--ui-green);
    color: var(--ui-green-dark);
}

.ui-state-active,
.ui-widget-content .ui-state-active {
    background: var(--ui-green);
    background-image: none;
    border-color: var(--ui-green);
    color: #ffffff;
}

.btn-light.border {
    border-color: var(--ui-border) !important;
    border-radius: 8px;
    background: #fff;
}

/* ---------- Formulare ---------- */

input[type="text"], input[type="password"], input[type="email"], input[type="number"],
input[type="search"], input[type="tel"], input[type="url"], input[type="date"],
input[type="datetime-local"], input[type="time"], select, textarea {
    padding: 6px 10px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    font-family: var(--bs-body-font-family);
    color: var(--ui-text);
}

input[type="text"], input[type="password"], input[type="email"], input[type="number"],
input[type="search"], input[type="tel"], input[type="url"], input[type="date"],
input[type="datetime-local"], input[type="time"] {
    height: 22px;
}

select { height: 36px; }

input:focus, select:focus, textarea:focus {
    border-color: var(--ui-green);
    box-shadow: 0 0 0 3px rgba(45, 146, 62, 0.15);
}

input[type="checkbox"], input[type="radio"] {
    accent-color: var(--ui-green);
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

fieldset {
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    padding: 12px 16px 4px;
    margin-bottom: 16px;
}

legend {
    float: none;
    width: auto;
    margin: 0;
    padding: 0 6px;
    font-size: 0.95rem;
    font-weight: 600;
}

/* Speichern-Schaltflächen als Hauptaktion in Grün */
input[type="submit"].ui-button,
form button.ui-button:not([type="button"]):not([type="reset"]) {
    background: var(--ui-green);
    border-color: var(--ui-green);
    color: #ffffff;
}

input[type="submit"].ui-button:hover,
form button.ui-button:not([type="button"]):not([type="reset"]):hover {
    background: var(--ui-green-dark);
    border-color: var(--ui-green-dark);
    color: #ffffff;
}

/* In den dichten Tabellen (z. B. Wechselrichter-Konfiguration) kompakte Felder wie bisher */
.rtable input[type="text"], .rtable input[type="number"], .rtable select {
    padding: 4px 6px;
}
.rtable input[type="text"], .rtable input[type="number"] { height: 20px; }
.rtable select { height: 30px; }

/* Farbwähler (colorpicker.js): über den Diagrammen, eigene Mini-Felder unverändert lassen */
.colorpicker { z-index: 1060; }

.colorpicker input[type="text"] {
    width: auto;
    height: 11px;
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10px;
    color: #898989;
}

/* ---------- Tabellen ---------- */

table.table > thead > tr > th {
    color: var(--ui-muted);
    font-weight: 600;
    border-bottom-width: 1px;
}

table.table,
.rtable {
    font-family: var(--bs-body-font-family);
    color: var(--ui-text);
}

.rtable {
    font-size: 0.85rem;
    border-bottom: 0;
}

.table-head .column,
.table-head .column:hover {
    padding: 10px;
    background: #f9fafb;
    color: var(--ui-muted);
    font-size: 0.75rem;
    font-weight: 600;
    border-right: 0;
    border-bottom: 1px solid var(--ui-border);
}

.column {
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid #eef0f3;
    vertical-align: middle;
}

.rtable-row .column:nth-child(1) { border-left: 0; }
.column:hover { background: transparent; }
.rtable-row:hover > .column { background: #fafbfc; }

/* ---------- Anlagenliste (DataTables) ---------- */

table.dataTable {
    border-collapse: separate !important;
    border-spacing: 0;
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--ui-radius);
    background: var(--ui-card);
    box-shadow: var(--ui-shadow);
    overflow: hidden;
}

table.dataTable.table-bordered > :not(caption) > * > * {
    border-width: 0 0 1px 0;
    border-color: #eef0f3;
}

table.dataTable > tbody > tr:last-child > * { border-bottom-width: 0; }

table.dataTable > thead > tr > th {
    background: #f9fafb;
    color: var(--ui-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--ui-border) !important;
}

/* Ecken der Kopf- und letzten Zeile mitrunden (gestreifte Zeilen ragen sonst heraus) */
table.dataTable > thead > tr:first-child > *:first-child { border-top-left-radius: var(--ui-radius); }
table.dataTable > thead > tr:first-child > *:last-child { border-top-right-radius: var(--ui-radius); }
table.dataTable > tbody > tr:last-child > *:first-child { border-bottom-left-radius: var(--ui-radius); }
table.dataTable > tbody > tr:last-child > *:last-child { border-bottom-right-radius: var(--ui-radius); }

/* Excel/CSV/PDF: flach und weiß, Grün bei Hover und beim Drücken */
.dt-buttons .dt-button {
    margin-right: 6px;
    padding: 6px 14px;
    background: #ffffff !important;
    background-image: none !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    color: var(--ui-text) !important;
    font-family: var(--bs-body-font-family);
    font-size: 0.85rem;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.dt-buttons .dt-button:hover,
.dt-buttons .dt-button:focus {
    background: var(--ui-green-soft) !important;
    border-color: var(--ui-green) !important;
    color: var(--ui-green-dark) !important;
}

.dt-buttons .dt-button:active,
.dt-buttons .dt-button.active {
    background: var(--ui-green) !important;
    border-color: var(--ui-green) !important;
    color: #ffffff !important;
}

/* ---------- Anlagenauswahl: Zurück | Anlage | Vor als eine Leiste (theme.js) ---------- */

.breadcrump .ui-plantbar {
    display: inline-flex;
    vertical-align: middle;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.breadcrump .ui-plantbar > .btn,
.breadcrump .ui-plantbar > .dropdown > .btn {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    margin: 0;
    padding: 6px 12px;
}

.breadcrump .ui-plantbar > .btn:hover,
.breadcrump .ui-plantbar > .dropdown > .btn:hover {
    background: var(--ui-green-soft) !important;
    color: var(--ui-green-dark);
}

.breadcrump .ui-plantbar > .dropdown {
    border-left: 1px solid var(--ui-border);
    border-right: 1px solid var(--ui-border);
}

.breadcrump .ui-plantbar > .btn:first-child { border-radius: 8px 0 0 8px !important; }
.breadcrump .ui-plantbar > .btn:last-child { border-radius: 0 8px 8px 0 !important; }

/* Pfeile als Chevron-Icons, mittig */
.breadcrump .ui-plantbar > .btn {
    display: inline-flex;
    align-items: center;
    font-size: 0;
}

.breadcrump .ui-plantbar > .btn::before {
    font-family: "bootstrap-icons";
    font-size: 14px;
    line-height: 1;
}

.breadcrump .ui-plantbar > .btn:first-child::before { content: "\F284"; }
.breadcrump .ui-plantbar > .btn:last-child::before { content: "\F285"; }

/* Gesamtertrag als Text statt Rollenzählwerk (theme.js ersetzt steelseries.Odometer) */
.ui-odometer {
    font-family: "Oxanium", var(--bs-body-font-family);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ui-text);
    white-space: nowrap;
}

/* ---------- Gerät prüfen (/install/check) ---------- */

.ui-check {
    max-width: 1100px;
    margin: 0 24px 48px;
}

.ui-check .ui-card {
    padding: 18px 20px;
    margin-bottom: 16px;
}

.ui-check-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
}

.ui-check-form label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.8rem;
    color: var(--ui-muted);
}

.ui-check-form input[type="text"] {
    box-sizing: border-box;
    width: 280px;
    max-width: 100%;
    height: auto;
    margin: 0;
    padding: 9px 12px;
}

.ui-check-submit {
    padding: 9px 22px;
    border: 0;
    border-radius: 8px;
    background: var(--ui-green);
    color: #ffffff;
    font-weight: 600;
}

.ui-check-submit:hover { background: var(--ui-green-dark); }

.ui-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 0 16px;
}

.ui-check h3 {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 600;
}

.ui-check-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    color: var(--ui-muted);
    font-size: 1rem;
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}

.ui-check-refresh:hover {
    color: var(--ui-green-dark);
    border-color: var(--ui-green);
    background: var(--ui-green-soft);
}

.ui-check-refresh:hover .bi { transform: rotate(90deg); }
.ui-check-refresh .bi { transition: transform 0.3s; }

.ui-kv {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 8px 12px;
    margin: 0;
    font-size: 0.9rem;
}

.ui-kv dt { font-weight: 400; color: var(--ui-muted); }
.ui-kv dd { margin: 0; word-break: break-all; }

.ui-check-power { font-weight: 600; color: var(--ui-green-dark); }
.ui-check-power.ui-check-offline { color: #b42318; }

.ui-check-table {
    width: 100%;
    font-size: 0.85rem;
    border-collapse: collapse;
}

.ui-check-table th {
    padding: 6px 8px;
    text-align: left;
    color: var(--ui-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--ui-border);
}

.ui-check-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #eef0f3;
}

.ui-check-table tr:last-child td { border-bottom: 0; }

.ui-muted { color: var(--ui-muted); margin: 0; }

@media (max-width: 767.98px) {
    .ui-check { margin: 0 12px 32px; }
    .ui-check-grid { grid-template-columns: 1fr; }
    .ui-kv { grid-template-columns: 1fr; gap: 2px; }
    .ui-kv dd { margin-bottom: 8px; }
}

/* ---------- Tabs (jQuery UI) ---------- */

/* Tab-Bereich als Karte (Konfiguration, Gesamtverlauf) */
.ui-tabs.ui-widget-content {
    padding: 4px 20px 20px;
    background: var(--ui-card);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow);
}

.ui-tabs .ui-tabs-panel { padding: 20px 4px 4px; }

.ui-tabs .ui-tabs-nav li a {
    padding: 12px 14px;
    font-weight: 500;
    color: var(--ui-muted);
}

.ui-tabs-panel h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 8px 0 12px;
}

.ui-tabs .ui-tabs-nav {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--ui-border);
    border-radius: 0;
}

/* Flex statt Float: sonst hakt eine zweite Tab-Reihe unter dem (1px höheren) aktiven Tab ein */
.ui-tabs .ui-tabs-nav {
    display: flex;
    flex-wrap: wrap;
}

.ui-tabs .ui-tabs-nav li {
    float: none;
    top: 0;
    margin: 0 2px 0 0;
    padding: 0;
    border: none;
    background: transparent;
    white-space: nowrap;
}

.ui-tabs .ui-tabs-nav li.ui-tabs-active {
    margin-bottom: 0;
    padding-bottom: 0;
    border: none;
    background: transparent;
    box-shadow: inset 0 -2px 0 var(--ui-green);
}

.ui-tabs .ui-tabs-nav li.ui-tabs-active a { color: var(--ui-green-dark); }

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

.ui-echart {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: var(--ui-card);
}

.ui-nodata {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 120px;
    color: var(--ui-muted);
    font-size: 0.95rem;
    background: #fafbfc;
    border-radius: 8px;
}

/* Hat ECharts übernommen, bleibt von jqPlot nichts sichtbar (auch Achsentitel außerhalb) */
.jqplot-target:has(> .ui-echart) > :not(.ui-echart) {
    visibility: hidden;
}

/* ---------- Fußzeile ---------- */

#footer {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    border-top: 1px solid var(--ui-border);
    color: var(--ui-muted);
    font-size: 0.85rem;
}

#hr_footer { display: none; }

#footer footer { padding-top: 14px; }

/* Statuspunkt statt Ampel (Anlagenlisten, Tooltip-Legende); feste Ampelfarben,
   unabhängig von der Markenfarbe */
.ui-status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin: 0 8px 2px 0;
    border-radius: 50%;
    vertical-align: middle;
    background: #9ca3af;
}
.ui-status-dot--ok    { background: #22a447; box-shadow: 0 0 0 3px rgba(34, 164, 71, 0.18); }
.ui-status-dot--warn  { background: #f2b705; box-shadow: 0 0 0 3px rgba(242, 183, 5, 0.22); }
.ui-status-dot--error { background: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18); }

/* Hilfe (help.inc.phtml, theme.js): Knopf in der Kopfleiste, Panel rechts bzw. Blatt unten */
.ui-help-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    margin-right: 8px;
    padding: 6px 14px;
    border: 1px solid var(--ui-border);
    border-radius: 999px;
    background: #fff;
    color: var(--ui-text);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
}
.ui-help-btn:hover,
.ui-help-btn:focus-visible { border-color: var(--ui-green); color: var(--ui-green); }
.ui-help-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.ui-help-btn + .navbar-toggler { margin-left: 0; }
@media (max-width: 767.98px) {
    .ui-help-btn { padding: 7px; }
    .ui-help-btn span { display: none; }
}

.ui-help { z-index: 2100; }
.ui-help.offcanvas-end { width: 400px; max-width: 100vw; border-left: 1px solid var(--ui-border); box-shadow: -8px 0 24px rgba(0, 0, 0, 0.06); }
.ui-help.offcanvas-bottom { height: auto; max-height: 75vh; border-radius: 16px 16px 0 0; }
.ui-help.offcanvas-bottom::before { content: ""; display: block; width: 40px; height: 4px; margin: 8px auto 0; border-radius: 2px; background: #d1d5db; }
.ui-help .offcanvas-header { align-items: flex-start; padding: 18px 20px 8px; }
.ui-help-kicker { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--ui-green); }
.ui-help .offcanvas-title { margin: 2px 0 0; font-size: 1.15rem; font-weight: 600; }
.ui-help .offcanvas-body { padding: 8px 20px 16px; font-size: 0.925rem; line-height: 1.6; color: #374151; }
.ui-help .offcanvas-body h1,
.ui-help .offcanvas-body h2,
.ui-help .offcanvas-body h3,
.ui-help .offcanvas-body h4 { margin: 16px 0 6px; font-size: 1rem; font-weight: 600; }
.ui-help .offcanvas-body img { max-width: 100%; height: auto; }
.ui-help-legend { margin: 14px 0 0; padding: 12px 14px; border-radius: 10px; background: #f7f6fb; font-size: 0.85rem; }
.ui-help-legend div { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.ui-help-legend .ui-status-dot { margin: 0; flex-shrink: 0; }
.ui-help-foot { display: flex; gap: 16px; padding: 12px 20px; border-top: 1px solid var(--ui-border); font-size: 0.85rem; }
.ui-help-foot a { text-decoration: none; }

/* Breite Bildschirme: Panel neben dem Inhalt statt darüber */
body.ui-help-push { padding-right: 400px; }
body.ui-help-push #navigation,
body.ui-help-push #footer { right: 400px; }
body.ui-help-push #footer { width: auto; }
body.ui-help-push:not(.ui-with-sidebar) #footer { left: 0; }

/* Detailgrafik der Anlagenliste (Ertragsspalten beim Überfahren) */
#planttable td[data-detail] { cursor: pointer; }
.ui-detail-card {
    position: fixed;
    z-index: 1080;
    width: 360px;
    padding: 12px 14px 8px;
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    pointer-events: none;
}
.ui-detail-title { font-weight: 600; font-size: 0.9rem; color: var(--ui-text); }
.ui-detail-sub { margin: 2px 0 6px; font-size: 0.75rem; color: #6b7280; }
.ui-detail-empty { padding: 18px 0; text-align: center; font-size: 0.85rem; color: #6b7280; }
.ui-detail-sub--avg::after { content: ""; display: inline-block; width: 14px; margin-left: 6px; vertical-align: middle; border-top: 1px dashed #9ca3af; }

/* Handy: Fußzeile umbricht auf mehrere Zeilen und passt nicht in die festen 50px
   (main.css) – dort normal am Seitenende statt angeheftet */
@media (max-width: 767.98px) {
    #footer { position: static; height: auto; padding-bottom: 12px; }
    #footer footer { padding-top: 10px; line-height: 1.7; }
}

/* Seitenleiste der Diagrammansichten (public/js/series-tools.js): Farbpunkt statt Rand und
   Farbkreis-Bild, Schalter statt Auge, Chip „AC/DC ›“. Trefferflächen mindestens 40px. */
.sidebar-nav img.wsrtoolsicon { visibility: hidden; }
.well.sidebar-nav .wsr_box.ui-st-box { border-left-width: 0 !important; padding-left: 10px; }
.wsr_box { transition: opacity 0.2s; }
.wsr_box.is-off { opacity: 0.5; }
.wsr_box.is-off .ui-st-dot { background: transparent; box-shadow: inset 0 0 0 3px var(--ui-st-color); }
.wsr_box.ui-st-box .info { padding-left: 32px; }

h5.ui-st-title { display: flex; align-items: center; gap: 8px; min-height: 40px; margin-top: 6px; }
h5.ui-st-title .ui-st-name { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; hyphens: auto; }
h5.ui-st-title span.wsrtools { float: none; }
h5.ui-st-title > span:not(.ui-st-name):not(.ui-st-color) { display: inline-flex; align-items: center; }

.ui-st-dot {
    position: relative;
    flex: 0 0 auto;
    display: inline-block;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--ui-st-color, var(--ui-green));
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
    font-size: 0;
    color: transparent;
    vertical-align: middle;
}
button.ui-st-dot { cursor: pointer; transition: transform 0.15s; }
button.ui-st-dot::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; }
button.ui-st-dot:hover { transform: scale(1.12); }
button.ui-st-dot:focus-visible { outline: 2px solid var(--ui-green); outline-offset: 3px; }
.ui-st-color { display: inline-flex; }
/* jQuery-UI .button() einzelner Views (z. B. AC/DC) erfasst auch den Farbpunkt */
button.ui-st-dot.ui-button { margin: 0; padding: 0; border: 0; background: var(--ui-st-color, var(--ui-green)); }
button.ui-st-dot .ui-button-text { display: none; }

.ui-st-switch { display: inline-flex; align-items: center; min-height: 40px; margin: 0; padding-left: 0; }
.ui-st-switch .form-check-input { width: 2.4em; height: 1.3em; margin: 0; float: none; cursor: pointer; }
.ui-st-switch .form-check-input:checked { background-color: var(--ui-green); border-color: var(--ui-green); }
.ui-st-switch .form-check-input:focus { border-color: var(--ui-green); box-shadow: 0 0 0 0.2rem rgba(45, 146, 62, 0.25); }

a.ui-st-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-height: 30px;
    padding: 0 8px;
    border: 1px solid var(--ui-border);
    border-radius: 999px;
    background: var(--ui-card);
    color: var(--ui-text);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
a.ui-st-chip:hover { border-color: var(--ui-green); color: var(--ui-green-dark); background: var(--ui-green-soft); }
a.ui-st-chip .bi-lightning-charge { color: var(--ui-green); }
a.ui-st-chip .bi-chevron-right { font-size: 0.65rem; color: var(--ui-muted); }

/* Coloris: über Diagrammen und Kopfleiste */
.clr-picker { z-index: 1070; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); }
.clr-picker #clr-close { background: var(--ui-green); }
.clr-picker #clr-close:hover { background: var(--ui-green-dark); }

/* Handy: Farbwahl als Leiste von unten, Farbfelder zuerst und fingergroß */
@media (max-width: 575.98px) {
    .clr-picker {
        position: fixed !important;
        top: auto !important;
        left: 0 !important;
        right: 0;
        bottom: 0;
        width: auto !important;
        padding: 14px 0 calc(8px + env(safe-area-inset-bottom));
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
        z-index: 100000;
    }
    .clr-picker .clr-swatches { order: -1; }
    .clr-picker .clr-swatches button { width: 34px; height: 34px; margin: 0 6px 10px; }
    .clr-picker .clr-gradient { height: 120px; }
}

/* AC/DC-Ansicht: Tab-Leiste und Inhalt als eine Karte mit gemeinsamer Kante */
#tabs_div > .nav-tabs { border-bottom: 1px solid var(--ui-border); gap: 2px; }
#tabs_div > .nav-tabs .nav-link {
    margin-bottom: -1px;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 10px 10px 0 0;
    color: var(--ui-muted);
    font-weight: 600;
}
#tabs_div > .nav-tabs .nav-link:hover { color: var(--ui-green-dark); border-color: transparent; background: var(--ui-green-soft); }
#tabs_div > .nav-tabs .nav-link.active {
    color: var(--ui-green-dark);
    background: var(--ui-card);
    border-color: var(--ui-border) var(--ui-border) var(--ui-card);
}
#tabs_div > .tab-content {
    padding: 16px 0 12px;
    background: var(--ui-card);
    border: 1px solid var(--ui-border);
    border-top: 0;
    border-radius: 0 0 var(--ui-radius) var(--ui-radius);
    box-shadow: var(--ui-shadow);
}
/* Legende sitzt in derselben Karte: keine zweite Karte, nur eine Trennlinie */
#tabs_div > .tab-content .well {
    border: 0;
    border-left: 1px solid var(--ui-border);
    border-radius: 0;
    box-shadow: none;
}
/* Kennwerte des Tages je Kanal (Max. mit Uhrzeit, Min., Ø) */
.wsr_box .info p.ui-acdc-stats { margin-top: 2px; font-size: 0.78rem; line-height: 1.45; color: var(--ui-muted); }

/* Handy: Datumsleiste (#action_box…) als Raster – Zeile 1: zurück · Datum · vor,
   Zeile 2: Aktuell/Download. Erster Link = zurück, letzter = vor, Datum = Datepicker-Knopf. */
@media (max-width: 575.98px) {
    [id^="action_box"] {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 8px;
        margin: 12px 0;
    }
    [id^="action_box"] > a,
    [id^="action_box"] > button.ui-datepicker-trigger {
        grid-column: span 3;
        order: 4;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-height: 44px;
        margin: 0 !important;
        padding: 6px 4px !important;
        font-size: 0.875rem !important;
        line-height: 1.2;
        text-align: center;
        white-space: normal;
    }
    [id^="action_box"] > a:first-of-type { grid-column: span 2; order: 1; }
    [id^="action_box"] > button.ui-datepicker-trigger { grid-column: span 2; order: 2; }
    [id^="action_box"] > a:last-of-type { grid-column: span 2; order: 3; }
    /* nur ein Knopf in Zeile 2: volle Breite */
    [id^="action_box"] > a:nth-of-type(2):nth-last-of-type(2) { grid-column: span 6; }
    [id^="action_box"] .ui-button-text { padding: 0 !important; }
    /* sonstiger Inhalt (z. B. #info2 in Monat/Jahr) über die ganze Breite ans Ende */
    [id^="action_box"] > :not(a):not(button):not(input) { grid-column: 1 / -1; order: 5; }
    [id^="action_box"] > :not(a):not(button):not(input):empty { display: none; }
}

/* ── Cookie-Hinweis (Bibliothek cookie-bar, lädt ihr Stylesheet nachträglich; daher „body #…“) ── */
body #cookie-bar {
    left: 50% !important;
    bottom: 16px !important;
    width: min(760px, calc(100% - 32px));
    transform: translateX(-50%);
    padding: 14px 16px 14px 56px;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid var(--ui-border);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(16, 24, 40, 0.18);
    color: var(--ui-text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
}
body #cookie-bar::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 50%;
    width: 26px;
    height: 26px;
    transform: translateY(-50%);
    background: var(--ui-green);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.3A9 9 0 1 1 11.7 3a3 3 0 0 0 4 3.6 3 3 0 0 0 3.7 3.7 3 3 0 0 0 1.6 2z'/%3E%3Cpath d='M8.5 9.5h.01M12 15h.01M8 14.5h.01M15.5 13h.01'/%3E%3C/svg%3E") no-repeat center / contain;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.3A9 9 0 1 1 11.7 3a3 3 0 0 0 4 3.6 3 3 0 0 0 3.7 3.7 3 3 0 0 0 1.6 2z'/%3E%3Cpath d='M8.5 9.5h.01M12 15h.01M8 14.5h.01M15.5 13h.01'/%3E%3C/svg%3E") no-repeat center / contain;
}
body #cookie-bar p {
    float: none;
    margin: 0;
    padding-right: 140px;
    font-weight: 400;
    line-height: 1.5;
}
body #cookie-bar a#cookie-bar-prompt-button {
    color: var(--ui-green);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}
body #cookie-bar a#cookie-bar-button {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    float: none;
    margin: 0;
    padding: 10px 20px;
    border-radius: 8px;
    background: var(--ui-green);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    transition: background 0.15s;
}
body #cookie-bar a#cookie-bar-button:hover { background: var(--ui-green-dark); text-decoration: none; }
@media (max-width: 575.98px) {
    body #cookie-bar { padding: 14px 16px; }
    body #cookie-bar::before { display: none; }
    body #cookie-bar p { padding-right: 0; }
    body #cookie-bar a#cookie-bar-button {
        position: static;
        transform: none;
        display: block;
        margin-top: 12px;
        min-height: 44px;
        padding: 13px 20px;
        text-align: center;
    }
}

/* Details-Fenster */
body #cookie-bar-prompt { background: rgba(17, 24, 39, 0.5); }
body #cookie-bar-prompt-content {
    top: 50%;
    transform: translateY(-50%);
    width: 600px;
    max-width: calc(100% - 32px);
    max-height: 85vh;
    box-sizing: border-box;
    padding: 24px 28px;
    background: #fff;
    border: 0;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(16, 24, 40, 0.3);
    color: var(--ui-text);
    font-family: inherit;
    font-weight: 400;
    font-size: 14px;
}
body #cookie-bar-prompt-content * { line-height: 1.6; }
body #cookie-bar-prompt-content i { font-style: normal; color: var(--ui-muted); }
body #cookie-bar-prompt-content a,
body #cookie-bar-prompt-content span { color: var(--ui-green); }
body #cookie-bar-prompt-logo { display: none; }
body #cookie-bar-prompt-close {
    width: 32px;
    height: 32px;
    margin: -8px -12px 0 0;
    border-radius: 50%;
    background: var(--ui-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f2933' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E") no-repeat center / 18px;
    cursor: pointer;
}
body #cookie-bar-prompt hr { background: var(--ui-border); }
body #cookie-bar-browsers a { width: 40px; height: 40px; margin-right: 6px; background-size: contain !important; }
body #cookie-bar-browsers a span { top: 46px; color: #fff !important; }

/* ── Hinweis auf das bisherige Portal (legacy-notice.inc.phtml) ── */
.ui-legacy-notice {
    position: fixed;
    top: calc(var(--ui-topbar-h) + 12px);
    right: 16px;
    z-index: 1040;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 380px;
    max-width: calc(100% - 32px);
    padding: 14px 12px 10px 16px;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid var(--ui-border);
    border-left: 4px solid var(--ui-green);
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(16, 24, 40, 0.18);
    font-size: 13px;
    line-height: 1.5;
    animation: uiLegacyIn 0.35s ease;
}
.ui-legacy-notice[hidden] { display: none; }
.ui-legacy-notice > .bi { font-size: 20px; color: var(--ui-green); line-height: 1; margin-top: 2px; }
.ui-legacy-body { flex: 1; min-width: 0; }
.ui-legacy-body strong { display: block; font-size: 14px; margin-bottom: 2px; }
.ui-legacy-body p { margin: 0; color: var(--ui-muted); }
.ui-legacy-body a { color: var(--ui-green); font-weight: 600; }
.ui-legacy-body .btn-link { padding: 6px 0 0; font-size: 12px; color: var(--ui-muted); text-decoration: underline; }
.ui-legacy-notice .btn-close { flex: none; font-size: 11px; }
@keyframes uiLegacyIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (max-width: 767.98px) { .ui-legacy-notice { display: none !important; } }
