/* =============================================================
   Comex BR Dashboard — Stylesheet
   Fonte: GrapesJS export + ajustes manuais
   ============================================================= */

/* Índice:
Reset / Base
Design Tokens (:root)
GrapesJS Theme Classes
Typography
Layout
Panel / Card Base
Header
Filters — Metal Tabs
Filters — Controls Row
Stat Badges
Stats Grid
Main Grid
Balance Chart Card
Map Card
Donut Cards
Tables
ID Overrides (GrapesJS)
Media Queries
*/

/* -------------------------------------------------------------
   1. RESET / BASE
   ------------------------------------------------------------- */

*,
::before,
::after {
  box-sizing: border-box;
  border-width: 0;
  border-style: solid;
  border-color: #e5e7eb;
}

html,
:host {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-feature-settings: normal;
  font-variation-settings: normal;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  line-height: inherit;
}

h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
}

a {
  color: inherit;
  text-decoration: inherit;
}

b, strong {
  font-weight: bolder;
}

button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-feature-settings: inherit;
  font-variation-settings: inherit;
  font-size: 100%;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
}

button,
select {
  text-transform: none;
}

button,
input:where([type='button']),
input:where([type='reset']),
input:where([type='submit']) {
  -webkit-appearance: button;
  background-color: transparent;
  background-image: none;
}

button,
[role="button"] {
  cursor: pointer;
}

:disabled {
  cursor: default;
}

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block;
  vertical-align: middle;
}

img,
video {
  max-width: 100%;
  height: auto;
}

ol, ul, menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

blockquote, dl, dd, hr, figure, p, pre {
  margin: 0;
}

fieldset {
  margin: 0;
  padding: 0;
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  opacity: 1;
  color: #9ca3af;
}

[hidden] {
  display: none;
}


/* -------------------------------------------------------------
   2. DESIGN TOKENS
   ------------------------------------------------------------- */

:root {
  /* GrapesJS theme */
  --gjs-t-color-primary:   #184e63;
  --gjs-t-color-secondary: #6b7280;
  --gjs-t-color-accent:    #12b3d6;
  --gjs-t-color-success:   #22c55e;
  --gjs-t-color-warning:   #f4b61e;
  --gjs-t-color-error:     #ef4444;
}


/* -------------------------------------------------------------
   3. GRAPESJS THEME CLASSES
   ------------------------------------------------------------- */

.gjs-t-body {
  background-color: #eef1f4;
  color: #334155;
  font-size: 14px;
  line-height: 1.5;
}

.gjs-t-h1 {
  color: #1f2937;
  font-size: 28px;
  line-height: 1.2;
}

.gjs-t-h2 {
  color: #1f2937;
  font-size: 20px;
  line-height: 1.3;
}

.gjs-t-button {
  background-color: #184e63;
  color: #ffffff;
  border-radius: 12px;
}

.gjs-t-link {
  color: #184e63;
  text-decoration: none;
}

.gjs-t-border {
  border-radius: 14px;
  border-color: #d7dde4;
}


/* -------------------------------------------------------------
   4. TYPOGRAPHY
   ------------------------------------------------------------- */

.font-body {
  font-family: "Inter", sans-serif;
}

.font-heading {
  font-family: "Manrope", sans-serif;
}


/* -------------------------------------------------------------
   5. LAYOUT
   ------------------------------------------------------------- */

.dashboard-body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page-wrapper {
  min-height: 100vh;
  width: 100%;
  padding: 1.5rem 2rem;
}

.dashboard-container {
  margin-left: auto;
  margin-right: auto;
  max-width: 1380px;
}


/* -------------------------------------------------------------
   6. PANEL / CARD BASE
   ------------------------------------------------------------- */

.panel {
  background: #ffffff;
  border: 1px solid #dbe2e8;
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .03);
}

.pill {
  border: 1px solid #d6dde4;
  border-radius: 12px;
  background: #ffffff;
  color: #475569;
  transition: all .2s ease;
}

.pill:hover {
  border-color: #93a9b7;
  color: #184e63;
  box-shadow: 0 0 0 3px rgba(24, 78, 99, .08);
}

.pill-active:hover {
  color: #ffffff;
  border-color: #184e63;
  box-shadow: 0 0 0 3px rgba(24, 78, 99, .2);
}

.pill-active {
  background: #184e63;
  border-color: #184e63;
  color: #ffffff;
}


/* -------------------------------------------------------------
   7. HEADER
   ------------------------------------------------------------- */

.dashboard-panel {
  padding: 1.5rem;
}

.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgb(226 232 240 / 1);
  padding-bottom: 1.25rem;
}

.header-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.page-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.update-badge {
  align-self: flex-start;
  border-radius: 9999px;
  border: 1px solid rgb(226 232 240 / 1);
  background-color: rgb(248 250 252 / 1);
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  color: rgb(71 85 105 / 1);
}


/* -------------------------------------------------------------
   8. FILTERS — METAL TABS
   ------------------------------------------------------------- */

.filters-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 1.25rem;
}

.metal-tabs {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  flex: 0 0 auto;
  width: 100%;
  gap: 0.5rem;
}

.metal-filter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  height: 44px;
  flex: 1 1 0%;
  font-size: 0.875rem;
  line-height: 1rem;
  font-weight: 600;
}

.metal-symbol {
  display: flex;
  height: 1.75rem;
  width: 1.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  border: 1px solid rgb(203 213 225 / 1);
  background-color: rgb(248 250 252 / 1);
  font-size: 12px;
  font-weight: 700;
  color: rgb(51 65 85 / 1);
}

/* Metal symbol — estado ativo */
.metal-filter.pill-active .metal-symbol {
  background-color: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .3);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}

/* Metal symbol — estado inativo */
.metal-filter:not(.pill-active) .metal-symbol {
  background-color: rgb(248 250 252 / 1);
  border-color: rgb(203 213 225 / 1);
  color: rgb(51 65 85 / 1);
}

.metal-expand {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.55;
  margin-left: 0.125rem;
  cursor: pointer;
  padding: 0 0.125rem;
}

.metal-filter.pill-active .metal-expand {
  opacity: 1;
}

.metal-group-indicator {
  display: none;
  min-width: 18px;
  height: 18px;
  padding: 0 0.375rem;
  border-radius: 9999px;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  border: 1px solid rgba(100, 116, 139, .45);
  color: #475569;
  background: #f8fafc;
  gap: 0.125rem;
}

.metal-filter.pill-active .metal-group-indicator {
  display: inline-flex;
  border-color: rgba(255, 255, 255, .45);
  color: #ffffff;
  background: rgba(255, 255, 255, .14);
}

.metal-group-label {
  font-size: 10px;
  font-weight: 700;
  margin-left: 0.125rem;
}

/* Dropdown de subclasses — flutua abaixo do tab clicado */
.group-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  z-index: 50;
  min-width: 160px;
  background: #ffffff;
  border: 1px solid #dbe2e8;
  border-radius: 12px;
  padding: 0.375rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .10);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .15s ease, transform .15s ease;
}

.group-dropdown.group-dropdown-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.group-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: left;
  width: 100%;
  color: #475569;
  transition: background .12s, color .12s;
}

.group-filter:hover {
  background: #f1f5f9;
  color: #184e63;
}

.group-filter.active {
  background: #184e63;
  color: #ffffff;
}

.group-code {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  opacity: 0.55;
  min-width: 14px;
}

.group-filter.active .group-code {
  opacity: 1;
}


/* -------------------------------------------------------------
   9. FILTERS — CONTROLS ROW (toggles + datas)
   ------------------------------------------------------------- */

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.segment-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

/* Toggle base — unit-toggle mantém comportamento exclusivo (pill encaixada) */
.unit-toggle {
  display: flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid rgb(226 232 240 / 1);
  background-color: rgb(248 250 252 / 1);
  padding: 0.25rem;
}

/* trade-toggle: multi-select — botões independentes lado a lado */
.trade-toggle {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.trade-option {
  border-radius: 9999px;
  border: 1px solid rgb(226 232 240 / 1);
  background-color: rgb(248 250 252 / 1);
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  color: #184e63;
  transition: color 150ms, background-color 150ms, border-color 150ms;
}

.unit-option {
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  color: #184e63;
  transition: color 150ms, background-color 150ms;
}

.trade-option:hover,
.unit-option:hover {
  color: #184e63;
}

.trade-option.gjs-t-button,
.unit-option.gjs-t-button,
.trade-option.gjs-t-button:hover,
.unit-option.gjs-t-button:hover {
  background-color: #184e63;
  color: #ffffff;
}

/* Período */
.date-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.control-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgb(148 163 184 / 1);
}

.date-pill {
  border-radius: 0.75rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 700;
}

.date-input-group {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.date-input-text {
  border-radius: 0.75rem;
  padding: 0.75rem 0.85rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 700;
  width: 92px;
}

.date-picker-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 0.65rem;
  border: 1px solid #dbe2e8;
  background: #ffffff;
  color: #64748b;
}

.date-picker-trigger:hover {
  border-color: #93a9b7;
  color: #184e63;
}

.date-input-picker-hidden {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  width: 34px;
  height: 34px;
  pointer-events: none;
  cursor: pointer;
  z-index: 1;
}

.custom-month-picker {
  position: fixed;
  display: none;
  width: min(220px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  overflow: auto;
  padding: 0.6rem;
  border: 1px solid #dbe2e8;
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
  z-index: 1200;
}

.custom-month-picker.open {
  display: block;
}

.custom-month-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.month-picker-year {
  font-size: 0.8rem;
  color: #184e63;
}

.month-nav-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #dbe2e8;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #184e63;
  line-height: 1;
}

.month-nav-btn:hover {
  border-color: #93a9b7;
}

.custom-month-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
}

.month-cell-btn {
  border: 1px solid #dbe2e8;
  border-radius: 0.55rem;
  background: #ffffff;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.45rem 0.3rem;
}

.month-cell-btn:hover {
  border-color: #93a9b7;
  color: #184e63;
}

.month-cell-btn.active {
  background: #184e63;
  border-color: #184e63;
  color: #ffffff;
}

.date-picker-trigger:focus,
.date-input-text:focus {
  outline: 2px solid rgba(24, 78, 99, 0.2);
  outline-offset: 1px;
}

.date-icon {
  width: 14px;
  height: 14px;
}

.date-apply-btn {
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 700;
}

.donut-reset-btn {
  margin-top: 0.25rem;
  align-self: flex-start;
  border-radius: 9999px;
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  padding: 0.45rem 0.75rem;
}


/* -------------------------------------------------------------
   10. STAT BADGES
   ------------------------------------------------------------- */

.stat-badge {
  align-self: flex-start;
  padding: 0.25rem 0.75rem;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9999px;
}

.stat-badge-positive {
  background: #e9f9ef;
  color: #1f8a46;
  border: 1px solid #c6efd4;
}

.stat-badge-negative {
  background: #fff0f0;
  color: #d83d3d;
  border: 1px solid #ffd1d1;
}

.stat-badge-neutral {
  background: #f4f7fa;
  color: #475569;
  border: 1px solid #dde4eb;
}


/* -------------------------------------------------------------
   11. STATS GRID
   ------------------------------------------------------------- */

.stats-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.stat-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.stat-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgb(148 163 184 / 1);
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: rgb(51 65 85 / 1);
}

.stat-sub {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.75rem;
  margin-top: auto;
  border-top: 1px solid rgb(226 232 240 / 1);
}

.stat-sub-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgb(148 163 184 / 1);
}

.stat-sub-value {
  font-size: 13px;
  font-weight: 600;
  color: rgb(51 65 85 / 1);
  font-family: "Manrope", sans-serif;
}

.stat-content-kpi {
  gap: 0.45rem;
}

.stat-content-kpi .stat-label {
  white-space: nowrap;
}

.stat-content-kpi .stat-value {
  font-size: 24px;
  line-height: 1.05;
}

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-top: 1px solid rgb(226 232 240 / 1);
  padding-top: 0.5rem;
}

.stat-row-left {
  font-size: 11px;
  line-height: 1.15;
  color: rgb(71 85 105 / 1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-row-delta {
  flex: 0 0 auto;
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  text-align: right;
}

.stat-row-delta-positive {
  color: #1f8a46;
}

.stat-row-delta-negative {
  color: #d83d3d;
}

.stat-row-delta-neutral {
  color: #64748b;
}


/* -------------------------------------------------------------
   12. MAIN GRID (left + right columns)
   ------------------------------------------------------------- */

.main-dashboard-grid {
  margin-top: 1rem;
}

.grid-main {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(290px, .95fr);
  gap: 16px;
}

.left-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.right-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}


/* -------------------------------------------------------------
   13. BALANCE CHART CARD
   ------------------------------------------------------------- */

.balance-chart-card {
  padding: 1rem;
}

.chart-card-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card-heading {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.card-title {
  font-size: 16px;
  font-weight: 800;
}

.card-subtitle {
  font-size: 0.75rem;
  line-height: 1rem;
  color: rgb(148 163 184 / 1);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
    word-break: break-word;
  color: rgb(71 85 105 / 1);
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 9999px;
  background-color: rgb(14 165 233 / 1);
}

.chart-legend .legend-item:nth-child(1) .legend-dot {
  background-color: #10b3d6;
}

.chart-legend .legend-item:nth-child(2) .legend-dot {
  background-color: #28c86f;
}

.chart-legend .legend-item:nth-child(3) .legend-dot {
  background-color: #f4b61e;
}

.legend-text {
  font-size: 0.75rem;
  line-height: 1rem;
  color: rgb(100 116 139 / 1);
}

.chart-layout {
  display: flex;
  gap: 0.75rem;
}

.chart-region {
  flex: 1 1 0%;
}

.area-chart {
  position: relative;
  height: 290px;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid rgb(226 232 240 / 1);
  background-color: #ffffff;
}

.area-chart canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-empty-state {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  text-align: center;
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.4;
  background: rgba(255, 255, 255, 0.78);
}

.chart-empty-state.is-visible {
  display: flex;
}

.chart-footer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid rgb(226 232 240 / 1);
  padding-top: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: rgb(100 116 139 / 1);
}

.footer-label {
  font-weight: 500;
}

.methodology-notes {
  font-size: 0.75rem;
  line-height: 1.45;
  color: #475569;
}

.methodology-title {
  font-weight: 700;
  color: #334155;
}

.methodology-list {
  margin: 0.25rem 0 0;
  padding-left: 1.15rem;
  list-style: disc;
}

.methodology-list li {
  margin: 0.125rem 0;
}

.methodology-subtitle {
  color: #64748b;
}


/* -------------------------------------------------------------
   14. MAP CARD
   ------------------------------------------------------------- */

.map-card {
  padding: 1rem;
}

.map-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.map-visual {
  height: 270px;
  border-radius: 0.75rem;
  border: 1px solid rgb(226 232 240 / 1);
  background-color: rgb(236 253 245 / 1);
}


/* -------------------------------------------------------------
   15. DONUT CARDS
   ------------------------------------------------------------- */

.donut-card {
  padding: 1rem;
}

.donut-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.donut-layout {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.donut-wrapper {
    flex-shrink: 0;
  position: relative;
  margin-left: auto;
  margin-right: auto;
}

.donut-ring {
  width: 168px;
  height: 168px;
  border-radius: 9999px;
  background: conic-gradient(
    #10b3d6 0 22%,
    #79d8ec 22% 47%,
    #f2c328 47% 63%,
    #2cc86f 63% 72%,
    #48a9c5 72% 100%
  );
  position: relative;
}

.donut-ring::after {
  content: "";
  position: absolute;
  inset: 26px;
  border-radius: 9999px;
  background: #ffffff;
  border: 1px solid #edf2f7;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, .03);
}

.donut-ring.is-empty {
  background: conic-gradient(#e2e8f0 0deg 360deg);
}

.legend-list {
    flex: 1;
    min-width: 140px;
    max-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.donut-flow-toggle {
  transition: opacity 0.2s;
}

.donut-flow-toggle:hover {
  opacity: 1 !important;
}

.donut-reset-icon {
  transition: opacity 0.2s, transform 0.2s;
}

.donut-reset-icon:hover {
  opacity: 1 !important;
  transform: rotate(180deg);
}

.donut-empty {
  color: rgb(100 116 139 / 1);
  font-size: 0.75rem;
  line-height: 1rem;
}


/* -------------------------------------------------------------
   16. TABLES
   ------------------------------------------------------------- */

.data-table {
  margin-top: 0.25rem;
  border-radius: 0.75rem;
  border: 1px solid rgb(226 232 240 / 1);
}

.table-header {
  border-bottom: 1px solid rgb(226 232 240 / 1);
  padding: 0.75rem 1rem;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgb(148 163 184 / 1);
}

.table-row,
.table-row-municipio {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 72px 108px;
  gap: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: rgb(71 85 105 / 1);
}

.table-empty {
  padding: 0.75rem 1rem;
  color: rgb(100 116 139 / 1);
  font-size: 0.75rem;
  line-height: 1rem;
}


/* -------------------------------------------------------------
   17. ID OVERRIDES (GrapesJS)
   ------------------------------------------------------------- */

/* Metal tabs — alturas uniformes */
#i7yfp,
#iowjc,
#iuck4,
#i9dyt {
  height: 44px;
  flex: 1 1 0%;
}

/* Botões ativos dos toggles */
#ilos4.gjs-t-button,
#ily7j.gjs-t-button {
  color: #ffffff;
}


/* -------------------------------------------------------------
   18. MEDIA QUERIES
   ------------------------------------------------------------- */

@media (max-width: 992px) {
  .grid-main {
    grid-template-columns: 1fr;
  }

  .donut-ring {
    width: 168px;
    height: 168px;
  }

  .page-wrapper {
    padding: 1rem;
  }

  .dashboard-panel {
    padding: 1rem;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 1rem;
  }

  .page-title {
    font-size: 22px;
  }

  .metal-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .controls-row {
    flex-direction: column;
    align-items: stretch;
  }

  .date-controls {
    justify-content: flex-start;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-value {
    font-size: 24px;
  }

  .stat-content-kpi .stat-value {
    font-size: 21px;
  }

  .stat-row-left,
  .stat-row-delta {
    font-size: 10px;
  }

  .map-visual {
    height: 240px;
  }

  .donut-layout {
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  .donut-ring {
    width: 148px;
    height: 148px;
  }

  .donut-ring::after {
    inset: 22px;
  }

  .page-wrapper {
    padding: 0.75rem;
  }

  .dashboard-panel {
    padding: 0.75rem;
  }

  .page-title {
    font-size: 20px;
  }

  .metal-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
  }

  .metal-filter {
    flex: 1 1 0%;
    min-width: 0;
    gap: 0.3rem;
    padding: 0.5rem 0.375rem;
  }

  .metal-filter span:not(.metal-symbol):not(.metal-expand):not(.metal-group-indicator) {
    display: none;
  }

  .metal-group-label {
    display: none;
  }

  .metal-filter .metal-symbol {
    margin: 0;
  }

  .date-controls {
    position: relative !important;
    display: grid !important;
    grid-template-columns: min-content minmax(0, 1fr) min-content minmax(0, 1fr) max-content;
    column-gap: 0.3rem !important;
    row-gap: 0.35rem !important;
    align-items: center !important;
    width: 100% !important;
    overflow-x: hidden;
    padding-top: 0.95rem;
    padding-bottom: 4px;
  }

  .date-controls > :nth-child(1) {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    grid-column: auto !important;
    grid-row: auto !important;
    line-height: 1 !important;
  }
  .date-controls > :nth-child(2) { grid-column: 2 !important; grid-row: 1 !important; }
  .date-controls > :nth-child(3) { grid-column: 3 !important; grid-row: 1 !important; }
  .date-controls > :nth-child(4) { grid-column: 4 !important; grid-row: 1 !important; }
  .date-controls > :nth-child(5) { grid-column: 1 !important; grid-row: 2 !important; }
  .date-controls > :nth-child(6) { grid-column: 2 !important; grid-row: 2 !important; }
  .date-controls > :nth-child(7) { grid-column: 3 !important; grid-row: 2 !important; }
  .date-controls > :nth-child(8) { grid-column: 4 !important; grid-row: 2 !important; }
  .date-controls > :nth-child(9) { grid-column: 5 !important; grid-row: 2 !important; }

  .date-controls .date-pill[data-period-mode] {
    flex: 0 0 auto;
    min-width: 0;
    width: 100%;
    padding: 0.5rem 0.4rem;
    font-size: 0.6rem;
    text-align: center;
    white-space: nowrap;
  }

  .date-controls .custom-period-label {
    margin: 0 !important;
    font-size: 10px !important;
    white-space: nowrap !important;
  }

  .date-input-group {
    position: relative !important;
    width: 100% !important;
    min-width: 0 !important;
    display: block !important;
    align-items: center !important;
  }

  .date-input-text {
    width: 100% !important;
    padding: 0.52rem 1.7rem 0.52rem 0.5rem !important;
    font-size: 0.74rem !important;
    min-width: 0 !important;
  }

  .date-picker-trigger {
    position: absolute !important;
    right: 0.2rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    flex: 0 0 22px !important;
    width: 22px !important;
    height: 22px !important;
    padding: 0 !important;
  }

  .date-apply-btn {
    width: auto !important;
    padding: 0.5rem 0.55rem !important;
    font-size: 0.64rem !important;
    white-space: nowrap !important;
  }

  .stats-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .stat-content-kpi .stat-value {
    font-size: 20px;
  }

  .area-chart {
    height: 240px;
  }

  .map-visual {
    height: 200px;
  }

  .donut-layout {
    flex-direction: column;
    align-items: flex-start;
  }

  .donut-wrapper {
    margin-left: 0;
    margin-right: 0;
  }

  .table-header,
  .table-row,
  .table-row-municipio {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  /* Aumentar o tamanho do toggle do donut em celulares */
  .donut-flow-toggle {
    font-size: 18px !important; /* Ajuste os pixels conforme achar melhor */
    opacity: 1 !important;       /* Força a aparecer independente de hover */
    display: inline-block;
    line-height: 1;
  }

  .donut-flow-toggle {
    padding: 8px !important; /* Aumenta a área de clique em volta da setinha */
  }
}
