/* ============================================================
   TRADSUL FINANCE — Custom Stylesheet
   Supplements Tailwind utility classes with component styles,
   custom scrollbars, animations, and @layer overrides.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ---- CSS Variables ---- */
:root {
  --color-navy:       #1e3a5f;
  --color-blue-brand: #1d4ed8;
  --color-green-ok:   #16a34a;
  --color-slate-bg:   #f1f5f9;
  --radius-card:      0.75rem;
  --transition-fast:  0.15s ease;
  --transition-med:   0.25s ease;
  --shadow-card:      0 1px 3px 0 rgb(0 0 0 / .10), 0 1px 2px -1px rgb(0 0 0 / .10);
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--color-slate-bg);
  color: #1e293b;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   NAVBAR
   ============================================================ */
#navbar {
  background: linear-gradient(90deg, #0f172a 0%, #1e3a5f 100%);
  border-bottom: 1px solid #1e40af44;
}

.navbar-logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 6px rgb(59 130 246 / .4));
}

/* ============================================================
   FILTER PANEL
   ============================================================ */
#filter-panel {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid #334155;
}

.filter-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 0.35rem;
}

.filter-field {
  display: flex;
  flex-direction: column;
}

.filter-input,
.filter-select {
  width: 100%;
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.8rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
}

.filter-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 2rem;
  cursor: pointer;
}

.filter-input:focus,
.filter-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgb(59 130 246 / .15);
}

.filter-input::placeholder {
  color: #475569;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgb(37 99 235 / .35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 4px 14px rgb(37 99 235 / .45);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid #334155;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
  white-space: nowrap;
}

.btn-secondary:hover {
  color: #e2e8f0;
  border-color: #475569;
  background: #1e293b;
}

/* Gerar BH button (green) inside table */
.btn-gerar-bh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.8rem;
  border-radius: 0.375rem;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  white-space: nowrap;
  box-shadow: 0 1px 4px rgb(22 163 74 / .3);
  letter-spacing: 0.02em;
}

.btn-gerar-bh:hover {
  background: linear-gradient(135deg, #15803d, #166534);
  box-shadow: 0 3px 10px rgb(22 163 74 / .4);
  transform: translateY(-1px);
}

.btn-gerar-bh:active {
  transform: translateY(0);
}

/* Faturar button (indigo) inside table */
.btn-faturar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.8rem;
  border-radius: 0.375rem;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  white-space: nowrap;
  box-shadow: 0 1px 4px rgb(79 70 229 / .3);
  letter-spacing: 0.02em;
}

.btn-faturar:hover {
  background: linear-gradient(135deg, #4338ca, #3730a3);
  box-shadow: 0 3px 10px rgb(79 70 229 / .4);
  transform: translateY(-1px);
}

.btn-faturar:active {
  transform: translateY(0);
}

/* Pagination buttons */
.pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #475569;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-number-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.page-number-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.page-number-btn.active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
  font-weight: 700;
}

/* ============================================================
   TABLE
   ============================================================ */
.table-scroll-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 60vh;
}

/* Custom scrollbar */
.table-scroll-wrapper::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

.table-scroll-wrapper::-webkit-scrollbar-track {
  background: #f8fafc;
  border-radius: 4px;
}

.table-scroll-wrapper::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.table-scroll-wrapper::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

#processos-table {
  border-collapse: collapse;
  min-width: 1400px;
}

/* ============================================================
   STICKY COLUMNS — first two columns frozen on left
   ============================================================ */

/* Shared sticky behaviour */
.th-sticky {
  position: sticky;
  z-index: 20; /* above scrolling data rows */
  background: #f1f5f9; /* bg-gray-50 — matches thead row */
}

.td-sticky {
  position: sticky;
  z-index: 10; /* above non-sticky cells, below sticky headers */
  background: #ffffff; /* solid white so scrolling data is hidden */
}

/* Column 1: SITUAÇÃO — anchored at the very left */
.th-sticky-1,
.td-sticky-1 {
  left: 0;
  min-width: 220px;
  max-width: 220px;
  width: 220px;
}

/* Column 2: CÓD. SINISTRO — offset by exact width of col 1 */
.th-sticky-2,
.td-sticky-2 {
  left: 220px;
  min-width: 160px;
  max-width: 160px;
  width: 160px;
  /* Hard right border marks the freeze boundary */
  border-right: 2px solid #e2e8f0;
  /* Drop-shadow reinforces the boundary on data cells */
  box-shadow: 3px 0 8px -2px rgb(0 0 0 / .10);
}

/* On row hover keep sticky cells in the hover background */
#processos-table tbody tr:hover .td-sticky {
  background: #f8fafc;
}

.th-cell {
  padding: 0.6rem 1rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #475569;
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: #f1f5f9;
  border-bottom: 2px solid #e2e8f0;
  z-index: 1;
}

.td-cell {
  padding: 0.65rem 1rem;
  font-size: 0.8rem;
  color: #374151;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
 
}

#processos-table tbody tr {
  transition: background var(--transition-fast);
}

#processos-table tbody tr:hover {
  background: #f8fafc;
}

/* ============================================================
   STATUS BADGES (Pill design)
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

/* Situação badges — exact value matching */
.badge-em-aberto {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.badge-em-aberto::before { background: #16a34a; }

/* CONCLUIDO TECNICAMENTE -> yellow */
.badge-concluido-tec {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde68a;
}
.badge-concluido-tec::before { background: #ca8a04; }

/* ENCERRADO FINANCEIRAMENTE -> blue */
.badge-encerrado-fin {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}
.badge-encerrado-fin::before { background: #2563eb; }

/* SITUAÇÃO: CONCLUÍDO FINANCEIRAMENTE -> Blue */
.badge-concluido-fin { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.badge-concluido-fin::before { background: #2563eb; }

/* keep the old aliases for backward compat */
.badge-concluido {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.badge-concluido::before { background: #2563eb; }

.badge-cancelado {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.badge-cancelado::before { background: #ef4444; }

.badge-pendente {
  background: #fef9c3;
  color: #a16207;
  border: 1px solid #fef08a;
}
.badge-pendente::before { background: #ca8a04; }

.badge-suspenso {
  background: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}
.badge-suspenso::before { background: #9333ea; }

/* Generic / fallback */
.badge-default {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.badge-default::before { background: #94a3b8; }

/* Alerta Cobrança / Alerta BH — exact value badges */
/* NAO GERAR / NÃO GERAR -> red */
.badge-nao-gerar {
  background: #fff1f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.badge-nao-gerar::before { background: #ef4444; }

/* GERAR BH -> green */
.badge-gerar-bh {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.badge-gerar-bh::before { background: #16a34a; }

/* ALERTA COBRANÇA: COBRANÇA IMEDIATA -> Red */
.badge-cobranca-imediata { background: #fff1f2; color: #b91c1c; border: 1px solid #fecaca; }
.badge-cobranca-imediata::before { background: #ef4444; }

/* ALERTA COBRANÇA: NO PRAZO -> Green */
.badge-no-prazo { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.badge-no-prazo::before { background: #16a34a; }

/* generic alerta helpers (kept for fallback) */
.badge-alerta-ok   { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.badge-alerta-ok::before { background: #16a34a; }

.badge-alerta-aviso { background: #fef9c3; color: #a16207; border: 1px solid #fef08a; }
.badge-alerta-aviso::before { background: #ca8a04; }

.badge-alerta-critico { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.badge-alerta-critico::before { background: #ef4444; }

/* ============================================================
   AUTOCOMPLETE DROPDOWN
   ============================================================ */
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgb(0 0 0 / .3);
  z-index: 9999;
  max-height: 200px;
  overflow-y: auto;
}

.autocomplete-dropdown::-webkit-scrollbar { width: 4px; }
.autocomplete-dropdown::-webkit-scrollbar-track { background: transparent; }
.autocomplete-dropdown::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; }

.autocomplete-item {
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  color: #cbd5e1;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  border-bottom: 1px solid #1e3a5f22;
}

.autocomplete-item:last-child { border-bottom: none; }

.autocomplete-item:hover {
  background: #1d4ed8;
  color: #fff;
}

.autocomplete-empty {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: #475569;
  text-align: center;
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.spinner-sm {
  width: 14px;
  height: 14px;
  border: 2px solid #e2e8f0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #1e293b;
  color: #e2e8f0;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  border-radius: 0.65rem;
  box-shadow: 0 8px 24px rgb(0 0 0 / .25);
  z-index: 99999;
  border-left: 4px solid #3b82f6;
  animation: slideIn 0.25s ease;
  max-width: 360px;
}

.toast.toast-success { border-left-color: #16a34a; }
.toast.toast-error   { border-left-color: #dc2626; }
.toast.toast-warn    { border-left-color: #ca8a04; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */
@media (max-width: 1023px) {
  /* Disable sticky columns in the main Processes table on mobile & tablet viewports */
  #processos-table th[style*="position: sticky"],
  #processos-table td[style*="position: sticky"],
  #processos-table th[style*="position:sticky"],
  #processos-table td[style*="position:sticky"],
  .th-cell,
  .td-cell,
  .th-sticky,
  .td-sticky,
  .th-sticky-1,
  .td-sticky-1,
  .th-sticky-2,
  .td-sticky-2 {
    position: static !important;
    left: auto !important;
    background: transparent !important;
    border-right: none !important;
    box-shadow: none !important;
  }

  /* Restore stable background colors for standard table header scrolling */
  #processos-table thead tr {
    background-color: #f1f5f9 !important;
  }
  #processos-table th {
    background-color: #f1f5f9 !important;
    position: static !important;
  }
  
  /* Reset stickiness for hover rows */
  #processos-table tbody tr:hover .td-sticky,
  #processos-table tbody tr:hover td {
    background: #f8fafc !important;
  }
}

@media (max-width: 768px) {
  .table-scroll-wrapper { max-height: 50vh; }

  #filter-panel .grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  #filter-panel .grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   UTILITY — Fade in for table rows
   ============================================================ */
@keyframes fadeRowIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.row-enter {
  animation: fadeRowIn 0.2s ease forwards;
}

/* ============================================================
   INLINE EDITING — STATUS BH select & OBS input
   ============================================================ */

/* Inline STATUS BH <select> inside tbody */
.inline-select {
  width: 100%;
  min-width: 140px;
  background: #f8fafc;
  color: #374151;
  border: 1px solid #e2e8f0;
  border-radius: 0.4rem;
  padding: 0.3rem 1.8rem 0.3rem 0.5rem;
  font-size: 0.75rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.inline-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgb(59 130 246 / .15);
  background-color: #fff;
}

/* Saving state (briefly while PATCH is in flight) */
.inline-select.saving {
  opacity: 0.6;
  pointer-events: none;
}

/* OBS flex container */
.obs-cell-wrapper {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.5rem;
  min-width: 320px;
}

/* Inline OBS <input> */
.inline-obs-input {
  flex: 1;
  min-width: 0;
  background: #f8fafc;
  color: #374151;
  border: 1px solid #e2e8f0;
  border-radius: 0.4rem;
  padding: 0.3rem 0.5rem;
  font-size: 0.75rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.inline-obs-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgb(59 130 246 / .15);
  background-color: #fff;
}

/* OBS action icon buttons */
.obs-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 0.35rem;
  cursor: pointer;
  background: transparent;
  padding: 0;
  flex-shrink: 0;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.obs-action-btn:hover {
  transform: scale(1.15);
}

.obs-save-btn:hover  { background: #dcfce7; }
.obs-clear-btn:hover { background: #fee2e2; }

/* Brief flash when a save succeeds */
@keyframes flashSuccess {
  0%   { background: #dcfce7; }
  100% { background: transparent; }
}

.save-flash {
  animation: flashSuccess 0.8s ease forwards;
}

/* ============================================================
   UTILITIES & CUSTOM SCROLLBAR
   ============================================================ */
.custom-scrollbar::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* ============================================================
   SIDEBAR & LAYOUT
   ============================================================ */
#sidebar {
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden;
}

#main-content {
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 100vh;
}

.sidebar-collapsed {
  width: 5rem !important; /* w-20 */
}

.sidebar-collapsed .sidebar-text {
  display: none;
}

.sidebar-collapsed #sidebar-logo {
  justify-content: center;
}

.sidebar-collapsed .nav-tab {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.sidebar-collapsed #toggle-icon {
  transform: rotate(180deg);
}

.content-expanded {
  margin-left: 5rem !important;
}

/* ============================================================
   NAV TABS (sidebar navigation switching)
   ============================================================ */
.nav-tab {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #94a3b8;
  background: transparent;
  border: none;
  border-radius: 0.5rem;
  padding: 0.625rem 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: normal;
  word-break: break-word;
  line-height: 1.2;
  width: 100%;
  text-align: left;
}

.nav-tab:hover {
  color: #e2e8f0;
  background: rgba(255,255,255,0.06);
}

.nav-tab--active {
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 4px 12px rgb(37 99 235 / .25);
  font-weight: 600;
}

.nav-tab svg {
  flex-shrink: 0;
}

/* Sub-menu styles */
#sub-dashboard {
  position: relative;
}

#sub-dashboard::before {
  content: '';
  position: absolute;
  left: 1.65rem;
  top: 0;
  bottom: 0.75rem;
  width: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.nav-subtab {
  display: flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 400;
  color: #64748b;
  padding: 0.5rem 0.75rem;
  padding-left: 1.5rem;
  border-radius: 0.375rem;
  transition: all 0.2s;
  cursor: pointer;
  width: 100%;
  position: relative;
  text-align: left;
  white-space: normal;
  word-break: break-word;
  line-height: 1.25;
}

.nav-subtab::before {
  content: '';
  position: absolute;
  left: 0.35rem;
  top: 50%;
  width: 0.5rem;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-50%);
}

.nav-subtab:hover {
  color: #cbd5e1;
  background: rgba(255,255,255,0.03);
}

.nav-subtab--active {
  color: #fff;
  background: rgba(37, 99, 235, 0.2);
  font-weight: 600;
}

.nav-subtab--active::after {
  content: '';
  position: absolute;
  left: 0.65rem;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #3b82f6;
  transform: translateY(-50%);
  box-shadow: 0 0 8px #3b82f6;
}

.sidebar-collapsed #sub-dashboard {
  display: none !important;
}

/* ============================================================
   KPI CARDS
   ============================================================ */
.kpi-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #ffffff;
  border-radius: var(--radius-card);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-card);
  border: 1px solid #f1f5f9;
  transition: transform var(--transition-med), box-shadow var(--transition-med);
  animation: kpiSlideUp 0.4s ease forwards;
  opacity: 0;
}

.kpi-card:nth-child(1) { animation-delay: 0s; }
.kpi-card:nth-child(2) { animation-delay: 0.07s; }
.kpi-card:nth-child(3) { animation-delay: 0.14s; }
.kpi-card:nth-child(4) { animation-delay: 0.21s; }

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgb(0 0 0 / .08);
}

.kpi-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  flex-shrink: 0;
}

.kpi-card-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 0.2rem;
}

.kpi-card-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

@keyframes kpiSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   CHART CARDS
   ============================================================ */
.chart-card {
  background: #ffffff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  border: 1px solid #f1f5f9;
  overflow: hidden;
  transition: box-shadow var(--transition-med);
}

.chart-card:hover {
  box-shadow: 0 8px 24px rgb(0 0 0 / .08);
}

.chart-card-header {
  padding: 1rem 1.25rem 0.5rem;
  border-bottom: 1px solid #f8fafc;
}

.chart-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
}

.chart-card-subtitle {
  font-size: 0.72rem;
  color: #94a3b8;
}

.chart-canvas-wrapper {
  position: relative;
  padding: 1rem 1.25rem 1.25rem;
  height: 320px;
}

.chart-canvas-wrapper--doughnut {
  height: 340px;
}

/* ============================================================
   MULTI-SELECT DROPDOWN COMPONENT
   ============================================================ */
.ms-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  width: 100%;
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.8rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  text-align: left;
}

.ms-trigger:hover {
  border-color: #475569;
}

.ms-trigger:focus,
.ms-trigger--open {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgb(59 130 246 / .15);
  outline: none;
}

.ms-trigger--open .ms-chevron {
  transform: rotate(180deg);
}

.ms-chevron {
  transition: transform var(--transition-fast);
}

.ms-trigger-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #475569;
}

.ms-trigger-label--active {
  color: #e2e8f0;
}

/* Dropdown panel */
.ms-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  box-shadow: 0 12px 32px rgb(0 0 0 / .35);
  z-index: 60;
  min-width: 220px;
  animation: msDropIn 0.15s ease;
}

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

/* Search inside dropdown */
.ms-search-wrapper {
  padding: 0.5rem;
  border-bottom: 1px solid #334155;
}

.ms-search {
  width: 100%;
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 0.375rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.75rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color var(--transition-fast);
}

.ms-search:focus {
  border-color: #3b82f6;
}

.ms-search::placeholder {
  color: #475569;
}

/* Options list */
.ms-options {
  max-height: 180px;
  overflow-y: auto;
  padding: 0.25rem 0;
}

.ms-options::-webkit-scrollbar { width: 4px; }
.ms-options::-webkit-scrollbar-track { background: transparent; }
.ms-options::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; }

/* Each option row */
.ms-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
  color: #cbd5e1;
  cursor: pointer;
  transition: background var(--transition-fast);
  user-select: none;
}

.ms-option:hover {
  background: rgba(59, 130, 246, 0.12);
}

/* Custom checkbox */
.ms-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.ms-option-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1.5px solid #475569;
  border-radius: 3px;
  background: #0f172a;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.ms-option input[type="checkbox"]:checked + .ms-option-check {
  background: #2563eb;
  border-color: #2563eb;
}

.ms-option input[type="checkbox"]:checked + .ms-option-check::after {
  content: '';
  display: block;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}

.ms-option-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Empty state */
.ms-empty {
  padding: 0.75rem;
  text-align: center;
  color: #475569;
  font-size: 0.75rem;
}

/* Footer actions */
.ms-footer {
  display: flex;
  justify-content: space-between;
  padding: 0.45rem 0.75rem;
  border-top: 1px solid #334155;
}

.ms-footer-btn {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 0.375rem;
  border: none;
  cursor: pointer;
  background: transparent;
  color: #94a3b8;
  transition: all var(--transition-fast);
}

.ms-footer-btn:hover {
  color: #e2e8f0;
  background: rgba(255,255,255,0.06);
}

.ms-footer-btn--primary {
  background: #2563eb;
  color: #fff;
}

.ms-footer-btn--primary:hover {
  background: #1d4ed8;
  color: #fff;
}

/* ============================================================
   RESPONSIVE — DASHBOARD
   ============================================================ */
@media (max-width: 768px) {
  .nav-tabs {
    display: none; /* hide tabs on very small screens — use hamburger later */
  }

  .chart-canvas-wrapper {
    height: 260px;
  }

  .kpi-card-value {
    font-size: 1.25rem;
  }

  .ms-dropdown {
    min-width: 100%;
  }
}

/* ============================================================
   DARK MODE CUSTOM STYLES
   ============================================================ */
html.dark {
  --color-slate-bg:   #0b0f19; /* Premium deep slate-navy dark background */
  --shadow-card:      0 10px 30px -10px rgba(0, 0, 0, 0.7), 0 4px 12px -5px rgba(0, 0, 0, 0.5);
}

html.dark body,
html.dark #main-content {
  background-color: var(--color-slate-bg) !important;
  color: #e2e8f0;
}

/* Global Tailwind Overrides for Dark Mode */
html.dark .bg-white {
  background-color: #111b27 !important; /* Rich deep navy slate */
  border-color: #24355a !important;
}

html.dark .bg-slate-50 {
  background-color: #16223f !important; /* Lighter blue */
  border-color: #24355a !important;
}

html.dark .bg-slate-100 {
  background-color: #0b0f19 !important;
}

html.dark .border-slate-100,
html.dark .border-slate-200,
html.dark .border-slate-300 {
  border-color: #24355a !important;
}

/* Custom Overrides for KPI and Chart Cards in Dark Mode */
html.dark .kpi-card,
html.dark .chart-card {
  background-color: #16223f !important; /* Lighter blue than background, darker than white */
  border-color: #24355a !important;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5) !important;
}

html.dark .kpi-card:hover,
html.dark .chart-card:hover {
  box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.6) !important;
}

/* Card content visibility overrides */
html.dark .kpi-card-value {
  color: #ffffff !important;
}

html.dark .kpi-card-label {
  color: #94a3b8 !important;
}

html.dark .chart-card-title {
  color: #f8fafc !important;
}

html.dark .chart-card p {
  color: #94a3b8 !important;
}

html.dark .chart-card-header {
  border-bottom-color: #24355a !important;
}

/* Text elements */
html.dark .text-slate-800,
html.dark .text-slate-700 {
  color: #f3f4f6 !important;
}

html.dark .text-slate-600 {
  color: #d1d5db !important;
}

html.dark .text-slate-500 {
  color: #9ca3af !important;
}

html.dark .text-slate-400 {
  color: #6b7280 !important;
}

/* Custom Scrollbar in Dark Mode */
html.dark .table-scroll-wrapper::-webkit-scrollbar-track {
  background: #0b0f19;
}

html.dark .table-scroll-wrapper::-webkit-scrollbar-thumb {
  background: #1e293b;
  border: 1px solid #334155;
}

html.dark .table-scroll-wrapper::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Autocomplete in Dark Mode */
html.dark .autocomplete-dropdown {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

html.dark .autocomplete-item {
  color: #cbd5e1;
  border-bottom-color: #334155/30;
}

html.dark .autocomplete-item:hover {
  background: #1d4ed8;
  color: #fff;
}

html.dark .autocomplete-empty {
  color: #64748b;
}

/* Table Cells & Columns in Dark Mode */
html.dark .th-cell {
  background: #1a2333 !important; /* Premium dark navy-blue */
  border-bottom-color: #24355a !important;
  color: #94a3b8 !important;
}

html.dark .td-cell {
  color: #d1d5db !important;
  border-bottom-color: #24355a !important;
}

/* Sticky frozen table cells and headers in Dark Mode (overriding inline styles) */
html.dark #processos-table th[style*="position:sticky"],
html.dark #processos-table th[style*="position: sticky"] {
  background-color: #1a2333 !important; /* Matches th-cell background */
  color: #f8fafc !important;
  border-bottom-color: #24355a !important;
}

html.dark #processos-table td[style*="position:sticky"],
html.dark #processos-table td[style*="position: sticky"] {
  background-color: #111b27 !important; /* Seamless match with row bg */
  color: #e2e8f0 !important;
  border-bottom-color: #24355a !important;
}

html.dark #processos-table tbody tr {
  background: #111b27 !important;
}

html.dark #processos-table tbody tr:hover {
  background: #1c2847 !important;
}

html.dark #processos-table tbody tr:hover td[style*="position:sticky"],
html.dark #processos-table tbody tr:hover td[style*="position: sticky"] {
  background-color: #1c2847 !important; /* Seamless hover match */
}

/* Overriding the light-gray border-right on Cód. Sinistro */
html.dark #processos-table th[style*="border-right"],
html.dark #processos-table td[style*="border-right"] {
  border-right: 2px solid #24355a !important;
}

html.dark #pagination-bar,
html.dark #processos-table thead tr {
  border-color: #24355a;
}

/* Inline Edit Controls in Dark Mode */
html.dark .inline-select,
html.dark .inline-obs-input {
  background: #16223f !important;
  color: #f3f4f6 !important;
  border-color: #24355a !important;
}

html.dark .inline-select:focus,
html.dark .inline-obs-input:focus {
  background-color: #111b27 !important;
  border-color: #3b82f6 !important;
}

/* Pagination in Dark Mode */
html.dark .pagination-btn,
html.dark .page-number-btn {
  background: #111b27;
  border-color: #24355a;
  color: #d1d5db;
}

html.dark .pagination-btn:hover:not(:disabled),
html.dark .page-number-btn:hover {
  background: #1c2847;
  border-color: #3b82f6;
  color: #fff;
}

html.dark .page-number-btn.active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

/* Multi-select in Dark Mode */
html.dark .ms-trigger {
  background: #16223f !important;
  border-color: #24355a !important;
  color: #f3f4f6 !important;
}

html.dark .ms-trigger:hover {
  border-color: #3b82f6 !important;
  background: #1c2847 !important;
}

html.dark .ms-dropdown {
  background: #111b27 !important;
  border-color: #24355a !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.7) !important;
}

html.dark .ms-search {
  background: #16223f !important;
  border-color: #24355a !important;
  color: #f3f4f6 !important;
}

html.dark .ms-search:focus {
  border-color: #3b82f6 !important;
}

html.dark .ms-option {
  color: #d1d5db !important;
}

html.dark .ms-option:hover {
  background: #1c2847 !important;
  color: #fff !important;
}

html.dark .ms-footer {
  border-top-color: #24355a !important;
  background: #111b27 !important;
}

html.dark .ms-footer-btn:hover {
  color: #fff !important;
  background: rgba(255,255,255,0.08) !important;
}

/* Custom Travel Need Toggle Switches in Dark Mode */
html.dark input[type="checkbox"].sr-only.peer + div {
  background-color: #ffffff !important; /* White track background when unchecked */
}

html.dark input[type="checkbox"].sr-only.peer + div::after {
  background-color: #1e293b !important; /* Dark slate-blue knob when unchecked */
}

html.dark input[type="checkbox"].sr-only.peer:checked + div {
  background-color: #3b82f6 !important; /* Vibrant blue track when checked */
}

html.dark input[type="checkbox"].sr-only.peer:checked + div::after {
  background-color: #ffffff !important; /* White knob when checked */
}

/* Global Form Controls & Inputs in Dark Mode */
html.dark input[type="text"],
html.dark input[type="email"],
html.dark input[type="password"],
html.dark input[type="number"],
html.dark input[type="date"],
html.dark input[type="datetime-local"],
html.dark select,
html.dark textarea {
  background-color: #16223f !important;
  color: #f3f4f6 !important;
  border-color: #24355a !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #64748b !important;
}

html.dark input:focus,
html.dark select:focus,
html.dark textarea:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
}

/* ============================================================
   STATUS BADGES IN DARK MODE (Curated Dark Palette)
   ============================================================ */

/* Green Badges: EM ABERTO, GERAR BH, ALERTA OK, NO PRAZO */
html.dark .badge-em-aberto,
html.dark .badge-gerar-bh,
html.dark .badge-no-prazo,
html.dark .badge-alerta-ok {
  background-color: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}
html.dark .badge-em-aberto::before,
html.dark .badge-gerar-bh::before,
html.dark .badge-no-prazo::before,
html.dark .badge-alerta-ok::before {
  background-color: #34d399 !important;
}

/* Blue Badges: CONCLUÍDO FINANCEIRAMENTE, ENCERRADO FINANCEIRAMENTE, CONCLUÍDO */
html.dark .badge-concluido-fin,
html.dark .badge-encerrado-fin,
html.dark .badge-concluido {
  background-color: rgba(59, 130, 246, 0.15) !important;
  color: #60a5fa !important;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
}
html.dark .badge-concluido-fin::before,
html.dark .badge-encerrado-fin::before,
html.dark .badge-concluido::before {
  background-color: #60a5fa !important;
}

/* Yellow/Orange Badges: CONCLUÍDO TECNICAMENTE, PENDENTE, ALERTA AVISO */
html.dark .badge-concluido-tec,
html.dark .badge-pendente,
html.dark .badge-alerta-aviso {
  background-color: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
}
html.dark .badge-concluido-tec::before,
html.dark .badge-pendente::before,
html.dark .badge-alerta-aviso::before {
  background-color: #fbbf24 !important;
}

/* Red Badges: CANCELADO, NÃO GERAR, COBRANÇA IMEDIATA, ALERTA CRÍTICO */
html.dark .badge-cancelado,
html.dark .badge-nao-gerar,
html.dark .badge-cobranca-imediata,
html.dark .badge-alerta-critico {
  background-color: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
}
html.dark .badge-cancelado::before,
html.dark .badge-nao-gerar::before,
html.dark .badge-cobranca-imediata::before,
html.dark .badge-alerta-critico::before {
  background-color: #f87171 !important;
}

/* Purple Badges: SUSPENSO */
html.dark .badge-suspenso {
  background-color: rgba(139, 92, 246, 0.15) !important;
  color: #c084fc !important;
  border: 1px solid rgba(139, 92, 246, 0.3) !important;
}

/* Inline Edit Controls in Dark Mode */
html.dark .inline-select,
html.dark .inline-obs-input {
  background: #16223f !important;
  color: #f3f4f6 !important;
  border-color: #24355a !important;
}

html.dark .inline-select:focus,
html.dark .inline-obs-input:focus {
  background-color: #111b27 !important;
  border-color: #3b82f6 !important;
}

/* Pagination in Dark Mode */
html.dark .pagination-btn,
html.dark .page-number-btn {
  background: #111b27;
  border-color: #24355a;
  color: #d1d5db;
}

html.dark .pagination-btn:hover:not(:disabled),
html.dark .page-number-btn:hover {
  background: #1c2847;
  border-color: #3b82f6;
  color: #fff;
}

html.dark .page-number-btn.active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

/* Multi-select in Dark Mode */
html.dark .ms-trigger {
  background: #16223f !important;
  border-color: #24355a !important;
  color: #f3f4f6 !important;
}

html.dark .ms-trigger:hover {
  border-color: #3b82f6 !important;
  background: #1c2847 !important;
}

html.dark .ms-dropdown {
  background: #111b27 !important;
  border-color: #24355a !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.7) !important;
}

html.dark .ms-search {
  background: #16223f !important;
  border-color: #24355a !important;
  color: #f3f4f6 !important;
}

html.dark .ms-search:focus {
  border-color: #3b82f6 !important;
}

html.dark .ms-option {
  color: #d1d5db !important;
}

html.dark .ms-option:hover {
  background: #1c2847 !important;
  color: #fff !important;
}

html.dark .ms-footer {
  border-top-color: #24355a !important;
  background: #111b27 !important;
}

html.dark .ms-footer-btn:hover {
  color: #fff !important;
  background: rgba(255,255,255,0.08) !important;
}

/* Custom Travel Need Toggle Switches in Dark Mode */
html.dark input[type="checkbox"].sr-only.peer + div {
  background-color: #ffffff !important; /* White track background when unchecked */
}

html.dark input[type="checkbox"].sr-only.peer + div::after {
  background-color: #1e293b !important; /* Dark slate-blue knob when unchecked */
}

html.dark input[type="checkbox"].sr-only.peer:checked + div {
  background-color: #3b82f6 !important; /* Vibrant blue track when checked */
}

html.dark input[type="checkbox"].sr-only.peer:checked + div::after {
  background-color: #ffffff !important; /* White knob when checked */
}

/* Global Form Controls & Inputs in Dark Mode */
html.dark input[type="text"],
html.dark input[type="email"],
html.dark input[type="password"],
html.dark input[type="number"],
html.dark input[type="date"],
html.dark input[type="datetime-local"],
html.dark select,
html.dark textarea {
  background-color: #16223f !important;
  color: #f3f4f6 !important;
  border-color: #24355a !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #64748b !important;
}

html.dark input:focus,
html.dark select:focus,
html.dark textarea:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
}

/* ============================================================
   STATUS BADGES IN DARK MODE (Curated Dark Palette)
   ============================================================ */

/* Green Badges: EM ABERTO, GERAR BH, ALERTA OK, NO PRAZO */
html.dark .badge-em-aberto,
html.dark .badge-gerar-bh,
html.dark .badge-no-prazo,
html.dark .badge-alerta-ok {
  background-color: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}
html.dark .badge-em-aberto::before,
html.dark .badge-gerar-bh::before,
html.dark .badge-no-prazo::before,
html.dark .badge-alerta-ok::before {
  background-color: #34d399 !important;
}

/* Blue Badges: CONCLUÍDO FINANCEIRAMENTE, ENCERRADO FINANCEIRAMENTE, CONCLUÍDO */
html.dark .badge-concluido-fin,
html.dark .badge-encerrado-fin,
html.dark .badge-concluido {
  background-color: rgba(59, 130, 246, 0.15) !important;
  color: #60a5fa !important;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
}
html.dark .badge-concluido-fin::before,
html.dark .badge-encerrado-fin::before,
html.dark .badge-concluido::before {
  background-color: #60a5fa !important;
}

/* Yellow/Orange Badges: CONCLUÍDO TECNICAMENTE, PENDENTE, ALERTA AVISO */
html.dark .badge-concluido-tec,
html.dark .badge-pendente,
html.dark .badge-alerta-aviso {
  background-color: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
}
html.dark .badge-concluido-tec::before,
html.dark .badge-pendente::before,
html.dark .badge-alerta-aviso::before {
  background-color: #fbbf24 !important;
}

/* Red Badges: CANCELADO, NÃO GERAR, COBRANÇA IMEDIATA, ALERTA CRÍTICO */
html.dark .badge-cancelado,
html.dark .badge-nao-gerar,
html.dark .badge-cobranca-imediata,
html.dark .badge-alerta-critico {
  background-color: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
}
html.dark .badge-cancelado::before,
html.dark .badge-nao-gerar::before,
html.dark .badge-cobranca-imediata::before,
html.dark .badge-alerta-critico::before {
  background-color: #f87171 !important;
}

/* Purple Badges: SUSPENSO */
html.dark .badge-suspenso {
  background-color: rgba(139, 92, 246, 0.15) !important;
  color: #c084fc !important;
  border: 1px solid rgba(139, 92, 246, 0.3) !important;
}
html.dark .badge-suspenso::before {
  background-color: #c084fc !important;
}

/* Default/Fallback Badges */
html.dark .badge-default {
  background-color: rgba(100, 116, 139, 0.15) !important;
  color: #94a3b8 !important;
  border: 1px solid rgba(100, 116, 139, 0.3) !important;
}
html.dark .badge-default::before {
  background-color: #94a3b8 !important;
}

/* Dashboard Tabs Switch Container in Dark Mode */
html.dark #dashboard-tab-container {
  background-color: #111b27 !important; /* Premium dark navy-slate track background */
  border-color: #24355a !important;
}

/* Active Tab Button in Dark Mode */
html.dark #dashboard-tab-container button.bg-white {
  background-color: #1c2847 !important; /* Elegant medium slate-blue for selected tab button */
  color: #60a5fa !important;             /* Vibrant light-blue text for ultimate contrast */
  border-color: #24355a !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* Inactive Tab Button in Dark Mode */
html.dark #dashboard-tab-container button:not(.bg-white) {
  color: #94a3b8 !important;             /* Muted grey text for unselected state */
  background-color: transparent !important;
}

html.dark #dashboard-tab-container button:not(.bg-white):hover {
  color: #f8fafc !important;             /* Glowing white on hover */
  background-color: rgba(255, 255, 255, 0.03) !important;
}

.hidden { display: none !important; }

