/* ─── Design tokens ───────────────────────────────────────────────── */
:root {
  /* Sidebar / nav (escura) — IBM Gray 100 */
  --sidebar-bg:          #161616;
  --sidebar-text:        #c6c6c6;
  --sidebar-muted:       #6f6f6f;
  --sidebar-border:      rgba(141, 141, 141, 0.10);
  --sidebar-active-bg:   #262626;
  --sidebar-active-text: #f4f4f4;
  --sidebar-hover-bg:    rgba(244, 244, 244, 0.06);
  --sidebar-w:           224px;

  /* Topbar (clara) — flutuante, sem borda/caixa (redesign v4) */
  --topbar-bg:           #ffffff;
  --topbar-border:       #e0e0e0;
  --topbar-h:            60px;

  /* Container central (redesign v4) */
  --maxw:                1440px;

  /* Conteúdo (clara) — IBM Gray 10 */
  --bg:       #f4f4f4;
  --surface:  #ffffff;
  --panel:    #f4f4f4;

  /* Borders — IBM Gray 20 / Gray 30 */
  --border:    #e0e0e0;
  --border-md: #c6c6c6;

  /* Tipografia — IBM Gray 100 / 60 / 40 */
  --text:  #161616;
  --muted: #525252;
  --dim:   #8d8d8d;

  /* Accent — IBM Blue 60 */
  --accent:      #0f62fe;
  --accent-lt:   #4589ff;
  --accent-text: #0043ce;
  --accent-bg:   #edf5ff;
  --accent-glow: rgba(15, 98, 254, 0.20);

  /* Status — IBM Green 60 / Red 60 / Yellow 30 */
  --success:     #198038;
  --success-bg:  #defbe6;
  --danger:      #da1e28;
  --danger-bg:   #fff1f1;
  --warning:     #f1c21b;
  --warning-bg:  #fdf6dd;

  /* Tiers */
  --tier-gold:       #f1c21b;
  --tier-gold-bg:    #fdf6dd;
  --tier-gold-bdr:   rgba(241, 194, 27, 0.35);
  --tier-silver:     #6f6f6f;
  --tier-silver-bg:  #f4f4f4;
  --tier-silver-bdr: rgba(111, 111, 111, 0.25);

  /* Radii — redesign v4: cantos arredondados */
  --r-sm:  8px;
  --r:     12px;
  --r-lg:  16px;
  --r-xl:  16px;

  /* Sombras — redesign v4 */
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.10);
  --shadow-md: 0 2px 4px rgba(16,24,40,.06), 0 4px 12px rgba(16,24,40,.08);

}

/* ─── Reset ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: linear-gradient(to right, #fafafc, #fbfbfc);
  background-attachment: fixed;
  display: flex;
}

/* ─── App Shell ───────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* ─── Sidebar ─────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-logo {
  width: 28px;
  height: 28px;
  color: var(--accent-lt);
  flex-shrink: 0;
}

.sidebar-brand-text { min-width: 0; }

.sidebar-brand-name {
  display: block;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #f4f4f4;
  line-height: 1.1;
}

.sidebar-brand-sub {
  display: block;
  font-size: 0.7rem;
  color: var(--sidebar-muted);
  letter-spacing: 0.01em;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 10px;
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 4px;
}

.sidebar-section-label {
  display: block;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  padding: 12px 8px 5px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--r);
  border: none;
  background: transparent;
  color: var(--sidebar-text);
  font: 500 0.855rem/1.3 'IBM Plex Sans', system-ui, sans-serif;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: none;
}

.sidebar-item:disabled {
  opacity: 0.38;
  cursor: default;
  justify-content: flex-start;
  text-align: left;
}

.sidebar-item:hover:not(:disabled) {
  background: var(--sidebar-hover-bg);
  color: #f4f4f4;
  border-color: transparent;
  box-shadow: none;
}

.sidebar-item.is-active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 600;
}

.sidebar-item.is-active:hover:not(:disabled) {
  background: var(--sidebar-active-bg);
  box-shadow: none;
}

.sidebar-item-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.75;
}

.sidebar-item.is-active .sidebar-item-icon { opacity: 1; }

.sidebar-badge {
  margin-left: auto;
  background: var(--sidebar-active-bg);
  color: var(--sidebar-muted);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--r-sm);
  border: 1px solid var(--sidebar-border);
}

.sidebar-item.is-active .sidebar-badge {
  background: var(--accent-bg);
  color: var(--accent-text);
  border-color: rgba(15, 98, 254, 0.25);
}

.sidebar-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-version {
  font-size: 0.72rem;
  color: var(--sidebar-muted);
  line-height: 1.5;
}

/* ─── App Main (painel branco flutuante — redesign v4) ────────────── */
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ─── Topbar (flutuante — redesign v4) ───────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: transparent;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

/* Conteúdo do topbar preenche o painel (sem container central) */
.topbar-inner {
  width: 100%;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 0;
  height: 100%;
}

/* Brand */
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  height: 100%;
}

.topbar-logo {
  width: 24px;
  height: 24px;
  color: var(--accent);
  flex-shrink: 0;
}

.topbar-brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.topbar-brand-name {
  font: 700 1rem/1 'IBM Plex Sans', system-ui, sans-serif;
  color: var(--text);
  letter-spacing: -0.01em;
}

.topbar-brand-sub {
  font: 400 0.65rem/1 'IBM Plex Sans', system-ui, sans-serif;
  color: var(--dim);
  letter-spacing: 0.01em;
}

/* Nav */
.topbar-nav {
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  height: 100%;
}

.topbar-nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 100%;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font: 600 0.72rem/1 'IBM Plex Sans', system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
  box-shadow: none;
  text-decoration: none;
}

.topbar-nav-item:hover:not(:disabled) {
  color: var(--text);
  background: var(--panel);
  border-bottom-color: transparent;
  box-shadow: none;
  text-decoration: none;
}

.topbar-nav-item.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
  background: transparent;
}

.topbar-nav-static {
  color: var(--dim);
  opacity: 0.7;
}

.topbar-nav-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.63rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--r-sm);
  line-height: 1.6;
}

/* File breadcrumb */
.topbar-file-area {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 0 16px;
  font-size: 0.8rem;
  color: var(--dim);
}

.topbar-file {
  color: var(--muted);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 1;
}

.topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-md);
  background: transparent;
  color: var(--muted);
  font: 400 0.78rem/1 'IBM Plex Sans', system-ui, sans-serif;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  box-shadow: none;
}

.topbar-btn:hover:not(:disabled) {
  background: var(--panel);
  color: var(--text);
  border-color: var(--border-md);
  box-shadow: none;
}

.topbar-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.topbar-btn-danger:hover:not(:disabled) {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
}

/* Dark mode toggle */
.dark-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: default;
  opacity: 0.5;
  user-select: none;
  flex-shrink: 0;
}

.dark-toggle input { display: none; }

.dark-toggle-icon {
  font-size: 0.9rem;
  color: var(--muted);
}

.dark-toggle-track {
  width: 34px;
  height: 18px;
  background: var(--border-md);
  border-radius: 9px;
  position: relative;
  display: block;
  flex-shrink: 0;
}

.dark-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Entrar button */
.btn-entrar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 20px;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  color: #fff;
  font: 600 0.84rem/1 'IBM Plex Sans', system-ui, sans-serif;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  box-shadow: none;
  flex-shrink: 0;
}

.btn-entrar:hover {
  background: var(--accent-text);
  border-color: var(--accent-text);
  box-shadow: none;
}

/* ─── Content ─────────────────────────────────────────────────────── */
.content {
  flex: 1;
  padding: 8px 28px 36px;
  overflow-x: hidden;
  position: relative;
  z-index: 1;
}

/* ─── Banner faixa topo ───────────────────────────────────────────── */
.banner-top-wrap {
  padding: 14px 28px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.banner-label {
  font: 600 0.6rem/1 'IBM Plex Sans', system-ui, sans-serif;
  letter-spacing: 0.12em;
  color: var(--dim);
  margin: 0;
}

.banner-img-top {
  max-width: 728px;
  width: 100%;
  max-height: 90px;
  object-fit: contain;
  border-radius: var(--r-sm);
  display: block;
}

.banner-img-bottom {
  max-width: 728px;
  width: 100%;
  max-height: 90px;
  object-fit: contain;
  border-radius: var(--r-sm);
}

/* ─── Layout principal ────────────────────────────────────────────── */
.layout {
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ─── Upload ──────────────────────────────────────────────────────── */
.upload-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.btn-clear-upload {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 38px;
  border: 1px solid var(--border-md);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font: 600 0.78rem/1 'IBM Plex Sans', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.btn-clear-upload:hover:not(:disabled) {
  background: #fff1f1;
  color: var(--danger);
  border-color: var(--danger);
}

.btn-clear-upload:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.upload-dropzone {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  padding: 26px 32px;
  border: 2px dashed var(--border-md);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  min-width: 0;
  box-shadow: none;
}

.upload-dropzone input { display: none; }

.upload-dropzone:hover,
.upload-dropzone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-bg);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.dropzone-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  color: var(--accent);
  transition: color 0.2s, transform 0.2s;
  opacity: 0.85;
}

.upload-dropzone:hover .dropzone-icon,
.upload-dropzone.is-dragging .dropzone-icon {
  color: var(--accent);
  opacity: 1;
  transform: translateY(-2px);
}

.dropzone-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.dropzone-primary {
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropzone-primary strong { color: var(--accent); font-weight: 700; }

.dropzone-secondary {
  color: var(--muted);
  font-size: 0.84rem;
}

.dropzone-filename {
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--success);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  font-family: 'IBM Plex Mono', monospace;
}

.upload-actions { display: flex; gap: 8px; flex-shrink: 0; }

.upload-select-btn {
  white-space: nowrap;
  padding: 10px 18px;
  font-size: 0.84rem;
}

/* ─── Status ──────────────────────────────────────────────────────── */
.status-message {
  margin: 0;
  font-size: 0.84rem;
  color: var(--dim);
  padding: 2px 0;
}

.status-message.is-success { color: var(--success); font-weight: 500; }
.status-message.is-error   { color: var(--danger);  font-weight: 500; }

/* ─── Buttons ─────────────────────────────────────────────────────── */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border-md);
  border-radius: var(--r);
  padding: 8px 18px;
  font: 600 0.86rem/1 'IBM Plex Sans', system-ui, sans-serif;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  box-shadow: none;
}

button:hover:not(:disabled) {
  background: var(--panel);
  border-color: var(--border-md);
  box-shadow: none;
}

button:active:not(:disabled) { background: var(--border); box-shadow: none; }

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: none;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-text);
  border-color: var(--accent-text);
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-md);
  color: var(--muted);
  box-shadow: none;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--panel);
  color: var(--text);
  border-color: var(--border-md);
}

.btn-accent {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent-text);
  box-shadow: none;
}

.btn-accent:hover:not(:disabled) {
  background: #d0e2ff;
  border-color: var(--accent);
  box-shadow: none;
}

.btn-xs {
  padding: 5px 11px;
  font-size: 0.78rem;
  border-radius: var(--r-sm);
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 1rem;
  border-radius: var(--r-sm);
}

/* ─── Cards ───────────────────────────────────────────────────────── */
.card {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: var(--border-md);
  box-shadow: var(--shadow-md);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-head h2 {
  margin: 0;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* ─── Export actions ──────────────────────────────────────────────── */
.export-actions { display: flex; gap: 5px; }

/* ─── Metrics strip ───────────────────────────────────────────────── */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.metric-box {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--panel);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.metric-box:hover {
  border-color: var(--border-md);
}

.metric-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--dim);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metric-box strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-text);
  line-height: 1.2;
}

/* ─── Summary grid ────────────────────────────────────────────────── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.summary-grid div {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--panel);
}

.summary-grid dt {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.summary-grid dd {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

/* ─── Intensity card ──────────────────────────────────────────────── */
.inline-summary {
  font-size: 0.88rem;
  color: var(--muted);
  padding: 8px 0;
}

.inline-summary strong { color: var(--accent-text); }

.button-row { display: flex; gap: 8px; margin-top: 10px; }

/* ─── Keywords ────────────────────────────────────────────────────── */
.keywords-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.keyword-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--panel);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.keyword-chip strong { color: var(--accent-text); font-weight: 600; }

/* ─── Charts row (grid de cards iguais — redesign v4) ─────────────── */
.charts-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: stretch;
}

.chart-panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  padding: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chart-panel:hover {
  border-color: var(--border-md);
  box-shadow: var(--shadow-md);
}

.chart-panel-title {
  font: 600 0.78rem/1 'IBM Plex Sans', system-ui, sans-serif;
  color: var(--text);
  margin: 0;
  padding: 14px 14px 0;
  letter-spacing: -0.01em;
}

.chart-panel > .canvas-frame,
.chart-panel > .goniometer-frame {
  margin: 0 14px;
}

.chart-panel > .plot-metrics,
.chart-panel > .goniometer-hint {
  margin: 0 14px;
}

.chart-panel > .isolux-controls {
  margin: 0 14px;
}

.chart-panel > .isolux-controls + .plot-metrics {
  margin: 0 14px;
}

/* ─── Canvas (frame de proporção fixa p/ gráficos do mesmo tamanho) ── */
.canvas-frame {
  border: 1px solid #262626;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: #080e1a;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

#polar-canvas,
#iso-candela-canvas,
#isolux-canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-in;
}

/* ─── Plot metrics chips ──────────────────────────────────────────── */
.plot-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.plot-chip {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--panel);
  font-size: 0.8rem;
  color: var(--muted);
}

.plot-chip strong { color: var(--accent-text); }

/* ─── Iso-Lux controls ────────────────────────────────────────────── */
.isolux-controls {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.control-card {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--panel);
  cursor: default;
  transition: border-color 0.15s;
}

.control-card:hover { border-color: var(--border-md); }

.control-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.control-value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}

.control-input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 700 1.1rem/1 'IBM Plex Sans', system-ui, sans-serif;
}

.control-input::-webkit-inner-spin-button,
.control-input::-webkit-outer-spin-button { opacity: 0.4; }

.control-unit {
  font-size: 0.82rem;
  color: var(--dim);
  flex-shrink: 0;
}

.control-card input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ─── Empty state ─────────────────────────────────────────────────── */
.empty-state { color: var(--dim); font-size: 0.86rem; }

/* ─── Table ───────────────────────────────────────────────────────── */
.table-wrap {
  margin-top: 16px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  font-size: 0.83rem;
  color: var(--text);
  white-space: nowrap;
}

th:first-child, td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--surface);
}

thead th {
  position: sticky;
  top: 0;
  background: var(--panel);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-md);
}

/* ─── Patrocinadores ──────────────────────────────────────────────── */
.sponsors-section {
  margin-top: 8px;
}

.sponsors-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.sponsors-title {
  margin: 0;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.sponsors-sub {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.sponsors-cta {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--accent-text);
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sponsors-cta:hover { text-decoration: underline; }

.sponsors-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ─ Sponsor card base ─ */
.sponsor-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 20px 22px;
  box-shadow: none;
  transition: border-color 0.2s;
}

.sponsor-card:hover {
  border-color: var(--border-md);
}

/* ─ Tier Gold ─ */
.sponsor-card.tier-gold {
  border-color: var(--tier-gold-bdr);
  border-width: 2px;
  background: var(--surface);
}

.sponsor-card.tier-gold:hover {
  border-color: var(--tier-gold);
}

/* ─ Tier Silver ─ */
.sponsor-card.tier-silver {
  border-color: var(--tier-silver-bdr);
}

.sponsor-card.tier-silver:hover {
  border-color: var(--tier-silver);
}

/* ─ Sponsor head ─ */
.sponsor-card-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.sponsor-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  background: var(--panel);
  padding: 6px;
  border: 1px solid var(--border);
}

.tier-gold .sponsor-logo {
  background: var(--tier-gold-bg);
  border-color: var(--tier-gold-bdr);
  width: 80px;
  height: 80px;
}

.sponsor-logo-placeholder {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  background: var(--panel);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  font-size: 0.7rem;
  text-align: center;
}

.tier-gold .sponsor-logo-placeholder {
  width: 80px;
  height: 80px;
}

.sponsor-info {
  flex: 1;
  min-width: 0;
}

.sponsor-name {
  margin: 0 0 4px;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sponsor-name a {
  color: var(--text);
  text-decoration: none;
}

.sponsor-name a:hover { color: var(--accent); }

.sponsor-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: var(--r-sm);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.tier-badge-gold {
  background: var(--tier-gold-bg);
  color: var(--tier-gold);
  border: 1px solid var(--tier-gold-bdr);
}

.tier-badge-silver {
  background: var(--tier-silver-bg);
  color: var(--tier-silver);
  border: 1px solid var(--tier-silver-bdr);
}

.tier-badge-basic {
  background: var(--panel);
  color: var(--dim);
  border: 1px solid var(--border);
}

.sponsor-meta {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.sponsor-head-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ─ Products grid ─ */
.sponsor-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.tier-gold .sponsor-products {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* ─ Product card ─ */
.product-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.product-card:hover {
  border-color: var(--border-md);
}

.product-thumb {
  width: 100%;
  height: 100px;
  object-fit: contain;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}

.product-thumb-placeholder {
  width: 100%;
  height: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  font-size: 0.75rem;
}

.product-name {
  margin: 0;
  font-size: 0.87rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}

.product-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.product-spec-chip {
  padding: 2px 7px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--muted);
}

.product-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
}

.btn-load-ies {
  flex: 1;
  padding: 7px 10px;
  background: var(--accent);
  border: none;
  border-radius: var(--r-sm);
  color: #fff;
  font: 600 0.78rem/1 'IBM Plex Sans', system-ui, sans-serif;
  cursor: pointer;
  transition: background 0.15s;
  text-align: center;
  box-shadow: none;
}

.btn-load-ies:hover { background: var(--accent-text); }
.btn-load-ies:disabled { background: var(--dim); cursor: not-allowed; }

.btn-quote {
  flex: 1;
  padding: 7px 10px;
  background: transparent;
  border: 1px solid var(--border-md);
  border-radius: var(--r-sm);
  color: var(--muted);
  font: 600 0.78rem/1 'IBM Plex Sans', system-ui, sans-serif;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  box-shadow: none;
}

.btn-quote:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-md);
  box-shadow: none;
}

/* ─── Banner rodapé ───────────────────────────────────────────────── */
.banner-bottom-wrap {
  margin-top: 32px;
  text-align: center;
}

/* ─── Modal cotação ───────────────────────────────────────────────── */
.quote-modal-dialog { width: min(560px, 100%); }

.quote-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.quote-field { display: flex; flex-direction: column; gap: 4px; }
.quote-field-full { grid-column: 1 / -1; }

.quote-field label { font-size: 0.8rem; color: var(--muted); font-weight: 500; }

.quote-field input,
.quote-field textarea {
  background: var(--panel);
  border: none;
  border-bottom: 2px solid var(--border-md);
  border-radius: var(--r-sm);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  padding: 8px 4px;
  outline: 0;
  transition: border-color 0.15s;
  width: 100%;
}

.quote-field input:focus,
.quote-field textarea:focus {
  border-bottom-color: var(--accent);
}

.quote-field textarea { resize: vertical; min-height: 72px; }

.quote-feedback-ok  { color: var(--success); font-size: 0.88rem; }
.quote-feedback-err { color: var(--danger);  font-size: 0.88rem; }

/* ─── Modals ──────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 12px;
  background: rgba(22, 22, 22, 0.70);
  backdrop-filter: blur(6px);
  z-index: 100;
}

.modal-overlay.is-open { display: grid; }

.modal-dialog {
  width: min(1200px, 100%);
  max-height: 90vh;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}

.chart-modal-dialog {
  width: min(1680px, calc(100vw - 16px));
  max-height: 98vh;
  padding: 14px 16px 16px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  margin-bottom: 4px;
}

.modal-head h2 {
  margin: 0;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.modal-head p {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.chart-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zoom-indicator {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.chart-modal-stage {
  flex: 1;
  overflow: auto;
  border: 1px solid #262626;
  border-radius: var(--r-sm);
  background: #040810;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: grab;
  margin-top: 12px;
}

.chart-modal-stage.is-panning { cursor: grabbing; }

.chart-modal-frame {
  width: fit-content;
  margin: 0 auto;
  transform-origin: center;
  transition: transform 160ms ease;
}

#chart-modal-canvas {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
}

.modal-table-wrap {
  flex: 1;
  overflow: auto;
  max-height: calc(90vh - 120px);
  margin-top: 14px;
}

/* ─── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .charts-row { grid-template-columns: repeat(2, 1fr); }
  .metrics-strip { grid-template-columns: repeat(3, 1fr); }
  .summary-grid  { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .topbar-brand-text { display: none; }
  .topbar-brand-sub  { display: none; }
  .topbar-file-area  { display: none; }
  .topbar-nav-static { display: none; }
  .dark-toggle       { display: none; }
  .topbar-inner { padding: 0 14px; }

  .content { padding: 18px 16px 36px; }

  .charts-row { grid-template-columns: 1fr; }

  .upload-row { grid-template-columns: 1fr; }
  .upload-actions { flex-direction: row; }

  .metrics-strip { grid-template-columns: repeat(2, 1fr); }
  .metrics-row   { grid-template-columns: repeat(3, 1fr); }
  .summary-grid  { grid-template-columns: 1fr; }

  .isolux-controls { grid-template-columns: 1fr; }

  .quote-form-grid { grid-template-columns: 1fr; }
  .quote-field-full { grid-column: auto; }
  .sponsor-products { grid-template-columns: 1fr; }

  .modal-head,
  .chart-modal-actions { flex-wrap: wrap; }
}

@media (max-width: 400px) {
  .metrics-row { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Brands / Fabricantes logos ──────────────────────────────────── */
.brands-section { padding: 16px 20px 20px; }

.brands-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.brands-header-left { display: flex; align-items: center; gap: 10px; }

.brands-label {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
}

.brands-count {
  font-size: .75rem;
  background: var(--accent-bg);
  color: var(--accent);
  padding: 1px 8px;
  border-radius: var(--r-sm);
  font-weight: 600;
}

.brands-cta {
  font-size: .84rem;
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  display: flex;
  align-items: center;
}
.brands-cta:hover { text-decoration: underline; }

.brands-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.brand-logo-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  min-width: 120px;
  max-width: 180px;
  min-height: 80px;
}

.brand-logo-btn:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.brand-logo-btn.tier-gold {
  border-color: var(--tier-gold-bdr);
  background: var(--surface);
}

.brand-logo-btn.tier-gold:hover {
  border-color: var(--tier-gold);
}

.brand-logo-img-wrap {
  width: 120px;
  height: 60px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: background .2s;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.brand-logo-placeholder {
  width: 56px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--dim);
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
}

.brand-logo-name {
  font-size: .68rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── File Summary (topo quando arquivo carregado) ────────────────── */
.file-summary { padding: 0; }

.file-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.file-summary-label {
  font-size: .82rem;
  font-weight: 400;
  color: var(--muted);
  margin: 0;
}

.file-summary-name {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: -.01em;
}

.file-summary-desc {
  font-size: .78rem;
  color: var(--muted);
  margin: 2px 0 0;
}

.file-summary-reload {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  transition: color .15s, background .15s;
}

.file-summary-reload:hover { color: var(--text); background: var(--panel); }

.metrics-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.metric-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  padding: 11px 13px 12px;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 9px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.metric-chip:hover {
  border-color: var(--border-md);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.metric-chip-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--accent);
  margin-top: 3px;
  opacity: 0.8;
}

.metric-chip-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.metric-chip-label {
  font-size: .67rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

.metric-chip-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.metric-chip-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: -.02em;
}

.metric-chip-value.accent { color: var(--accent); }

.metric-chip-unit {
  font-size: .72rem;
  color: var(--muted);
  font-weight: 500;
}

/* ─── Grade de artigos do blog ───────────────────────────────────── */
.articles-section {
  margin-top: 24px;
}

.articles-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.articles-section-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text);
}

.articles-section-cta {
  font-size: .82rem;
  color: var(--accent);
  font-weight: 500;
}
.articles-section-cta:hover { text-decoration: underline; }

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.article-card:hover { border-color: var(--border-md); box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.article-card:hover .article-card-title { color: var(--accent); }

.article-card-img {
  aspect-ratio: 16 / 9;
  background: var(--panel) center / cover no-repeat;
  position: relative;
  overflow: hidden;
}
.article-card-img--empty { background: var(--panel); }

.article-card-cat {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent);
  color: #fff;
  font-size: .65rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--r-sm);
  letter-spacing: .05em;
  text-transform: uppercase;
}

.article-card-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.article-card-title {
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.01em;
  color: var(--text);
  transition: color .15s;
}

.article-card-meta {
  font-size: .72rem;
  color: var(--dim);
}

@media (max-width: 900px) {
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .articles-grid { grid-template-columns: 1fr; }
}

/* ─── Accordions abaixo dos gráficos ─────────────────────────────── */
.accordions-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
}

@media (max-width: 700px) {
  .accordions-row { flex-direction: column; }
}

.accordion-card {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.accordion-card[open] { border-color: var(--border-md); box-shadow: var(--shadow-md); }

.accordion-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background .12s;
}

.accordion-head::-webkit-details-marker { display: none; }
.accordion-head::marker { display: none; content: ''; }

.accordion-head:hover { background: var(--panel); }

.accordion-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.75;
}

.accordion-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.accordion-title {
  font: 600 0.88rem/1.2 'IBM Plex Sans', system-ui, sans-serif;
  color: var(--text);
}

.accordion-desc {
  font: 400 0.76rem/1.3 'IBM Plex Sans', system-ui, sans-serif;
  color: var(--muted);
}

.accordion-toggle {
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--muted);
  flex-shrink: 0;
  line-height: 1;
  width: 20px;
  text-align: center;
  transition: transform 0.2s ease;
}

details[open] .accordion-toggle {
  transform: rotate(45deg);
}

.accordion-body {
  padding: 6px 20px 20px 56px;
  border-top: 1px solid var(--border);
}

/* ─── Goniômetro 3D ──────────────────────────────────────────────── */
.goniometer-frame {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.goniometer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--dim);
  font-size: .8rem;
  text-align: center;
  padding: 20px;
}

.goniometer-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  color: var(--dim);
  margin: 6px 0 0;
}

/* ─── Modal de produtos ───────────────────────────────────────────── */
.product-modal-dialog {
  background: var(--surface);
  border-radius: var(--r-sm);
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
  width: min(900px, 94vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-in .18s ease;
}

.product-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.product-modal-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.product-modal-logo-wrap {
  width: 72px;
  height: 72px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: #fff;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.product-modal-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-modal-logo-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border-radius: var(--r-sm);
  color: var(--dim);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.product-modal-brand-info { flex: 1; min-width: 0; }

.product-modal-mfr-name {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
  letter-spacing: -.02em;
}

.product-modal-mfr-desc {
  font-size: .84rem;
  color: var(--muted);
  margin: 0 0 8px;
}

.product-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.product-modal-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.product-modal-site-link {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  transition: background .12s;
}

.product-modal-site-link:hover { background: var(--accent-bg); }

.product-modal-quote-btn {
  font-size: .82rem;
}

.product-modal-cats {
  display: flex;
  gap: 4px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  overflow-x: auto;
}

.cat-tab {
  padding: 5px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all .12s;
  white-space: nowrap;
}

.cat-tab:hover { border-color: var(--accent); color: var(--accent); }

.cat-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.product-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.product-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.product-modal-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  transition: border-color .15s;
  cursor: pointer;
}

.product-modal-card:hover {
  border-color: var(--accent);
}

.product-modal-card-img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  background: #fff;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.product-modal-card-img-placeholder {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  color: var(--dim);
  font-size: .72rem;
}

.product-modal-card-body { padding: 10px 12px 12px; }

.product-modal-card-name {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
  line-height: 1.3;
}

.product-modal-card-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 8px;
}

.product-modal-card-actions {
  display: flex;
  gap: 6px;
}

.product-modal-empty {
  text-align: center;
  color: var(--muted);
  font-size: .88rem;
  padding: 40px 0;
}

.product-modal-tier-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--r-sm);
  font-size: .72rem;
  font-weight: 700;
  border: 1px solid transparent;
}
.product-modal-tier-badge.tier-gold   { background: var(--tier-gold-bg);    color: var(--tier-gold);    border-color: var(--tier-gold-bdr); }
.product-modal-tier-badge.tier-silver { background: var(--tier-silver-bg);  color: var(--tier-silver);  border-color: var(--tier-silver-bdr); }
.product-modal-tier-badge.tier-basic  { background: var(--panel); color: var(--dim); border-color: var(--border); }

@media (max-width: 700px) {
  .metrics-row { grid-template-columns: repeat(3, 1fr); }
  .brands-grid { gap: 8px; }
  .product-modal-dialog { border-radius: 0; }
  .product-modal-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-chip-icon { display: none; }
}

/* ══════════════════════════════════════════════════════════════
   Road View — Calculador de Iluminação Viária (NBR 5101:2024)
   ══════════════════════════════════════════════════════════════ */

.road-view {
  flex: 1;
  min-width: 0;
}

.road-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 20px 24px 40px;
  min-height: calc(100vh - 52px);
}

/* ── Painel de inputs ─────────────────────────────────────── */

.road-inputs {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: 72px;
}

.road-inputs-title {
  font: 600 0.72rem/1 'IBM Plex Sans', sans-serif;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 0 0 14px;
}

.road-fieldset {
  border: none;
  border-top: 1px solid var(--border);
  padding: 12px 0 6px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.road-fieldset legend {
  font: 600 0.68rem/1 'IBM Plex Sans', sans-serif;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 4px 0 0;
  float: left;
  width: 100%;
  margin-bottom: 8px;
}

.road-label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font: 400 0.75rem/1.3 'IBM Plex Sans', sans-serif;
  color: var(--muted);
}

.road-input,
.road-select {
  width: 100%;
  padding: 5px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-md);
  color: var(--text);
  font: 400 0.83rem/1 'IBM Plex Sans', sans-serif;
  outline: none;
  transition: border-color 0.15s;
  border-radius: var(--r-sm);
  -webkit-appearance: none;
}

.road-input:focus,
.road-select:focus { border-bottom-color: var(--accent); }

.road-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238d8d8d' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  padding-right: 16px;
}

.road-file-status {
  font: 400 0.72rem/1.4 'IBM Plex Mono', monospace;
  color: var(--dim);
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.road-file-status.has-file {
  color: var(--accent-text);
  font-weight: 600;
}

.road-calc-btn {
  margin-top: 18px;
  padding: 10px 0;
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font: 600 0.83rem/1 'IBM Plex Sans', sans-serif;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: 0.01em;
}

.road-calc-btn:hover:not(:disabled) { background: var(--accent-text); }
.road-calc-btn:disabled { background: var(--dim); cursor: not-allowed; opacity: 0.7; }

/* ── Painel de resultados ─────────────────────────────────── */

.road-results-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.road-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 64px 40px;
  text-align: center;
  color: var(--dim);
  font: 400 0.88rem/1.7 'IBM Plex Sans', sans-serif;
  border: 2px dashed var(--border);
  background: transparent;
}

.road-empty-state svg { opacity: 0.3; }
.road-empty-state strong { color: var(--muted); }

/* ── Badge de conformidade ────────────────────────────────── */

.road-compliance-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.road-compliance-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  font: 700 0.78rem/1 'IBM Plex Sans', sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.road-compliance-badge.conforme {
  background: #defbe6;
  color: var(--success);
  border: 1px solid #a7f0ba;
}

.road-compliance-badge.nao-conforme {
  background: #fff1f1;
  color: var(--danger);
  border: 1px solid #ffb3b8;
}

.road-compliance-badge.marginal {
  background: #fdf6dd;
  color: #a2780d;
  border: 1px solid #f1c21b;
}

.road-compliance-label {
  font: 400 0.78rem/1 'IBM Plex Sans', sans-serif;
  color: var(--muted);
}

/* ── Metric chips viária ──────────────────────────────────── */

.road-metrics-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.road-metrics-row .metric-chip {
  flex: 1;
  min-width: 120px;
}

/* ── Heatmap ──────────────────────────────────────────────── */

.road-heatmap-card { padding: 16px 20px; }

.road-heatmap-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.road-heatmap-title {
  font: 600 0.83rem/1 'IBM Plex Sans', sans-serif;
  color: var(--text);
}

.road-heatmap-subtitle {
  font: 400 0.72rem/1 'IBM Plex Mono', monospace;
  color: var(--dim);
}

.road-heatmap-wrap {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

#road-heatmap-canvas {
  display: block;
  background: #080e1a;
  flex: 1;
  min-width: 0;
}

.road-heatmap-legend {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
}

.road-legend-bar {
  width: 14px;
  flex: 1;
  min-height: 160px;
  border-radius: var(--r-sm);
}

.road-legend-label {
  font: 400 0.62rem/1 'IBM Plex Mono', monospace;
  color: var(--dim);
  white-space: nowrap;
}

/* ── Tabela de conformidade ───────────────────────────────── */

.road-conformance-card { padding: 0; overflow: hidden; }

.road-conformance-table {
  width: 100%;
  border-collapse: collapse;
  font: 400 0.82rem/1.4 'IBM Plex Sans', sans-serif;
}

.road-conformance-table th {
  padding: 10px 16px;
  text-align: left;
  font: 600 0.68rem/1 'IBM Plex Sans', sans-serif;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.road-conformance-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.road-conformance-table tr:last-child td { border-bottom: none; }

.road-conformance-table .status-ok   { color: var(--success); font-weight: 600; }
.road-conformance-table .status-fail { color: var(--danger);  font-weight: 600; }
.road-conformance-table .status-warn { color: #a2780d;        font-weight: 600; }

/* ── Aviso normativo ──────────────────────────────────────── */

.road-disclaimer {
  font: 400 0.70rem/1.6 'IBM Plex Sans', sans-serif;
  color: var(--dim);
  border-left: 2px solid var(--border);
  padding-left: 10px;
  margin: 0;
}

/* ── Responsivo ───────────────────────────────────────────── */

@media (max-width: 900px) {
  .road-layout { flex-direction: column; padding: 16px; }
  .road-inputs { width: 100%; position: static; }
}

@media (max-width: 700px) {
  .road-metrics-row .metric-chip { min-width: 100px; }
}
