/* ===== Dark Theme Globals ===== */
body {
  color: #eaf0ff;
}

/* Bootstrap overrides for dark theme */
.card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px;
  color: #eaf0ff;
}

.card-header {
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid rgba(255,255,255,.06);
  color: #eaf0ff;
}

.card-body { color: #eaf0ff; }

.form-control, .form-select {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: #eaf0ff;
  border-radius: 12px;
}
.form-control:focus, .form-select:focus {
  background: rgba(255,255,255,.08);
  border-color: rgba(79,124,255,.5);
  box-shadow: 0 0 0 3px rgba(79,124,255,.15);
  color: #eaf0ff;
}
.form-control::placeholder { color: rgba(234,240,255,.35); }

.form-label { color: rgba(234,240,255,.65); font-size: 13px; font-weight: 600; }

.table { color: #eaf0ff; --bs-table-bg: transparent; }
.table th { color: rgba(234,240,255,.6); border-color: rgba(255,255,255,.06); }
.table td { border-color: rgba(255,255,255,.04); }
.table-striped > tbody > tr:nth-of-type(odd) > * { background: rgba(255,255,255,.02); }
.table-hover > tbody > tr:hover > * { background: rgba(255,255,255,.05); }

.badge.bg-secondary { background: rgba(255,255,255,.1) !important; color: rgba(234,240,255,.7); }
.badge.bg-info { background: rgba(79,124,255,.2) !important; color: #a5d8ff; }
.badge.bg-success { background: rgba(46,229,157,.15) !important; color: #a7f3d0; }
.badge.bg-warning { background: rgba(245,158,11,.15) !important; color: #fde68a; }

.text-muted { color: rgba(234,240,255,.4) !important; }

a { color: #4f7cff; }
a:hover { color: #6d9bff; }

h1, h2, h3, h4, h5, h6 { color: #eaf0ff; }

.btn-primary { background: linear-gradient(135deg, #2563eb, #4f7cff); border: none; border-radius: 12px; }
.btn-primary:hover { background: linear-gradient(135deg, #3b82f6, #60a5fa); box-shadow: 0 6px 20px rgba(79,124,255,.3); }
.btn-success { background: linear-gradient(135deg, #059669, #2ee59d); border: none; color: #000; border-radius: 12px; }
.btn-success:hover { box-shadow: 0 6px 20px rgba(46,229,157,.3); }
.btn-outline-secondary { border-color: rgba(255,255,255,.12); color: rgba(234,240,255,.65); border-radius: 12px; }
.btn-outline-secondary:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: #eaf0ff; }
.btn-outline-primary { border-color: rgba(79,124,255,.3); color: #4f7cff; border-radius: 12px; }
.btn-outline-primary:hover { background: rgba(79,124,255,.15); color: #a5d8ff; }
.btn-outline-danger { border-color: rgba(255,77,109,.3); color: #ff4d6d; border-radius: 12px; }
.btn-outline-danger:hover { background: rgba(255,77,109,.15); color: #ffd6de; }
.btn-secondary { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); color: #eaf0ff; border-radius: 12px; }
.btn-secondary:hover { background: rgba(255,255,255,.12); }

.btn-sm { border-radius: 10px; }

/* Modal dark */
.modal-content {
  background: #12162a;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  color: #eaf0ff;
}
.modal-header { border-bottom: 1px solid rgba(255,255,255,.06); }
.modal-footer { border-top: 1px solid rgba(255,255,255,.06); }
.modal-title { color: #eaf0ff; }

/* Pagination dark */
.page-link {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  color: #4f7cff;
  border-radius: 10px;
}
.page-link:hover {
  background: rgba(79,124,255,.15);
  color: #a5d8ff;
}
.page-item.active .page-link {
  background: linear-gradient(135deg, #2563eb, #4f7cff);
  border-color: transparent;
}

/* Collapse / accordion */
.collapse .card { background: rgba(255,255,255,.03); }

/* Datalist */
option { background: #12162a; color: #eaf0ff; }

/* ===== Google Places Autocomplete dropdown ===== */
.pac-container{
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.1);
  background: #12162a;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
  margin-top: 4px;
  font-family: inherit;
  z-index: 10500;
}
.pac-item{
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
  border-top: 1px solid rgba(255,255,255,.05);
  color: #eaf0ff;
  background: transparent;
}
.pac-item:first-child{ border-top: none; }
.pac-item:hover{ background: rgba(79,124,255,.12); }
.pac-item-selected{ background: rgba(79,124,255,.18); }
.pac-icon{ display: none; }
.pac-item-query{ font-weight: 600; color: #a5d8ff; }
.pac-matched { color: #4f7cff; }

/* ===== Light Theme Overrides ===== */
/* This single block overrides ALL dark-theme patterns across the entire app. */

body.theme-light { color: #1a1a2e; }

/* --- Bootstrap components --- */
body.theme-light .card {
  background: rgba(255,255,255,.85);
  border-color: rgba(0,0,0,.08);
  color: #1a1a2e;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
body.theme-light .card-header {
  background: rgba(0,0,0,.02);
  border-bottom-color: rgba(0,0,0,.06);
  color: #1a1a2e;
}
body.theme-light .card-body { color: #1a1a2e; }

body.theme-light .form-control,
body.theme-light .form-select {
  background: #fff;
  border-color: rgba(0,0,0,.12);
  color: #1a1a2e;
}
body.theme-light .form-control:focus,
body.theme-light .form-select:focus {
  background: #fff;
  border-color: rgba(79,124,255,.5);
  box-shadow: 0 0 0 3px rgba(79,124,255,.12);
  color: #1a1a2e;
}
body.theme-light .form-control::placeholder { color: rgba(0,0,0,.35); }
body.theme-light .form-label { color: rgba(0,0,0,.6); }

body.theme-light .table { color: #1a1a2e; }
body.theme-light .table th { color: rgba(0,0,0,.55); border-color: rgba(0,0,0,.08); }
body.theme-light .table td { border-color: rgba(0,0,0,.06); color: #1a1a2e; }
body.theme-light .table-striped > tbody > tr:nth-of-type(odd) > * { background: rgba(0,0,0,.02); }
body.theme-light .table-hover > tbody > tr:hover > * { background: rgba(0,0,0,.04); }

body.theme-light .badge.bg-secondary { background: rgba(0,0,0,.06) !important; color: rgba(0,0,0,.6); }
body.theme-light .badge.bg-info { background: rgba(79,124,255,.1) !important; color: #2563eb; }
body.theme-light .badge.bg-success { background: rgba(22,163,74,.1) !important; color: #166534; }
body.theme-light .badge.bg-warning { background: rgba(245,158,11,.1) !important; color: #92400e; }
body.theme-light .badge.bg-danger { background: rgba(220,38,38,.1) !important; color: #991b1b; }

body.theme-light .text-muted { color: rgba(0,0,0,.56) !important; }

body.theme-light a { color: #2563eb; }
body.theme-light a:hover { color: #1d4ed8; }

body.theme-light h1,
body.theme-light h2,
body.theme-light h3,
body.theme-light h4,
body.theme-light h5,
body.theme-light h6 { color: #1a1a2e; }

body.theme-light .btn-outline-secondary { border-color: rgba(0,0,0,.15); color: rgba(0,0,0,.6); }
body.theme-light .btn-outline-secondary:hover { background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.2); color: #1a1a2e; }
body.theme-light .btn-outline-primary { border-color: rgba(79,124,255,.3); color: #2563eb; }
body.theme-light .btn-outline-primary:hover { background: rgba(79,124,255,.08); color: #1d4ed8; }
body.theme-light .btn-outline-danger { border-color: rgba(220,38,38,.3); color: #dc2626; }
body.theme-light .btn-outline-danger:hover { background: rgba(220,38,38,.08); color: #991b1b; }
body.theme-light .btn-secondary { background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.1); color: #1a1a2e; }
body.theme-light .btn-secondary:hover { background: rgba(0,0,0,.08); }

/* Modal light */
body.theme-light .modal-content {
  background: #fff;
  border-color: rgba(0,0,0,.1);
  color: #1a1a2e;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
}
body.theme-light .modal-header { border-bottom-color: rgba(0,0,0,.08); }
body.theme-light .modal-footer { border-top-color: rgba(0,0,0,.08); }
body.theme-light .modal-title { color: #1a1a2e; }

/* Pagination light */
body.theme-light .page-link {
  background: #fff;
  border-color: rgba(0,0,0,.1);
  color: #2563eb;
}
body.theme-light .page-link:hover {
  background: rgba(79,124,255,.06);
  color: #1d4ed8;
}

body.theme-light .collapse .card { background: rgba(0,0,0,.02); }

body.theme-light option { background: #fff !important; color: #1a1a2e !important; }

/* Google Places light */
body.theme-light .pac-container {
  border-color: rgba(0,0,0,.1);
  background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.1);
}
body.theme-light .pac-item {
  border-top-color: rgba(0,0,0,.06);
  color: #1a1a2e;
}
body.theme-light .pac-item:hover { background: rgba(79,124,255,.06); }
body.theme-light .pac-item-selected { background: rgba(79,124,255,.1); }
body.theme-light .pac-item-query { color: #2563eb; }
body.theme-light .pac-matched { color: #1d4ed8; }

/* PDF overlay light */
body.theme-light .pdf-toolbar { background: rgba(255,255,255,.98); border-bottom-color: rgba(0,0,0,.08); }
body.theme-light .pdf-toolbar .pdf-title { color: #1a1a2e; }
body.theme-light .pdf-toolbar .pdf-pg { color: rgba(0,0,0,.5); }
body.theme-light .pdf-toolbar button,
body.theme-light .pdf-toolbar a { background: rgba(0,0,0,.06); color: #1a1a2e; }
body.theme-light .pdf-toolbar button:hover,
body.theme-light .pdf-toolbar a:hover { background: rgba(0,0,0,.1); }

/* --- GENERIC: glassmorphism cards used across all pages --- */
/* Covers: .perm-card, .nav-tile, .mitglied-card, .katalog-block, .dok-section,
   .form-section, .fm-card, .download-card, .tab-panel, .detail-card, etc. */
body.theme-light [class*="-card"],
body.theme-light [class*="-section"],
body.theme-light [class*="-block"],
body.theme-light .tab-panel,
body.theme-light .nav-tile,
body.theme-light .perm-card,
body.theme-light .dok-section,
body.theme-light .form-section,
body.theme-light .fm-card {
  background: rgba(255,255,255,.8) !important;
  border-color: rgba(0,0,0,.08) !important;
  color: #1a1a2e;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
}
/* Die Regel oben trifft auch Kinder wie «bh-card-label» oder «x-section-title»
   — jedes bekam ein eigenes weisses Kästchen samt Schatten. Kinder bleiben
   durchsichtig. */
body.theme-light [class*="-card"] [class*="-card-"],
body.theme-light [class*="-section"] [class*="-section-"],
body.theme-light [class*="-block"] [class*="-block-"] {
  background: transparent !important;
  box-shadow: none !important;
  border-color: transparent !important;
}

/* --- GENERIC: all inputs/textareas/selects in page-specific forms --- */
body.theme-light input[type="text"],
body.theme-light input[type="email"],
body.theme-light input[type="tel"],
body.theme-light input[type="number"],
body.theme-light input[type="password"],
body.theme-light input[type="date"],
body.theme-light input[type="time"],
body.theme-light input[type="url"],
body.theme-light input[type="search"],
body.theme-light input:not([type]),
body.theme-light textarea,
body.theme-light select {
  background: #fff !important;
  border-color: rgba(0,0,0,.12) !important;
  color: #1a1a2e !important;
}
body.theme-light input:focus,
body.theme-light textarea:focus,
body.theme-light select:focus {
  border-color: rgba(79,124,255,.5) !important;
  box-shadow: 0 0 0 3px rgba(79,124,255,.1) !important;
}
body.theme-light input::placeholder,
body.theme-light textarea::placeholder {
  color: rgba(0,0,0,.35) !important;
}

/* --- GENERIC: all labels --- */
body.theme-light label {
  color: rgba(0,0,0,.6);
}

/* --- GENERIC: all gradient text headers --- */
/* Covers: .verw-edit-header h1, .dok-page h1, .firma-page h1, .fm-page h1, etc. */
body.theme-light [class*="-header"] h1,
body.theme-light [class*="-page"] h1 {
  background: linear-gradient(135deg, #1a1a2e, #2563eb) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent;
}

/* --- GENERIC: subtitle / secondary text --- */
body.theme-light .subtitle,
body.theme-light [class*="-subtitle"],
body.theme-light .dok-subtitle,
body.theme-light .fm-subtitle,
body.theme-light .help-text {
  color: rgba(0,0,0,.45) !important;
}

/* --- GENERIC: back links --- */
body.theme-light .back-link {
  color: rgba(0,0,0,.5) !important;
}
body.theme-light .back-link:hover {
  color: #2563eb !important;
}

/* --- GENERIC: search boxes --- */
body.theme-light .search-box,
body.theme-light [class*="search"] input,
body.theme-light [class*="filter"] input,
body.theme-light [class*="filter"] select {
  background: #fff !important;
  border-color: rgba(0,0,0,.1) !important;
  color: #1a1a2e !important;
}

/* --- GENERIC: all table-like custom tables --- */
/* Covers: .dl-table, .mahn-table, .sl-table, .fb-table, .lager-table, .abzuege-table, .pos-table-xl */
body.theme-light [class*="-table"] th,
body.theme-light [class*="-table"] thead {
  color: rgba(0,0,0,.5) !important;
  border-color: rgba(0,0,0,.08) !important;
}
body.theme-light [class*="-table"] td {
  color: #1a1a2e !important;
  border-color: rgba(0,0,0,.06) !important;
}
body.theme-light [class*="-table"] tr:hover td {
  background: rgba(79,124,255,.04) !important;
}
body.theme-light [class*="-table"] input {
  color: #1a1a2e !important;
}

/* --- GENERIC: save/action buttons --- */
body.theme-light .btn-save,
body.theme-light [class*="btn-action"] {
  background: linear-gradient(135deg, rgba(79,124,255,.12), rgba(46,229,157,.08)) !important;
  border-color: rgba(79,124,255,.25) !important;
  color: #2563eb !important;
}
body.theme-light .btn-save:hover,
body.theme-light [class*="btn-action"]:hover {
  background: linear-gradient(135deg, rgba(79,124,255,.2), rgba(46,229,157,.12)) !important;
}
body.theme-light [class*="btn-action"].primary {
  background: linear-gradient(135deg, #2563eb, #4f7cff) !important;
  color: #fff !important;
}

/* --- GENERIC: buttons with dark bg (ba-btn, fm-btn, popup-btn, etc.) --- */
body.theme-light [class*="-btn"]:not(.btn-primary):not(.btn-success):not(.btn-danger):not(.btn-warning):not(.btn-close):not(.pdf-close-btn) {
  color: rgba(0,0,0,.6);
}

/* --- GENERIC: dropdowns, popups, autocomplete results --- */
body.theme-light .tb-dropdown,
body.theme-light .ac-results,
body.theme-light .bar-opt-dropdown,
body.theme-light [class*="-popup"],
body.theme-light [class*="-popup-inner"],
body.theme-light .modal-box,
body.theme-light .fm-ctx,
body.theme-light .fm-upload-box {
  background: rgba(255,255,255,.98) !important;
  border-color: rgba(0,0,0,.1) !important;
  box-shadow: 0 12px 40px rgba(0,0,0,.12) !important;
  color: #1a1a2e !important;
}
body.theme-light .tb-item,
body.theme-light .ac-item,
body.theme-light .bar-opt-item,
body.theme-light .fm-ctx-item,
body.theme-light [class*="popup-field"] {
  color: #1a1a2e !important;
}
body.theme-light .tb-item:hover,
body.theme-light .ac-item:hover,
body.theme-light .bar-opt-item:hover,
body.theme-light .fm-ctx-item:hover {
  background: rgba(79,124,255,.08) !important;
}
body.theme-light .ac-selected {
  background: rgba(79,124,255,.06) !important;
}

/* --- Dokumente tabs --- */
body.theme-light .dok-tab,
body.theme-light [class*="im-tab"] {
  background: rgba(0,0,0,.03) !important;
  color: rgba(0,0,0,.5) !important;
}
body.theme-light .dok-tab.active,
body.theme-light [class*="im-tab"].active {
  background: rgba(79,124,255,.1) !important;
  color: #2563eb !important;
}

/* --- Dokumente field labels --- */
body.theme-light .dok-field label,
body.theme-light [class*="field-group"] label,
body.theme-light [class*="form-group"] label,
body.theme-light .pattern-section label {
  color: rgba(0,0,0,.5) !important;
}

/* --- Dokumente position rows --- */
body.theme-light .pos-titel-row { background: rgba(79,124,255,.06) !important; }
body.theme-light .pos-untertitel-row { background: rgba(46,229,157,.05) !important; }
body.theme-light .pos-textpos-row { background: rgba(0,0,0,.01) !important; }
body.theme-light .pos-alternativ-row { background: rgba(255,165,0,.04) !important; }
body.theme-light .pos-zuschlag-row { background: rgba(147,130,255,.04) !important; }
body.theme-light .pos-row-selected { background: rgba(79,124,255,.08) !important; }

/* --- Tabellenansicht (pos-table-xl) --- */
body.theme-light .pos-table-xl th {
  background: rgba(240,242,245,.98) !important;
  color: rgba(0,0,0,.5) !important;
  border-bottom-color: rgba(0,0,0,.1) !important;
}
body.theme-light .pos-table-xl td { color: #1a1a2e !important; }
body.theme-light .pos-table-xl input,
body.theme-light .pos-table-xl select {
  color: #1a1a2e !important;
}
body.theme-light .pos-table-xl input:hover,
body.theme-light .pos-table-xl select:hover {
  border-color: rgba(0,0,0,.12) !important;
}
body.theme-light .pos-table-xl input:focus,
body.theme-light .pos-table-xl select:focus {
  border-color: rgba(79,124,255,.4) !important;
  background: rgba(79,124,255,.04) !important;
}
body.theme-light .pos-table-xl select option {
  background: #fff !important;
  color: #1a1a2e !important;
}
body.theme-light .pos-table-xl .readonly-cell {
  color: rgba(0,0,0,.45) !important;
}
body.theme-light .cx-eh select {
  color: #1a1a2e !important;
}
body.theme-light .cx-eh select:hover { border-color: rgba(0,0,0,.12) !important; }
body.theme-light .cx-eh select:focus { border-color: rgba(79,124,255,.4) !important; background: rgba(79,124,255,.04) !important; }
body.theme-light .cx-eh select option { background: #fff !important; color: #1a1a2e !important; }

/* --- Arbeitsplatz (fullscreen) --- */
body.theme-light .dok-page.arbeitsplatz {
  background: #f0f2f5 !important;
}
body.theme-light .arbeitsplatz-btn {
  background: rgba(0,0,0,.04) !important;
  border-color: rgba(0,0,0,.08) !important;
  color: rgba(0,0,0,.45) !important;
}
body.theme-light .arbeitsplatz-btn:hover {
  background: rgba(79,124,255,.1) !important;
  color: #2563eb !important;
  border-color: rgba(79,124,255,.2) !important;
}

/* --- Bottom bar (Dokumente) --- */
body.theme-light .bottom-bar,
body.theme-light [class*="bottom-bar"] {
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(240,242,245,.98)) !important;
  border-top: 1px solid rgba(0,0,0,.08) !important;
}
body.theme-light .bt-label { color: rgba(0,0,0,.4) !important; }
body.theme-light .bt-val { color: rgba(0,0,0,.7) !important; }
body.theme-light .bt-brutto .bt-val { color: #059669 !important; }
body.theme-light .ba-btn {
  background: rgba(0,0,0,.04) !important;
  color: rgba(0,0,0,.6) !important;
}
body.theme-light .ba-btn:hover { background: rgba(79,124,255,.08) !important; }
body.theme-light .ba-save { color: #059669 !important; }

/* --- Status badges (Dokumente) --- */
body.theme-light [class*="status-ENTWURF"] { background: rgba(100,116,139,.1) !important; color: #475569 !important; }
body.theme-light [class*="status-GESENDET"] { background: rgba(79,124,255,.1) !important; color: #2563eb !important; }
body.theme-light [class*="status-BEZAHLT"] { background: rgba(22,163,74,.1) !important; color: #166534 !important; }
body.theme-light [class*="status-STORNIERT"] { background: rgba(220,38,38,.1) !important; color: #991b1b !important; }
body.theme-light .bezahlt-ja { background: rgba(22,163,74,.08) !important; color: #166534 !important; }
body.theme-light .bezahlt-nein { background: rgba(220,38,38,.06) !important; color: #991b1b !important; }
body.theme-light .storno-info { background: rgba(255,165,0,.08) !important; color: #92400e !important; }

/* --- Verwaltung tiles & cards --- */
body.theme-light .nav-tile {
  background: rgba(255,255,255,.8) !important;
  color: #1a1a2e !important;
}
body.theme-light .nav-tile:hover { border-color: rgba(79,124,255,.3) !important; }
body.theme-light .nav-tile.active { background: rgba(79,124,255,.06) !important; }
body.theme-light .nav-tile-desc { color: rgba(0,0,0,.4) !important; }
body.theme-light .section-title { color: rgba(0,0,0,.6) !important; }

body.theme-light .mitglied-card {
  background: rgba(255,255,255,.8) !important;
  color: #1a1a2e !important;
}
body.theme-light .mitglied-card:hover { background: rgba(79,124,255,.06) !important; }
body.theme-light .mitglied-meta { color: rgba(0,0,0,.45) !important; }
body.theme-light .edit-icon { color: rgba(0,0,0,.3) !important; }

/* --- Toggle switches light --- */
body.theme-light .toggle-slider { background: rgba(220,38,38,.15) !important; }
body.theme-light .toggle-switch input:checked + .toggle-slider { background: rgba(22,163,74,.2) !important; }
body.theme-light .toggle-label { color: rgba(0,0,0,.7) !important; }
body.theme-light .admin-notice { background: rgba(168,85,247,.06) !important; color: #7c3aed !important; }

/* --- Dateimanager --- */
body.theme-light .fm-btn {
  background: rgba(0,0,0,.04) !important;
  color: rgba(0,0,0,.6) !important;
}
body.theme-light .fm-header { color: rgba(0,0,0,.4) !important; }
body.theme-light .fm-row:hover { background: rgba(79,124,255,.04) !important; }
body.theme-light .fm-name { color: #1a1a2e !important; }
body.theme-light .fm-size,
body.theme-light .fm-date { color: rgba(0,0,0,.4) !important; }
body.theme-light .fm-empty { color: rgba(0,0,0,.3) !important; }
body.theme-light .fm-drop-zone { color: rgba(0,0,0,.4) !important; }
body.theme-light .fm-drop-zone.hover { background: rgba(79,124,255,.04) !important; color: #2563eb !important; }
body.theme-light .fm-act-btn:hover { background: rgba(79,124,255,.1) !important; color: #2563eb !important; }

/* --- Breadcrumbs --- */
body.theme-light .fm-bc,
body.theme-light [class*="-bc"] { color: rgba(0,0,0,.5) !important; }

/* --- Import modal steps --- */
body.theme-light .imp-stepper .step-dot { background: rgba(0,0,0,.05) !important; color: rgba(0,0,0,.4) !important; }
body.theme-light .imp-stepper .step-dot.done { background: rgba(22,163,74,.1) !important; color: #166534 !important; }
body.theme-light .imp-stepper .step-dot.current { background: rgba(79,124,255,.15) !important; color: #2563eb !important; }
body.theme-light .imp-source-btn { background: rgba(0,0,0,.03) !important; color: #1a1a2e !important; }
body.theme-light [class*="imp-"] [class*="-item"]:hover { background: rgba(79,124,255,.06) !important; }

/* --- Rechnungen/Dokumente list --- */
body.theme-light .dl-nummer,
body.theme-light [class*="dc-nr"] { color: #2563eb !important; }
body.theme-light .dl-actions-cell a:hover { background: rgba(79,124,255,.08) !important; color: #2563eb !important; }
body.theme-light [class*="dl-typ-gutschrift"] { background: rgba(255,165,0,.08) !important; color: #92400e !important; }
body.theme-light [class*="dl-typ-storno"] { background: rgba(220,38,38,.08) !important; color: #991b1b !important; }
body.theme-light [class*="-card"]:hover,
body.theme-light [class*="dl-card"]:hover { border-color: rgba(79,124,255,.2) !important; }
body.theme-light .pagination-bar .current { background: rgba(79,124,255,.15) !important; color: #2563eb !important; }

/* --- Arbeitschein wizard fields --- */
body.theme-light [class*="wizard-"] input,
body.theme-light [class*="as-field"],
body.theme-light [class*="ase-field"] {
  background: #fff !important;
  color: #1a1a2e !important;
}

/* --- Messenger --- */
body.theme-light .messenger-wrap {
  background: rgba(255,255,255,.85) !important;
  border-color: rgba(0,0,0,.1) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.08) !important;
}
body.theme-light .msg-sidebar {
  border-right-color: rgba(0,0,0,.08) !important;
}
body.theme-light .msg-sidebar-header {
  border-bottom-color: rgba(0,0,0,.08) !important;
}
body.theme-light .msg-sidebar-header h5 { color: #1a1a2e !important; }
body.theme-light .msg-search {
  background: rgba(0,0,0,.04) !important;
  border-color: rgba(0,0,0,.1) !important;
  color: #1a1a2e !important;
}
body.theme-light .msg-search:focus {
  background: rgba(0,0,0,.06) !important;
  border-color: rgba(79,124,255,.4) !important;
}
body.theme-light .msg-search::placeholder { color: rgba(0,0,0,.35) !important; }
body.theme-light .msg-conv-item {
  border-bottom-color: rgba(0,0,0,.04) !important;
}
body.theme-light .msg-conv-item:hover { background: rgba(0,0,0,.03) !important; }
body.theme-light .msg-conv-item.active { background: rgba(79,124,255,.1) !important; }
body.theme-light .msg-conv-name { color: #1a1a2e !important; }
body.theme-light .msg-conv-preview { color: rgba(0,0,0,.45) !important; }
body.theme-light .msg-conv-time { color: rgba(0,0,0,.35) !important; }
body.theme-light .msg-main-header {
  border-bottom-color: rgba(0,0,0,.08) !important;
  color: #1a1a2e !important;
}
body.theme-light .msg-main-header .back-btn { color: rgba(0,0,0,.5) !important; }
body.theme-light .msg-empty { color: rgba(0,0,0,.3) !important; }
body.theme-light .msg-bubble.own {
  background: linear-gradient(135deg, rgba(79,124,255,.15), rgba(79,124,255,.08)) !important;
  border-color: rgba(79,124,255,.2) !important;
  color: #1a1a2e !important;
}
body.theme-light .msg-bubble.other {
  background: rgba(0,0,0,.04) !important;
  border-color: rgba(0,0,0,.06) !important;
  color: #1a1a2e !important;
}
body.theme-light .msg-bubble-sender { color: #2563eb !important; }
body.theme-light .msg-bubble-time { color: rgba(0,0,0,.3) !important; }
body.theme-light .msg-input-area {
  border-top-color: rgba(0,0,0,.08) !important;
}
body.theme-light .msg-input-area textarea {
  background: rgba(0,0,0,.04) !important;
  border-color: rgba(0,0,0,.1) !important;
  color: #1a1a2e !important;
}
body.theme-light .msg-input-area textarea:focus {
  background: rgba(0,0,0,.06) !important;
  border-color: rgba(79,124,255,.4) !important;
}
body.theme-light .msg-input-area textarea::placeholder { color: rgba(0,0,0,.3) !important; }
body.theme-light .btn-new-conv {
  background: rgba(79,124,255,.1) !important;
  border-color: rgba(79,124,255,.2) !important;
  color: #2563eb !important;
}
body.theme-light .btn-new-conv:hover {
  background: rgba(79,124,255,.18) !important;
  color: #1d4ed8 !important;
}
body.theme-light .btn-glass {
  background: rgba(0,0,0,.04) !important;
  border-color: rgba(0,0,0,.1) !important;
  color: rgba(0,0,0,.6) !important;
}
body.theme-light .btn-glass:hover {
  background: rgba(0,0,0,.08) !important;
  color: #1a1a2e !important;
}
body.theme-light .glass-modal {
  background: rgba(255,255,255,.98) !important;
  border-color: rgba(0,0,0,.1) !important;
  color: #1a1a2e !important;
}
body.theme-light .glass-modal .modal-header { border-bottom-color: rgba(0,0,0,.08) !important; }
body.theme-light .glass-modal .modal-footer { border-top-color: rgba(0,0,0,.08) !important; }
body.theme-light .glass-modal .btn-close { filter: none !important; }
body.theme-light .glass-modal .form-control,
body.theme-light .glass-modal .form-select {
  background: #fff !important;
  border-color: rgba(0,0,0,.12) !important;
  color: #1a1a2e !important;
}
body.theme-light .glass-modal .form-control:focus,
body.theme-light .glass-modal .form-select:focus {
  background: #fff !important;
  border-color: rgba(79,124,255,.5) !important;
  color: #1a1a2e !important;
}
body.theme-light .glass-modal .form-label { color: rgba(0,0,0,.6) !important; }
body.theme-light .glass-modal .form-check-input {
  background-color: rgba(0,0,0,.06) !important;
  border-color: rgba(0,0,0,.15) !important;
}
body.theme-light .glass-modal .form-check-label { color: rgba(0,0,0,.6) !important; }

/* --- Tab bar (tabs.css overrides) --- */
body.theme-light .tab-bar {
  background: rgba(255,255,255,.85) !important;
  border-bottom-color: rgba(0,0,0,.08) !important;
}
body.theme-light .tab-item {
  background: rgba(0,0,0,.03) !important;
  border-color: rgba(0,0,0,.04) !important;
  color: rgba(0,0,0,.5) !important;
}
body.theme-light .tab-item:hover {
  background: rgba(0,0,0,.06) !important;
  color: rgba(0,0,0,.75) !important;
}
body.theme-light .tab-item.active {
  background: rgba(79,124,255,.1) !important;
  border-color: rgba(79,124,255,.15) !important;
  color: #1a1a2e !important;
}
body.theme-light .tab-item .tab-close {
  color: rgba(0,0,0,.3) !important;
}
body.theme-light .tab-item .tab-close:hover {
  background: rgba(220,38,38,.1) !important;
  color: #dc2626 !important;
}
body.theme-light .tab-bar-btn {
  color: rgba(0,0,0,.4) !important;
}
body.theme-light .tab-bar-btn:hover {
  background: rgba(0,0,0,.06) !important;
  color: #1a1a2e !important;
}
body.theme-light .tab-container iframe {
  background: #f0f2f5 !important;
}

/* --- Scrollbars --- */
body.theme-light ::-webkit-scrollbar-thumb { background: rgba(0,0,0,.12) !important; }
body.theme-light * { scrollbar-color: rgba(0,0,0,.12) transparent; }

/* --- Chart.js tooltip fix --- */
body.theme-light .chartjs-tooltip { background: rgba(255,255,255,.95) !important; color: #1a1a2e !important; }

/* --- Generic: elements with explicit dark text/bg colors --- */
body.theme-light [style*="color: #eaf0ff"],
body.theme-light [style*="color:#eaf0ff"] { color: #1a1a2e !important; }

/* --- Download page --- */
body.theme-light .version-badge { background: rgba(79,124,255,.08) !important; color: #2563eb !important; }
body.theme-light .download-info { color: rgba(0,0,0,.4) !important; }
body.theme-light .no-download { color: rgba(0,0,0,.4) !important; }
body.theme-light .feature { background: rgba(0,0,0,.02) !important; color: rgba(0,0,0,.6) !important; }

/* --- Beleg tree (Dokumente Vorschau) --- */
body.theme-light .tree-node:hover { background: rgba(79,124,255,.06) !important; }
body.theme-light .preview-placeholder { background: rgba(0,0,0,.02) !important; color: rgba(0,0,0,.3) !important; }

/* --- Chevrons and meta text --- */
body.theme-light .chevron { color: rgba(0,0,0,.25) !important; }
body.theme-light [class*="-meta"] { color: rgba(0,0,0,.45) !important; }

/* --- Stundenliste / Fahrtenbuch / Auswertung --- */
body.theme-light .sl-page,
body.theme-light .fb-page,
body.theme-light .auswertung { color: #1a1a2e; }

body.theme-light .sl-subtitle,
body.theme-light .fb-subtitle { color: rgba(0,0,0,.45) !important; }

/* Stat cards */
body.theme-light .stat-card {
  background: linear-gradient(165deg, rgba(0,0,0,.02), rgba(0,0,0,.04)) !important;
  border-color: rgba(0,0,0,.08) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
body.theme-light .stat-val { color: #1a1a2e !important; }
body.theme-light .stat-label { color: rgba(0,0,0,.45) !important; }

/* Detail cards */
body.theme-light .detail-card {
  background: rgba(255,255,255,.8) !important;
  border-color: rgba(0,0,0,.08) !important;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
}
body.theme-light .detail-card h5 { color: rgba(0,0,0,.55) !important; }

/* Filter row */
body.theme-light .filter-row label { color: rgba(0,0,0,.5) !important; }
body.theme-light .btn-reset {
  background: rgba(0,0,0,.04) !important;
  border-color: rgba(0,0,0,.1) !important;
  color: rgba(0,0,0,.6) !important;
}
body.theme-light .btn-reset:hover {
  background: rgba(0,0,0,.08) !important;
  color: #1a1a2e !important;
}

/* Project bars */
body.theme-light .proj-bar-name { color: rgba(0,0,0,.6) !important; }
body.theme-light .proj-bar-track { background: rgba(0,0,0,.04) !important; }
body.theme-light .proj-bar-fill { background: linear-gradient(90deg, rgba(79,124,255,.5), rgba(46,229,157,.5)) !important; }
body.theme-light .proj-bar-val { color: rgba(0,0,0,.5) !important; }

/* Timesheet form rows */
body.theme-light .ts-row {
  background: rgba(0,0,0,.02) !important;
}
body.theme-light .ts-row label { color: rgba(0,0,0,.45) !important; }
body.theme-light .ts-summary span { color: rgba(0,0,0,.5) !important; }
body.theme-light .ts-summary strong { color: #1a1a2e !important; }
body.theme-light .btn-add-row {
  background: rgba(0,0,0,.04) !important;
  border-color: rgba(0,0,0,.1) !important;
  color: #1a1a2e !important;
}
body.theme-light .btn-add-row:hover { background: rgba(0,0,0,.08) !important; }

/* SL Table */
body.theme-light .sl-table th {
  color: rgba(0,0,0,.45) !important;
  border-bottom-color: rgba(0,0,0,.08) !important;
}
body.theme-light .sl-table td {
  color: #1a1a2e !important;
  border-bottom-color: rgba(0,0,0,.06) !important;
}
body.theme-light .sl-table tr:hover td { background: rgba(79,124,255,.04) !important; }

/* Type badges (light) */
body.theme-light .type-badge.work     { background: rgba(37,99,235,.1) !important; color: #2563eb !important; }
body.theme-light .type-badge.vacation { background: rgba(168,85,247,.1) !important; color: #7c3aed !important; }
body.theme-light .type-badge.sick     { background: rgba(239,68,68,.1) !important; color: #dc2626 !important; }
body.theme-light .type-badge.comp     { background: rgba(245,158,11,.1) !important; color: #b45309 !important; }

/* Mobile cards */
body.theme-light .me-card {
  background: rgba(0,0,0,.02) !important;
  border-color: rgba(0,0,0,.06) !important;
}
body.theme-light .me-card-date { color: #1a1a2e !important; }
body.theme-light .me-card-grid .lbl { color: rgba(0,0,0,.4) !important; }
body.theme-light .me-card-grid .val { color: rgba(0,0,0,.7) !important; }

/* Chart helper text */
body.theme-light .detail-card [style*="color:rgba(234,240,255"] { color: rgba(0,0,0,.35) !important; }

/* Nav links (Stundenliste/Fahrtenbuch) */
body.theme-light .sl-nav-link {
  background: rgba(0,0,0,.04) !important;
  border-color: rgba(0,0,0,.08) !important;
  color: rgba(0,0,0,.55) !important;
}
body.theme-light .sl-nav-link:hover {
  background: rgba(0,0,0,.08) !important;
  color: #1a1a2e !important;
}
body.theme-light .sl-nav-link.active {
  background: rgba(79,124,255,.1) !important;
  border-color: rgba(79,124,255,.25) !important;
  color: #2563eb !important;
}
body.theme-light .fb-links a {
  background: rgba(0,0,0,.04) !important;
  border-color: rgba(0,0,0,.08) !important;
  color: rgba(0,0,0,.55) !important;
}
body.theme-light .fb-links a:hover {
  background: rgba(79,124,255,.08) !important;
  color: #2563eb !important;
}
body.theme-light .fb-links a.active {
  background: rgba(79,124,255,.1) !important;
  border-color: rgba(79,124,255,.25) !important;
  color: #2563eb !important;
}

/* Manager label in form */
body.theme-light .detail-card label[style*="color:rgba(234,240,255"] { color: rgba(0,0,0,.5) !important; }

/* Fahrtenbuch table */
body.theme-light .fb-table th {
  color: rgba(0,0,0,.45) !important;
  border-bottom-color: rgba(0,0,0,.08) !important;
}
body.theme-light .fb-table td {
  color: #1a1a2e !important;
  border-bottom-color: rgba(0,0,0,.06) !important;
}
body.theme-light .fb-table tr:hover td { background: rgba(79,124,255,.04) !important; }

/* Fahrtenbuch form rows */
body.theme-light .fb-row {
  background: rgba(0,0,0,.02) !important;
}
body.theme-light .fb-row label { color: rgba(0,0,0,.45) !important; }
body.theme-light .fb-subtitle { color: rgba(0,0,0,.45) !important; }

/* Stunden Auswertung */
body.theme-light .summary-card {
  background: rgba(255,255,255,.8) !important;
  border-color: rgba(0,0,0,.08) !important;
}
body.theme-light .summary-card .sv { color: #1a1a2e !important; }
body.theme-light .summary-card .sl { color: rgba(0,0,0,.45) !important; }
body.theme-light .matrix-table thead th {
  color: rgba(0,0,0,.45) !important;
  border-color: rgba(0,0,0,.08) !important;
  background: rgba(0,0,0,.02) !important;
}
body.theme-light .matrix-table tbody td {
  color: #1a1a2e !important;
  border-color: rgba(0,0,0,.04) !important;
}
body.theme-light .matrix-table tbody td.name { color: #1a1a2e !important; }
body.theme-light .matrix-table tbody tr:hover td { background: rgba(79,124,255,.04) !important; }
body.theme-light .matrix-table tfoot td { border-color: rgba(0,0,0,.15) !important; }
body.theme-light .badge-vac { background: rgba(245,158,11,.1) !important; color: #b45309 !important; }
body.theme-light .badge-sick { background: rgba(239,68,68,.1) !important; color: #dc2626 !important; }
body.theme-light .btn-csv { background: linear-gradient(135deg, #22c55e, #14b8a6) !important; color: #fff !important; }

/* Collapse toggle */
body.theme-light .collapse-toggle { color: rgba(0,0,0,.55) !important; }

/* --- Empty states --- */
body.theme-light [class*="-empty"],
body.theme-light .empty-state { color: rgba(0,0,0,.35) !important; }

/* --- Rolle badges --- */
body.theme-light .rolle-badge { color: #fff !important; }

/* --- Abzuege (Rechnung) --- */
body.theme-light .abzug-del-btn { color: #dc2626 !important; }
body.theme-light .abzug-add-btn { background: rgba(79,124,255,.06) !important; color: #2563eb !important; }

/* --- btn-icon --- */
body.theme-light [class*="btn-icon"] {
  background: rgba(0,0,0,.04) !important;
  color: rgba(0,0,0,.5) !important;
}
body.theme-light [class*="btn-icon"]:hover {
  background: rgba(79,124,255,.08) !important;
  color: #2563eb !important;
}

/* --- Popup overlay backgrounds --- */
body.theme-light .pos-popup { background: rgba(0,0,0,.3) !important; }

/* --- Lieferant filter, Textbaustein button --- */
body.theme-light .tb-btn { color: #2563eb !important; }

/* --- Aufmass result --- */
body.theme-light .aufmass-result { color: #059669 !important; }

/* --- Datumsfelder: am Tablet liefen sie aus ihrer Spalte heraus und die
   Werte standen rechts, während daneben jedes andere Feld links beginnt.
   iOS gibt <input type=date> eine eigene Mindestbreite und richtet den
   Wert selbst aus; beides hier abstellen, damit ein Datum aussieht wie
   ein Textfeld. --- */
input[type="date"], input[type="time"],
input[type="datetime-local"], input[type="month"], input[type="week"] {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
@supports (-webkit-touch-callout: none) {
  input[type="date"], input[type="time"],
  input[type="datetime-local"], input[type="month"], input[type="week"] {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    text-align: left;
    min-height: 34px;
    line-height: 1.35;
  }
  /* Ohne Wert zeigt iOS nichts an — das Feld sah aus wie ein leerer Balken. */
  input[type="date"]:not(:focus):invalid::-webkit-datetime-edit,
  input[type="date"][value=""]::-webkit-datetime-edit { color: rgba(234,240,255,.35); }
}

/* --- Diagramme liefen am Tablet aus ihrer Spalte: eine 1fr-Spalte ist
   minmax(auto,1fr) und schrumpft nicht unter die Mindestbreite ihres
   Inhalts. Bei zwei Diagrammen nebeneinander gibt die Legende — eine
   Flex-Zeile aus sieben Einträgen — diese Mindestbreite vor, und beides
   zusammen war breiter als der Bildschirm. --- */
canvas { max-width: 100%; }
.chart-wrap, .chart-card { min-width: 0; }
.chart-legend { flex-wrap: wrap; }

/* --- Helles Design: Bootstrap-Knöpfe für dunklen Grund --- */
body.theme-light .btn-outline-light { border-color: rgba(0,0,0,.15); color: rgba(26,26,46,.75); }
body.theme-light .btn-outline-light:hover { background: rgba(0,0,0,.05); color: #1a1a2e; }
body.theme-light .btn-light { background: #fff; border-color: rgba(0,0,0,.12); color: #1a1a2e; }
