
/* ==========================================================
   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;
}
/* SIBA Darkmode – final UI polish. Dark mode only; print/light untouched. */
@media screen {
body.siba-dark {
  --ui-bg:#0d1117;
  --ui-panel:#151b24;
  --ui-panel-2:#1b2430;
  --ui-panel-3:#222d3a;
  --ui-line:#303b4a;
  --ui-line-soft:rgba(255,255,255,.075);
  --ui-text:#eef3f8;
  --ui-muted:#9ba8b8;
  --ui-orange:#ff7417;
  --ui-orange-hover:#ff8b39;
  --ui-green:#218a59;
  --ui-green-hover:#29a66b;
  --ui-red:#b93d48;
  --ui-red-hover:#d34a56;
  --ui-blue:#3378c8;
  --ui-amber:#d99a25;
}

/* 1) Ruhige Flächen – keine orange Drahtgitter-Optik */
body.siba-dark .siba-main :where(.body1,.bodybody,.content,.container,.box,.panel,.card,.section,.section-box,.section-container,.report-title,.report-card,.table-container,.form-container,.list-container,.user-header,.visitor-header,.firmen-header,.top-actions,.action-bar) {
  border-color:var(--ui-line)!important;
  box-shadow:none!important;
}
body.siba-dark .siba-main > :where(div,section,form,container,kasten,kastren):not(.siba-header) {
  border-color:transparent!important;
}
body.siba-dark .siba-main > :where(.page-header,.page-heading,.title-card,.headline-card,.report-title,.report-card,.body1,.bodybody,.content,.container,.box,.panel,.card,.section,.section-box,.section-container,.table-container,.form-container,.list-container) {
  border:1px solid var(--ui-line)!important;
  border-radius:13px!important;
}

/* Tabellen nur mit feinen Trennlinien; Filter nicht wie hundert kleine Rahmen */
body.siba-dark :where(table,.table) { border:1px solid var(--ui-line)!important; }
body.siba-dark :where(th,td) { border-left:0!important; border-right:0!important; }
body.siba-dark :where(thead input,.table-filters input,.filter-row input,.search-row input) {
  border:1px solid #3a4758!important;
  background:#111821!important;
}
body.siba-dark :where(.filter-row,.search-row,.table-filters,.filters,.filter-bar,.search-bar) {
  border:1px solid var(--ui-line)!important;
  background:var(--ui-panel-2)!important;
}

/* 2) Buttons immer lesbar und nach Funktion eingefärbt */
body.siba-dark :where(button,.btn,.pbtn,a.btn,.bf-btn,.pg-btn,.tpg-btn,.visitor-save,.visitor-back,.visitor-icon,.r-btn,.siba-settings-btn,.pg-add,.tpg-add) {
  opacity:1!important;
  visibility:visible!important;
  color:#fff!important;
  text-shadow:none!important;
  font-weight:750!important;
  border-radius:9px!important;
  min-height:36px;
}
body.siba-dark :where(.bf-btn,.pg-btn,.tpg-btn,.visitor-save,.visitor-back,.r-btn,.siba-settings-btn,.pg-add,.tpg-add,[class*="hinzuf" i],[class*="speicher" i],[class*="erstellen" i]) {
  background:var(--ui-orange)!important;
  border:1px solid var(--ui-orange)!important;
  color:#fff!important;
}
body.siba-dark :where(.bf-btn,.pg-btn,.tpg-btn,.visitor-save,.visitor-back,.r-btn,.siba-settings-btn,.pg-add,.tpg-add,[class*="hinzuf" i],[class*="speicher" i],[class*="erstellen" i]):hover {
  background:var(--ui-orange-hover)!important;
  border-color:var(--ui-orange-hover)!important;
}
body.siba-dark :where(.bf-approve,.bf-approve.done,.pg-ok,.tpg-return,.btn-success,.success,[name="freigeben"],[name="druck_fertig"]) {
  background:var(--ui-green)!important;
  border:1px solid var(--ui-green)!important;
  color:#fff!important;
}
body.siba-dark :where(.bf-approve,.pg-ok,.tpg-return,[name="freigeben"],[name="druck_fertig"]):hover {
  background:var(--ui-green-hover)!important;
  border-color:var(--ui-green-hover)!important;
}
body.siba-dark :where(.pg-reject,.btn-danger,.danger,[name="ablehnen"],.visitor-icon.delete) {
  background:var(--ui-red)!important;
  border:1px solid var(--ui-red)!important;
  color:#fff!important;
}
body.siba-dark :where(.pg-reject,[name="ablehnen"],.visitor-icon.delete):hover {
  background:var(--ui-red-hover)!important;
  border-color:var(--ui-red-hover)!important;
}
body.siba-dark :where([name="druck_offen"],[name="zurueckgegeben"],.pg-print-button,.tpg-print-button,.card-buttons button,.card-buttons a) {
  background:#263241!important;
  border:1px solid #465568!important;
  color:#f5f7fa!important;
}
body.siba-dark :where(.pg-print-toolbar,.tpg-print-toolbar,.print-selection,.print-bar) {
  background:var(--ui-panel-2)!important;
  color:var(--ui-text)!important;
  border:1px solid var(--ui-line)!important;
}

/* 3) Freigaben: Status- und BA-Farben wieder sichtbar */
body.siba-dark .bf-cards .bf-card,
body.siba-dark .pg-cards .pg-card,
body.siba-dark .tpg-cards .tpg-card {
  background:linear-gradient(180deg,#1b2430,#171e28)!important;
  border:1px solid var(--ui-line)!important;
  border-left-width:5px!important;
}
body.siba-dark .bf-cards .bf-card:nth-child(1),body.siba-dark .pg-cards .pg-card:nth-child(1){border-left-color:var(--ui-amber)!important;}
body.siba-dark .bf-cards .bf-card:nth-child(2),body.siba-dark .pg-cards .pg-card:nth-child(2){border-left-color:var(--ui-green)!important;}
body.siba-dark .bf-cards .bf-card:nth-child(3),body.siba-dark .pg-cards .pg-card:nth-child(3){border-left-color:var(--ui-red)!important;}
body.siba-dark .tpg-cards .tpg-card:nth-child(1){border-left-color:var(--ui-green)!important;}
body.siba-dark .tpg-cards .tpg-card:nth-child(2){border-left-color:var(--ui-red)!important;}
body.siba-dark .tpg-cards .tpg-card:nth-child(3){border-left-color:var(--ui-blue)!important;}

body.siba-dark .bf-ba-link,
body.siba-dark .pg-ba {
  background:#19222d!important;
  color:#f1f4f8!important;
  border:1px solid #445164!important;
}
body.siba-dark .bf-ba-link.active,
body.siba-dark .pg-ba.active {
  background:var(--ui-orange)!important;
  color:#fff!important;
  border-color:var(--ui-orange)!important;
}
body.siba-dark .bf-section {
  background:color-mix(in srgb,var(--bf-color,#ff7417) 13%,var(--ui-panel))!important;
  border:1px solid color-mix(in srgb,var(--bf-color,#ff7417) 55%,var(--ui-line))!important;
  border-top:6px solid var(--bf-color,#ff7417)!important;
  box-shadow:0 10px 24px rgba(0,0,0,.18)!important;
}
body.siba-dark .bf-count { background:rgba(255,255,255,.10)!important; color:#fff!important; }
body.siba-dark .bf-table td { background:rgba(18,24,33,.88)!important; color:var(--ui-text)!important; }
body.siba-dark .bf-row-danger td { background:rgba(185,61,72,.25)!important; border-color:rgba(211,74,86,.7)!important; }

body.siba-dark .bf-status.Offen,
body.siba-dark .pg-status.Offen { background:#6a521d!important;color:#fff3c4!important; }
body.siba-dark .bf-status.Freigegeben,
body.siba-dark .pg-status.Freigegeben { background:#1d6b48!important;color:#dcffed!important; }
body.siba-dark .bf-status.Abgelehnt,
body.siba-dark .pg-status.Abgelehnt { background:#9e303b!important;color:#fff!important; }

/* Parkgenehmigungen: Fahrzeugtyp-/BA-Farbe darf nicht neutralisiert werden. */
body.siba-dark .pg-row-vehicle td {
  background:var(--pg-row-color,#202936)!important;
  border-top-color:var(--pg-row-border,#3a4657)!important;
  border-bottom-color:var(--pg-row-border,#3a4657)!important;
  color:#111!important;
}
body.siba-dark .pg-row-vehicle td :where(button,textarea,input,.pg-status) { color:inherit; }
body.siba-dark .pg-row-vehicle .pg-actions button { color:#fff!important; }
body.siba-dark .pg-row-danger td { background:rgba(185,61,72,.32)!important;color:#f7d9dc!important; }

/* Temporäre Genehmigungen – ursprüngliche Zustandsfarben */
body.siba-dark .tpg-row-active td { background:#1f8c52!important;color:#fff!important; }
body.siba-dark .tpg-row-expired td { background:#a93640!important;color:#fff!important; }
body.siba-dark .tpg-row-future td { background:#286b91!important;color:#fff!important; }
body.siba-dark .tpg-empty,.pg-empty,.bf-empty { background:#151e28!important;color:var(--ui-muted)!important;border:1px dashed #3b485a!important; }

/* 4) Reportseiten: vernünftige Filtergrößen, weniger Konturen */
body.siba-dark .report-card > .filter-row {
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr))!important;
  border:0!important;
  background:transparent!important;
  padding:0!important;
}
body.siba-dark .report-card > .filter-row input {
  height:42px!important;
  font-size:12px!important;
  border:1px solid #3a4758!important;
}
body.siba-dark .report-card :where(table,.report-table) { border:0!important; }
body.siba-dark .report-card .empty-row { border:1px dashed #3b485a!important; }

/* 5) Einstellungen / Besucher / Benutzer – markierte Buttons und weiße Zeilen */
body.siba-dark .siba-settings-card { border:1px solid var(--ui-line)!important; }
body.siba-dark .siba-settings-icon { color:#ff9b58!important; background:rgba(255,116,23,.14)!important; }
body.siba-dark .visitor-card,
body.siba-dark .visitor-title,
body.siba-dark .visitor-scan-dialog { border-color:var(--ui-line)!important; background:var(--ui-panel)!important; }
body.siba-dark .visitor-card-button { background:#1b2430!important;color:#ffb078!important;border:1px dashed #ff7417!important; }
body.siba-dark :where(.linked-card,.karten-item,.card-item,.selected-card) {
  background:#1b2430!important;color:var(--ui-text)!important;border:1px solid var(--ui-line)!important;
}
body.siba-dark :where(.card-buttons,.visitor-form-actions,.table-actions,.top-actions) {
  border:0!important;background:transparent!important;
}
body.siba-dark .visitor-save { min-width:170px; }

/* Such-/Aktionsleiste Benutzer und Firmen ohne übermäßige Konturen */
body.siba-dark :where(.user-header,.firmen-header,.visitor-list-head) {
  border:0!important;
  border-bottom:1px solid var(--ui-line)!important;
  border-radius:0!important;
  background:transparent!important;
}

/* Checkboxen im Darkmode sichtbar */
body.siba-dark input[type="checkbox"] { accent-color:var(--ui-orange); }

@media(max-width:900px){
 body.siba-dark :where(.bf-actions,.pg-actions,.tpg-actions){gap:8px!important;}
 body.siba-dark :where(.bf-btn,.pg-btn,.tpg-btn){min-height:38px!important;}
}
}


/* ============================================================
   SIBA Darkmode – weniger verschachtelte Rahmen
   Nur Bildschirm + Darkmode. Lightmode und Drucklayout bleiben unberührt.
   ============================================================ */
@media screen {
:is(body.siba-dark, body.dark, body[data-theme="dark"]) {
    --siba-clean-line:#303844;
    --siba-clean-line-soft:rgba(255,255,255,.08);
}

/* Reine Layout-Hüllen nicht mehr als Karten darstellen. */
:is(body.siba-dark, body.dark, body[data-theme="dark"]) :where(
    main,.main,.content,.content-wrapper,.main-content,.page-content,.page-wrapper,.wrapper,
    .container,.container-fluid,.siba-main,
    .firmen-page,.firma-page,.benutzer-page,.user-page,.besucher-page,
    .rollen-page,.settings-page,.einstellungen-page,.admin-page,
    .berichte-page,.report-page,.zeit-page,.checkins-page,
    .anw-page,.anwesende-page,.live-page,.history-page,.vod-page,
    .firmen-wrap,.firma-wrap,.benutzer-wrap,.user-wrap,.besucher-wrap,
    .rollen-wrap,.settings-wrap,.einstellungen-wrap,.admin-wrap,
    .berichte-wrap,.report-wrap,.zeit-wrap,.checkins-wrap,
    .anw-wrap,.anwesende-wrap,.live-wrap,.history-wrap,.vod-wrap
){border:0!important;outline:0!important;box-shadow:none!important;}

/* Seitentitel und Bereichsüberschriften ohne eigenen Kasten. */
:is(body.siba-dark, body.dark, body[data-theme="dark"]) :where(
    .page-title,.page-header,.page-heading,.title-card,.headline-card,
    .zeit-title,.live-title,.history-title,.berichte-title,.report-title,
    .section-title,.content-title
){border:0!important;outline:0!important;box-shadow:none!important;background:transparent!important;}

/* Große Inhaltskarten ohne zusätzlichen Außenrahmen. */
:is(body.siba-dark, body.dark, body[data-theme="dark"]) :where(
    .content-card,.content-box,.white-box,
    .table-card,.table-box,.list-card,.list-box,.form-card,.form-box,
    .dashboard-page,.dashboard,
    .firmen-card,.firma-card,.benutzer-card,.user-card,.besucher-card,
    .report-card,.bericht-card
){border:0!important;outline:0!important;box-shadow:none!important;}

/* Filter-/Suchbereiche selbst ohne Außenrahmen. */
:is(body.siba-dark, body.dark, body[data-theme="dark"]) :where(
    .filter-grid,.filter-card,.filter-box,.filter-panel,.search-panel,
    .filter-row,.filters,.search-row,.toolbar-filters,.table-filters,.location-filter
){border:0!important;outline:0!important;box-shadow:none!important;background:transparent!important;}

/* Eingabefelder behalten nur einen dezenten eigenen Rahmen. */
:is(body.siba-dark, body.dark, body[data-theme="dark"]) :where(
    input,select,textarea,.form-control,.form-select,.input,.select,.textarea,
    .search-input,.date-input,.filter-input,.select2-selection,.choices__inner
){border-color:#46515f!important;}

/* Tabellen bleiben Hauptcontainer, aber ohne orange Rasteroptik. */
:is(body.siba-dark, body.dark, body[data-theme="dark"]) :where(
    table,.table,.firmen-table,.bf-table,.pg-table,.tpg-table,.zeit-table,.live-table
){border:1px solid var(--siba-clean-line)!important;box-shadow:none!important;}
:is(body.siba-dark, body.dark, body[data-theme="dark"]) :where(
    table th,.table th,.firmen-table th,.bf-table th,.pg-table th,.tpg-table th,.zeit-table th,.live-table th
){border-color:var(--siba-clean-line)!important;}
:is(body.siba-dark, body.dark, body[data-theme="dark"]) :where(
    table td,.table td,.firmen-table td,.bf-table td,.pg-table td,.tpg-table td,.zeit-table td,.live-table td
){border-color:var(--siba-clean-line-soft)!important;}
:is(body.siba-dark, body.dark, body[data-theme="dark"]) :where(
    .table-responsive,.table-wrapper,.table-container,.responsive-table,
    .firmen-table-wrap,.bf-table-wrap,.pg-table-wrap,.tpg-table-wrap
){border:0!important;outline:0!important;box-shadow:none!important;}

/* Sinnvolle Einzelkarten behalten ihren Rahmen. */
:is(body.siba-dark, body.dark, body[data-theme="dark"]) :where(
    .stat-card,.stats-card,.stat-box,.bf-card,.pg-card,.tpg-card,
    .modal-content,.firma-modal,.alert,.message,.notice,.error,.warning,.success
){border-width:1px!important;}

/* Buttons und semantische Aktionsfarben bleiben erhalten. */
:is(body.siba-dark, body.dark, body[data-theme="dark"]) :where(
    button,.btn,.button,.pbtn,.action-btn,.submit-btn,.save-btn,.delete-btn,.edit-btn,
    .orange-btn,.grey-btn,.icon-btn,.bf-btn,.pg-btn,.tpg-btn
){box-shadow:none!important;}

/* Alte globale Inline-Border-Regel nicht mehr pauschal orange. */
:is(body.siba-dark, body.dark, body[data-theme="dark"]) div[style*="border"]{border-color:var(--siba-clean-line)!important;}
}
