/* =========================================
   S7 2.0 - DESIGN SYSTEM (GLOBAL)
   ========================================= */

:root {
  /* --- CORES DA MARCA (SEVEN) --- */
  --brand-navy: #01306b;
  --brand-blue: #0070cf;
  --brand-mint: #6de3b2;
  --brand-danger: #dc3545;

  /* --- LAYOUT --- */
  --sb-width: 260px;
  --sb-width-collapsed: 80px;

  /* --- UI (Light Mode Defaults) --- */
  --filter-bg: #f8f9fa;
  --card-radius: 12px;
  --body-bg: #f4f6f9;
  --surface: #ffffff;
  --surface-raised: #f8f9fa;
  --border-color: #e9ecef;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --hover-bg: #f0f7ff;
}

/* =========================================
   1. ESTRUTURA E LAYOUT
   ========================================= */
body {
  background-color: var(--body-bg);
  font-family: "Inter", sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

.main-content {
  min-height: 100vh;
}

/* =========================================
   2. COMPONENTES DE UI
   ========================================= */

.text-brand-navy { color: var(--brand-navy) !important; }
.bg-brand-navy { background-color: var(--brand-navy) !important; }
.text-brand-primary { color: var(--brand-blue) !important; }

.btn-primary {
  background-color: var(--brand-blue);
  border-color: var(--brand-blue);
  font-weight: 500;
  padding: 8px 20px;
  border-radius: 8px;
}
.btn-primary:hover {
  background-color: var(--brand-navy);
  border-color: var(--brand-navy);
}

.req {
  color: var(--brand-danger);
  margin-left: 2px;
  font-weight: bold;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

.nav-tabs .nav-link {
  color: #888;
  font-size: 0.9rem;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 12px 15px;
}
.nav-tabs .nav-link.active {
  color: #1f2937;
  font-weight: 700;
  border-bottom: 2px solid var(--brand-blue);
  background: transparent;
}

.filter-box {
  background-color: var(--filter-bg);
  border: 1px solid #e9ecef;
  padding: 1.5rem;
  border-radius: var(--card-radius);
}
.filter-box label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #6c757d;
}
.filter-box .form-control,
.filter-box .form-select {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}
.filter-box .form-control:focus,
.filter-box .form-select:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 0.15rem rgba(0, 112, 207, 0.1);
}
/* Light mode — softer input borders globally */
.form-control, .form-select {
  border-color: #e2e8f0;
}
.form-control:focus, .form-select:focus {
  box-shadow: 0 0 0 0.15rem rgba(0, 112, 207, 0.1);
}

/* =========================================
   3. TABELAS
   ========================================= */
.sort-header { cursor: pointer; user-select: none; }
.sort-header:hover { background-color: #f1f3f5; }
.sort-icon { font-size: 0.8em; margin-left: 5px; color: #adb5bd; }
.sort-header:hover .sort-icon { color: var(--brand-blue); }

.linha-tabela { cursor: pointer; transition: background-color 0.1s; }
.linha-tabela:hover { background-color: #f0f7ff !important; }

.card-footer {
  background-color: #fff;
  border-top: 1px solid #efefef;
  padding: 1rem 1.5rem;
  border-bottom-left-radius: var(--card-radius) !important;
  border-bottom-right-radius: var(--card-radius) !important;
}

.form-check-input:checked {
  background-color: var(--brand-blue);
  border-color: var(--brand-blue);
}

/* =========================================
   4. BARRA DE AÇÃO EM MASSA (FLUTUANTE)
   ========================================= */
.bulk-actions-bar {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(150%);
  background: #ffffff;
  padding: 12px 25px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid #e9ecef;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-width: 400px;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.bulk-actions-bar.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.bulk-actions-bar .vr {
  height: 20px;
  width: 1px;
  background-color: #dee2e6;
  margin: 0 10px;
}

/* =========================================
   5. ANIMAÇÃO DE CARREGAMENTO
   ========================================= */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.spin-loading { animation: spin 1s linear infinite; }

.modal-content {
  border: none;
  border-radius: var(--card-radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
.modal-header {
  border-bottom: 1px solid #f0f0f0;
  padding: 1.2rem 1.5rem;
}

/* =========================================
   DARK MODE
   ========================================= */

/* --- Variáveis Dark (override :root) --- */
[data-theme="dark"] {
  --brand-navy: #93c5fd;
  --brand-blue: #4da6ff;
  --body-bg: #111827;
  --filter-bg: #1f2937;
  --surface: #1f2937;
  --surface-raised: #283548;
  --border-color: #374151;
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --hover-bg: rgba(77, 166, 255, 0.08);
  color-scheme: dark;
}

/* --- Body & Main Content (NUCLEAR - hardcoded) --- */
[data-theme="dark"] body {
  background-color: #111827 !important;
  color: #f3f4f6 !important;
}
[data-theme="dark"] .main-content {
  background-color: #111827 !important;
  color: #f3f4f6;
}

/* --- Cards & Bootstrap Containers --- */
[data-theme="dark"] .card,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .offcanvas {
  background: #1f2937 !important;
  border-color: rgba(255,255,255,0.06) !important;
  color: #f3f4f6;
}
[data-theme="dark"] .card-header {
  background: #283548 !important;
  border-color: #374151 !important;
  color: #f3f4f6;
}
[data-theme="dark"] .card-footer {
  background: #1f2937 !important;
  border-color: #374151 !important;
  color: #f3f4f6;
}
[data-theme="dark"] .card-body { color: #f3f4f6; }

/* --- Tables --- */
[data-theme="dark"] .table {
  --bs-table-bg: #1f2937;
  --bs-table-color: #f3f4f6;
  --bs-table-border-color: #374151;
}
[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-bg-type: #283548;
}
[data-theme="dark"] .table thead th {
  background: #283548 !important;
  color: #9ca3af !important;
  border-color: #374151 !important;
}
[data-theme="dark"] .table td,
[data-theme="dark"] .table th {
  border-color: #374151 !important;
}
[data-theme="dark"] .linha-tabela:hover,
[data-theme="dark"] .sort-header:hover,
[data-theme="dark"] .sortable-header:hover,
[data-theme="dark"] .linha-pai:hover {
  background-color: #283548 !important;
}

/* --- Forms & Inputs --- */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  background-color: transparent !important;
  border-color: rgba(255,255,255,0.12) !important;
  color: #f3f4f6 !important;
}
[data-theme="dark"] .form-control::placeholder { color: #5a6577; }
[data-theme="dark"] .form-control:disabled,
[data-theme="dark"] .form-control[readonly],
[data-theme="dark"] .form-select:disabled {
  background-color: rgba(255,255,255,0.03) !important;
  color: #6b7280 !important;
}
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
  border-color: rgba(77, 166, 255, 0.5) !important;
  box-shadow: 0 0 0 0.15rem rgba(77, 166, 255, 0.1) !important;
}
[data-theme="dark"] .form-label { color: #9ca3af !important; }
[data-theme="dark"] .form-check-label { color: #f3f4f6; }
[data-theme="dark"] .input-group-text {
  background-color: transparent !important;
  border-color: rgba(255,255,255,0.12) !important;
  color: #7a8a9e !important;
}

/* --- Filter Box --- */
[data-theme="dark"] .filter-box {
  background-color: #1f2937 !important;
  border-color: rgba(255,255,255,0.08) !important;
}
[data-theme="dark"] .filter-box label { color: #9ca3af !important; }

/* --- Dropdowns --- */
[data-theme="dark"] .dropdown-menu {
  background: #1f2937 !important;
  border-color: #374151 !important;
}
[data-theme="dark"] .dropdown-item { color: #f3f4f6 !important; }
[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
  background: #283548 !important;
}
[data-theme="dark"] .dropdown-divider { border-color: #374151; }

/* --- Modals --- */
[data-theme="dark"] .modal-header { border-color: #374151 !important; }
[data-theme="dark"] .modal-footer { border-color: rgba(255,255,255,0.06) !important; background: #1f2937 !important; }
[data-theme="dark"] .modal-body { color: #f3f4f6; }
[data-theme="dark"] .modal-body.bg-light { background: #1f2937 !important; }
[data-theme="dark"] .modal-title { color: #f3f4f6 !important; }
[data-theme="dark"] .modal-content .tab-content.bg-white { background: #1f2937 !important; border-color: rgba(255,255,255,0.06) !important; box-shadow: none !important; }
[data-theme="dark"] .modal-content .nav-tabs { border-color: rgba(255,255,255,0.06) !important; }
/* Modal forms — unify colors in dark */
[data-theme="dark"] .modal-content .card.bg-light { background: rgba(255,255,255,0.03) !important; border-color: rgba(255,255,255,0.06) !important; }
[data-theme="dark"] .modal-content .text-brand-navy { color: #c8d4e0 !important; }
[data-theme="dark"] .modal-content .shadow-sm { box-shadow: none !important; }
[data-theme="dark"] .modal-content tbody.bg-white { background: transparent !important; }
[data-theme="dark"] .modal-content .border-0.shadow-sm { border: 1px solid rgba(255,255,255,0.12) !important; }
/* Product selector dark */
[data-theme="dark"] .psel-trigger { background: transparent !important; border-color: rgba(255,255,255,0.12) !important; box-shadow: none !important; }
[data-theme="dark"] .psel-panel { background: #1f2937 !important; border-color: rgba(255,255,255,0.1) !important; }
[data-theme="dark"] .psel-search-inner { background: rgba(255,255,255,0.04) !important; }
[data-theme="dark"] .psel-search-inner input { color: #f3f4f6 !important; }
[data-theme="dark"] .psel-item { color: #e0e8f0 !important; }
[data-theme="dark"] .psel-item:hover { background: rgba(255,255,255,0.06) !important; }
[data-theme="dark"] .psel-item.selected { background: rgba(0,112,207,0.15) !important; }
[data-theme="dark"] .psel-group { color: #7a8a9e !important; background: #1a2030 !important; }
/* Date input icon color fix */
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.7); }

/* --- Tabs --- */
[data-theme="dark"] .nav-tabs { border-color: #374151; }
[data-theme="dark"] .nav-tabs .nav-link { color: #7a8a9e; }
[data-theme="dark"] .nav-tabs .nav-link.active {
  color: #e8edf2;
  background: transparent;
  border-bottom-color: var(--brand-blue);
}
[data-theme="dark"] .nav-tabs .nav-link:hover { color: #c8d4e0; }

/* --- Bootstrap Utility Overrides --- */
[data-theme="dark"] .text-dark { color: #f3f4f6 !important; }
[data-theme="dark"] .text-muted { color: #6b7280 !important; }
[data-theme="dark"] .text-secondary { color: #9ca3af !important; }
[data-theme="dark"] .bg-light { background-color: #1f2937 !important; }
[data-theme="dark"] .bg-white { background-color: #1f2937 !important; }
[data-theme="dark"] .bg-body { background-color: #111827 !important; }
[data-theme="dark"] .badge.bg-light { background: #283548 !important; color: #f3f4f6 !important; }

/* --- Borders --- */
[data-theme="dark"] .border { border-color: #374151 !important; }
[data-theme="dark"] .border-bottom { border-color: rgba(255,255,255,0.08) !important; }
[data-theme="dark"] .border-top { border-color: #374151 !important; }
[data-theme="dark"] .border-light { border-color: #374151 !important; }
[data-theme="dark"] hr { border-color: #374151; opacity: 0.3; }

/* --- Accordion (global) --- */
[data-theme="dark"] .accordion-button { background: #1f2937 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .accordion-button:not(.collapsed) { background: #283548 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .accordion-button::after { filter: invert(1) grayscale(100%) brightness(200%); }
[data-theme="dark"] .accordion-body { background: #1f2937; color: #f3f4f6; }
[data-theme="dark"] .accordion-item { border-color: #374151 !important; background: #1f2937; }

/* --- List Groups --- */
[data-theme="dark"] .list-group-item { background-color: #1f2937; border-color: #374151; color: #f3f4f6; }
[data-theme="dark"] .list-group-item:hover { background-color: #283548; }

/* --- Pagination --- */
[data-theme="dark"] .page-link { background-color: #1f2937; border-color: #374151; color: #f3f4f6; }
[data-theme="dark"] .page-link:hover { background-color: #283548; color: #f3f4f6; }
[data-theme="dark"] .page-item.active .page-link { background-color: #4da6ff; border-color: #4da6ff; }
[data-theme="dark"] .page-item.disabled .page-link { background-color: #283548; color: #6b7280; }

/* --- Alerts --- */
[data-theme="dark"] .alert { border-color: #374151; }

/* --- Bulk Actions Bar --- */
[data-theme="dark"] .bulk-actions-bar { background: #1f2937 !important; border-color: #374151 !important; color: #f3f4f6; }
[data-theme="dark"] .bulk-actions-bar .vr { background-color: #374151; }

/* --- Select2 --- */
[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection { background-color: #1f2937 !important; border-color: #374151 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered { color: #f3f4f6 !important; }
[data-theme="dark"] .select2-dropdown { background-color: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .select2-results__option { color: #f3f4f6 !important; }
[data-theme="dark"] .select2-results__option--highlighted { background-color: #283548 !important; }
[data-theme="dark"] .select2-search__field { background-color: #1f2937 !important; color: #f3f4f6 !important; border-color: #374151 !important; }

/* --- Sidebar --- */
[data-theme="dark"] .sidebar {
  background: linear-gradient(180deg, #132d4a 0%, #0d1f35 50%, #091828 100%) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.08) !important;
}

/* --- Mobile Blocker --- */
[data-theme="dark"] .mobile-blocker { background: #111827 !important; }
[data-theme="dark"] .mobile-blocker .mb-title { color: #f3f4f6; }
[data-theme="dark"] .mobile-blocker .mb-text { color: #9ca3af; }
[data-theme="dark"] .mobile-blocker .mb-badge { background: #1f2937; border-color: #374151; color: #9ca3af; }
[data-theme="dark"] .mobile-blocker .mb-icon { background: linear-gradient(135deg, #1e3a5f 0%, #162a4a 100%); }

/* --- Cookie Banner --- */
[data-theme="dark"] #sgfCookieBanner { background: #1f2937 !important; border-top: 1px solid #374151; }

/* --- Notification Popover --- */
[data-theme="dark"] .notif-popover { background: #1f2937 !important; border: 1px solid #374151; }
[data-theme="dark"] .notif-popover::before { background: #1f2937 !important; }
[data-theme="dark"] .notif-header { border-color: #374151 !important; }
[data-theme="dark"] .notif-header-title { color: #f3f4f6 !important; }
[data-theme="dark"] .notif-item { border-color: #374151 !important; }
[data-theme="dark"] .notif-item:hover { background: #283548 !important; }
[data-theme="dark"] .notif-item.unread { background: rgba(254,252,232,0.05) !important; }
[data-theme="dark"] .notif-title { color: #f3f4f6 !important; }
[data-theme="dark"] .notif-text { color: #9ca3af !important; }
[data-theme="dark"] .notif-tabs { border-color: #374151 !important; }
[data-theme="dark"] .notif-tab { color: #6b7280; }
[data-theme="dark"] .notif-tab:hover { color: #9ca3af; }
[data-theme="dark"] .notif-empty { color: #6b7280; }

/* --- Upload Popover --- */
[data-theme="dark"] .upload-popover { background: #1f2937 !important; border: 1px solid #374151; }
[data-theme="dark"] .upload-pop-header { border-color: #374151 !important; }
[data-theme="dark"] .upload-pop-title { color: #f3f4f6 !important; }
[data-theme="dark"] .upload-pop-name { color: #f3f4f6 !important; }
[data-theme="dark"] .upload-pop-meta { color: #9ca3af !important; }
[data-theme="dark"] .upload-pop-item.history-item { border-color: #374151 !important; }

/* =============================================================
   INLINE STYLE OVERRIDES (catches style="background:#fff" etc.)
   ============================================================= */
[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background: #fff"],
[data-theme="dark"] [style*="background-color:#fff"],
[data-theme="dark"] [style*="background-color: #fff"],
[data-theme="dark"] [style*="background:#ffffff"],
[data-theme="dark"] [style*="background: #ffffff"],
[data-theme="dark"] [style*="background:white"],
[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background-color:white"],
[data-theme="dark"] [style*="background-color: white"] {
  background: #1f2937 !important;
  color: #f3f4f6;
}

[data-theme="dark"] [style*="background:#f8f9fa"],
[data-theme="dark"] [style*="background: #f8f9fa"],
[data-theme="dark"] [style*="background-color:#f8f9fa"],
[data-theme="dark"] [style*="background:#f9fafb"],
[data-theme="dark"] [style*="background: #f9fafb"],
[data-theme="dark"] [style*="background:#f8fafc"],
[data-theme="dark"] [style*="background: #f8fafc"],
[data-theme="dark"] [style*="background:#f4f6f9"],
[data-theme="dark"] [style*="background:#f3f4f6"],
[data-theme="dark"] [style*="background: #f3f4f6"],
[data-theme="dark"] [style*="background-color:#f3f4f6"],
[data-theme="dark"] [style*="background:#fafafa"],
[data-theme="dark"] [style*="background: #fafafa"],
[data-theme="dark"] [style*="background:#fafbfc"],
[data-theme="dark"] [style*="background:#f1f5f9"],
[data-theme="dark"] [style*="background: #f1f5f9"],
[data-theme="dark"] [style*="background:#f0f0f0"],
[data-theme="dark"] [style*="background:#f5f5f5"],
[data-theme="dark"] [style*="background-color:#f4f6f9"],
[data-theme="dark"] [style*="background-color: #f4f6f9"],
[data-theme="dark"] [style*="background-color:#f8f9fa"],
[data-theme="dark"] [style*="background-color: #f8f9fa"],
[data-theme="dark"] [style*="background:#f8faff"],
[data-theme="dark"] [style*="background: #f8faff"],
[data-theme="dark"] [style*="background:#e8f0fe"],
[data-theme="dark"] [style*="background: #e8f0fe"],
[data-theme="dark"] [style*="background:#fafcff"],
[data-theme="dark"] [style*="background: #fafcff"],
[data-theme="dark"] [style*="background:#f0f4f8"],
[data-theme="dark"] [style*="background: #f0f4f8"],
[data-theme="dark"] [style*="background:#e2e8f0"],
[data-theme="dark"] [style*="background: #e2e8f0"],
[data-theme="dark"] [style*="background:#eef4ff"],
[data-theme="dark"] [style*="background: #eef4ff"] {
  background: #283548 !important;
}

[data-theme="dark"] [style*="color:#374151"],
[data-theme="dark"] [style*="color: #374151"],
[data-theme="dark"] [style*="color:#1f2937"],
[data-theme="dark"] [style*="color: #1f2937"],
[data-theme="dark"] [style*="color:#333"],
[data-theme="dark"] [style*="color: #333"],
[data-theme="dark"] [style*="color:#1e293b"],
[data-theme="dark"] [style*="color: #1e293b"],
[data-theme="dark"] [style*="color:#1e3a5f"],
[data-theme="dark"] [style*="color: #1e3a5f"],
[data-theme="dark"] [style*="color:#0f172a"],
[data-theme="dark"] [style*="color: #0f172a"],
[data-theme="dark"] [style*="color:#0c2b5e"],
[data-theme="dark"] [style*="color: #0c2b5e"],
[data-theme="dark"] [style*="color:#111827"],
[data-theme="dark"] [style*="color: #111827"],
[data-theme="dark"] [style*="color:#212529"],
[data-theme="dark"] [style*="color: #212529"],
[data-theme="dark"] [style*="color:#334155"],
[data-theme="dark"] [style*="color: #334155"],
[data-theme="dark"] [style*="color:#475569"],
[data-theme="dark"] [style*="color: #475569"] {
  color: #f3f4f6 !important;
}

[data-theme="dark"] [style*="color:#6b7280"],
[data-theme="dark"] [style*="color: #6b7280"],
[data-theme="dark"] [style*="color:#555"],
[data-theme="dark"] [style*="color: #555"],
[data-theme="dark"] [style*="color:#64748b"],
[data-theme="dark"] [style*="color: #64748b"],
[data-theme="dark"] [style*="color:#6c757d"],
[data-theme="dark"] [style*="color: #6c757d"] {
  color: #9ca3af !important;
}

[data-theme="dark"] [style*="color:#9ca3af"],
[data-theme="dark"] [style*="color: #9ca3af"],
[data-theme="dark"] [style*="color:#94a3b8"],
[data-theme="dark"] [style*="color: #94a3b8"],
[data-theme="dark"] [style*="color:#adb5bd"],
[data-theme="dark"] [style*="color: #adb5bd"],
[data-theme="dark"] [style*="color:#b0b8c4"],
[data-theme="dark"] [style*="color: #b0b8c4"],
[data-theme="dark"] [style*="color:#cbd5e1"],
[data-theme="dark"] [style*="color: #cbd5e1"] {
  color: #6b7280 !important;
}

[data-theme="dark"] [style*="border-color:#e5e7eb"],
[data-theme="dark"] [style*="border-color: #e5e7eb"],
[data-theme="dark"] [style*="border-color:#dee2e6"],
[data-theme="dark"] [style*="border-color: #dee2e6"],
[data-theme="dark"] [style*="border-color:#e9ecef"],
[data-theme="dark"] [style*="border-color: #e9ecef"],
[data-theme="dark"] [style*="border-color:#eee"],
[data-theme="dark"] [style*="border-color: #eee"],
[data-theme="dark"] [style*="border:1px solid #e5e7eb"],
[data-theme="dark"] [style*="border:1px solid #e9ecef"],
[data-theme="dark"] [style*="border:1px solid #dee2e6"],
[data-theme="dark"] [style*="border: 1px solid #e5e7eb"],
[data-theme="dark"] [style*="border: 1px solid #e9ecef"],
[data-theme="dark"] [style*="border: 1px solid #dee2e6"],
[data-theme="dark"] [style*="border-bottom:1px solid #eee"],
[data-theme="dark"] [style*="border-bottom:1px solid #e5e7eb"],
[data-theme="dark"] [style*="border-bottom:1px solid #f0f0f0"],
[data-theme="dark"] [style*="border:1px dashed #e2e8f0"],
[data-theme="dark"] [style*="border: 1px dashed #e2e8f0"],
[data-theme="dark"] [style*="border-top:1px solid #f1f5f9"],
[data-theme="dark"] [style*="border-top: 1px solid #f1f5f9"],
[data-theme="dark"] [style*="border:1px solid #e2e8f0"],
[data-theme="dark"] [style*="border: 1px solid #e2e8f0"],
[data-theme="dark"] [style*="border:1px solid #e8f0fe"],
[data-theme="dark"] [style*="border: 1px solid #e8f0fe"],
[data-theme="dark"] [style*="border-bottom:1px solid #e9ecef"],
[data-theme="dark"] [style*="border-bottom: 1px solid #e9ecef"],
[data-theme="dark"] [style*="border-color:#e2e8f0"],
[data-theme="dark"] [style*="border-color: #e2e8f0"],
[data-theme="dark"] [style*="border-color:#f1f5f9"],
[data-theme="dark"] [style*="border-color: #f1f5f9"],
[data-theme="dark"] [style*="border-color:#e8f0fe"],
[data-theme="dark"] [style*="border-color: #e8f0fe"] {
  border-color: #374151 !important;
}

/* =============================================================
   MODULE-SPECIFIC OVERRIDES (classes from view <style> blocks)
   ============================================================= */

/* --- Dashboard Financeiro --- */
[data-theme="dark"] .dfin-card,
[data-theme="dark"] .dfin-eq-card,
[data-theme="dark"] .dfin-escola-panel,
[data-theme="dark"] .dfin-grid-val,
[data-theme="dark"] .dfin-liq-val { background: #1f2937 !important; border-color: #374151 !important; color: #f3f4f6; }
[data-theme="dark"] .dfin-escola-trigger { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .dfin-escola-trigger-text { color: #f3f4f6 !important; }
[data-theme="dark"] .dfin-escola-trigger-text.is-empty { color: #6b7280 !important; }
[data-theme="dark"] .dfin-escola-trigger-icon { color: #9ca3af !important; }
[data-theme="dark"] .dfin-escola-trigger-chevron { color: #9ca3af !important; }
[data-theme="dark"] .dfin-escola-grupo { background: #1f2937 !important; color: #f3f4f6; }
[data-theme="dark"] .dfin-escola-grupo:hover { background: #283548 !important; }
[data-theme="dark"] .dfin-escola-grupo.selected { background: rgba(77,166,255,0.12) !important; }
[data-theme="dark"] .dfin-escola-item { border-color: #374151 !important; color: #f3f4f6; }
[data-theme="dark"] .dfin-escola-item:hover { background: #283548 !important; }
[data-theme="dark"] .dfin-escola-item.selected { background: rgba(77,166,255,0.15) !important; color: #60a5fa !important; }
[data-theme="dark"] .dfin-ano-selector { background: #1e293b !important; border-color: #374151 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .dfin-ano-btn { color: #9ca3af !important; }
[data-theme="dark"] .dfin-ano-btn:hover { color: #f3f4f6 !important; background: #334155 !important; }
[data-theme="dark"] .dfin-ano-btn.active { background: #0070CF !important; color: #fff !important; box-shadow: 0 1px 4px rgba(0,112,207,0.4) !important; }
[data-theme="dark"] .dfin-row { border-color: #374151 !important; }
[data-theme="dark"] .dfin-row:hover { background: #283548 !important; }
[data-theme="dark"] .dfin-escola { color: #f3f4f6 !important; }
[data-theme="dark"] .dfin-valor { color: #f3f4f6 !important; }
[data-theme="dark"] .dfin-valor-col { border-left-color: #374151 !important; }
[data-theme="dark"] .dfin-fade { background: linear-gradient(to bottom, rgba(17,24,39,0) 0%, rgba(17,24,39,0.9) 70%, rgba(17,24,39,1) 100%) !important; }
[data-theme="dark"] .dfin-table-header,
[data-theme="dark"] .dfin-eq-header { background: #283548 !important; color: #6b7280 !important; border-color: #374151 !important; }
[data-theme="dark"] .dfin-v-total,
[data-theme="dark"] .dfin-lv-total { background: #283548 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .dfin-grid-footer .dfin-grid-val,
[data-theme="dark"] .dfin-liq-footer .dfin-liq-val { background: #283548 !important; }
[data-theme="dark"] .dfin-faceoff-total-past { color: #f3f4f6 !important; }
[data-theme="dark"] .dfin-growth-neutral { background: #283548 !important; color: #6b7280 !important; }
[data-theme="dark"] .dfin-badge-default { background: #283548 !important; color: #9ca3af !important; }
[data-theme="dark"] .dfin-eq-row { border-color: #374151 !important; }
[data-theme="dark"] .dfin-eq-row:hover { background: #283548 !important; }
[data-theme="dark"] .dfin-eq-sub-escola { color: #f3f4f6 !important; }
[data-theme="dark"] .dfin-bar-track,
[data-theme="dark"] .dfin-eq-bar-track { background: #374151 !important; }
[data-theme="dark"] .dfin-empty { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .dfin-bloco-status { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .dfin-bloco-liq { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .dfin-bloco-header { color: #f3f4f6 !important; }
[data-theme="dark"] .dfin-bloco-desc { color: #9ca3af !important; }

/* --- Pedidos --- */
[data-theme="dark"] .ano-card-header { background: #1f2937 !important; border-color: #374151 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .ano-card-header:hover { background: #283548 !important; }
[data-theme="dark"] .ano-card-body { color: #f3f4f6; }
[data-theme="dark"] .tabs-scroll-wrapper { background: #1f2937 !important; }
[data-theme="dark"] .produto-grupo-header { background: #1f2937 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .produto-grupo-header:hover { background: #283548 !important; }
[data-theme="dark"] .escola-card { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .escola-card-header { background: #1f2937 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .escola-card-header:hover { background: #283548 !important; }
[data-theme="dark"] .escola-card-body { background: #283548 !important; border-color: #374151 !important; }
[data-theme="dark"] .contrato-card { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .contrato-card-header { background: #1f2937 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .contrato-card-header:hover { background: #283548 !important; }
[data-theme="dark"] .contrato-card-body { background: #283548 !important; border-color: #374151 !important; }
[data-theme="dark"] .produtos-collapse-row { background-color: #283548 !important; }
[data-theme="dark"] .produto-item:hover { background-color: #283548 !important; }
[data-theme="dark"] .chip-select-input { background: #1f2937 !important; color: #f3f4f6 !important; border-color: #374151 !important; }
[data-theme="dark"] .chip-dropdown { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .preview-col { background: #283548 !important; border-color: #374151 !important; }

/* --- Comunicação --- */
[data-theme="dark"] .com-card { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .com-card-header h6 { color: #f3f4f6 !important; }
[data-theme="dark"] .com-tabs { background: #283548 !important; border-color: #374151 !important; }
[data-theme="dark"] .com-tabs .nav-link.active { background: #1f2937 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .com-tab-count-gray { background: #283548 !important; color: #6b7280 !important; }
[data-theme="dark"] .com-card-channel-icon.inactive { background: #283548 !important; color: #6b7280 !important; }
[data-theme="dark"] .com-card-ativo-off { background: #283548 !important; color: #6b7280 !important; }
[data-theme="dark"] .com-card-ativo-on { background: rgba(22,163,74,0.15) !important; }
[data-theme="dark"] .com-card-actions .btn:hover { background: #283548 !important; border-color: #374151 !important; }
[data-theme="dark"] .com-card-assunto { color: #6b7280 !important; }
[data-theme="dark"] .com-card-qtab:hover { background: #283548 !important; }
[data-theme="dark"] .com-card-footer { border-color: #374151 !important; color: #6b7280 !important; }
[data-theme="dark"] .com-card-quote { border-left-color: #374151 !important; }
[data-theme="dark"] .com-card-quote::after { background: linear-gradient(to bottom, rgba(31,41,55,0), rgba(31,41,55,1)) !important; }
[data-theme="dark"] .com-card-preview { color: #9ca3af !important; }
[data-theme="dark"] .com-modulo-header { color: #f3f4f6 !important; border-color: #374151 !important; }
[data-theme="dark"] .com-modulo-empty { background: #283548 !important; }
[data-theme="dark"] .com-filter-chip,
[data-theme="dark"] .com-seg-chip { background: #1f2937 !important; color: #9ca3af !important; border-color: #374151 !important; }
[data-theme="dark"] .com-filter-chip:hover { background: #283548 !important; }
[data-theme="dark"] .com-filter-select { background-color: #1f2937 !important; color: #f3f4f6 !important; border-color: #374151 !important; }
[data-theme="dark"] .com-gat-card { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .com-gat-titulo { color: #f3f4f6 !important; }
[data-theme="dark"] .com-gat-cond { color: #6b7280 !important; background: #283548 !important; border-color: #374151 !important; }
[data-theme="dark"] .com-toggle-off { background: #283548 !important; color: #6b7280 !important; }
[data-theme="dark"] .com-empty { background: #1f2937 !important; }
[data-theme="dark"] .com-empty-icon-hist { background: #283548 !important; color: #6b7280 !important; }
[data-theme="dark"] .com-hist-table thead th { color: #6b7280 !important; border-color: #374151 !important; background: #283548 !important; }
[data-theme="dark"] .com-hist-table tbody tr:hover { background: #283548 !important; }
[data-theme="dark"] .com-hist-dest { color: #f3f4f6 !important; }
[data-theme="dark"] .com-hist-btn { border-color: #374151 !important; color: #6b7280 !important; background: #1f2937 !important; }
[data-theme="dark"] .com-hist-btn:hover { background: #283548 !important; }
[data-theme="dark"] .com-gear-btn { border-color: #374151 !important; background: #1f2937 !important; color: #6b7280 !important; }
[data-theme="dark"] .com-step-dot { background: #283548 !important; color: #6b7280 !important; }
[data-theme="dark"] .com-step-line { background: #374151 !important; }
[data-theme="dark"] .com-channel-tabs,
[data-theme="dark"] .com-sub-tabs { background: #283548 !important; }
[data-theme="dark"] .com-channel-tab.active,
[data-theme="dark"] .com-sub-tab.active { background: #1f2937 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .com-modal .input-group-text { border-color: #374151 !important; background: #283548 !important; color: #6b7280 !important; }
[data-theme="dark"] .com-trava-card { background: #283548 !important; border-color: #374151 !important; }
[data-theme="dark"] .com-assunto-editor { border-color: #374151 !important; color: #f3f4f6 !important; background: #1f2937 !important; }
[data-theme="dark"] .com-editor-wrap { border-color: #374151 !important; background: #1f2937 !important; }
[data-theme="dark"] .com-editor-toolbar,
[data-theme="dark"] .com-editor-charcount { background: #283548 !important; }
[data-theme="dark"] .com-editor-body { color: #f3f4f6 !important; }
[data-theme="dark"] .com-dest-field { border-color: #374151 !important; background: #1f2937 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .com-dest-opt { border-color: #374151 !important; background: #283548 !important; color: #6b7280 !important; }
[data-theme="dark"] .com-preview-frame,
[data-theme="dark"] .com-preview-frame-body { background: #283548 !important; }
[data-theme="dark"] .com-preview-frame-header { border-color: #374151 !important; background: #1f2937 !important; }
[data-theme="dark"] .com-preview-frame-tab { border-color: #374151 !important; background: #1f2937 !important; color: #6b7280 !important; }
[data-theme="dark"] .com-preview-frame-close { background: #283548 !important; color: #6b7280 !important; }
[data-theme="dark"] .com-preview-frame-content { background: #1f2937 !important; }
[data-theme="dark"] .com-var-dropdown { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .com-var-copy-all { border-color: #374151 !important; background: #1f2937 !important; color: #6b7280 !important; }
[data-theme="dark"] .com-var-item-label { color: #f3f4f6 !important; }
[data-theme="dark"] .com-gatilho-dropdown { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .com-phone-inputbar-field { background: #1f2937 !important; border-color: #374151 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .com-email-mock { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .com-canal-card-sms.off,
[data-theme="dark"] .com-canal-card-email.off { background: #283548 !important; border-color: #374151 !important; }
[data-theme="dark"] .com-canal-icon.off { background: #283548 !important; color: #6b7280 !important; }
[data-theme="dark"] .com-cond-box { background: #283548 !important; border-color: #374151 !important; }
[data-theme="dark"] .com-seg-section-title { color: #f3f4f6 !important; background: #283548 !important; border-color: #374151 !important; }
[data-theme="dark"] .com-seg-group-label { color: #f3f4f6 !important; }
[data-theme="dark"] .com-envio-value { color: #f3f4f6 !important; }
[data-theme="dark"] .com-envio-body { background: #283548 !important; border-color: #374151 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .com-source-editor:focus { background: #1f2937 !important; }
[data-theme="dark"] .com-cfg-section { background: transparent !important; border-color: #374151 !important; }
[data-theme="dark"] .com-cfg-section-title { color: #f3f4f6 !important; }
[data-theme="dark"] .com-cfg-badge-ok { background: rgba(22,163,74,0.15) !important; color: #4ade80 !important; }
[data-theme="dark"] .com-cfg-badge-no { background: rgba(220,38,38,0.15) !important; color: #f87171 !important; }
[data-theme="dark"] .com-cfg-pw-wrap input,
[data-theme="dark"] #modalConfigAPI .form-control { background: #1f2937 !important; border-color: #374151 !important; color: #f3f4f6 !important; }
[data-theme="dark"] #modalConfigAPI .form-label { color: #d1d5db !important; }
[data-theme="dark"] #modalConfigAPI .modal-content { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] #modalConfigAPI .modal-header { border-color: #374151 !important; }
[data-theme="dark"] #modalConfigAPI .modal-title { color: #f3f4f6 !important; }
[data-theme="dark"] #modalConfigAPI hr { border-color: #374151 !important; }
[data-theme="dark"] .com-cfg-pw-toggle { color: #6b7280 !important; }
[data-theme="dark"] .com-cfg-pw-toggle:hover { color: #d1d5db !important; }

/* --- Galeria --- */
[data-theme="dark"] .gal-main-panel,
[data-theme="dark"] .gal-main-area { background: #111827 !important; }
[data-theme="dark"] .gal-col,
[data-theme="dark"] .gal-col-header,
[data-theme="dark"] .gal-col-sidebar,
[data-theme="dark"] .gal-col-search,
[data-theme="dark"] .gal-col-body,
[data-theme="dark"] .gal-main,
[data-theme="dark"] .gal-card,
[data-theme="dark"] .gal-listview,
[data-theme="dark"] .gal-card-open { background: #1f2937 !important; border-color: #374151 !important; color: #f3f4f6; }
[data-theme="dark"] .gal-col-item { background: #1f2937 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .gal-col-item:hover { background: #283548 !important; }
[data-theme="dark"] .gal-aluno-card,
[data-theme="dark"] .gal-massa-card { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .gal-search-input { background-color: #1f2937 !important; border-color: #374151 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .gal-search-input:focus { background: #1f2937 !important; }
[data-theme="dark"] .gal-btn-search { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .gal-search-item:hover,
[data-theme="dark"] .gal-btn-ghost:hover,
[data-theme="dark"] .gal-back-btn:hover,
[data-theme="dark"] .gal-import-card { border-color: #374151 !important; }
[data-theme="dark"] .gal-import-card h6 { color: #f3f4f6 !important; }
[data-theme="dark"] .gal-import-card p { color: #9ca3af !important; }
[data-theme="dark"] .gal-import-card:hover,
[data-theme="dark"] .gal-busca-row:hover { background: #283548 !important; }
[data-theme="dark"] .gal-search-item .search-icon.escola { background: rgba(59,130,246,0.15) !important; color: #60a5fa !important; }
[data-theme="dark"] .gal-search-item .search-name,
[data-theme="dark"] .gal-confirm-name,
[data-theme="dark"] .gal-face-group-name,
[data-theme="dark"] .gal-sep-atribuir-nome,
[data-theme="dark"] .gal-sep-jobs-item-title,
[data-theme="dark"] .gal-album-title { color: #93c5fd !important; }
[data-theme="dark"] .gal-massa-card-name,
[data-theme="dark"] .gal-massa-step-txt { color: #f3f4f6 !important; }
[data-theme="dark"] .gal-photo-grid { background: #283548 !important; }
[data-theme="dark"] .gal-back-btn { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .gal-upload-zone,
[data-theme="dark"] .gal-upload-zone2,
[data-theme="dark"] .gal-upload-info { background: #283548 !important; border-color: #374151 !important; }
[data-theme="dark"] .gal-upload-bar,
[data-theme="dark"] .gal-upload-bar-album { background: #374151 !important; }
[data-theme="dark"] .gal-face-group { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .gal-face-group-meta { color: #9ca3af !important; }
[data-theme="dark"] .gal-face-group-avatar { background: #374151 !important; color: #d1d5db !important; }
[data-theme="dark"] .gal-face-event-tag.has-event { background: rgba(16,185,129,0.15) !important; color: #6ee7b7 !important; }
[data-theme="dark"] .gal-face-event-tag.no-event { background: rgba(245,158,11,0.15) !important; color: #fcd34d !important; }
[data-theme="dark"] .gal-face-confidence-high { background: rgba(16,185,129,0.15) !important; color: #6ee7b7 !important; }
[data-theme="dark"] .gal-face-confidence-med { background: rgba(245,158,11,0.15) !important; color: #fcd34d !important; }
[data-theme="dark"] .gal-face-confidence-low { background: rgba(239,68,68,0.15) !important; color: #fca5a5 !important; }
[data-theme="dark"] .gal-face-confidence-manual { background: rgba(59,130,246,0.15) !important; color: #93c5fd !important; }
[data-theme="dark"] .gal-sep-foto-checkbox { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .gal-sep-jobs-item-icon.created { background: #283548 !important; color: #6b7280 !important; }
[data-theme="dark"] .gal-sep-jobs-divider { background: #374151 !important; }
[data-theme="dark"] .gal-sep-col-left,
[data-theme="dark"] .gal-sep-col-right { background: #1f2937 !important; }
[data-theme="dark"] .gal-aluno-drop-status.detecting { background: rgba(77,166,255,0.08) !important; }
[data-theme="dark"] #galSepAtribuirPopup { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .gal-sep-atribuir-item:hover { background: #283548 !important; }
[data-theme="dark"] .gal-sep-atribuir-item.selected { background: rgba(96,165,250,0.12) !important; border-left-color: #60a5fa !important; }
[data-theme="dark"] .gal-sep-atribuir-item.selected:hover { background: rgba(96,165,250,0.18) !important; }
[data-theme="dark"] .gal-sep-atribuir-chip { background: rgba(96,165,250,0.15); color: #93c5fd; }
[data-theme="dark"] #galSepAtribuirConfirmBar { border-color: #374151 !important; }
[data-theme="dark"] .gal-sep-atribuir-avatar { background: #283548 !important; color: #d1d5db !important; }
[data-theme="dark"] .gal-sep-atribuir-meta { color: #9ca3af !important; }
[data-theme="dark"] .gal-sep-compare { background: #111827 !important; }
[data-theme="dark"] .gal-sep-compare-header { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .gal-sep-compare-title { color: #f3f4f6 !important; }
[data-theme="dark"] .gal-sep-compare-chip { background: #283548 !important; color: #d1d5db !important; border-color: #374151 !important; }
[data-theme="dark"] .gal-sep-compare-chip.active { background: #1e40af !important; color: #fff !important; }

/* NR section dark mode overrides */
[data-theme="dark"] .gal-sep-split { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .gal-sep-col-left { border-right-color: #374151 !important; }
[data-theme="dark"] .gal-sep-col-title { color: #d1d5db !important; border-bottom-color: #374151 !important; }
[data-theme="dark"] .gal-sep-col-left .gal-sep-col-title { color: #6ee7b7 !important; }
[data-theme="dark"] .gal-sep-col-right .gal-sep-col-title { color: #fcd34d !important; }
[data-theme="dark"] .gal-sep-col-body::-webkit-scrollbar-thumb { background: #4b5563 !important; }
[data-theme="dark"] .gal-sep-nr-thumb { background: #283548 !important; }
[data-theme="dark"] .gal-sep-nr-thumb:hover { border-color: #60a5fa !important; }
[data-theme="dark"] .gal-sep-nr-grupo { border-color: #374151 !important; }
[data-theme="dark"] .gal-sep-nr-grupo-header { background: #352a1a !important; border-bottom-color: #374151 !important; }
[data-theme="dark"] .gal-sep-nr-grupo-header.drag-over { background: #453518 !important; }
[data-theme="dark"] .gal-sep-nr-grupo-label { color: #fcd34d !important; }
[data-theme="dark"] .gal-sep-nr-grupo-count { color: #6b7280 !important; }
[data-theme="dark"] .gal-sep-nr-grupo-btn { background: #1f2937 !important; border-color: #374151 !important; color: #9ca3af !important; }
[data-theme="dark"] .gal-sep-nr-grupo-btn:hover { background: #283548 !important; border-color: #60a5fa !important; }
[data-theme="dark"] .gal-sep-nr-sem-grupo-header { color: #9ca3af !important; border-top-color: #374151 !important; }
[data-theme="dark"] .gal-sep-nr-info-strip { background: #283548 !important; color: #9ca3af !important; border-bottom-color: #374151 !important; }
[data-theme="dark"] .gal-sep-bulk-bar { background: #1f2937 !important; border-top-color: #374151 !important; }
[data-theme="dark"] .gal-sep-bulk-bar span { color: #60a5fa !important; }
[data-theme="dark"] .gal-sep-marquee { border-color: rgba(96,165,250,0.7) !important; background: rgba(96,165,250,0.08) !important; }
[data-theme="dark"] .gal-face-group.drop-target { background: #1e3a5f !important; border-color: #60a5fa !important; }
[data-theme="dark"] .gal-sep-col-right.drop-target { background: #352a1a !important; }
[data-theme="dark"] .gal-sep-foto-checkbox { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .gal-sep-nr-checkbox { border-color: rgba(255,255,255,0.3) !important; background: rgba(0,0,0,0.5) !important; }
[data-theme="dark"] .gal-sep-nr-badge { box-shadow: 0 1px 3px rgba(0,0,0,0.5) !important; }

/* --- Checklists --- */
[data-theme="dark"] .pill-item-name { color: #f3f4f6 !important; }
[data-theme="dark"] .pill-filter-tabs { background: #283548 !important; }
[data-theme="dark"] .pill-tab.active { background: #1f2937 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .drawer-body { background: #283548 !important; }
[data-theme="dark"] .drawer-card { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .drawer-switch-row:hover { background: #283548 !important; }
[data-theme="dark"] .drawer-footer { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .carousel-btn { background: #1f2937 !important; border-color: #374151 !important; color: #9ca3af !important; }
[data-theme="dark"] .carousel-btn:hover { background: #283548 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .grid-checklist tbody tr:hover .td-check,
[data-theme="dark"] .grid-checklist tbody tr:hover .td-meta { background: #283548 !important; }
[data-theme="dark"] .grid-checklist tbody tr.tr-complete .td-meta { background-color: rgba(22,163,74,0.1) !important; }
[data-theme="dark"] .cel-texto:focus { background-color: #1f2937 !important; }
[data-theme="dark"] .kpi-card { background: #1f2937 !important; border: 1px solid #374151 !important; box-shadow: 0 1px 4px rgba(0,0,0,0.2) !important; }
[data-theme="dark"] .kpi-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important; }
[data-theme="dark"] .kpi-card.kpi-active { box-shadow: 0 0 0 2px #4da6ff, 0 4px 12px rgba(77,166,255,0.2) !important; }
[data-theme="dark"] .kpi-label { color: #9ca3af !important; }
[data-theme="dark"] .segmented-control { background: #283548 !important; }
[data-theme="dark"] .segmented-btn { color: #9ca3af; }
[data-theme="dark"] .segmented-btn:hover { color: #f3f4f6; }
[data-theme="dark"] .segmented-btn.active { background: #1f2937 !important; color: #f3f4f6 !important; box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important; }
[data-theme="dark"] .inst-card { background: #1f2937 !important; box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important; }
[data-theme="dark"] .inst-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.3) !important; }
[data-theme="dark"] .inst-card-archive { background: #283548 !important; color: #9ca3af !important; border-color: #374151 !important; }
[data-theme="dark"] .inst-card-archive:hover { color: #f87171 !important; background: rgba(220,53,69,0.15) !important; }
[data-theme="dark"] .btn-ghost { border-color: #374151 !important; color: #9ca3af !important; }
[data-theme="dark"] .btn-ghost:hover { background: #4da6ff !important; border-color: #4da6ff !important; color: #fff !important; }
[data-theme="dark"] .section-divider { border-color: #374151 !important; }
[data-theme="dark"] .modelo-card { background: #1f2937 !important; box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important; }
[data-theme="dark"] .modelo-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.3) !important; }
[data-theme="dark"] .modelo-icon-btn { color: #6b7280 !important; }
[data-theme="dark"] .modelo-icon-btn:hover { background: #283548 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .pill-filter-btn { border-color: #374151 !important; background: #1f2937 !important; color: #9ca3af !important; }
[data-theme="dark"] .pill-filter-btn:hover { border-color: #4b5563 !important; }
[data-theme="dark"] .pill-filter-btn.pill-active { border-color: #4da6ff !important; background: rgba(77,166,255,0.08) !important; }
[data-theme="dark"] .pill-popover { background: #1f2937 !important; border-color: #374151 !important; box-shadow: 0 12px 36px rgba(0,0,0,0.4) !important; }
[data-theme="dark"] .pill-popover-search { border-color: #374151 !important; }
[data-theme="dark"] .pill-popover-search input { color: #f3f4f6 !important; }
[data-theme="dark"] .pill-popover-item:hover { background: rgba(77,166,255,0.08) !important; }
[data-theme="dark"] .pill-popover-item-active { background: rgba(77,166,255,0.08) !important; }
[data-theme="dark"] .pill-item-sub { color: #6b7280 !important; }
[data-theme="dark"] .avatar-circle-sm { background: #283548 !important; color: #4da6ff !important; border-color: #1f2937 !important; }
[data-theme="dark"] .chip-tag { background: #283548 !important; color: #4da6ff !important; }
[data-theme="dark"] #btnToggleInativos,
[data-theme="dark"] #btnToggleInativosModelos { background: #1f2937 !important; border-color: #374151 !important; color: #9ca3af !important; }

/* --- Vendas / Contratos --- */
[data-theme="dark"] .contrato-row { border-color: #374151 !important; }
[data-theme="dark"] .detail-card { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .tl-drawer { background: #1f2937 !important; border-color: #374151 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .tl-drawer-input { background: #283548 !important; border-color: #374151 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .autocomplete-dropdown { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .tl-bubble-name { color: #f3f4f6 !important; }
[data-theme="dark"] .psel-trigger { background: #1f2937 !important; border-color: #374151 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .psel-panel { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .psel-search-inner { background: #283548 !important; }
[data-theme="dark"] .psel-search-wrap { border-color: #374151 !important; }
[data-theme="dark"] .psel-group { color: #6b7280 !important; background: #283548 !important; }
[data-theme="dark"] .psel-item { color: #f3f4f6 !important; }

/* --- Financeiro --- */
[data-theme="dark"] .fil-row { border-color: #374151 !important; }
[data-theme="dark"] .escola-select-container { background: #1f2937 !important; border-color: #374151 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .escola-select-input { background: transparent !important; color: #f3f4f6 !important; }
[data-theme="dark"] .escola-select-dropdown { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .escola-select-dropdown-item { color: #f3f4f6 !important; }
[data-theme="dark"] .escola-select-dropdown-item:hover { background: #283548 !important; }
[data-theme="dark"] .escola-chip { background: #283548 !important; color: #f3f4f6 !important; border-color: #374151 !important; }
[data-theme="dark"] .escola-select-chevron { color: #6b7280 !important; }
[data-theme="dark"] .card-divergencia-alerta .rounded-3 { background: linear-gradient(135deg, #92400e 0%, #78350f 100%) !important; border-color: #b45309 !important; }
[data-theme="dark"] .card-kpi { box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important; }
[data-theme="dark"] .card-kpi:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important; }
[data-theme="dark"] .accordion-escola .accordion-button { background: #1f2937 !important; color: #f3f4f6 !important; box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important; }
[data-theme="dark"] .accordion-escola .accordion-button:not(.collapsed) { background: #283548 !important; }
[data-theme="dark"] .accordion-ano .accordion-button { background: #1f2937 !important; color: #f3f4f6 !important; border-color: #374151 !important; }
[data-theme="dark"] .accordion-turma .accordion-button { background: #283548 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .collapse-row td.bg-light { background: #1f2937 !important; }
[data-theme="dark"] .chip-escola { background: #283548 !important; color: #60a5fa !important; border-color: #374151 !important; }
[data-theme="dark"] .chip-escola .btn-close-chip { color: #60a5fa !important; }
[data-theme="dark"] .chip-escola-count { background: #4da6ff !important; }

/* --- Turmas --- */
[data-theme="dark"] .autocomplete-list,
[data-theme="dark"] .autocomplete-dropdown { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .autocomplete-item,
[data-theme="dark"] .autocomplete-dropdown-item { border-color: #374151 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .autocomplete-item:hover,
[data-theme="dark"] .autocomplete-dropdown-item:hover { background-color: #283548 !important; }
[data-theme="dark"] .autocomplete-dropdown-item.selecionada { background-color: rgba(77,166,255,0.15) !important; }

/* --- Config Contrato --- */
[data-theme="dark"] .cfg-section { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .cfg-container { --cfg-navy: #93c5fd; --cfg-blue: #4da6ff; --cfg-gray: #9ca3af; }
[data-theme="dark"] .cfg-summary-card { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .cfg-summary-value { color: #f3f4f6 !important; }
[data-theme="dark"] .cfg-tabs-wrapper { background: #1f2937 !important; border-color: #374151 !important; box-shadow: 0 4px 20px rgba(0,0,0,0.2) !important; }
[data-theme="dark"] .cfg-tabs { background: #283548 !important; border-color: #374151 !important; }
[data-theme="dark"] .cfg-tab { color: #9ca3af; }
[data-theme="dark"] .cfg-tab:hover { color: #f3f4f6; background: rgba(255,255,255,0.05); }
[data-theme="dark"] .cfg-tab.active { color: #f3f4f6; background: #1f2937 !important; }
[data-theme="dark"] .cfg-tab-count { background: rgba(255,255,255,0.1); color: #9ca3af; }
[data-theme="dark"] .cfg-content-header { border-color: #374151 !important; }
[data-theme="dark"] .cfg-content-title { color: #f3f4f6 !important; }
[data-theme="dark"] .cfg-stat { background: #283548 !important; color: #9ca3af !important; }
[data-theme="dark"] .cfg-stat-required { color: #f87171 !important; background: rgba(220,53,69,0.15) !important; }
[data-theme="dark"] .cfg-subgroup-header { background: #283548 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .cfg-subgroup-count { background: rgba(77,166,255,0.15) !important; }
[data-theme="dark"] .cfg-subgroup-fields { border-color: #374151 !important; }
[data-theme="dark"] .cfg-field-card { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .cfg-field-card:hover { border-color: #4b5563 !important; box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important; }
[data-theme="dark"] .cfg-field-title { color: #f3f4f6 !important; }
[data-theme="dark"] .cfg-field-desc { color: #9ca3af !important; }
[data-theme="dark"] .cfg-field-var { color: #9ca3af !important; }
[data-theme="dark"] .cfg-field-var code { background: #283548 !important; color: #d1d5db !important; }
[data-theme="dark"] .cfg-field-table { background: #283548 !important; color: #9ca3af !important; }
[data-theme="dark"] .cfg-field-mask { color: #9ca3af !important; }
[data-theme="dark"] .cfg-toggle-label { color: #9ca3af !important; }
[data-theme="dark"] .cfg-slider { background: #374151 !important; }
[data-theme="dark"] .cfg-rules-section { border-color: #374151 !important; }
[data-theme="dark"] .cfg-rules-header { background: linear-gradient(135deg, #2a2013 0%, #1f2937 100%) !important; border-color: #4b3a1a !important; }
[data-theme="dark"] .cfg-rules-header:hover { background: linear-gradient(135deg, #332810 0%, #283548 100%) !important; }
[data-theme="dark"] .cfg-rules-title { color: #fbbf24 !important; }
[data-theme="dark"] .cfg-rules-hint { color: #d97706 !important; }
[data-theme="dark"] .cfg-rules-arrow { color: #fbbf24 !important; }
[data-theme="dark"] .cfg-rule-card { background: #1f2937 !important; }
[data-theme="dark"] .cfg-rule-card.cfg-rule-danger { border-color: rgba(220,53,69,0.3) !important; background: linear-gradient(135deg, #2a1215 0%, #1f2937 100%) !important; }
[data-theme="dark"] .cfg-rule-card.cfg-rule-info { border-color: rgba(59,130,246,0.3) !important; background: linear-gradient(135deg, #172135 0%, #1f2937 100%) !important; }
[data-theme="dark"] .cfg-rule-card.cfg-rule-warning { border-color: rgba(245,158,11,0.3) !important; background: linear-gradient(135deg, #2a2013 0%, #1f2937 100%) !important; }
[data-theme="dark"] .cfg-rule-card.cfg-rule-primary { border-color: rgba(0,112,207,0.3) !important; background: linear-gradient(135deg, #0c1f35 0%, #1f2937 100%) !important; }
[data-theme="dark"] .cfg-rule-card.cfg-rule-unique { border-color: rgba(139,92,246,0.3) !important; background: linear-gradient(135deg, #1f1535 0%, #1f2937 100%) !important; }
[data-theme="dark"] .cfg-rule-name { color: #f3f4f6 !important; }
[data-theme="dark"] .cfg-rule-condition { color: #9ca3af !important; }
[data-theme="dark"] .cfg-rule-condition code { background: #283548 !important; color: #d1d5db !important; }
[data-theme="dark"] .cfg-rule-when { color: #6b7280 !important; }
[data-theme="dark"] .cfg-rule-fields-label { color: #6b7280 !important; }
[data-theme="dark"] .cfg-rule-exception { color: #9ca3af !important; border-color: #374151 !important; }
[data-theme="dark"] .cfg-tag-info { background: #283548 !important; color: #9ca3af !important; border-color: #374151 !important; }
[data-theme="dark"] .cfg-footer { background: #283548 !important; border-color: #374151 !important; }
[data-theme="dark"] .cfg-footer-info { color: #9ca3af !important; }

/* --- Eventos / FullCalendar --- */
[data-theme="dark"] .fc { --fc-border-color: #374151; --fc-page-bg-color: #1f2937; --fc-neutral-bg-color: #283548; --fc-list-event-hover-bg-color: #283548; --fc-today-bg-color: rgba(77,166,255,0.08); }
[data-theme="dark"] .fc .fc-daygrid-day { background: #1f2937 !important; }
[data-theme="dark"] .fc .fc-daygrid-day:hover { background: #283548 !important; }
[data-theme="dark"] .fc .fc-daygrid-day.fc-day-today { background-color: rgba(77,166,255,0.08) !important; }
[data-theme="dark"] .fc .fc-daygrid-day-number { color: #9ca3af; }
[data-theme="dark"] .fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number { color: #4da6ff; background-color: rgba(77,166,255,0.15); }
[data-theme="dark"] .fc .fc-daygrid-day-frame { border-color: #374151 !important; }
[data-theme="dark"] .fc .fc-col-header-cell { background: #283548 !important; border-color: #374151 !important; }
[data-theme="dark"] .fc .fc-col-header-cell-cushion { color: #9ca3af; }
[data-theme="dark"] .fc .fc-col-header-cell.fc-day-today { background-color: rgba(77,166,255,0.12) !important; }
[data-theme="dark"] .fc .fc-col-header-cell.fc-day-today .fc-col-header-cell-cushion { color: #4da6ff; }
[data-theme="dark"] .fc .fc-col-header { border-color: #374151 !important; }
[data-theme="dark"] .fc .fc-timegrid-body { background-color: #1f2937 !important; }
[data-theme="dark"] .fc .fc-timegrid-slot-lane { border-color: #374151 !important; }
[data-theme="dark"] .fc .fc-timegrid-slot-label { color: #6b7280; }
[data-theme="dark"] .fc .fc-timegrid-col-frame { border-color: #374151 !important; }
[data-theme="dark"] .fc .fc-scrollgrid { border-color: #374151 !important; }
[data-theme="dark"] .fc .fc-scrollgrid td, [data-theme="dark"] .fc .fc-scrollgrid th { border-color: #374151 !important; }
[data-theme="dark"] .fc .fc-event .fc-event-title { color: #f3f4f6 !important; }
[data-theme="dark"] .fc .fc-toolbar-title { color: #93c5fd !important; }
[data-theme="dark"] .fc .fc-button { background-color: #283548; border-color: #374151; color: #f3f4f6; }
[data-theme="dark"] .fc .fc-button:hover { background-color: #374151; }
[data-theme="dark"] .fc .fc-button-active { background-color: #4da6ff !important; border-color: #4da6ff !important; }
[data-theme="dark"] .fc .fc-more-link { color: #4da6ff; }

/* --- Tipos Evento --- */
[data-theme="dark"] .tipo-card { background: #1f2937 !important; border-color: #374151 !important; }

/* --- Empresa --- */
[data-theme="dark"] .emp-section { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .emp-logo-box { background: #283548 !important; border-color: #374151 !important; }
[data-theme="dark"] .emp-logo-box.has-logo { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .emp-card { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .emp-card-title { color: #93c5fd !important; border-color: #374151 !important; }
[data-theme="dark"] .emp-card-title i { color: #4da6ff !important; }
[data-theme="dark"] .emp-header h3 { color: #93c5fd !important; }
[data-theme="dark"] .emp-nome { color: #93c5fd !important; }
[data-theme="dark"] .emp-razao { color: #6b7280 !important; }
[data-theme="dark"] .emp-meta-item { background: #283548 !important; border-color: #374151 !important; }
[data-theme="dark"] .emp-meta-item strong { color: #f3f4f6 !important; }
[data-theme="dark"] .emp-meta-item span { color: #9ca3af !important; }
[data-theme="dark"] .emp-badge { background: #283548 !important; color: #f3f4f6 !important; border-color: #374151 !important; }
[data-theme="dark"] .emp-contato-value { color: #f3f4f6 !important; }
[data-theme="dark"] .emp-fiscal-value { color: #f3f4f6 !important; }
[data-theme="dark"] .emp-endereco-value { color: #f3f4f6 !important; }
[data-theme="dark"] .emp-endereco-value .addr-sub { color: #9ca3af !important; }
[data-theme="dark"] .emp-endereco-row { border-color: #374151 !important; }
[data-theme="dark"] .emp-file-card { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .emp-file-name { color: #f3f4f6 !important; }
[data-theme="dark"] .emp-file-desc { color: #6b7280 !important; }
[data-theme="dark"] .emp-timbrado-empty { background: #283548 !important; border-color: #374151 !important; color: #6b7280 !important; }
[data-theme="dark"] .emp-header .btn-editar { color: #9ca3af !important; border-color: #374151 !important; }
[data-theme="dark"] .emp-header .btn-editar:hover { color: #4da6ff !important; border-color: #4da6ff !important; }
[data-theme="dark"] .modal-upload-zone { background: #283548 !important; border-color: #374151 !important; }
[data-theme="dark"] .modal-upload-zone:hover { border-color: #4da6ff !important; background: rgba(77,166,255,0.08) !important; }
[data-theme="dark"] #modalEditarEmpresa .modal-header,
[data-theme="dark"] #modalEditarEmpresa .modal-footer { border-color: #374151 !important; }
[data-theme="dark"] #modalEditarEmpresa .section-divider { color: #9ca3af !important; border-color: #374151 !important; }

/* --- Distribuição --- */
[data-theme="dark"] .dist-card { background: #1f2937 !important; border-color: #374151 !important; }

/* --- Session & Perfil Modals --- */
[data-theme="dark"] #sgf-session-modal .modal-content { background: #1f2937 !important; }
[data-theme="dark"] #modalPerfil .modal-body.bg-light { background: #111827 !important; }
[data-theme="dark"] #modalPerfil .card { background: #283548 !important; }

/* --- Brand color overrides (navy/blue must be LIGHT in dark mode) --- */
[data-theme="dark"] .text-brand-navy { color: #93c5fd !important; }
[data-theme="dark"] .text-brand-primary { color: #4da6ff !important; }
[data-theme="dark"] [style*="color:#01306b"],
[data-theme="dark"] [style*="color:#01306B"],
[data-theme="dark"] [style*="color: #01306b"],
[data-theme="dark"] [style*="color: #01306B"],
[data-theme="dark"] [style*="color:#0c2b5e"],
[data-theme="dark"] [style*="color: #0c2b5e"],
[data-theme="dark"] [style*="color:#0070CF"],
[data-theme="dark"] [style*="color: #0070CF"],
[data-theme="dark"] [style*="color:#0070cf"],
[data-theme="dark"] [style*="color: #0070cf"] {
  color: #93c5fd !important;
}

/* --- Generic text overrides --- */
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3,
[data-theme="dark"] h4, [data-theme="dark"] h5, [data-theme="dark"] h6 { color: #f3f4f6; }
[data-theme="dark"] p { color: #d1d5db; }
[data-theme="dark"] label { color: #9ca3af; }
[data-theme="dark"] strong { color: #f3f4f6; }
[data-theme="dark"] small { color: #6b7280; }
[data-theme="dark"] .close, [data-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* --- Outline buttons dark mode --- */
[data-theme="dark"] .btn-outline-secondary { color: #9ca3af !important; border-color: #374151 !important; }
[data-theme="dark"] .btn-outline-secondary:hover { background: #283548 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .btn-outline-primary { color: #4da6ff !important; border-color: #4da6ff !important; }
[data-theme="dark"] .btn-light { background: #283548 !important; color: #f3f4f6 !important; border-color: #374151 !important; }

/* --- Scrollbar (webkit) --- */
[data-theme="dark"] ::-webkit-scrollbar { width: 8px; height: 8px; }
[data-theme="dark"] ::-webkit-scrollbar-track { background: #111827; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #374151; border-radius: 4px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #4b5563; }

/* =============================================================
   ADDITIONAL INLINE STYLE OVERRIDES (missing backgrounds/colors)
   ============================================================= */
[data-theme="dark"] [style*="background:#f8fafc"],
[data-theme="dark"] [style*="background: #f8fafc"],
[data-theme="dark"] [style*="background-color:#f8fafc"],
[data-theme="dark"] [style*="background-color: #f8fafc"] {
  background: #283548 !important;
}
[data-theme="dark"] [style*="background:#e9ecef"],
[data-theme="dark"] [style*="background: #e9ecef"],
[data-theme="dark"] [style*="background-color:#e9ecef"],
[data-theme="dark"] [style*="background-color: #e9ecef"] {
  background: #283548 !important;
}
[data-theme="dark"] [style*="background:#fef2f2"],
[data-theme="dark"] [style*="background: #fef2f2"],
[data-theme="dark"] [style*="background:#fdf2f2"],
[data-theme="dark"] [style*="background: #fdf2f2"] {
  background: rgba(220,53,69,0.15) !important;
}
[data-theme="dark"] [style*="background:#f0f9f4"],
[data-theme="dark"] [style*="background: #f0f9f4"],
[data-theme="dark"] [style*="background:#e6f4ed"],
[data-theme="dark"] [style*="background: #e6f4ed"],
[data-theme="dark"] [style*="background:#f4faf6"],
[data-theme="dark"] [style*="background: #f4faf6"],
[data-theme="dark"] [style*="background:#f5fbf8"],
[data-theme="dark"] [style*="background: #f5fbf8"],
[data-theme="dark"] [style*="background:#eef7f2"],
[data-theme="dark"] [style*="background: #eef7f2"],
[data-theme="dark"] [style*="background:#eff7f1"],
[data-theme="dark"] [style*="background: #eff7f1"],
[data-theme="dark"] [style*="background:#e9f3eb"],
[data-theme="dark"] [style*="background: #e9f3eb"],
[data-theme="dark"] [style*="background:#f6f8fa"],
[data-theme="dark"] [style*="background: #f6f8fa"],
[data-theme="dark"] [style*="background:#f0f1f3"],
[data-theme="dark"] [style*="background: #f0f1f3"] {
  background: #283548 !important;
}
[data-theme="dark"] [style*="color:#1a56db"],
[data-theme="dark"] [style*="color: #1a56db"] {
  color: #60a5fa !important;
}
[data-theme="dark"] [style*="color:#2563eb"],
[data-theme="dark"] [style*="color: #2563eb"] {
  color: #60a5fa !important;
}
[data-theme="dark"] [style*="color:#4a5568"],
[data-theme="dark"] [style*="color: #4a5568"] {
  color: #9ca3af !important;
}
[data-theme="dark"] [style*="border:1.5px solid #e2e8f0"],
[data-theme="dark"] [style*="border: 1.5px solid #e2e8f0"],
[data-theme="dark"] [style*="border:1.5px solid #d0d7de"],
[data-theme="dark"] [style*="border: 1.5px solid #d0d7de"],
[data-theme="dark"] [style*="border:1.5px dashed #d0d7de"],
[data-theme="dark"] [style*="border: 1.5px dashed #d0d7de"] {
  border-color: #374151 !important;
}
[data-theme="dark"] [style*="border-bottom:2px solid #d0d7de"],
[data-theme="dark"] [style*="border-bottom: 2px solid #d0d7de"],
[data-theme="dark"] [style*="border-right:2px solid #d0d7de"],
[data-theme="dark"] [style*="border-right: 2px solid #d0d7de"],
[data-theme="dark"] [style*="border-bottom:2px solid #334155"],
[data-theme="dark"] [style*="border-bottom: 2px solid #334155"] {
  border-color: #4b5563 !important;
}

/* --- Bootstrap shadow overrides --- */
[data-theme="dark"] .shadow-sm { box-shadow: 0 .125rem .25rem rgba(0,0,0,.3) !important; }
[data-theme="dark"] .shadow { box-shadow: 0 .5rem 1rem rgba(0,0,0,.35) !important; }
[data-theme="dark"] .shadow-lg { box-shadow: 0 1rem 3rem rgba(0,0,0,.4) !important; }

/* =============================================================
   CHECKLIST GRID — COMPLETE DARK MODE
   ============================================================= */
[data-theme="dark"] .grid-checklist th,
[data-theme="dark"] .grid-checklist td { border-color: #374151 !important; }
[data-theme="dark"] .grid-checklist thead th { background: #283548 !important; color: #9ca3af !important; border-bottom-color: #4b5563 !important; }
[data-theme="dark"] .th-label { color: #9ca3af !important; }
[data-theme="dark"] .td-ctx { background: #1a2332 !important; }
[data-theme="dark"] .grid-checklist thead .th-ctx { background: #283548 !important; color: #9ca3af !important; }
[data-theme="dark"] .td-ctx-last { border-right-color: #4b5563 !important; box-shadow: 4px 0 6px -2px rgba(0,0,0,0.3) !important; }
[data-theme="dark"] .grid-checklist thead .th-ctx-last { border-right-color: #4b5563 !important; box-shadow: 4px 0 6px -2px rgba(0,0,0,0.3) !important; }
[data-theme="dark"] .td-check { background: #1f2937 !important; color: #f3f4f6; }
[data-theme="dark"] .td-meta { background: #1f2937 !important; color: #f3f4f6; }
[data-theme="dark"] .grid-checklist tbody tr:nth-child(even) .td-check { background: #1a2332 !important; }
[data-theme="dark"] .grid-checklist tbody tr:nth-child(even) .td-ctx { background: #182030 !important; }
[data-theme="dark"] .grid-checklist tbody tr:nth-child(even) .td-meta { background: #1a2332 !important; }
[data-theme="dark"] .grid-checklist tbody tr:hover .td-check,
[data-theme="dark"] .grid-checklist tbody tr:hover .td-meta { background: rgba(77,166,255,0.08) !important; }
[data-theme="dark"] .grid-checklist tbody tr:hover .td-ctx { background: rgba(77,166,255,0.06) !important; }
[data-theme="dark"] .grid-checklist tbody tr.tr-complete .td-check,
[data-theme="dark"] .grid-checklist tbody tr.tr-complete .td-meta { background-color: rgba(22,163,74,0.1) !important; }
[data-theme="dark"] .grid-checklist tbody tr.tr-complete .td-ctx { background-color: rgba(22,163,74,0.08) !important; }
[data-theme="dark"] .grid-checklist tbody tr.tr-complete:nth-child(even) .td-check,
[data-theme="dark"] .grid-checklist tbody tr.tr-complete:nth-child(even) .td-meta { background-color: rgba(22,163,74,0.07) !important; }
[data-theme="dark"] .grid-checklist tbody tr.tr-complete:nth-child(even) .td-ctx { background-color: rgba(22,163,74,0.05) !important; }
[data-theme="dark"] .grid-wrapper { border-color: #374151 !important; }
[data-theme="dark"] .grid-wrapper::-webkit-scrollbar-track { background: #111827 !important; }
[data-theme="dark"] .grid-wrapper::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15) !important; }

/* Checklist grid badge & avatar */
[data-theme="dark"] .badge-modelo-nome { background: rgba(77,166,255,0.15) !important; color: #60a5fa !important; }
[data-theme="dark"] .avatar-mini-checklist { background: rgba(77,166,255,0.15) !important; color: #4da6ff !important; border-color: #1f2937 !important; }

/* Checklist grid command card */
[data-theme="dark"] .command-card { background: #1f2937 !important; box-shadow: 0 1px 4px rgba(0,0,0,0.2), 0 4px 16px rgba(0,0,0,0.15) !important; }
[data-theme="dark"] .command-card .breadcrumb-back { color: #6b7280 !important; }
[data-theme="dark"] .command-card .breadcrumb-back:hover { color: #f3f4f6 !important; }
[data-theme="dark"] .progress-slim { background: #374151 !important; }

/* Checklist grid drawer */
[data-theme="dark"] .drawer-header { border-color: #374151 !important; }
[data-theme="dark"] .drawer-header h6 { color: #f3f4f6 !important; }
[data-theme="dark"] .drawer-close { background: #283548 !important; color: #9ca3af !important; }
[data-theme="dark"] .drawer-close:hover { background: #374151 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .drawer-panel { background: #1f2937 !important; box-shadow: -8px 0 30px rgba(0,0,0,0.5) !important; }
[data-theme="dark"] .drawer-island { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .drawer-island-header { color: #6b7280 !important; }
[data-theme="dark"] .drawer-switch-row { border-color: #283548 !important; }
[data-theme="dark"] .drawer-switch-row:hover { background: #283548 !important; }
[data-theme="dark"] .drawer-switch-label { color: #f3f4f6 !important; }

/* Checklist grid filter */
[data-theme="dark"] .filtro-toggle-btn { border-color: #374151 !important; color: #9ca3af !important; }
[data-theme="dark"] .filtro-toggle-btn:hover { background: #283548 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .filtro-toggle-btn.open { background: rgba(77,166,255,0.1) !important; color: #4da6ff !important; border-color: #374151 !important; }
[data-theme="dark"] .filtro-grupo-label { color: #6b7280 !important; }
[data-theme="dark"] .badge-turma { background: #283548 !important; color: #9ca3af !important; border-color: #374151 !important; }
[data-theme="dark"] .badge-turma:hover { background: #374151 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .badge-turma.active { background: #4da6ff !important; color: #fff !important; border-color: #4da6ff !important; }

/* Checklist grid ghost buttons */
[data-theme="dark"] .btn-ghost-colunas { color: #9ca3af !important; }
[data-theme="dark"] .btn-ghost-colunas:hover { color: #4da6ff !important; background: rgba(77,166,255,0.08) !important; }

/* Checklist grid anexo icons */
[data-theme="dark"] .anexo-icon-view { background: rgba(77,166,255,0.15) !important; color: #4da6ff !important; }
[data-theme="dark"] .anexo-icon-view:hover { background: rgba(77,166,255,0.25) !important; }
[data-theme="dark"] .anexo-icon-del:hover { background: rgba(220,53,69,0.15) !important; color: #f87171 !important; }
[data-theme="dark"] .anexo-upload-btn { background: #283548 !important; color: #6b7280 !important; border-color: #374151 !important; }
[data-theme="dark"] .anexo-upload-btn:hover { background: rgba(77,166,255,0.1) !important; color: #4da6ff !important; border-color: #4da6ff !important; }

/* Checklist grid sorting */
[data-theme="dark"] .sort-icon { color: #4b5563 !important; }
[data-theme="dark"] .th-sortable:hover .th-label { color: #4da6ff !important; }
[data-theme="dark"] .th-sortable:hover .sort-icon { color: #6b7280 !important; }
[data-theme="dark"] .sort-icon.sort-active { color: #4da6ff !important; }

/* Checklist grid copy */
[data-theme="dark"] .td-copyable:hover { background-color: #283548 !important; }

/* Checklist modal tabs */
[data-theme="dark"] #instanciaTabs { background: #283548 !important; }
[data-theme="dark"] #instanciaTabs .nav-link { color: #9ca3af !important; }
[data-theme="dark"] #instanciaTabs .nav-link:not(.active):hover { color: #4da6ff !important; background: rgba(77,166,255,0.08) !important; }
[data-theme="dark"] #instanciaTabs .nav-link.active { color: #fff !important; background: #4da6ff !important; }

/* Checklist chip dropdown items */
[data-theme="dark"] .chip-dropdown-item:hover { background: #283548 !important; }
[data-theme="dark"] .chip-dropdown-empty { color: #6b7280 !important; }

/* Checklist preview */
[data-theme="dark"] .preview-col .preview-header { border-color: #374151 !important; }
[data-theme="dark"] .preview-empty-state { color: #6b7280 !important; }
[data-theme="dark"] .preview-mini-table thead th { background: linear-gradient(135deg, #1a3a5c 0%, #15304d 100%) !important; color: #f3f4f6 !important; }

/* =============================================================
   DASHBOARD FINANCEIRO — CONTRAST FIXES
   ============================================================= */
[data-theme="dark"] .dfin-card { box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important; }
[data-theme="dark"] .dfin-faceoff-total-label { color: #6b7280 !important; }
[data-theme="dark"] .dfin-faceoff-year-label { color: #9ca3af !important; }
[data-theme="dark"] .dfin-faceoff-year-current { color: #60a5fa !important; }
[data-theme="dark"] .dfin-legend-cancelado { background: #6b7280 !important; }
[data-theme="dark"] .dfin-faceoff-legend-item { color: #9ca3af !important; }
[data-theme="dark"] .dfin-faceoff-legend-dot[style*="background:#374151"] { background: #6b7280 !important; }
[data-theme="dark"] .dfin-card-title { color: #f3f4f6 !important; }
[data-theme="dark"] .dfin-card-subtitle { color: #6b7280 !important; }
[data-theme="dark"] .dfin-escola-search { background: #283548 !important; border-color: #374151 !important; color: #f3f4f6 !important; }
[data-theme="dark"] .dfin-escola-search::placeholder { color: #6b7280; }
[data-theme="dark"] .dfin-eq-nome { color: #f3f4f6 !important; }
[data-theme="dark"] .dfin-eq-valor-carteira { color: #9ca3af !important; }
[data-theme="dark"] .dfin-eq-escolas { color: #6b7280 !important; }
[data-theme="dark"] .dfin-eq-impacto { color: #dc3545 !important; }
[data-theme="dark"] .dfin-eq-impacto-zero { color: #16a34a !important; }
[data-theme="dark"] .dfin-eq-avatar { background: #283548 !important; color: #4da6ff !important; }
[data-theme="dark"] .dfin-eq-sub-header { color: #6b7280 !important; border-color: #374151 !important; }
[data-theme="dark"] .dfin-eq-sub-row { border-color: #374151 !important; }
[data-theme="dark"] .dfin-eq-sub-risco { color: inherit !important; }
[data-theme="dark"] .dfin-eq-sub-contratos { color: #9ca3af !important; }
[data-theme="dark"] .dfin-faceoff-arrow { color: #6b7280 !important; }
[data-theme="dark"] .dfin-grid-ano { color: #9ca3af !important; }

/* Dashboard grid value colors — brighter for dark mode */
[data-theme="dark"] .dfin-v-quitado { color: #60a5fa !important; border-left-color: #60a5fa !important; }
[data-theme="dark"] .dfin-v-emdia { color: #34d399 !important; border-left-color: #34d399 !important; }
[data-theme="dark"] .dfin-v-conf { color: #fbbf24 !important; border-left-color: #fbbf24 !important; }
[data-theme="dark"] .dfin-v-atraso { color: #fb923c !important; border-left-color: #f59e0b !important; }
[data-theme="dark"] .dfin-v-inad { color: #f87171 !important; border-left-color: #f87171 !important; }
[data-theme="dark"] .dfin-v-total { color: #f3f4f6 !important; }
[data-theme="dark"] .dfin-pct-label { opacity: 1 !important; color: #d1d5db !important; }

/* Dashboard liquidação colors — brighter for dark mode */
[data-theme="dark"] .dfin-lv-credito { color: #22d3ee !important; border-left-color: #22d3ee !important; }
[data-theme="dark"] .dfin-lv-debito { color: #a78bfa !important; border-left-color: #a78bfa !important; }
[data-theme="dark"] .dfin-lv-pix { color: #34d399 !important; border-left-color: #34d399 !important; }
[data-theme="dark"] .dfin-lv-dinheiro { color: #fbbf24 !important; border-left-color: #fbbf24 !important; }
[data-theme="dark"] .dfin-lv-total { color: #34d399 !important; border-left-color: #34d399 !important; }

/* Dashboard grid table headers — brighter for dark mode */
[data-theme="dark"] .dfin-th-quitado { color: #60a5fa !important; }
[data-theme="dark"] .dfin-th-emdia { color: #34d399 !important; }
[data-theme="dark"] .dfin-th-conf { color: #fbbf24 !important; }
[data-theme="dark"] .dfin-th-atraso { color: #fb923c !important; }
[data-theme="dark"] .dfin-th-inad { color: #f87171 !important; }
[data-theme="dark"] .dfin-th-total { color: #9ca3af !important; }

/* Dashboard liquidação table headers — brighter for dark mode */
[data-theme="dark"] .dfin-th-credito { color: #22d3ee !important; }
[data-theme="dark"] .dfin-th-debito { color: #a78bfa !important; }
[data-theme="dark"] .dfin-th-pix { color: #34d399 !important; }
[data-theme="dark"] .dfin-th-dinheiro { color: #fbbf24 !important; }
[data-theme="dark"] .dfin-th-liq-total { color: #34d399 !important; }

/* Dashboard bloco liquidação bg */
[data-theme="dark"] .dfin-bloco-liq { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .dfin-grid-footer { border-color: #374151 !important; }
[data-theme="dark"] .dfin-liq-footer { border-color: #374151 !important; }
/* Badges de contratos/inadimplência — mais contraste no dark */
[data-theme="dark"] .dfin-bloco-badge { font-size: 0.78rem; font-weight: 700; padding: 4px 14px; color: #fff !important; letter-spacing: 0.02em; }
[data-theme="dark"] .dfin-bloco-badge-info { background: #2563eb !important; }
[data-theme="dark"] .dfin-bloco-badge-danger { background: #dc2626 !important; }
[data-theme="dark"] .dfin-bloco-badge-success { background: #16a34a !important; }
/* Porcentagens na grid — remover opacity que torna ilegível no dark */
[data-theme="dark"] .dfin-pct-label { opacity: 1 !important; color: #d1d5db !important; }
/* Descrição do bloco — mais legível */
[data-theme="dark"] .dfin-bloco-desc { color: #9ca3af !important; }

/* =============================================================
   FINANCEIRO VIEW — CONTRAST FIXES
   ============================================================= */
[data-theme="dark"] .card-kpi { background: #1f2937 !important; border-color: #374151 !important; }
[data-theme="dark"] .card-kpi-active { border-color: #4da6ff !important; }

/* =============================================================
   GENERAL CONTRAST IMPROVEMENTS
   ============================================================= */
/* Fix nav-tabs link contrast */
[data-theme="dark"] .nav-tabs .nav-link { color: #7a8a9e !important; }
[data-theme="dark"] .nav-tabs .nav-link:hover { color: #c8d4e0 !important; }

/* Fix btn-outline-primary hover */
[data-theme="dark"] .btn-outline-primary:hover { background: rgba(77,166,255,0.15) !important; color: #4da6ff !important; }

/* Fix light gray text on dark bg */
[data-theme="dark"] [style*="color:#94a3b8"],
[data-theme="dark"] [style*="color: #94a3b8"] {
  color: #9ca3af !important;
}

/* Fix filter box label contrast */
[data-theme="dark"] .filter-box label { color: #9ca3af !important; }

/* Desativar icon bg */
.desativar-icon-bg { background: #fef2f2; }
[data-theme="dark"] .desativar-icon-bg { background: rgba(220,53,69,0.15) !important; }

/* Fix Bootstrap progress bar track */
[data-theme="dark"] .progress { --bs-progress-bg: #374151; }

/* Fix chip-select dark mode */
[data-theme="dark"] .chip-select-input input { color: #f3f4f6 !important; }
[data-theme="dark"] .chip-select-input input::placeholder { color: #6b7280; }

/* =========================================
   SGF CUSTOM SELECT
   ========================================= */
.sgf-sel-wrap {
  position: relative;
  width: 100%;
}

.sgf-sel-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 6px 12px;
  font-size: 0.875rem;
  font-family: inherit;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  user-select: none;
}
.sgf-sel-trigger:hover {
  border-color: #adb5bd;
}
.sgf-sel-trigger:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 0.15rem rgba(0, 112, 207, 0.15);
}
.sgf-sel-open .sgf-sel-trigger {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 0.15rem rgba(0, 112, 207, 0.15);
}
.sgf-sel-disabled .sgf-sel-trigger {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.sgf-sel-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sgf-sel-placeholder {
  color: var(--text-muted);
}

.sgf-sel-chevron {
  font-size: 0.7rem;
  color: var(--text-secondary);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.sgf-sel-open .sgf-sel-chevron {
  transform: rotate(180deg);
}

/* Dropdown (portal no body — position:fixed) */
.sgf-sel-dropdown {
  position: fixed;
  z-index: 10070;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  overflow: hidden;
  animation: sgfSelFadeIn 0.12s ease-out;
  display: flex;
  flex-direction: column;
}

@keyframes sgfSelFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Search */
.sgf-sel-search-wrap {
  padding: 8px 8px 4px;
}
.sgf-sel-search {
  width: 100%;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-family: inherit;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}
.sgf-sel-search:focus {
  border-color: var(--brand-blue);
}
.sgf-sel-search::placeholder {
  color: var(--text-muted);
}

/* Options list */
.sgf-sel-options {
  max-height: 260px;
  overflow-y: auto;
  padding: 4px 0;
  overscroll-behavior: contain;
}
.sgf-sel-options::-webkit-scrollbar {
  width: 5px;
}
.sgf-sel-options::-webkit-scrollbar-thumb {
  background: rgba(128,128,128,0.3);
  border-radius: 3px;
}

/* Item */
.sgf-sel-item {
  padding: 7px 12px;
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sgf-sel-item:hover,
.sgf-sel-item-focus {
  background: var(--hover-bg);
}
.sgf-sel-item-active {
  color: var(--brand-blue);
  font-weight: 600;
}
.sgf-sel-item-disabled {
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.5;
}
.sgf-sel-item-disabled:hover {
  background: transparent;
}
.sgf-sel-empty {
  padding: 12px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* === DARK MODE === */
[data-theme="dark"] .sgf-sel-trigger {
  background: transparent;
  border-color: rgba(255,255,255,0.12);
  color: #f3f4f6;
}
[data-theme="dark"] .sgf-sel-trigger:hover {
  border-color: rgba(255,255,255,0.25);
}
[data-theme="dark"] .sgf-sel-trigger:focus,
[data-theme="dark"] .sgf-sel-open .sgf-sel-trigger {
  border-color: rgba(77, 166, 255, 0.5);
  box-shadow: 0 0 0 0.15rem rgba(77, 166, 255, 0.1);
}
[data-theme="dark"] .sgf-sel-placeholder {
  color: #5a6577;
}
[data-theme="dark"] .sgf-sel-chevron {
  color: #6b7280;
}
[data-theme="dark"] .sgf-sel-dropdown {
  background: #1f2937;
  border-color: #374151;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
[data-theme="dark"] .sgf-sel-search {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
  color: #f3f4f6;
}
[data-theme="dark"] .sgf-sel-search:focus {
  border-color: rgba(77, 166, 255, 0.5);
}
[data-theme="dark"] .sgf-sel-search::placeholder {
  color: #5a6577;
}
[data-theme="dark"] .sgf-sel-item {
  color: #e5e7eb;
}
[data-theme="dark"] .sgf-sel-item:hover,
[data-theme="dark"] .sgf-sel-item-focus {
  background: rgba(77, 166, 255, 0.08);
}
[data-theme="dark"] .sgf-sel-item-active {
  color: #4da6ff;
}
[data-theme="dark"] .sgf-sel-empty {
  color: #6b7280;
}

/* =========================================
   PREVIEW OVERLAY (global — usado por Comunicações, Captação, etc)
   ========================================= */
.com-preview-overlay { position:fixed; inset:0; z-index:99999; background:rgba(0,0,0,0.55); display:flex; align-items:center; justify-content:center; animation:comOverlayIn 0.2s ease; }
@keyframes comOverlayIn { from{opacity:0} to{opacity:1} }
.com-preview-frame { background:#f5f5f7; border-radius:16px; box-shadow:0 25px 80px rgba(0,0,0,0.25); display:flex; flex-direction:column; height:85vh; width:800px; max-width:95vw; overflow:hidden; animation:comFrameIn 0.2s ease; }
@keyframes comFrameIn { from{transform:scale(0.95);opacity:0} to{transform:scale(1);opacity:1} }
.com-preview-frame-header { display:flex; align-items:center; gap:12px; padding:12px 16px; border-bottom:1px solid #e5e7eb; background:#fff; border-radius:16px 16px 0 0; }
.com-preview-frame-title { flex:1; font-size:0.82rem; font-weight:700; color:#1c1c1e; }
.com-preview-frame-tabs { display:flex; gap:4px; }
.com-preview-frame-tab { padding:5px 14px; border-radius:6px; border:1px solid #e5e7eb; background:#fff; font-size:0.72rem; font-weight:600; color:#6b7280; cursor:pointer; transition:all 0.15s; }
.com-preview-frame-tab:hover { background:#f0f7ff; border-color:#93c5fd; color:#0070cf; }
.com-preview-frame-tab.active { background:#0070cf; color:#fff; border-color:#0070cf; }
.com-preview-frame-close { width:28px; height:28px; border-radius:8px; border:none; background:#f3f4f6; display:flex; align-items:center; justify-content:center; cursor:pointer; font-size:0.8rem; color:#6b7280; transition:all 0.15s; }
.com-preview-frame-close:hover { background:#e5e7eb; }
.com-preview-frame-body { flex:1; overflow-y:auto; padding:24px; display:flex; justify-content:center; align-items:flex-start; background:#f5f5f7; }
/* Preview content */
.com-preview-frame-content { background:var(--surface, #fff); border-radius:4px; box-shadow:0 1px 6px rgba(0,0,0,0.1); overflow:hidden; transition:width 0.3s ease; }
.com-preview-frame-content.mobile { width:375px; }
.com-preview-frame-content.desktop { width:700px; }
.com-preview-frame-content iframe { width:100%; border:none; }

[data-theme="dark"] .com-preview-frame { background:#111827; }
[data-theme="dark"] .com-preview-frame-header { background:#1f2937; border-color:#374151; }
[data-theme="dark"] .com-preview-frame-title { color:#f3f4f6; }
[data-theme="dark"] .com-preview-frame-tab { background:#1f2937; border-color:#374151; color:#9ca3af; }
[data-theme="dark"] .com-preview-frame-tab:hover { background:rgba(77,166,255,0.08); border-color:rgba(77,166,255,0.3); color:#4da6ff; }
[data-theme="dark"] .com-preview-frame-tab.active { background:#0070cf; color:#fff; border-color:#0070cf; }
[data-theme="dark"] .com-preview-frame-close { background:#374151; color:#9ca3af; }
[data-theme="dark"] .com-preview-frame-close:hover { background:#4b5563; }
[data-theme="dark"] .com-preview-frame-body { background:#0f172a; }
[data-theme="dark"] .com-preview-frame-content { background:#1f2937; box-shadow:0 1px 6px rgba(0,0,0,0.3); }

