/* Design System — Tokens */
:root {
  /* Cores base (dark default) */
  --bg: #0f172a;
  --bg-soft: #111827;
  --surface: #1f2937;
  --card: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --primary: #38bdf8;
  --accent: #a78bfa;
  --ok: #34d399;
  --warn: #f59e0b;
  --danger: #ef4444;
  --border: #374151;
  --shadow: 0 6px 18px rgba(0, 0, 0, .35);

  /* Tipografia (escala modular) */
  --font-sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  /* tamanhos base convertidos para rem + clamp para responsividade fluida */
  --fs-10: clamp(0.58rem, 0.52rem + 0.2vw, 0.66rem);
  --fs-12: clamp(0.70rem, 0.64rem + 0.2vw, 0.78rem);
  --fs-13: clamp(0.75rem, 0.69rem + 0.2vw, 0.82rem);
  --fs-14: clamp(0.82rem, 0.74rem + 0.25vw, 0.90rem);
  --fs-16: clamp(0.88rem, 0.80rem + 0.35vw, 1.00rem);
  --fs-18: clamp(1.00rem, 0.90rem + 0.45vw, 1.12rem);
  --fs-20: clamp(1.06rem, 0.96rem + 0.55vw, 1.25rem);
  --fw-600: 600;
  --fw-700: 700;
  --fw-800: 800;

  /* Espaçamentos (baseline 4px) com leve fluidez */
  --space-4: clamp(2px, 0.3vw, 4px);
  --space-6: clamp(4px, 0.5vw, 6px);
  --space-8: clamp(6px, 0.7vw, 8px);
  --space-10: clamp(8px, 1.0vw, 10px);
  --space-12: clamp(10px, 1.2vw, 12px);
  --space-14: clamp(12px, 1.4vw, 14px);
  --space-16: clamp(14px, 1.6vw, 16px);
  --space-20: clamp(16px, 2.0vw, 20px);

  /* Grid */
  --gutter-col: 12px;
  --gutter-row: 10px;
}

/* Tema claro com alto contraste e melhor legibilidade */
html[data-theme="light"] {
  --bg: #f3f6fb;
  --bg-soft: #eef2f8;
  --surface: #ffffff;
  --card: #ffffff;
  --text: #0a1222;
  --muted: #334155;
  --primary: #0e7ac7;
  --accent: #7c3aed;
  --ok: #047857;
  --warn: #b45309;
  --danger: #b91c1c;
  --border: #d6d9e2;
  --shadow: 0 8px 22px rgba(2, 8, 23, .10);
}

/* Fallback: aplica tema claro se sistema preferir claro e JS não executou */
@media (prefers-color-scheme: light) {
  html:not([data-theme]) {
    --bg: #f3f6fb;
    --bg-soft: #eef2f8;
    --surface: #ffffff;
    --card: #ffffff;
    --text: #0a1222;
    --muted: #334155;
    --primary: #0e7ac7;
    --accent: #7c3aed;
    --ok: #047857;
    --warn: #b45309;
    --danger: #b91c1c;
    --border: #d6d9e2;
    --shadow: 0 8px 22px rgba(2, 8, 23, .10);
  }
}

/* Reset/estrutura básica */
* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  line-height: 1.5;
  background:
    radial-gradient(1200px 800px at 10% -10%, rgba(56, 189, 248, .10), transparent 60%),
    radial-gradient(1000px 700px at 100% 0%, rgba(167, 139, 250, .08), transparent 60%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* suporte a recortes de notch em iOS/Android */
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--primary) 65%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-14) var(--space-20);
  background: linear-gradient(180deg, color-mix(in oklab, var(--bg-soft) 80%, transparent), transparent);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: env(safe-area-inset-top, 0);
  z-index: 20;
  backdrop-filter: blur(6px);
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.app-header.header-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.logo-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-title h1 {
  font-size: var(--fs-20);
  font-weight: var(--fw-800);
  margin: 0;
  white-space: nowrap;
}

.title-container {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.title-separator {
  color: var(--muted);
  font-size: var(--fs-20);
  font-weight: var(--fw-300);
}

.station-select {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: var(--fs-20);
  font-weight: var(--fw-800);
  color: var(--primary); /* Destaca que é selecionável */
  cursor: pointer;
  padding: 0 4px;
  margin: 0;
  outline: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  max-width: 250px;
  text-overflow: ellipsis;
}

.station-select:hover {
  background: color-mix(in oklab, var(--primary) 10%, transparent);
  border-radius: 4px;
}

.station-select:focus {
  border-bottom: 2px solid var(--primary);
}

.station-select option {
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-14);
  font-weight: var(--fw-400);
}

.logo-title p {
  font-size: var(--fs-12);
  color: var(--muted);
  margin: 0;
  display: flex;
  align-items: center;
}

.hardware-stats {
  display: none;
  align-items: center;
  margin-left: 15px;
  padding-left: 15px;
  border-left: 1px solid var(--border);
  user-select: none;
  font-family: var(--ff-mono);
}

.hardware-stats.show {
  display: flex;
}

#batteryStatus,
#solarStatus {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

#solarStatus {
  margin-left: 12px;
}

.hardware-stats > span {
  transition: opacity 0.2s ease;
}

.hardware-stats > span:hover {
  opacity: 0.8;
}

.logo {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 4px 12px color-mix(in oklab, var(--primary) 35%, transparent));
}

.header-actions .btn {
  margin-left: 10px;
}

/* User Menu & Dropdown */
.user-menu-container {
  position: relative;
  display: inline-block;
}

.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: var(--fw-600);
  font-size: var(--fs-14);
}

.user-btn:hover {
  background: var(--bg-soft);
}

.user-btn svg {
  color: var(--primary);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  padding: 8px;
  display: none;
  z-index: 2000;
  animation: dropdownFadeIn 0.2s ease-out;
}

.user-dropdown.show {
  display: block;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.user-info {
  padding: 12px;
}

.user-email {
  font-weight: var(--fw-700);
  color: var(--text);
  margin: 0;
  font-size: var(--fs-14);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-org {
  font-size: var(--fs-12);
  color: var(--muted);
  margin: 2px 0 0;
}

.user-role-badge {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: var(--fw-800);
  padding: 2px 6px;
  border-radius: 4px;
  background: color-mix(in oklab, var(--primary) 15%, transparent);
  color: var(--primary);
  margin-top: 8px;
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: var(--fs-14);
  font-weight: var(--fw-600);
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
  transition: background 0.2s;
}

.dropdown-item:hover {
  background: var(--bg-soft);
}

.dropdown-item svg {
  color: var(--muted);
}

.dropdown-item.logout {
  color: #ef4444;
}

.dropdown-item.logout svg {
  color: #ef4444;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: calc(100vh - 64px);
}

.sidebar {
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-soft), transparent);
  padding: 16px;
}

.sidebar h3 {
  margin: 10px 0;
  color: var(--text);
}

.form-group {
  margin: 12px 0;
}

.form-group label {
  font-size: var(--fs-12);
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

.form-group .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
}

select,
input[type="date"] {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 10px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

select:hover,
input[type="date"]:hover {
  border-color: color-mix(in oklab, var(--primary) 35%, var(--border));
}

select:focus,
input[type="date"]:focus {
  border-color: color-mix(in oklab, var(--primary) 80%, #fff 20%);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 25%, transparent);
}

.downloads .btn {
  width: 100%;
  margin-bottom: 8px;
}

.content {
  padding: clamp(10px, 2.5vw, 16px);
  max-width: 1600px;
  margin: 0 auto;
}

/* Buttons */
.btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  transition: transform .05s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
  box-shadow: var(--shadow);
}

/* Botão de ícone circular para o toggle de tema */
.icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.btn:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 16px color-mix(in oklab, var(--primary) 18%, transparent);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.btn.primary {
  background: linear-gradient(180deg, var(--primary), color-mix(in oklab, var(--primary) 75%, #0ea5e9));
  color: #ffffff;
  border: none;
}

/* Sections */
.section h2 {
  margin: 6px 0 12px;
  letter-spacing: .3px;
  font-weight: var(--fw-800);
  color: var(--text);
  font-size: var(--fs-18);
}

/* Cards / KPI */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(160px, 1fr));
  gap: var(--gutter-row) var(--gutter-col);
}

.kpi {
  background: linear-gradient(180deg, color-mix(in oklab, var(--surface) 92%, transparent), transparent);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--shadow);
  position: relative;
}

html[data-theme="light"] .kpi {
  background: linear-gradient(180deg, #ffffff, color-mix(in oklab, #ffffff 85%, var(--bg-soft)));
}

.kpi h4 {
  margin: 2px 0 6px;
  color: var(--muted);
  font-weight: var(--fw-700);
  font-size: var(--fs-12);
  text-transform: uppercase;
  letter-spacing: .6px;
}

.kpi .value {
  font-size: 28px;
  font-weight: var(--fw-800);
  color: var(--text);
}

.kpi .badge {
  position: absolute;
  top: 10px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  color: white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .15);
}

.kpi .badge svg {
  display: block;
  width: 18px;
  height: 18px;
}

.badge.ok {
  background: var(--ok);
}

.badge.warn {
  background: var(--warn);
}

.badge.danger {
  background: var(--danger);
}

.kpi .sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

/* Charts grid (tempo real e histórico) */
.charts-grid,
.card-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  grid-auto-rows: auto;
  align-items: stretch;
  gap: var(--gutter-row) var(--gutter-col);
  margin-top: var(--space-12);
}

/* Cartões */
.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  height: 100%;
  /* ocupa 100% da célula do grid-auto-rows */
  display: flex;
  flex-direction: column;
}

html[data-theme="light"] .chart-card {
  background: #ffffff;
  border-color: #cfd6e3;
}

.chart-card h3 {
  margin: 0 0 6px;
  font-size: var(--fs-16);
  font-weight: var(--fw-700);
  color: var(--text);
}

/* Containers Plotly */
.plotly-container-fixed {
  width: 100%;
  height: 280px;
  display: block;
  flex: 1 1 auto;
  min-height: 240px;
  max-height: 340px;
}

.plot-container,
.svg-container {
  width: 100% !important;
  max-width: 100% !important;
}

/* Ritmo vertical entre blocos soltos dentro da section */
.section .chart-card {
  margin-bottom: var(--space-12);
}

/* Evita “colar” quando a fileira de cima usa grid-auto-rows e o último card vem sozinho abaixo */
.section .chart-card:last-child {
  margin-bottom: calc(var(--space-20) + var(--gutter-row));
}

/* Respiro extra entre a última grade de cards e o próximo bloco (tabela/rodapé) */
.section:last-of-type {
  padding-bottom: calc(var(--space-20) + var(--gutter-row));
}

/* Table */
.table-wrapper {
  overflow-x: auto;
  /* Dá respiro explícito acima da tabela para não colar no último card,
     independentemente da altura do grid anterior */
  margin-top: calc(var(--space-20) + var(--gutter-row));
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
  /* rolagem suave em mobile */
}

html[data-theme="light"] .table-wrapper {
  border-color: #cfd6e3;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-weight: var(--fw-800);
  padding: 10px;
  font-size: var(--fs-13);
  text-transform: uppercase;
  white-space: nowrap;
}

html[data-theme="light"] thead th {
  background: #f8fafc;
  color: #0f172a;
}

tbody td {
  border-bottom: 1px solid var(--border);
  padding: 10px;
  font-size: var(--fs-13);
  color: var(--text);
}

tbody tr:hover td {
  background: color-mix(in oklab, var(--bg-soft) 35%, transparent);
}

/* Status bar */
.status-bar {
  margin-top: var(--space-8);
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  overflow-wrap: anywhere;
}

html[data-theme="light"] .status-bar {
  background: #ffffff;
  border-color: #cfd6e3;
  color: #334155;
}

/* Trends */
.trend-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: var(--gutter-row) var(--gutter-col);
  margin-bottom: 10px;
}

.trend {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--shadow);
}

html[data-theme="light"] .trend {
  background: #ffffff;
  border-color: #cfd6e3;
}

.trend .delta.up {
  color: var(--ok);
  font-weight: var(--fw-800);
}

.trend .delta.down {
  color: var(--danger);
  font-weight: var(--fw-800);
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 16px 10px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  background: linear-gradient(0deg, color-mix(in oklab, var(--bg-soft) 60%, transparent), transparent);
}

/* Drawer tweaks (quando ativo) */
.drawer {
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
}

html[data-theme="light"] .drawer {
  background: #eef2f8;
  border-right-color: #cfd6e3;
}

/* Responsive — breakpoints consistentes */
@media (min-width: 1400px) {

  .charts-grid,
  .card-row {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    grid-auto-rows: auto;
    /* mantém consistência também em 3 colunas */
  }
}

@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .trend-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .charts-grid,
  .card-row {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    /* em 1 coluna, deixe altura natural */
  }

  .layout {
    grid-template-columns: 260px 1fr;
  }
}

@media (max-width: 820px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .trend-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .chart-card h3 {
    font-size: var(--fs-14);
  }

  .plotly-container-fixed {
    height: 260px;
    min-height: 220px;
    max-height: 300px;
    touch-action: pan-y;
  }

  /* Mostra botão de zoom em tablets */
  #zoomToggle {
    display: inline-flex;
  }
}

/* Telas pequenas extras */
@media (max-width: 600px) {
  .app-header {
    padding: var(--space-8) var(--space-12);
  }

  .logo-title {
    gap: 8px;
  }

  .logo {
    width: 28px;
    height: 28px;
    margin-left: 4px !important;
  }

  #userOrgTitle, 
  .title-separator {
    display: none !important;
  }

  .station-select {
    font-size: var(--fs-18);
    max-width: 220px;
  }

  .header-text p {
    font-size: var(--fs-10);
  }

  .hardware-stats {
    margin-left: 8px !important;
    padding-left: 8px !important;
  }

  #solarStatus {
    margin-left: 8px !important;
  }

  .user-btn span {
    display: none;
  }

  .user-btn {
    padding: 8px !important;
    border-radius: 50% !important;
    min-width: 38px;
    height: 38px;
    justify-content: center;
  }

  .header-actions .btn {
    margin-left: 6px;
    padding: 8px 10px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .trend-grid {
    grid-template-columns: 1fr;
  }

  thead th,
  tbody td {
    padding: 8px;
    font-size: var(--fs-12);
  }

  .plotly-container-fixed {
    height: 240px;
    min-height: 200px;
    max-height: 280px;
    touch-action: pan-y;
  }

  /* Ajusta tipografia do Plotly para caber melhor no mobile */
  .plotly .xtick text,
  .plotly .ytick text {
    font-size: 10px !important;
  }

  .plotly .legendtext {
    font-size: 10px !important;
  }

  /* Mostra botão de zoom em mobile/tablet */
  #zoomToggle {
    display: inline-flex;
  }
}

@media (max-width: 420px) {
  .logo {
    display: none;
  }

  .station-select {
    max-width: 170px;
  }

  .hardware-stats {
    border-left: none !important;
    padding-left: 0 !important;
    margin-left: 4px !important;
  }

  #lastFetchTime {
    display: none;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 10px;
  }

  .btn {
    padding: 8px 10px;
    border-radius: 10px;
  }

  .charts-grid,
  .card-row {
    gap: 8px;
  }

  .chart-card {
    padding: 8px;
  }

  .chart-card h3 {
    margin-bottom: 4px;
  }

  .plotly-container-fixed {
    height: 220px;
    min-height: 180px;
    max-height: 260px;
  }
}

/* -------------------- Botão de Zoom Interativo -------------------- */
/* Oculto por padrão em desktop, visível apenas em mobile via media query acima */
#zoomToggle {
  display: none;
}

#zoomToggle.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

#zoomToggle.active:hover {
  background: color-mix(in oklab, var(--primary) 85%, #000);
}

/* -------------------- Toast de Notificação -------------------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 12px 24px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: var(--fs-14);
  font-weight: var(--fw-600);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* -------------------- Drawer Lateral -------------------- */
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 320px;
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform .25s ease;
  z-index: 1000;
  padding: 16px;
  overflow-y: auto;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.drawer-header h3 {
  margin: 0;
  font-size: var(--fs-18);
  font-weight: var(--fw-700);
  color: var(--text);
}

.drawer-header .btn {
  padding: 8px;
  border-radius: 8px;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 900;
}

.drawer-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* Empurra o conteúdo quando o drawer estiver aberto em telas largas */
@media (min-width: 1200px) {
  .push-when-open {
    transition: margin-left .25s ease;
    margin-left: 0;
  }

  .push-when-open.drawer-active {
    margin-left: 320px;
  }
}

/* -------------------- Drawer Navigation -------------------- */
.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.drawer-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: var(--fs-14);
  font-weight: var(--fw-600);
  transition: background .15s ease, color .15s ease;
  border: 1px solid transparent;
}

.drawer-nav-item:hover {
  background: var(--surface);
  border-color: var(--border);
}

.drawer-nav-item.active {
  background: linear-gradient(135deg, color-mix(in oklab, var(--primary) 15%, transparent), color-mix(in oklab, var(--accent) 10%, transparent));
  border-color: color-mix(in oklab, var(--primary) 30%, var(--border));
  color: var(--primary);
}

.drawer-nav-item svg {
  flex-shrink: 0;
  opacity: 0.8;
}

.drawer-nav-item.active svg {
  opacity: 1;
  stroke: var(--primary);
}

.drawer-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 12px 0;
}

/* -------------------- Drawer Dropdowns -------------------- */
.drawer-dropdown {
  margin-bottom: 8px;
}

.drawer-dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: var(--fs-14);
  font-weight: var(--fw-600);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.drawer-dropdown-header:hover {
  border-color: var(--primary);
}

.drawer-dropdown-header span {
  flex: 1;
  text-align: left;
}

.drawer-dropdown-header .dropdown-arrow {
  transition: transform .2s ease;
}

.drawer-dropdown-header[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

.drawer-dropdown-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease, padding .25s ease;
  padding: 0 8px;
}

.drawer-dropdown-content.open {
  max-height: 600px;
  padding: 12px 8px 8px 8px;
}

/* -------------------- Botões com largura total -------------------- */
.btn.full-width {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn.full-width svg {
  flex-shrink: 0;
}

.downloads {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* -------------------- Menu Button (Hamburger) -------------------- */
.menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.menu-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.menu-icon::before,
.menu-icon::after {
  content: "";
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 1px;
}

.menu-icon span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 1px;
}

/* -------------------- Header Refinements -------------------- */
.app-header {
  padding: 10px 16px;
  gap: 12px;
}

.logo-title h1 {
  margin: 0 0 2px 0;
  font-size: 20px;
  line-height: 1.2;
}

.logo-title p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

/* -------------------- Charts -------------------- */
.chart-card {
  padding: 8px 8px 2px 8px;
  position: relative;
}

.chart-card h3 {
  font-size: 14px;
  margin: 0 0 6px 2px;
}

.chart-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
}

.chart-action-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  box-shadow: var(--shadow);
  opacity: .9;
}

.chart-action-btn:hover {
  border-color: var(--primary);
  opacity: 1;
}

/* Estilo quando container estiver em fullscreen */
.chart-card:fullscreen .plotly-container-fixed {
  height: 100vh;
}

.chart-card:fullscreen {
  background: var(--card);
}

/* -------------------- Content Max Width -------------------- */
.content {
  max-width: 1600px;
  margin: 0 auto;
}

/* -------------------- Previsão do Tempo -------------------- */

/* Card de condições atuais */
.current-weather-card {
  background: linear-gradient(135deg, color-mix(in oklab, var(--primary) 15%, var(--card)), var(--card));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.current-weather-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.current-weather-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.current-weather-icon {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(180deg, color-mix(in oklab, var(--warn) 20%, transparent), transparent);
}

.current-weather-icon.night {
  background: linear-gradient(180deg, color-mix(in oklab, var(--accent) 20%, transparent), transparent);
}

.current-weather-icon svg {
  width: 48px;
  height: 48px;
  stroke: var(--warn);
}

.current-weather-icon.night svg {
  stroke: var(--accent);
}

.current-weather-temp {
  display: flex;
  align-items: flex-start;
}

.current-weather-temp .temp-value {
  font-size: 48px;
  font-weight: var(--fw-800);
  line-height: 1;
  color: var(--text);
}

.current-weather-temp .temp-unit {
  font-size: 24px;
  font-weight: var(--fw-600);
  color: var(--muted);
  margin-top: 4px;
}

.current-weather-desc {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.current-weather-desc .weather-description {
  font-size: var(--fs-18);
  font-weight: var(--fw-600);
  color: var(--text);
}

.current-weather-desc .feels-like {
  font-size: var(--fs-14);
  color: var(--muted);
}

.current-weather-details {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.current-weather-details .detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.current-weather-details .detail-label {
  font-size: var(--fs-12);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.current-weather-details .detail-value {
  font-size: var(--fs-16);
  font-weight: var(--fw-600);
  color: var(--text);
}

/* Grid de previsão diária */
.forecast-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.forecast-day-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.forecast-day-card:hover {
  border-color: color-mix(in oklab, var(--primary) 40%, var(--border));
}

.forecast-day-card.expanded {
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

html[data-theme="light"] .forecast-day-card {
  background: #ffffff;
}

/* Header do card (clicável) */
.forecast-day-header {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.forecast-day-header:hover {
  background: color-mix(in oklab, var(--bg-soft) 50%, transparent);
}

.forecast-day-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.forecast-day-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.forecast-day-icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--primary);
}

.forecast-day-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.forecast-day-date {
  font-size: var(--fs-14);
  font-weight: var(--fw-700);
  color: var(--text);
}

.forecast-day-desc {
  font-size: var(--fs-12);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.forecast-day-temps {
  display: flex;
  gap: 8px;
  align-items: center;
}

.forecast-day-temps .temp-max {
  font-size: var(--fs-16);
  font-weight: var(--fw-700);
  color: var(--warn);
}

.forecast-day-temps .temp-min {
  font-size: var(--fs-14);
  color: var(--muted);
}

.forecast-day-details {
  display: flex;
  gap: 12px;
  font-size: var(--fs-12);
  color: var(--muted);
}

.forecast-day-expand {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease;
}

.forecast-day-expand svg {
  width: 18px;
  height: 18px;
  stroke: var(--muted);
}

.forecast-day-card.expanded .forecast-day-expand {
  transform: rotate(180deg);
}

/* Conteúdo expandido (horas) */
.forecast-day-hours {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding: 0 16px;
}

.forecast-day-card.expanded .forecast-day-hours {
  max-height: 600px;
  padding: 12px 16px;
}

html[data-theme="light"] .forecast-day-hours {
  background: #f8fafc;
}

.hours-header {
  display: grid;
  grid-template-columns: 60px 60px 50px 50px;
  gap: 12px;
  font-size: var(--fs-12);
  font-weight: var(--fw-600);
  color: var(--muted);
  text-transform: uppercase;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.hours-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}

.hour-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-width: 70px;
  flex-shrink: 0;
}

.hour-time {
  font-size: var(--fs-12);
  font-weight: var(--fw-600);
  color: var(--text);
}

.hour-icon {
  width: 28px;
  height: 28px;
}

.hour-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--primary);
}

.hour-temp {
  font-size: var(--fs-14);
  font-weight: var(--fw-700);
  color: var(--text);
}

.hour-rain {
  font-size: var(--fs-12);
  color: var(--primary);
}

.hour-probability {
  font-size: var(--fs-12);
  color: var(--accent);
}

/* Info extra do dia */
.day-extra-info {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.extra-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: var(--fs-12);
  color: var(--muted);
  margin-bottom: 6px;
}

.extra-row:last-child {
  margin-bottom: 0;
}

/* Responsivo para previsão */
@media (max-width: 820px) {
  .forecast-day-header {
    grid-template-columns: 1fr auto auto;
  }

  .forecast-day-details {
    display: none;
  }

  .current-weather-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .current-weather-details {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 600px) {
  .current-weather-icon {
    width: 56px;
    height: 56px;
  }

  .current-weather-icon svg {
    width: 36px;
    height: 36px;
  }

  .current-weather-temp .temp-value {
    font-size: 36px;
  }

  .current-weather-temp .temp-unit {
    font-size: 18px;
  }

  .forecast-day-header {
    padding: 12px;
    gap: 10px;
  }

  .forecast-day-icon {
    width: 28px;
    height: 28px;
  }

  .forecast-day-icon svg {
    width: 22px;
    height: 22px;
  }

  .extra-row {
    gap: 10px;
  }
}

/* Erro de carregamento */
.forecast-grid .error,
.current-weather-card .error {
  color: var(--danger);
  text-align: center;
  padding: 20px;
}

.forecast-grid .no-data {
  color: var(--muted);
  text-align: center;
  padding: 12px;
  font-style: italic;
}

/* Calendário de Chuva */
.calendar-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px;
  flex: 1 1 auto;
}

.calendar-month {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.calendar-month:not(:last-child) {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.calendar-month h4 {
  margin: 0 0 8px 0;
  color: var(--text);
  font-size: 16px;
  font-weight: var(--fw-700);
  text-transform: capitalize;
}

.calendar-month-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 0 4px;
}

.month-total {
  font-size: 12px;
  font-weight: var(--fw-700);
  color: var(--primary);
  background: color-mix(in oklab, var(--primary) 10%, transparent);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid color-mix(in oklab, var(--primary) 20%, transparent);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  flex: 1;
}

.calendar-day-head {
  text-align: center;
  font-size: 11px;
  font-weight: var(--fw-700);
  color: var(--muted);
  padding-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: transparent;
  font-size: 13px;
  position: relative;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  color: var(--muted);
  min-height: 44px;
  padding: 6px;
}

.calendar-day:hover:not(.empty) {
  background: var(--surface);
  border-color: var(--border);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  z-index: 2;
  color: var(--text);
}

.calendar-day.empty {
  background: transparent;
  pointer-events: none;
}

.calendar-day .day-num {
  font-weight: var(--fw-600);
  font-size: 13px;
  line-height: 1;
}

.calendar-day .day-rain {
  font-size: 11px;
  font-weight: var(--fw-700);
  color: var(--text);
  margin-top: 4px;
}

.calendar-day.has-rain {
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .calendar-day.has-rain {
  border-color: rgba(0, 0, 0, 0.05);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

html[data-theme="light"] .calendar-day.has-rain .day-num,
html[data-theme="light"] .calendar-day.has-rain .day-rain {
  color: #fff;
}

/* -------------------- Modal -------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 20px;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 28px;
  width: 100%;
  max-width: 550px;
  max-height: calc(100vh - 40px);
  margin: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  transform: translateY(20px) scale(0.98);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.modal-overlay.show .modal-container {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: var(--fs-20);
  font-weight: var(--fw-800);
  color: var(--text);
}

.modal-close {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

html[data-theme="light"] .modal-container {
  background: #ffffff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

/* Controles de Navegação do Calendário */
.calendar-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.calendar-nav-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.calendar-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.calendar-nav-btn:disabled:hover {
  background: var(--card);
  border-color: var(--border);
  color: var(--text);
}

.calendar-range-display {
  flex: 1;
  text-align: center;
  font-size: var(--fs-14);
  font-weight: var(--fw-700);
  color: var(--text);
}

html[data-theme="light"] .calendar-controls {
  background: #f8fafc;
}

/* Modal de Ampliação de Gráficos */
.chart-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.chart-modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.chart-modal-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  width: 100%;
  max-width: 1200px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease;
  overflow: hidden;
}

.chart-modal-overlay.show .chart-modal-container {
  transform: scale(1);
}

.chart-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chart-modal-header h3 {
  margin: 0;
  font-size: var(--fs-18);
  font-weight: var(--fw-700);
  color: var(--text);
}

.chart-modal-close {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 24px;
  line-height: 1;
}

.chart-modal-close:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.chart-modal-body {
  padding: 20px;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#chartModalContent {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.chart-modal-body .plotly-container-fixed {
  width: 100% !important;
  height: 100% !important;
  min-height: 600px;
  max-height: none;
  flex: 1;
}

html[data-theme="light"] .chart-modal-container {
  background: #ffffff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

@media (max-width: 820px) {
  .chart-modal-container {
    max-width: 95vw;
    max-height: 85vh;
  }

  .chart-modal-body {
    padding: 12px;
  }

  .chart-modal-body .plotly-container-fixed {
    min-height: 400px;
  }
}

/* Responsividade do Modal e Calendário */
@media (max-width: 600px) {
  .modal-container {
    width: 100%;
    max-height: 85vh;
    border-radius: 16px;
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-header h2 {
    font-size: 18px;
  }

  .modal-body {
    padding: 12px;
  }

  .calendar-container {
    gap: 8px;
    padding: 0;
  }

  .calendar-month h4 {
    font-size: 14px;
    margin-bottom: 6px;
  }

  .calendar-grid {
    gap: 3px;
  }

  .calendar-day {
    min-height: 36px;
    padding: 2px;
    border-radius: 8px;
  }

  .calendar-day .day-num {
    font-size: 11px;
  }

  .calendar-day .day-rain {
    font-size: 9px;
    margin-top: 2px;
  }
  
  .month-total {
    font-size: 10px;
    padding: 2px 8px;
  }
}

/*  Terminal de Logs de Ingest�o  */

.terminal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  flex-wrap: wrap;
}

.terminal-toolbar-left,
.terminal-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.terminal-autorefresh {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.terminal-container {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  min-height: 420px;
  max-height: 620px;
  overflow-y: auto;
  padding: 12px;
  font-family: 'Consolas', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 12px;
  line-height: 1.5;
  color: #c9d1d9;
}

.term-muted {
  color: #484f58;
  font-style: italic;
}

.term-entry {
  border-bottom: 1px solid #21262d;
  margin-bottom: 4px;
}

.term-entry:last-child {
  border-bottom: none;
}

.term-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 4px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
}

.term-header:hover {
  background: #161b22;
}

.term-ts {
  color: #8b949e;
  min-width: 140px;
  font-size: 11px;
}

.term-badge {
  color: #58a6ff;
  font-weight: 600;
  font-size: 12px;
}

.term-org {
  color: #3fb950;
  font-size: 11px;
  flex: 1;
}

.term-toggle-icon {
  color: #484f58;
  font-size: 10px;
  margin-left: auto;
}

.term-body {
  display: none;
  margin: 0;
  padding: 8px 16px 10px;
  background: #010409;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 11.5px;
  line-height: 1.6;
  color: #c9d1d9;
  white-space: pre;
}

.term-body.open {
  display: block;
}

.term-key   { color: #79c0ff; }
.term-str   { color: #a5d6ff; }
.term-num   { color: #f2cc60; }
.term-kw    { color: #ff7b72; }

/* Scrollbar do terminal */
.terminal-container::-webkit-scrollbar { width: 6px; }
.terminal-container::-webkit-scrollbar-track { background: #010409; }
.terminal-container::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }

/* Bot�o pequeno reutiliz�vel */
.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

/* Adaptar em tela pequena */
@media (max-width: 600px) {
  .terminal-toolbar { flex-direction: column; align-items: flex-start; }
  .term-ts { min-width: 90px; }
}
