
/* ==========================================================
   SIBA: Orange Rahmen auf ALLEN Seiten im Darkmode
   Greift ausschließlich im Darkmode.
   Lightmode bleibt unverändert.
   ========================================================== */

html.siba-dark,
html.dark,
html[data-theme="dark"],
body.siba-dark,
body.dark,
body[data-theme="dark"]{
    --siba-orange:#ff6b1a;
    --siba-dark-bg:#000000;
    --siba-dark-box:#111111;
    --siba-dark-box2:#151515;
    --siba-dark-line:#ff6b1a;
    --siba-dark-text:#ffffff;
}

/* Hauptseitenflächen */
body.siba-dark :where(
    main,.main,.content,.content-wrapper,.main-content,.page-content,.page-wrapper,.wrapper,
    .dashboard,.dashboard-page,.container,.container-fluid,.siba-main,section,
    .zeit-wrap,.live-wrap,.history-wrap,.checkins-wrap,.berichte-wrap,.report-wrap,.vod-wrap,
    .anw-wrap,.anwesende-wrap,.user-wrap,.benutzer-wrap,.besucher-wrap,.firma-wrap,.firmen-wrap,
    .rollen-wrap,.settings-wrap,.einstellungen-wrap,.admin-wrap,.standorte-wrap
),
body.dark :where(
    main,.main,.content,.content-wrapper,.main-content,.page-content,.page-wrapper,.wrapper,
    .dashboard,.dashboard-page,.container,.container-fluid,.siba-main,section,
    .zeit-wrap,.live-wrap,.history-wrap,.checkins-wrap,.berichte-wrap,.report-wrap,.vod-wrap,
    .anw-wrap,.anwesende-wrap,.user-wrap,.benutzer-wrap,.besucher-wrap,.firma-wrap,.firmen-wrap,
    .rollen-wrap,.settings-wrap,.einstellungen-wrap,.admin-wrap,.standorte-wrap
),
body[data-theme="dark"] :where(
    main,.main,.content,.content-wrapper,.main-content,.page-content,.page-wrapper,.wrapper,
    .dashboard,.dashboard-page,.container,.container-fluid,.siba-main,section,
    .zeit-wrap,.live-wrap,.history-wrap,.checkins-wrap,.berichte-wrap,.report-wrap,.vod-wrap,
    .anw-wrap,.anwesende-wrap,.user-wrap,.benutzer-wrap,.besucher-wrap,.firma-wrap,.firmen-wrap,
    .rollen-wrap,.settings-wrap,.einstellungen-wrap,.admin-wrap,.standorte-wrap
){
    background:var(--siba-dark-bg) !important;
    color:var(--siba-dark-text) !important;
}

/* Alle sichtbaren Boxen/Kästen */
body.siba-dark :where(
    .card,.box,.panel,.widget,.tile,.item,.block,
    .dash-card,.dashboard-card,.dashboard-box,.dashboard-widget,
    .stat-card,.stats-card,.stat-box,
    .table-card,.table-box,.form-card,.form-box,.list-card,.list-box,
    .filter-card,.filter-box,.filter-panel,.search-panel,.export-panel,
    .content-card,.content-box,.white-box,.modal-content,.dropdown-menu,
    .page-header,.page-heading,.page-title,.title-card,.headline-card,
    .zeit-title,.zeit-card,.live-title,.live-card,.history-title,.history-card,
    .berichte-title,.report-title,.report-card,.bericht-card,
    .location-filter,.location-card,.location-box,.location-select,.tree-row,
    .profile-card,.settings-card,.user-card,.firma-card,.besucher-card,
    [class*="card"],[class*="box"],[class*="panel"],[class*="filter"],[class*="wrapper"]
),
body.dark :where(
    .card,.box,.panel,.widget,.tile,.item,.block,
    .dash-card,.dashboard-card,.dashboard-box,.dashboard-widget,
    .stat-card,.stats-card,.stat-box,
    .table-card,.table-box,.form-card,.form-box,.list-card,.list-box,
    .filter-card,.filter-box,.filter-panel,.search-panel,.export-panel,
    .content-card,.content-box,.white-box,.modal-content,.dropdown-menu,
    .page-header,.page-heading,.page-title,.title-card,.headline-card,
    .zeit-title,.zeit-card,.live-title,.live-card,.history-title,.history-card,
    .berichte-title,.report-title,.report-card,.bericht-card,
    .location-filter,.location-card,.location-box,.location-select,.tree-row,
    .profile-card,.settings-card,.user-card,.firma-card,.besucher-card,
    [class*="card"],[class*="box"],[class*="panel"],[class*="filter"],[class*="wrapper"]
),
body[data-theme="dark"] :where(
    .card,.box,.panel,.widget,.tile,.item,.block,
    .dash-card,.dashboard-card,.dashboard-box,.dashboard-widget,
    .stat-card,.stats-card,.stat-box,
    .table-card,.table-box,.form-card,.form-box,.list-card,.list-box,
    .filter-card,.filter-box,.filter-panel,.search-panel,.export-panel,
    .content-card,.content-box,.white-box,.modal-content,.dropdown-menu,
    .page-header,.page-heading,.page-title,.title-card,.headline-card,
    .zeit-title,.zeit-card,.live-title,.live-card,.history-title,.history-card,
    .berichte-title,.report-title,.report-card,.bericht-card,
    .location-filter,.location-card,.location-box,.location-select,.tree-row,
    .profile-card,.settings-card,.user-card,.firma-card,.besucher-card,
    [class*="card"],[class*="box"],[class*="panel"],[class*="filter"],[class*="wrapper"]
){
    background:var(--siba-dark-box) !important;
    color:var(--siba-dark-text) !important;
    border:1px solid var(--siba-dark-line) !important;
}

/* Formulare und Auswahlfelder */
body.siba-dark :where(
    input,select,textarea,.form-control,.form-select,
    .input,.select,.textarea,.search-input,.date-input,
    .select2-container,.select2-selection,.choices,.choices__inner
),
body.dark :where(
    input,select,textarea,.form-control,.form-select,
    .input,.select,.textarea,.search-input,.date-input,
    .select2-container,.select2-selection,.choices,.choices__inner
),
body[data-theme="dark"] :where(
    input,select,textarea,.form-control,.form-select,
    .input,.select,.textarea,.search-input,.date-input,
    .select2-container,.select2-selection,.choices,.choices__inner
){
    background:#101010 !important;
    color:#ffffff !important;
    border:1px solid var(--siba-dark-line) !important;
}

/* Buttons */
body.siba-dark :where(button,.btn,.button,.pbtn,.action-btn,.submit-btn,.save-btn,.delete-btn,.edit-btn),
body.dark :where(button,.btn,.button,.pbtn,.action-btn,.submit-btn,.save-btn,.delete-btn,.edit-btn),
body[data-theme="dark"] :where(button,.btn,.button,.pbtn,.action-btn,.submit-btn,.save-btn,.delete-btn,.edit-btn){
    border:1px solid var(--siba-dark-line) !important;
}

/* Tabellen überall */
body.siba-dark :where(table,.table,.zeit-table,.live-table),
body.dark :where(table,.table,.zeit-table,.live-table),
body[data-theme="dark"] :where(table,.table,.zeit-table,.live-table){
    background:#0b0b0b !important;
    color:#ffffff !important;
    border:1px solid var(--siba-dark-line) !important;
}

body.siba-dark :where(th,thead,thead tr),
body.dark :where(th,thead,thead tr),
body[data-theme="dark"] :where(th,thead,thead tr){
    background:#1a1a1a !important;
    color:#ffffff !important;
    border:1px solid var(--siba-dark-line) !important;
}

body.siba-dark :where(td,tr,tbody),
body.dark :where(td,tr,tbody),
body[data-theme="dark"] :where(td,tr,tbody){
    background:#101010 !important;
    color:#ffffff !important;
    border-color:#2d2d2d !important;
}

/* Header-Balken, aber orange Header-Verlauf bleibt erhalten */
body.siba-dark :where(.siba-header,.topbar,.navbar,.header),
body.dark :where(.siba-header,.topbar,.navbar,.header),
body[data-theme="dark"] :where(.siba-header,.topbar,.navbar,.header){
    color:#ffffff !important;
}

/* Sidebar-Kästen nicht mit Rahmen überladen, nur Inhalt dunkel */
body.siba-dark :where(.siba-sidebar,.sidebar,#sidebar),
body.dark :where(.siba-sidebar,.sidebar,#sidebar),
body[data-theme="dark"] :where(.siba-sidebar,.sidebar,#sidebar){
    background:#0b0b0b !important;
    color:#ffffff !important;
}

/* Untermenüs / Navigation */
body.siba-dark :where(.navigation-link,.submenu-link,.menu-item,.nav-item),
body.dark :where(.navigation-link,.submenu-link,.menu-item,.nav-item),
body[data-theme="dark"] :where(.navigation-link,.submenu-link,.menu-item,.nav-item){
    color:#ffffff !important;
}

body.siba-dark :where(.navigation-link.active,.submenu-link.active,.menu-item.active,.nav-item.active),
body.dark :where(.navigation-link.active,.submenu-link.active,.menu-item.active,.nav-item.active),
body[data-theme="dark"] :where(.navigation-link.active,.submenu-link.active,.menu-item.active,.nav-item.active){
    border-color:var(--siba-dark-line) !important;
}

/* Meldungen */
body.siba-dark :where(.alert,.msg,.notice,.error,.error-box,.db-error,.msg-details,.warning,.success),
body.dark :where(.alert,.msg,.notice,.error,.error-box,.db-error,.msg-details,.warning,.success),
body[data-theme="dark"] :where(.alert,.msg,.notice,.error,.error-box,.db-error,.msg-details,.warning,.success){
    background:#151515 !important;
    color:#ffffff !important;
    border:1px solid var(--siba-dark-line) !important;
}

/* Direkt sichtbare Divs mit Inline-Border ebenfalls orange */
body.siba-dark div[style*="border"],
body.dark div[style*="border"],
body[data-theme="dark"] div[style*="border"]{
    border-color:var(--siba-dark-line) !important;
}

/* Fokus */
body.siba-dark :where(input,select,textarea,button,.btn):focus,
body.dark :where(input,select,textarea,button,.btn):focus,
body[data-theme="dark"] :where(input,select,textarea,button,.btn):focus{
    outline:1px solid var(--siba-dark-line) !important;
    box-shadow:0 0 0 2px rgba(255,107,26,.25) !important;
}

/* Optionen */
body.siba-dark option,
body.dark option,
body[data-theme="dark"] option{
    background:#111111 !important;
    color:#ffffff !important;
}
