:root {
  --brand: #094E67;
  --brand-rgb: 9, 78, 103;
  --bg: #0b1220;
  --panel: #0f1a2d;
  --panel-2: #0c1528;
  --text: #d8e6ee;
  --muted: #9fb9c6;
  --grid: rgba(216, 230, 238, .10);
  --stroke: rgba(216, 230, 238, .12);
  --accent: rgba(var(--brand-rgb), .55);
  --good: #19c37d;
  --warn: #ff4d4d;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Helvetica Neue", sans-serif;
  background: radial-gradient(1200px 800px at 15% 10%, rgba(var(--brand-rgb), .30), transparent 55%),
    radial-gradient(1200px 800px at 90% 30%, rgba(var(--brand-rgb), .18), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.app {
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px 16px 36px;
}

/* ===== TOP BAR ===== */
.topbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(15, 26, 45, .95), rgba(12, 21, 40, .95));
  box-shadow: var(--shadow);
  position: sticky;
  top: 10px;
  z-index: 20;
  backdrop-filter: blur(12px);
  transition: all .2s ease;
}

.topbar:hover {
  box-shadow: 0 12px 35px rgba(0, 0, 0, .45);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.brand .dot {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), rgba(var(--brand-rgb), .35));
  box-shadow: inset 0 0 0 1px rgba(216, 230, 238, .14), 0 4px 12px rgba(var(--brand-rgb), .35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease;
}

.brand .dot:hover {
  transform: scale(1.05);
}

.brand h1 {
  font-size: 15px;
  margin: 0;
  letter-spacing: .5px;
  font-weight: 800;
  line-height: 1.25;
  background: linear-gradient(135deg, var(--text), var(--muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand .sub {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 2px;
  letter-spacing: .2px;
}

.controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ===== FILTROS ===== */
.filterRow {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin: 12px 0 8px;
  padding: 14px 16px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(15, 26, 45, .88), rgba(12, 21, 40, .88));
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

.filterRow .pill.grow {
  min-width: 280px;
  flex: 1;
  max-width: 400px;
}

.groupLabel {
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: .4px;
  padding: 8px 10px;
  margin-left: 4px;
  text-transform: uppercase;
  background: rgba(var(--brand-rgb), .08);
  border-radius: 8px;
}

.applyBtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid rgba(var(--brand-rgb), .8);
  background: linear-gradient(135deg, rgba(var(--brand-rgb), .75), rgba(var(--brand-rgb), .45));
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .3px;
  transition: all .2s ease;
  box-shadow: 0 3px 10px rgba(var(--brand-rgb), .25);
}

.applyBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(var(--brand-rgb), .35);
  border-color: rgba(var(--brand-rgb), 1);
}

.pill {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(12, 21, 40, .75);
  transition: all .2s ease;
}

.pill:hover {
  background: rgba(12, 21, 40, .9);
  border-color: rgba(216, 230, 238, .18);
}

.pill label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: .2px;
  white-space: nowrap;
}

/* ===== INPUTS & SELECTS ===== */
input[type="date"],
input[type="text"] {
  background: rgba(var(--brand-rgb), .12);
  border: 1px solid rgba(216, 230, 238, .14);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  outline: none;
  font-size: 12px;
  font-weight: 500;
  transition: all .2s ease;
  min-width: 140px;
}

input[type="date"]:hover,
input[type="text"]:hover {
  border-color: rgba(216, 230, 238, .22);
  background: rgba(var(--brand-rgb), .15);
}

input[type="date"]:focus,
input[type="text"]:focus {
  border-color: rgba(var(--brand-rgb), .8);
  background: rgba(var(--brand-rgb), .18);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .15);
}

input[type="text"]::placeholder {
  color: rgba(159, 185, 198, .5);
}

/* ===== SELECT ESTILIZADO ===== */
select {
  background: rgba(var(--brand-rgb), .12);
  border: 1px solid rgba(216, 230, 238, .14);
  color: var(--text);
  padding: 8px 32px 8px 12px;
  border-radius: 10px;
  outline: none;
  font-size: 12px;
  font-weight: 600;
  transition: all .2s ease;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%23d8e6ee' d='M7 10L2 5h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  min-width: 130px;
  max-width: 300px;
  line-height: 1.4;
}

/* Seta do select no tema claro */
[data-theme="light"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%231a2332' d='M7 10L2 5h10z'/%3E%3C/svg%3E") !important;
}

select:hover {
  background-color: rgba(var(--brand-rgb), .18);
  border-color: rgba(216, 230, 238, .25);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(var(--brand-rgb), .15);
}

select:focus {
  border-color: rgba(var(--brand-rgb), .8);
  background-color: rgba(var(--brand-rgb), .18);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .15);
}

/* Estilo das opções do dropdown */
select option {
  background: var(--panel);
  color: var(--text);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
}

select option:hover {
  background: rgba(var(--brand-rgb), .25);
}

select option:checked {
  background: linear-gradient(135deg, rgba(var(--brand-rgb), .65), rgba(var(--brand-rgb), .35));
  font-weight: 700;
}

/* Select específico para Centro de Custo (com mais opções) */
#centroCustoSelect {
  min-width: 180px;
  max-width: 350px;
}

/* ===== SCOPE TABS ===== */
.scopeTabs {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 5px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(12, 21, 40, .75);
}

.scopeTabs button {
  border: 0;
  cursor: pointer;
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 11px;
  background: transparent;
  font-weight: 800;
  letter-spacing: .3px;
  font-size: 12px;
  transition: all .2s ease;
  display: flex;
  gap: 8px;
  align-items: center;
}

.scopeTabs button:hover:not(.active) {
  background: rgba(var(--brand-rgb), .15);
  color: var(--text);
}

.scopeTabs button.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(var(--brand-rgb), .85), rgba(var(--brand-rgb), .45));
  box-shadow: inset 0 0 0 1px rgba(216, 230, 238, .18), 0 3px 8px rgba(var(--brand-rgb), .25);
}

/* ===== LOGOUT BTN ===== */
.logoutBtn {
  border: 1px solid rgba(216, 230, 238, .14);
  background: rgba(12, 21, 40, .75);
  color: rgba(216, 230, 238, .95);
  padding: 9px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  transition: all .2s ease;
  letter-spacing: .2px;
}

.logoutBtn:hover {
  transform: translateY(-2px);
  background: rgba(12, 21, 40, .9);
  border-color: rgba(216, 230, 238, .22);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}

/* ===== BOTÃO ADM - Exclusivo para Administradores ===== */
.adminBtn {
  border: 1px solid rgba(245, 87, 108, 0.4);
  background: linear-gradient(135deg, rgba(240, 147, 251, 0.25), rgba(245, 87, 108, 0.25));
  color: rgba(216, 230, 238, .95);
  padding: 9px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  transition: all 0.3s ease;
  letter-spacing: .2px;
  box-shadow: 0 4px 15px rgba(245, 87, 108, 0.2);
}

.adminBtn:hover {
  background: linear-gradient(135deg, rgba(240, 147, 251, 0.35), rgba(245, 87, 108, 0.35));
  border-color: rgba(245, 87, 108, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 87, 108, 0.3);
}

.adminBtn i {
  color: #f5576c !important;
}

.hidden {
  display: none !important;
}

/* ===== LAYOUT ===== */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}

.sectionTitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 2px 6px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .6px;
  text-transform: uppercase;
  font-weight: 800;
}

.splitGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ===== PANELS ===== */
.panel {
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(15, 26, 45, .92), rgba(12, 21, 40, .92));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: visible;
  transition: all .2s ease;
}

.panel:hover {
  box-shadow: 0 12px 35px rgba(0, 0, 0, .45);
  border-color: rgba(216, 230, 238, .18);
}

.panelHeader {
  padding: 12px 14px;
  background: rgba(var(--brand-rgb), .14);
  border-bottom: 1px solid var(--stroke);
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius) var(--radius) 0 0;
}

.panelHeader h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .3px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panelHeader h2 i {
  color: rgba(216, 230, 238, .85);
  font-size: 16px;
}

.panelBody {
  padding: 14px;
  background: rgba(12, 21, 40, .55);
  overflow: visible;
}

/* ===== KPI CARDS ===== */
.kpiRow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.kpi {
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: linear-gradient(135deg, rgba(var(--brand-rgb), .16), rgba(12, 21, 40, .85));
  box-shadow: inset 0 0 0 1px rgba(216, 230, 238, .05), 0 4px 12px rgba(0, 0, 0, .15);
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all .2s ease;
}

.kpi:hover {
  transform: translateY(-3px);
  box-shadow: inset 0 0 0 1px rgba(216, 230, 238, .08), 0 8px 20px rgba(0, 0, 0, .25);
  border-color: rgba(216, 230, 238, .18);
}

.kpi .label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.kpi .value {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .3px;
  margin-top: 8px;
  background: linear-gradient(135deg, var(--text), rgba(216, 230, 238, .75));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== CHARTS ===== */
.chartWrap {
  position: relative;
  width: 100%;
  min-height: 240px;
  padding: 24px 8px 8px 8px;
  overflow: visible;
}

.chartWrap canvas {
  display: block;
  max-width: 100%;
  height: auto !important;
}

.chartSmall {
  min-height: 220px;
  margin-top: 12px;
  padding-top: 24px;
}

.chartTall {
  min-height: 280px;
  padding-top: 28px;
}

.btnStack {
  display: flex;
  flex-direction: row;
  gap: 6px;
  padding: 5px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(12, 21, 40, .75);
}

.iconBtn {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s ease;
  font-size: 14px;
}

.iconBtn:hover:not(.active) {
  background: rgba(var(--brand-rgb), .15);
  color: var(--text);
}

.iconBtn.active {
  background: linear-gradient(135deg, rgba(var(--brand-rgb), .85), rgba(var(--brand-rgb), .45));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(216, 230, 238, .18), 0 3px 8px rgba(var(--brand-rgb), .25);
}

/* ===== TABLES ===== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid rgba(216, 230, 238, .06);
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: rgba(216, 230, 238, .92);
  font-weight: 900;
  background: rgba(var(--brand-rgb), .12);
  position: sticky;
  top: 0;
  z-index: 5;
  letter-spacing: .3px;
  text-transform: uppercase;
  font-size: 11px;
  backdrop-filter: blur(8px);
}

tbody tr {
  transition: background .15s ease;
}

tbody tr:hover {
  background: rgba(var(--brand-rgb), .12);
}

.rankTable tfoot td {
  font-weight: 900;
  background: rgba(var(--brand-rgb), .12);
  border-top: 1px solid rgba(216, 230, 238, .12);
  letter-spacing: .2px;
}

.tableWrap {
  max-height: 280px;
  overflow: auto;
  border-top: 1px solid rgba(216, 230, 238, .10);
  border-radius: 8px;
}

.tableWrap.tall {
  max-height: 400px;
}

/* Scrollbar personalizada */
.tableWrap::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.tableWrap::-webkit-scrollbar-track {
  background: rgba(12, 21, 40, .5);
  border-radius: 4px;
}

.tableWrap::-webkit-scrollbar-thumb {
  background: rgba(var(--brand-rgb), .6);
  border-radius: 4px;
}

.tableWrap::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--brand-rgb), .8);
}

/* ===== STATUS CELLS ===== */
.cell-warn {
  background: rgba(255, 77, 77, .15);
  color: rgba(255, 210, 210, .95);
  border-radius: 8px;
  padding: 6px 10px;
  display: inline-block;
  border: 1px solid rgba(255, 77, 77, .22);
  font-weight: 800;
}

.cell-good {
  background: rgba(25, 195, 125, .15);
  color: rgba(210, 255, 235, .95);
  border-radius: 8px;
  padding: 6px 10px;
  display: inline-block;
  border: 1px solid rgba(25, 195, 125, .22);
  font-weight: 800;
}

.cellBest {
  background: rgba(25, 195, 125, .18) !important;
  font-weight: 900;
  color: rgba(210, 255, 235, 1) !important;
}

.cellWorst {
  background: rgba(231, 76, 60, .18) !important;
  font-weight: 900;
  color: rgba(255, 190, 190, 1) !important;
}

/* ===== REP BAR ===== */
.repBar {
  width: 100%;
  height: 18px;
  border-radius: 9px;
  border: 1px solid rgba(216, 230, 238, .14);
  background: rgba(12, 21, 40, .75);
  overflow: hidden;
}

.repBar>span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(var(--brand-rgb), .95), rgba(var(--brand-rgb), .55));
  transition: width .3s ease;
}

/* ===== COLUMN HELPERS ===== */
.hideNac .colNac {
  display: none;
}

.hideInt .colInt {
  display: none;
}

.hidden {
  display: none !important;
}

/* ===== MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modalCard {
  width: min(540px, 100%);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(15, 26, 45, .97), rgba(12, 21, 40, .97));
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
  padding: 20px;
  animation: modalSlideIn .2s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modalTitle {
  font-weight: 900;
  font-size: 16px;
  letter-spacing: .3px;
  margin-bottom: 10px;
}

.modalText {
  color: rgba(216, 230, 238, .85);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.modalLabel {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: .2px;
  text-transform: uppercase;
}

.modalActions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.modalBtn {
  border: 1px solid rgba(216, 230, 238, .14);
  background: linear-gradient(135deg, rgba(var(--brand-rgb), .85), rgba(var(--brand-rgb), .45));
  color: rgba(216, 230, 238, .95);
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 900;
  font-size: 13px;
  transition: all .2s ease;
  letter-spacing: .2px;
}

.modalBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--brand-rgb), .35);
}

.modalBtn.ghost {
  background: rgba(12, 21, 40, .75);
}

.modalBtn.ghost:hover {
  background: rgba(12, 21, 40, .9);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .kpiRow {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .splitGrid {
    grid-template-columns: 1fr;
  }
  
  .controls {
    gap: 8px;
  }
}

@media (max-width: 768px) {
  .filterRow {
    padding: 12px;
    gap: 8px;
  }
  
  .pill {
    flex: 1 1 auto;
    min-width: 140px;
  }
  
  select {
    min-width: 110px;
    font-size: 11px;
  }
  
  #centroCustoSelect {
    min-width: 150px;
    max-width: 100%;
  }
}

@media (max-width: 560px) {
  .kpiRow {
    grid-template-columns: 1fr;
  }

  .brand {
    min-width: auto;
  }

  .controls {
    justify-content: flex-start;
  }

  .topbar {
    position: static;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
  }

  .filterRow {
    flex-direction: column;
    align-items: stretch;
  }

  .pill.grow {
    min-width: auto;
    max-width: 100%;
  }
  
  .pill {
    min-width: auto;
  }
  
  select, input[type="date"], input[type="text"] {
    width: 100%;
    min-width: auto;
  }
  
  .groupLabel {
    text-align: center;
  }
}

/* ===== MELHORIAS VISUAIS ADICIONAIS ===== */
/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Melhoria no foco de acessibilidade */
*:focus-visible {
  outline: 2px solid rgba(var(--brand-rgb), .8);
  outline-offset: 2px;
}

/* Loading states para inputs */
input:disabled, select:disabled, button:disabled {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Animação suave para charts */
.chartWrap {
  animation: fadeIn .3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== SCROLLBAR CUSTOMIZADA ===== */
/* Scrollbar para Webkit (Chrome, Safari, Edge) */
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(12, 21, 40, .5);
  border-radius: 5px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(var(--brand-rgb), .8), rgba(var(--brand-rgb), .4));
  border-radius: 5px;
  border: 2px solid rgba(12, 21, 40, .5);
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, rgba(var(--brand-rgb), 1), rgba(var(--brand-rgb), .6));
}

*::-webkit-scrollbar-corner {
  background: rgba(12, 21, 40, .5);
}

/* Scrollbar para Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--brand-rgb), .8) rgba(12, 21, 40, .5);
}/* ===== SISTEMA DE TEMA CLARO/ESCURO ===== */

/* Tema Escuro (Padrão) */
:root {
  --brand: #094E67;
  --brand-rgb: 9, 78, 103;
  --bg: #0b1220;
  --panel: #0f1a2d;
  --panel-2: #0c1528;
  --text: #d8e6ee;
  --muted: #9fb9c6;
  --grid: rgba(216,230,238,.10);
  --stroke: rgba(216,230,238,.12);
  --accent: rgba(var(--brand-rgb),.55);
  --good: #19c37d;
  --warn: #ff4d4d;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 14px;
}

/* Tema Claro */
[data-theme="light"] {
  --brand: #094E67;
  --brand-rgb: 9, 78, 103;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --panel-2: #f8f9fb;
  --text: #1a2332;
  --muted: #5a6c84;
  --grid: rgba(26,35,50,.08);
  --stroke: rgba(26,35,50,.12);
  --accent: rgba(var(--brand-rgb),.15);
  --good: #0f9960;
  --warn: #d32f2f;
  --shadow: 0 10px 30px rgba(0,0,0,.08);
  --radius: 14px;
}

/* Ajustes específicos para tema claro */
[data-theme="light"] body {
  background: radial-gradient(1200px 800px at 15% 10%, rgba(var(--brand-rgb),.08), transparent 55%),
              radial-gradient(1200px 800px at 90% 30%, rgba(var(--brand-rgb),.05), transparent 60%),
              var(--bg);
}

[data-theme="light"] .topbar {
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(248,249,251,.95));
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}

[data-theme="light"] .panel {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,249,251,.98));
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
}

[data-theme="light"] .panel:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,.10);
}

[data-theme="light"] .panelHeader {
  background: rgba(var(--brand-rgb),.06);
}

[data-theme="light"] .panelBody {
  background: rgba(248,249,251,.5);
}

[data-theme="light"] .filterRow {
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(248,249,251,.95));
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}

[data-theme="light"] .pill {
  background: rgba(248,249,251,.9);
}

[data-theme="light"] .pill:hover {
  background: rgba(240,242,245,.95);
}

[data-theme="light"] select,
[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="text"] {
  background: rgba(255,255,255,.8);
  border-color: rgba(26,35,50,.18);
}

[data-theme="light"] select:hover,
[data-theme="light"] input[type="date"]:hover,
[data-theme="light"] input[type="text"]:hover {
  background: rgba(255,255,255,.95);
  border-color: rgba(var(--brand-rgb),.3);
}

[data-theme="light"] select:focus,
[data-theme="light"] input[type="date"]:focus,
[data-theme="light"] input[type="text"]:focus {
  background: rgba(255,255,255,1);
  border-color: rgba(var(--brand-rgb),.6);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb),.08);
}

[data-theme="light"] .kpi {
  background: linear-gradient(180deg, rgba(var(--brand-rgb),.04), rgba(248,249,251,.95));
}

[data-theme="light"] .scopeTabs,
[data-theme="light"] .btnStack {
  background: rgba(248,249,251,.9);
}

[data-theme="light"] .logoutBtn {
  background: rgba(248,249,251,.9);
}

[data-theme="light"] table thead th {
  background: rgba(var(--brand-rgb),.06);
}

[data-theme="light"] tbody tr:hover {
  background: rgba(var(--brand-rgb),.04);
}

[data-theme="light"] .rankTable tfoot td {
  background: rgba(var(--brand-rgb),.06);
}

[data-theme="light"] .modalCard {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,249,251,.98));
}

[data-theme="light"] .groupLabel {
  background: rgba(var(--brand-rgb), .06);
}

/* Scrollbar tema claro */
[data-theme="light"] *::-webkit-scrollbar-track {
  background: rgba(240, 242, 245, .8);
}

[data-theme="light"] *::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(var(--brand-rgb), .4), rgba(var(--brand-rgb), .2));
  border: 2px solid rgba(240, 242, 245, .8);
}

[data-theme="light"] *::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, rgba(var(--brand-rgb), .6), rgba(var(--brand-rgb), .3));
}

[data-theme="light"] * {
  scrollbar-color: rgba(var(--brand-rgb), .4) rgba(240, 242, 245, .8);
}

/* Botão de alternância de tema */
.theme-toggle {
  width: 42px;
  height: 42px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text);
  transition: all .2s ease;
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--brand-rgb), .2);
  border-color: rgba(var(--brand-rgb), .4);
}

.theme-toggle i {
  transition: transform .3s ease, opacity .3s ease;
}

.theme-toggle .fa-sun {
  position: absolute;
  opacity: 0;
  transform: rotate(-90deg) scale(0);
}

.theme-toggle .fa-moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

[data-theme="light"] .theme-toggle .fa-sun {
  opacity: 1;
  transform: rotate(0) scale(1);
  color: #f59e0b;
}

[data-theme="light"] .theme-toggle .fa-moon {
  opacity: 0;
  transform: rotate(90deg) scale(0);
}

/* Animação de transição de tema */
body {
  transition: background-color .3s ease, color .3s ease;
}

.topbar,
.panel,
.pill,
select,
input,
button {
  transition: all .2s ease, background-color .3s ease, border-color .3s ease, color .3s ease !important;
}
/* ===== SISTEMA DE TEMAS (CLARO/ESCURO) ===== */

/* Tema Claro */
[data-theme="light"] {
  --brand: #094E67;
  --brand-rgb: 9, 78, 103;
  --bg: #e8f0f5;
  --panel: #ffffff;
  --panel-2: #f5f9fc;
  --text: #1a2332;
  --muted: #5c6f82;
  --grid: rgba(var(--brand-rgb),.08);
  --stroke: rgba(var(--brand-rgb),.15);
  --accent: rgba(var(--brand-rgb),.25);
  --good: #16a862;
  --warn: #e63946;
  --shadow: 0 10px 30px rgba(var(--brand-rgb),.15);
  --radius: 14px;
}

/* Ajustes específicos para tema claro */
[data-theme="light"] body {
  background: radial-gradient(1200px 800px at 15% 10%, rgba(var(--brand-rgb),.08), transparent 55%),
              radial-gradient(1200px 800px at 90% 30%, rgba(var(--brand-rgb),.05), transparent 60%),
              var(--bg);
}

[data-theme="light"] .topbar {
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(245,249,252,.95));
  box-shadow: 0 4px 16px rgba(var(--brand-rgb),.12);
}

[data-theme="light"] .panel {
  background: linear-gradient(180deg, #ffffff, rgba(245,249,252,.95));
  box-shadow: 0 8px 24px rgba(var(--brand-rgb),.10);
}

[data-theme="light"] .panel:hover {
  box-shadow: 0 12px 32px rgba(var(--brand-rgb),.15);
}

[data-theme="light"] .panelHeader {
  background: rgba(var(--brand-rgb),.06);
}

[data-theme="light"] .panelBody {
  background: rgba(255,255,255,.5);
}

[data-theme="light"] .filterRow {
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(245,249,252,.92));
  box-shadow: 0 4px 12px rgba(var(--brand-rgb),.10);
}

[data-theme="light"] select,
[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="text"] {
  background: rgba(var(--brand-rgb),.05);
  border-color: rgba(var(--brand-rgb),.20);
}

[data-theme="light"] select:hover,
[data-theme="light"] input[type="date"]:hover,
[data-theme="light"] input[type="text"]:hover {
  background: rgba(var(--brand-rgb),.08);
  border-color: rgba(var(--brand-rgb),.30);
}

[data-theme="light"] select:focus,
[data-theme="light"] input[type="date"]:focus,
[data-theme="light"] input[type="text"]:focus {
  background: rgba(var(--brand-rgb),.10);
  border-color: rgba(var(--brand-rgb),.50);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb),.08);
}

[data-theme="light"] .pill {
  background: rgba(var(--brand-rgb),.05);
}

[data-theme="light"] .pill:hover {
  background: rgba(var(--brand-rgb),.10);
}

[data-theme="light"] .groupLabel {
  background: rgba(var(--brand-rgb),.06);
}

[data-theme="light"] .kpi {
  background: linear-gradient(180deg, rgba(var(--brand-rgb),.06), rgba(255,255,255,.90));
}

[data-theme="light"] .scopeTabs,
[data-theme="light"] .btnStack,
[data-theme="light"] .logoutBtn {
  background: rgba(var(--brand-rgb),.08);
}

[data-theme="light"] .scopeTabs button.active {
  background: linear-gradient(135deg, rgba(var(--brand-rgb),.25), rgba(var(--brand-rgb),.15));
}

[data-theme="light"] .iconBtn.active {
  background: linear-gradient(135deg, rgba(var(--brand-rgb),.25), rgba(var(--brand-rgb),.15));
}

[data-theme="light"] table thead th {
  background: rgba(var(--brand-rgb),.08);
  backdrop-filter: blur(8px);
}

[data-theme="light"] tbody tr:hover {
  background: rgba(var(--brand-rgb),.05);
}

[data-theme="light"] .rankTable tfoot td {
  background: rgba(var(--brand-rgb),.08);
}

[data-theme="light"] .modalCard {
  background: linear-gradient(180deg, #ffffff, rgba(245,249,252,.98));
  box-shadow: 0 20px 60px rgba(var(--brand-rgb),.25);
}

[data-theme="light"] .modal {
  background: rgba(255,255,255,.75);
}

[data-theme="light"] *::-webkit-scrollbar-track {
  background: rgba(var(--brand-rgb),.08);
}

[data-theme="light"] *::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(var(--brand-rgb), .4), rgba(var(--brand-rgb), .2));
  border: 2px solid rgba(var(--brand-rgb),.08);
}

[data-theme="light"] *::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, rgba(var(--brand-rgb), .6), rgba(var(--brand-rgb), .3));
}

[data-theme="light"] * {
  scrollbar-color: rgba(var(--brand-rgb), .4) rgba(var(--brand-rgb),.08);
}

[data-theme="light"] .applyBtn {
  background: rgba(var(--brand-rgb),.18);
}

/* Toggle de Tema */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(12,21,40,.75);
  cursor: pointer;
  transition: all .2s ease;
  position: relative;
}

[data-theme="light"] .theme-toggle {
  background: rgba(var(--brand-rgb),.08);
  border-color: rgba(var(--brand-rgb),.20);
}

.theme-toggle:hover {
  background: rgba(12,21,40,.9);
  border-color: rgba(216,230,238,.22);
  transform: translateY(-1px);
}

[data-theme="light"] .theme-toggle:hover {
  background: rgba(var(--brand-rgb),.12);
  border-color: rgba(var(--brand-rgb),.30);
}

.theme-toggle-icon {
  font-size: 14px;
  color: var(--muted);
  transition: all .3s ease;
}

.theme-toggle-switch {
  position: relative;
  width: 38px;
  height: 20px;
  background: rgba(var(--brand-rgb),.3);
  border-radius: 10px;
  transition: all .3s ease;
}

[data-theme="light"] .theme-toggle-switch {
  background: rgba(var(--brand-rgb),.20);
}

.theme-toggle-switch::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(200,210,220,.9), rgba(180,190,200,.9));
  top: 2px;
  left: 2px;
  transition: all .3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
}

[data-theme="light"] .theme-toggle-switch::before {
  left: 20px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 2px 6px rgba(251,191,36,.4);
}

.theme-toggle-text {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .3px;
  text-transform: uppercase;
  min-width: 48px;
}

/* Animação de transição do tema */
body {
  transition: background-color .3s ease, color .3s ease;
}

.topbar,
.panel,
.filterRow,
.pill,
.kpi,
select,
input,
button {
  transition: background .3s ease, border-color .3s ease, color .3s ease, box-shadow .3s ease;
}/* ===== CORREÇÕES DE TEMA CLARO ===== */

/* Textos e valores numéricos em preto no tema claro */
[data-theme="light"] .kpi .value,
[data-theme="light"] .sectionTitle,
[data-theme="light"] td,
[data-theme="light"] th,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] .panelHeader h2 {
  color: #1a2332 !important;
}

/* Valores de tabela em preto */
[data-theme="light"] table td {
  color: #1a2332;
}

[data-theme="light"] table th {
  color: #0d1117;
}

/* KPI values em preto */
[data-theme="light"] .kpi .value {
  color: #0d1117;
  font-weight: 900;
}

/* Ícones dos headers */
[data-theme="light"] .panelHeader h2 i {
  color: #5c6f82 !important;
}

/* Ajustes nos botões - remover transform para evitar quebra */
[data-theme="light"] .logoutBtn:hover,
[data-theme="light"] .theme-toggle:hover {
  transform: none;
  box-shadow: 0 2px 8px rgba(var(--brand-rgb),.20);
}

/* Melhorar contraste de labels */
[data-theme="light"] .kpi .label {
  color: #5c6f82;
  font-weight: 700;
}

[data-theme="light"] .pill label {
  color: #5c6f82;
}

/* Botões de gráfico - melhor contraste */
[data-theme="light"] .iconBtn {
  color: #5c6f82;
  background: rgba(var(--brand-rgb),.05);
}

[data-theme="light"] .iconBtn:hover {
  background: rgba(var(--brand-rgb),.12);
  color: #1a2332;
}

[data-theme="light"] .iconBtn.active {
  color: #0d1117;
}

/* Tabs de escopo */
[data-theme="light"] .scopeTabs button {
  color: #5c6f82;
}

[data-theme="light"] .scopeTabs button.active {
  color: #0d1117;
}

/* Textos de input e select mais escuros */
[data-theme="light"] select,
[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="text"] {
  color: #1a2332;
}

[data-theme="light"] select option {
  color: #1a2332;
  background: #ffffff;
}

/* Modal texts */
[data-theme="light"] .modalTitle,
[data-theme="light"] .modalText {
  color: #1a2332;
}

[data-theme="light"] .modalLabel {
  color: #5c6f82;
}

/* Células especiais da tabela */
[data-theme="light"] .cell-warn {
  background: rgba(227, 76, 60, .15);
  color: #c0392b;
  border-color: rgba(227, 76, 60, .3);
}

[data-theme="light"] .cell-good {
  background: rgba(22, 168, 98, .15);
  color: #16a862;
  border-color: rgba(22, 168, 98, .3);
}

/* Rodapé da tabela */
[data-theme="light"] .rankTable tfoot td {
  color: #0d1117;
}

/* Cells Best/Worst */
[data-theme="light"] .rankTable td.cellBest {
  background: rgba(46, 204, 113, .25);
  color: #16a862;
}

[data-theme="light"] .rankTable td.cellWorst {
  background: rgba(231, 76, 60, .25);
  color: #c0392b;
}

/* Apply button */
[data-theme="light"] .applyBtn {
  color: #0d1117;
}

/* Group label */
[data-theme="light"] .groupLabel {
  color: #5c6f82;
}

/* Section title */
[data-theme="light"] .sectionTitle {
  color: #5c6f82;
}

/* Brand subtitle */
[data-theme="light"] .brand .sub {
  color: #5c6f82;
}

/* Chart labels - garantir que sejam visíveis */
[data-theme="light"] canvas {
  filter: brightness(0.95);
}

/* Mensagens de erro/ok no login */
[data-theme="light"] .msg.error {
  background: rgba(227, 76, 60, .15);
  color: #c0392b;
  border-color: rgba(227, 76, 60, .3);
}

[data-theme="light"] .msg.ok {
  background: rgba(22, 168, 98, .15);
  color: #16a862;
  border-color: rgba(22, 168, 98, .3);
}

/* Link no login */
[data-theme="light"] .link {
  color: var(--brand);
}

/* Placeholder mais escuro */
[data-theme="light"] input::placeholder {
  color: rgba(92, 111, 130, .6);
}

/* Hint no login */
[data-theme="light"] .hint {
  color: #5c6f82;
}

[data-theme="light"] .mini {
  color: #5c6f82;
}/* ===== CORREÇÕES COMPLETAS DE TEMA CLARO ===== */

/* ========================================
   1. TEXTOS E TÍTULOS - PRETO NO TEMA CLARO
   ======================================== */

[data-theme="light"] body {
  color: #1a2332;
}

[data-theme="light"] .brand h1 {
  color: #0d1117 !important;
}

[data-theme="light"] .brand .sub {
  color: #5c6f82 !important;
}

[data-theme="light"] .sectionTitle {
  color: var(--brand) !important;
  font-weight: 900;
}

[data-theme="light"] .panelHeader h2 {
  color: #0d1117 !important;
}

[data-theme="light"] .panelHeader h2 i {
  color: var(--brand) !important;
  opacity: 0.85;
}

[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4 {
  color: #0d1117 !important;
}

/* ========================================
   2. KPIs - VALORES EM PRETO INTENSO
   ======================================== */

[data-theme="light"] .kpi .label {
  color: var(--brand) !important;
  font-weight: 800;
}

[data-theme="light"] .kpi .value {
  color: #0d1117 !important;
  font-weight: 900;
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #0d1117 !important;
  background-clip: unset !important;
}

/* ========================================
   3. TABELAS - TUDO EM PRETO
   ======================================== */

[data-theme="light"] table th {
  color: #0d1117 !important;
  font-weight: 800;
}

[data-theme="light"] table td {
  color: #1a2332 !important;
}

[data-theme="light"] .rankTable tfoot td {
  color: #0d1117 !important;
  font-weight: 900;
}

[data-theme="light"] .cell-warn {
  background: rgba(227, 76, 60, .20) !important;
  color: #c0392b !important;
  border-color: rgba(227, 76, 60, .35) !important;
  font-weight: 700;
}

[data-theme="light"] .cell-good {
  background: rgba(22, 168, 98, .20) !important;
  color: #16a862 !important;
  border-color: rgba(22, 168, 98, .35) !important;
  font-weight: 700;
}

[data-theme="light"] .rankTable td.cellBest {
  background: rgba(46, 204, 113, .25) !important;
  color: #16a862 !important;
  font-weight: 800;
}

[data-theme="light"] .rankTable td.cellWorst {
  background: rgba(231, 76, 60, .25) !important;
  color: #c0392b !important;
  font-weight: 800;
}

/* ========================================
   4. INPUTS, SELECTS E LABELS
   ======================================== */

[data-theme="light"] .pill {
  background: rgba(var(--brand-rgb),.05) !important;
  border-color: rgba(var(--brand-rgb),.20) !important;
}

[data-theme="light"] .pill:hover {
  background: rgba(var(--brand-rgb),.10) !important;
  border-color: rgba(var(--brand-rgb),.30) !important;
}

[data-theme="light"] .pill label {
  color: var(--brand) !important;
  font-weight: 800;
}

[data-theme="light"] .groupLabel {
  color: var(--brand) !important;
  font-weight: 900;
  background: rgba(var(--brand-rgb),.12) !important;
}

[data-theme="light"] select,
[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="text"] {
  color: #1a2332 !important;
  font-weight: 700;
  background: rgba(var(--brand-rgb),.08) !important;
  border-color: rgba(var(--brand-rgb),.20) !important;
}

[data-theme="light"] select:hover,
[data-theme="light"] input[type="date"]:hover,
[data-theme="light"] input[type="text"]:hover {
  background: rgba(var(--brand-rgb),.12) !important;
  border-color: rgba(var(--brand-rgb),.30) !important;
}

[data-theme="light"] select:focus,
[data-theme="light"] input[type="date"]:focus,
[data-theme="light"] input[type="text"]:focus {
  background: rgba(var(--brand-rgb),.15) !important;
  border-color: rgba(var(--brand-rgb),.50) !important;
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb),.10) !important;
}

[data-theme="light"] select option {
  color: #1a2332 !important;
  background: #ffffff !important;
}

[data-theme="light"] input::placeholder {
  color: rgba(92, 111, 130, .6) !important;
}

/* ========================================
   5. BOTÕES - AJUSTE DE TAMANHO E COR
   ======================================== */

[data-theme="light"] .theme-toggle {
  background: rgba(var(--brand-rgb),.08) !important;
  border-color: rgba(var(--brand-rgb),.20) !important;
  min-height: 40px;
  padding: 8px 12px;
}

[data-theme="light"] .theme-toggle:hover {
  transform: none !important;
  background: rgba(var(--brand-rgb),.12) !important;
  border-color: rgba(var(--brand-rgb),.30) !important;
  box-shadow: 0 2px 8px rgba(var(--brand-rgb),.20) !important;
}

[data-theme="light"] .theme-toggle-text {
  color: var(--brand) !important;
  font-weight: 800;
}

[data-theme="light"] .theme-toggle-icon {
  color: var(--brand) !important;
}

[data-theme="light"] .logoutBtn {
  background: rgba(var(--brand-rgb),.08) !important;
  color: #1a2332 !important;
  min-height: 40px;
}

[data-theme="light"] .logoutBtn:hover {
  transform: none !important;
  background: rgba(var(--brand-rgb),.12) !important;
  box-shadow: 0 2px 8px rgba(var(--brand-rgb),.20) !important;
}

/* Botão ADM - Tema Claro */
[data-theme="light"] .adminBtn {
  background: linear-gradient(135deg, rgba(240, 147, 251, 0.15), rgba(245, 87, 108, 0.15)) !important;
  border-color: rgba(245, 87, 108, 0.5) !important;
  color: #1a2332 !important;
  box-shadow: 0 2px 8px rgba(245, 87, 108, 0.15) !important;
  min-height: 40px;
}

[data-theme="light"] .adminBtn:hover {
  background: linear-gradient(135deg, rgba(240, 147, 251, 0.25), rgba(245, 87, 108, 0.25)) !important;
  border-color: rgba(245, 87, 108, 0.7) !important;
  box-shadow: 0 4px 12px rgba(245, 87, 108, 0.25) !important;
  transform: translateY(-2px) !important;
}

[data-theme="light"] .adminBtn i {
  color: #f5576c !important;
}

[data-theme="light"] .iconBtn {
  color: #5c6f82 !important;
  background: rgba(var(--brand-rgb),.05) !important;
}

[data-theme="light"] .iconBtn:hover {
  background: rgba(var(--brand-rgb),.12) !important;
  color: #1a2332 !important;
}

[data-theme="light"] .iconBtn.active {
  color: #0d1117 !important;
  background: linear-gradient(135deg, rgba(var(--brand-rgb),.25), rgba(var(--brand-rgb),.15)) !important;
}

[data-theme="light"] .applyBtn {
  color: #0d1117 !important;
  background: rgba(var(--brand-rgb),.18) !important;
}

/* ========================================
   6. TABS E NAVEGAÇÃO
   ======================================== */

[data-theme="light"] .scopeTabs button {
  color: var(--brand) !important;
  font-weight: 800;
}

[data-theme="light"] .scopeTabs button.active {
  color: #0d1117 !important;
  background: linear-gradient(135deg, rgba(var(--brand-rgb),.25), rgba(var(--brand-rgb),.15)) !important;
  font-weight: 900;
}

/* ========================================
   7. MODAIS
   ======================================== */

[data-theme="light"] .modalTitle {
  color: #0d1117 !important;
}

[data-theme="light"] .modalText {
  color: #1a2332 !important;
}

[data-theme="light"] .modalLabel {
  color: #5c6f82 !important;
}

/* ========================================
   8. GRÁFICOS - VALORES VISÍVEIS
   ======================================== */

/* Removido o filtro - as cores agora são ajustadas dinamicamente no JS */

/* ========================================
   9. MENSAGENS E HINTS
   ======================================== */

[data-theme="light"] .msg.error {
  background: rgba(227, 76, 60, .20) !important;
  color: #c0392b !important;
  border-color: rgba(227, 76, 60, .35) !important;
}

[data-theme="light"] .msg.ok {
  background: rgba(22, 168, 98, .20) !important;
  color: #16a862 !important;
  border-color: rgba(22, 168, 98, .35) !important;
}

[data-theme="light"] .link {
  color: var(--brand) !important;
}

[data-theme="light"] .hint {
  color: #5c6f82 !important;
}

[data-theme="light"] .mini {
  color: #5c6f82 !important;
}

/* ===== Export Excel (padronizado) ===== */
.logoutBtn:hover,
#exportExcelBtn:hover{
  background: rgba(12,21,40,.9);
  border-color: rgba(216,230,238,.22);
  transform: translateY(-1px);
}

.logoutBtn i,
#exportExcelBtn i{
  color: var(--text) !important;
}

#exportExcelBtn i{
  color: var(--good) !important;
}

/* Correção do ícone Export Excel no tema claro */
[data-theme="light"] #exportExcelBtn {
  background: rgba(var(--brand-rgb),.08) !important;
  color: #1a2332 !important;
  min-height: 40px;
}

[data-theme="light"] #exportExcelBtn:hover {
  background: rgba(var(--brand-rgb),.12) !important;
  box-shadow: 0 2px 8px rgba(var(--brand-rgb),.20) !important;
  transform: translateY(-1px) !important;
}

[data-theme="light"] #exportExcelBtn i {
  color: #16a862 !important;
}


/* ===== KPI (valor alinhado) ===== */
.kpi .value{ width: 100%; text-align: right; }
.kpi .label{ width: 100%; }

/* ===== Toggle de tema (padronizado) ===== */

.theme-toggle{
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 9px 12px !important;
  border-radius: 12px !important;
  border: 1px solid var(--stroke);
  background: rgba(12,21,40,.75);
  cursor: pointer !important;
  transition: all .3s ease;
  white-space: nowrap !important;
  overflow: visible !important;
  min-width: fit-content !important;
  height: 38px !important;
  min-height: 38px !important;
  width: auto !important;
  max-width: none !important;
}
.theme-toggle-switch{
  width: 40px !important;
  height: 20px !important;
}
.theme-toggle-text{
  min-width: 50px !important;
}
/* Light theme: keep data/filters text black */
[data-theme="light"] .filterRow label,
[data-theme="light"] .filterRow input,
[data-theme="light"] .filterRow select,
[data-theme="light"] .filterRow option,
[data-theme="light"] .filterRow .groupLabel,
[data-theme="light"] .filterRow .pillValue,
[data-theme="light"] .panelBody,
[data-theme="light"] .panelBody td,
[data-theme="light"] .panelBody th,
[data-theme="light"] .panelBody .kpi .label,
[data-theme="light"] .panelBody .kpi .value,
[data-theme="light"] .panelBody .sectionTitle,
[data-theme="light"] .panelBody .pill label,
[data-theme="light"] .panelBody .pillValue,
[data-theme="light"] .panelBody .rankTable td,
[data-theme="light"] .panelBody .rankTable th {
  color: #000;
}

[data-theme="light"] .filterRow input::placeholder {
  color: #333;
}
/* Light theme: topbar titles black */
[data-theme="light"] .topbar .brand h1 {
  color: #000;
  background: none;
  -webkit-text-fill-color: #000;
}
[data-theme="light"] .topbar .brand .sub {
  color: #000;
}
/* Light theme: force filter/topbar text black */
[data-theme="light"] .topbar .pill label,
[data-theme="light"] .topbar .pill select,
[data-theme="light"] .topbar .pill option,
[data-theme="light"] .topbar input[type="date"],
[data-theme="light"] .topbar input[type="text"],
[data-theme="light"] .topbar .groupLabel,
[data-theme="light"] .topbar .pillValue,
[data-theme="light"] .filterRow .pill label,
[data-theme="light"] .filterRow .pill select,
[data-theme="light"] .filterRow .pill option,
[data-theme="light"] .filterRow input[type="date"],
[data-theme="light"] .filterRow input[type="text"],
[data-theme="light"] .filterRow .groupLabel,
[data-theme="light"] .filterRow .pillValue {
  color: #000 !important;
}

[data-theme="light"] .topbar input::placeholder,
[data-theme="light"] .filterRow input::placeholder {
  color: #333 !important;
}
/* Light theme: KPI labels/values black */
[data-theme="light"] .kpi .label,
[data-theme="light"] .kpi .value {
  color: #000 !important;
}
/* Light theme: chart section titles black */
[data-theme="light"] .sectionTitle,
[data-theme="light"] .sectionTitle span,
[data-theme="light"] .sectionTitle h2,
[data-theme="light"] .sectionTitle h3 {
  color: #000 !important;
}
/* Light theme: scope tabs + theme toggle text black */
[data-theme="light"] .scopeTabs button,
[data-theme="light"] .scopeTabs button i,
[data-theme="light"] .scopeTabs button span,
[data-theme="light"] .theme-toggle,
[data-theme="light"] .theme-toggle-text,
[data-theme="light"] .theme-toggle-icon {
  color: #000 !important;
}

/* ===== Footer ===== */
.page-footer {
  margin: 24px auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.page-footer .footer-img {
  max-width: 260px;
  width: 70%;
  height: auto;
  display: none;
}

.page-footer .footer-dark {
  display: block;
}

[data-theme="light"] .page-footer .footer-dark {
  display: none;
}

[data-theme="light"] .page-footer .footer-light {
  display: block;
}
