
/* ==========================================================
   SIBA Darkmode Komplett-Fix
   WICHTIG: Alle Regeln sind ausschließlich auf Darkmode gescoped.
   Lightmode wird dadurch nicht verändert.
   ========================================================== */

/* Grundfläche */
html.siba-dark,
html.dark,
html[data-theme="dark"],
body.siba-dark,
body.dark,
body[data-theme="dark"]{
    background:#000000 !important;
    color:#f2f2f2 !important;
}

/* Hauptbereiche */
body.siba-dark :where(
    main,.main,.content,.content-wrapper,.main-content,.page-content,
    .wrapper,.page-wrapper,.dashboard,.dashboard-page,.container-fluid,
    section,.siba-main,
    .zeit-wrap,.live-wrap,.history-wrap,.checkins-wrap,.berichte-wrap,.report-wrap,.vod-wrap,
    .anw-wrap,.user-wrap,.besucher-wrap,.firma-wrap,.rollen-wrap,.settings-wrap
),
body.dark :where(
    main,.main,.content,.content-wrapper,.main-content,.page-content,
    .wrapper,.page-wrapper,.dashboard,.dashboard-page,.container-fluid,
    section,.siba-main,
    .zeit-wrap,.live-wrap,.history-wrap,.checkins-wrap,.berichte-wrap,.report-wrap,.vod-wrap,
    .anw-wrap,.user-wrap,.besucher-wrap,.firma-wrap,.rollen-wrap,.settings-wrap
),
body[data-theme="dark"] :where(
    main,.main,.content,.content-wrapper,.main-content,.page-content,
    .wrapper,.page-wrapper,.dashboard,.dashboard-page,.container-fluid,
    section,.siba-main,
    .zeit-wrap,.live-wrap,.history-wrap,.checkins-wrap,.berichte-wrap,.report-wrap,.vod-wrap,
    .anw-wrap,.user-wrap,.besucher-wrap,.firma-wrap,.rollen-wrap,.settings-wrap
){
    background:#000000 !important;
    color:#f2f2f2 !important;
}

/* Karten, Boxen, Titelbereiche */
body.siba-dark :where(
    .card,.box,.panel,.widget,.tile,.modal-content,.dropdown-menu,
    .dash-card,.stat-box,.stats-card,.table-box,.table-card,.form-box,.list-box,
    .filter-box,.filter-card,.filter-panel,.search-panel,.export-panel,.content-box,.white-box,
    .zeit-title,.zeit-card,.live-title,.live-card,.history-title,.history-card,
    .page-header,.page-heading,.title-card,.headline-card,.location-filter,.tree-row,
    [class*="card"],[class*="box"],[class*="panel"]
),
body.dark :where(
    .card,.box,.panel,.widget,.tile,.modal-content,.dropdown-menu,
    .dash-card,.stat-box,.stats-card,.table-box,.table-card,.form-box,.list-box,
    .filter-box,.filter-card,.filter-panel,.search-panel,.export-panel,.content-box,.white-box,
    .zeit-title,.zeit-card,.live-title,.live-card,.history-title,.history-card,
    .page-header,.page-heading,.title-card,.headline-card,.location-filter,.tree-row,
    [class*="card"],[class*="box"],[class*="panel"]
),
body[data-theme="dark"] :where(
    .card,.box,.panel,.widget,.tile,.modal-content,.dropdown-menu,
    .dash-card,.stat-box,.stats-card,.table-box,.table-card,.form-box,.list-box,
    .filter-box,.filter-card,.filter-panel,.search-panel,.export-panel,.content-box,.white-box,
    .zeit-title,.zeit-card,.live-title,.live-card,.history-title,.history-card,
    .page-header,.page-heading,.title-card,.headline-card,.location-filter,.tree-row,
    [class*="card"],[class*="box"],[class*="panel"]
){
    background:#111111 !important;
    color:#f2f2f2 !important;
    border-color:#ff6b1a !important;
}

/* Tabellen */
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:#f2f2f2 !important;
    border-color:#ff6b1a !important;
}

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

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

body.siba-dark :where(tr:nth-child(even),tr:nth-child(odd)),
body.dark :where(tr:nth-child(even),tr:nth-child(odd)),
body[data-theme="dark"] :where(tr:nth-child(even),tr:nth-child(odd)){
    background:#101010 !important;
}

/* Formulare */
body.siba-dark :where(input,select,textarea,button,.form-control,.form-select),
body.dark :where(input,select,textarea,button,.form-control,.form-select),
body[data-theme="dark"] :where(input,select,textarea,button,.form-control,.form-select){
    background:#0f0f0f !important;
    color:#ffffff !important;
    border-color:#ff6b1a !important;
}

body.siba-dark :where(input::placeholder,textarea::placeholder),
body.dark :where(input::placeholder,textarea::placeholder),
body[data-theme="dark"] :where(input::placeholder,textarea::placeholder){
    color:#b8b8b8 !important;
}

/* Texte */
body.siba-dark :where(h1,h2,h3,h4,h5,h6,p,label,span,small,strong,b,li,a,div),
body.dark :where(h1,h2,h3,h4,h5,h6,p,label,span,small,strong,b,li,a,div),
body[data-theme="dark"] :where(h1,h2,h3,h4,h5,h6,p,label,span,small,strong,b,li,a,div){
    color:inherit;
}

/* Links und Icons */
body.siba-dark :where(a,.navigation-link),
body.dark :where(a,.navigation-link),
body[data-theme="dark"] :where(a,.navigation-link){
    color:#f2f2f2;
}

body.siba-dark :where(.active,.navigation-link.active,.pbtn.active,.btn-primary),
body.dark :where(.active,.navigation-link.active,.pbtn.active,.btn-primary),
body[data-theme="dark"] :where(.active,.navigation-link.active,.pbtn.active,.btn-primary){
    border-color:#ff6b1a !important;
}

/* Header / Sidebar NICHT kaputt machen, aber dunkel halten */
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:#111111 !important;
    color:#f2f2f2 !important;
}

body.siba-dark :where(.siba-header,.header,.topbar,.navbar),
body.dark :where(.siba-header,.header,.topbar,.navbar),
body[data-theme="dark"] :where(.siba-header,.header,.topbar,.navbar){
    color:#ffffff !important;
}

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

/* Pagination */
body.siba-dark :where(.pbtn,.pagination a,.page-link),
body.dark :where(.pbtn,.pagination a,.page-link),
body[data-theme="dark"] :where(.pbtn,.pagination a,.page-link){
    background:#151515 !important;
    color:#ffffff !important;
    border-color:#444 !important;
}

/* Spezifisch Live Check-ins weißer Block */
body.siba-dark .live-wrap,
body.dark .live-wrap,
body[data-theme="dark"] .live-wrap{
    background:#000000 !important;
}
body.siba-dark .live-title,
body.siba-dark .live-card,
body.dark .live-title,
body.dark .live-card,
body[data-theme="dark"] .live-title,
body[data-theme="dark"] .live-card{
    background:#111111 !important;
    color:#ffffff !important;
    border-color:#ff6b1a !important;
}

/* Spezifisch Berichte / Rahmen */
body.siba-dark :where(.berichte-title,.report-title,.report-card,.bericht-card),
body.dark :where(.berichte-title,.report-title,.report-card,.bericht-card),
body[data-theme="dark"] :where(.berichte-title,.report-title,.report-card,.bericht-card){
    background:#111111 !important;
    color:#ffffff !important;
    border-color:#ff6b1a !important;
}

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



/* ===== ORANGE RAHMEN FÜR ALLE BOXEN IM DARKMODE ===== */

body.siba-dark .dashboard-card,
body.siba-dark .dashboard-box,
body.siba-dark .dashboard-widget,
body.siba-dark .stat-card,
body.siba-dark .filter-card,
body.siba-dark .location-card,
body.siba-dark .location-filter,
body.siba-dark .location-select,
body.siba-dark .card,
body.siba-dark .box,
body.siba-dark .panel,
body.siba-dark .widget,
body.siba-dark .form-group,
body.siba-dark .form-box,
body.siba-dark .table-card,
body.siba-dark .content-box,
body.siba-dark select,
body.siba-dark input,
body.siba-dark textarea,
body.siba-dark .select2-container,
body.siba-dark [class*="filter"],
body.siba-dark [class*="card"],
body.siba-dark [class*="box"],
body.siba-dark [class*="panel"]{
    border:1px solid #ff6b1a !important;
}

body.siba-dark .dashboard-title,
body.siba-dark .page-header,
body.siba-dark .title-card,
body.siba-dark .headline-card{
    border:1px solid #ff6b1a !important;
}

body.siba-dark select,
body.siba-dark input,
body.siba-dark textarea{
    background:#111111 !important;
    color:#ffffff !important;
}

body.siba-dark option{
    background:#111111 !important;
    color:#ffffff !important;
}


/* SIBA: falsche zweite Headerbutton-Leiste komplett verstecken */
#sibaOnlyTwoHeaderButtons{
    display:none !important;
    visibility:hidden !important;
    height:0 !important;
    max-height:0 !important;
    overflow:hidden !important;
    pointer-events:none !important;
}
