/* ═══════════════════════════════════════════════════════════════
   SkinVault Pro — Design System
═══════════════════════════════════════════════════════════════ */
:root {
  /* ── Tema escuro (padrão) — reestruturação de layout, 20/11/2026 ──
     Todas as cores do sistema saem daqui. Contraste (WCAG) conferido
     contra --bg-1: texto ≥ 4,5:1, bordas de campos ≥ 3:1. */
  color-scheme: dark;
  --bg-0: #0b0e13;          /* fundo da página */
  --bg-1: #11151c;          /* cartões, tabelas, menu */
  --bg-2: #171c25;          /* cabeçalho de tabela, linha sob o mouse */
  --bg-3: #1e2430;          /* campos, linha selecionada */
  --border: #262d3a;        /* divisórias */
  --border-strong: #3a4458; /* divisórias fortes */
  --line-ctl: #5b6577;      /* borda de campos e botões (3,1:1) */
  --text-primary: #e7ecf3;  /* 15,4:1 */
  --text-secondary: #a3acbd;/* 8,0:1 */
  --text-muted: #808a9d;    /* 5,3:1 */
  --accent: #ff7a2e;        /* 7,0:1 */
  --accent-2: #ff9a5c;
  --on-accent: #0b0e13;     /* texto sobre o laranja: 7,4:1 */
  --green: #4ade80;
  --red: #f87171;
  --yellow: #fbbf24;
  --blue: #60a5fa;
  --purple: #c084fc;
  --pink: #f472b6;
  --teal: #2dd4bf;
  --green-soft: color-mix(in srgb, var(--green) 12%, transparent);
  --red-soft: color-mix(in srgb, var(--red) 12%, transparent);
  --shadow-float: 0 8px 24px rgba(0, 0, 0, .45);
  --overlay: rgba(0, 0, 0, .6);

  /* Letra */
  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --fs-xs: 11px; --fs-sm: 12px; --fs-md: 13px; --fs-lg: 15px; --fs-xl: 18px; --fs-2xl: 22px;

  /* Densidade (compacto; o padrão está em [data-density="padrao"]) */
  --row-h: 32px; --cell-px: 8px; --cell-fs: 12px; --thumb: 64px; --head-h: 28px; --bar-h: 32px;
  --topbar-h: 40px; --sidebar-w: 200px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg-0: #f1f3f6;
  --bg-1: #ffffff;
  --bg-2: #f7f8fa;
  --bg-3: #eceff3;
  --border: #dde1e7;
  --border-strong: #c3c9d2;
  --line-ctl: #7d8796;      /* 3,6:1 */
  --text-primary: #111827;  /* 17,7:1 */
  --text-secondary: #4b5563;/* 7,6:1 */
  --text-muted: #5d6470;    /* 6,0:1 */
  --accent: #b93d0b;        /* 5,6:1 */
  --accent-2: #9a3412;
  --on-accent: #ffffff;     /* 5,6:1 */
  --green: #166c34;
  --red: #b91c1c;
  --yellow: #8a5a06;
  --blue: #1d4ed8;
  --purple: #7e22ce;
  --pink: #be185d;
  --teal: #0f766e;
  --shadow-float: 0 6px 20px rgba(15, 23, 42, .14);
  --overlay: rgba(15, 23, 42, .4);
}
/* Cores de ganho e perda para daltonismo (Configurações → Aparência) */
:root[data-gl="azul-laranja"] { --green: #60a5fa; --red: #fb923c; }
:root[data-gl="azul-vermelho"] { --green: #60a5fa; }
:root[data-theme="light"][data-gl="azul-laranja"] { --green: #1d4ed8; --red: #c2410c; }
:root[data-theme="light"][data-gl="azul-vermelho"] { --green: #1d4ed8; }
/* Densidade padrão (40 px por linha) */
:root[data-density="padrao"] { --row-h: 40px; --cell-px: 12px; --cell-fs: 13px; --thumb: 80px; --head-h: 32px; --bar-h: 40px; --topbar-h: 48px; }

* { box-sizing: border-box; margin: 0; padding: 0; }
*::before, *::after { box-sizing: border-box; }

html, body {
  background: var(--bg-0);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-md);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body { min-height: 100vh; }

.mono { font-variant-numeric: tabular-nums; }

button { font-family: inherit; border: none; cursor: pointer; color: inherit; background: transparent; }
input, select { font-family: inherit; color: inherit; background: transparent; border: none; outline: none; }
a { color: var(--accent); text-decoration: none; cursor: pointer; }
svg { display: block; }

/* Scrollbar */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* Grain overlay */
.grain {
  position: fixed; inset: 0; pointer-events: none; opacity: 0.015; z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════════════════ */
.app { display: flex; min-height: 100vh; }

/* ─────────── SIDEBAR ─────────── */
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}

.logo {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 16px;
}
.logo-mark {
  width: 36px; height: 36px;
  background: var(--accent-2);
  border-radius: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: none;
  flex-shrink: 0;
}
.logo-title {
  display: flex; align-items: center; gap: 4px;
  font-weight: 700; font-size: var(--fs-lg); letter-spacing: -0.01em;
}
.pro-badge {
  font-size: var(--fs-xs); font-weight: 700;
  padding: 2px 4px; border-radius: 0;
  background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent);
  letter-spacing: 0.04em;
}
.logo-sub {
  font-size: var(--fs-xs); letter-spacing: 0; text-transform: none !important;
  color: var(--text-muted); text-transform: uppercase;
  font-weight: 600; margin-top: 2px;
}

.nav { flex: 1; overflow-y: auto; padding: 0 12px 16px; }
.nav-section {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.12em;
  color: var(--text-muted); text-transform: uppercase;
  padding: 12px 12px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 0;
  color: var(--text-secondary);
  font-size: var(--fs-md); font-weight: 500;
  cursor: pointer; transition: background 0.12s, color 0.12s;
}
.nav-item:hover { background: var(--bg-2); color: var(--text-primary); }
.nav-item.active {
  background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent);
  box-shadow: none;
}
.nav-item svg { flex-shrink: 0; }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.sf-label {
  font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-muted); font-weight: 700;
}
.sf-big { font-size: var(--fs-xl); font-weight: 700; color: var(--green); margin-top: 2px; }
.sf-small { font-size: var(--fs-xs); color: var(--green); }

/* ─────────── MAIN ─────────── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ─────────── TOPBAR ─────────── */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-1);
  position: sticky; top: 0; z-index: 50;
}
.search-wrap {
  position: relative; width: 440px; max-width: 45%;
}
.search-wrap input {
  width: 100%;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 0;
  padding: 8px 64px 8px 40px;
  font-size: var(--fs-md);
  transition: border-color 0.12s;
}
.search-wrap input:focus { border-color: var(--accent); }
.search-wrap input::placeholder { color: var(--text-muted); }
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted);
}
.kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 600;
  color: var(--text-muted); border: 1px solid var(--border-strong);
  padding: 2px 4px; border-radius: 0;
}
.spacer { flex: 1; }
.pill-select {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 0;
  padding: 8px 12px;
  font-size: var(--fs-md); font-weight: 500;
  cursor: pointer; transition: background 0.12s;
}
.pill-select:hover { background: var(--bg-3); }
.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 0;
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer; position: relative;
  transition: background 0.12s, color 0.12s;
}
.icon-btn:hover { background: var(--bg-3); color: var(--text-primary); }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--accent); color: var(--on-accent);
  font-size: var(--fs-xs); font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 0;
  display: flex; align-items: center; justify-content: center;
}
.notif-badge:empty, .notif-badge[data-empty="1"] { display: none; }
.user-pill {
  display: flex; align-items: center; gap: 8px;
  padding-left: 8px; margin-left: 4px;
  border-left: 1px solid var(--border);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: var(--fs-md);
}
.user-name { font-size: var(--fs-md); font-weight: 600; line-height: 1.2; }
.user-status {
  display: flex; align-items: center; gap: 4px;
  font-size: var(--fs-xs); color: var(--green);
}
.pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: none; }
  70% { box-shadow: none; }
  100% { box-shadow: none; }
}

/* ═══════════════════════════════════════════════════════════════
   VIEWS
═══════════════════════════════════════════════════════════════ */
.view { display: none; }
.view.active { display: block; }

.content {
  padding: 12px 16px 32px;
  display: flex; flex-direction: column; gap: 12px;
}

.view-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 4px; gap: 16px;
}
.view-title { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.01em; }
.view-sub { font-size: var(--fs-md); color: var(--text-secondary); margin-top: 4px; }
.view-actions { display: flex; gap: 8px; }

.btn-primary {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 12px; border-radius: 0;
  background: var(--accent); color: var(--on-accent);
  font-size: var(--fs-md); font-weight: 600;
  transition: background 0.12s;
}
.btn-primary:hover { background: var(--accent-2); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 12px; border-radius: 0;
  background: var(--bg-2); color: var(--text-primary);
  border: 1px solid var(--border);
  font-size: var(--fs-md); font-weight: 600;
  transition: background 0.12s;
}
.btn-secondary:hover { background: var(--bg-3); }

.btn-icon {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 0;
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer; transition: background 0.12s, color 0.12s;
}
.btn-icon:hover { background: var(--bg-3); color: var(--text-primary); }

/* ═══════════════════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 16px;
}
.card-strong {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 16px;
}
.card-title {
  font-size: var(--fs-sm); font-weight: 700; letter-spacing: 0.1em;
  color: var(--text-secondary); text-transform: uppercase;
  margin-bottom: 12px;
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.card-header .card-title { margin: 0; }

/* ═══════════════════════════════════════════════════════════════
   KPI CARDS (DASHBOARD)
═══════════════════════════════════════════════════════════════ */

.kpi {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 12px 16px;
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 4px;
}
.kpi::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: color-mix(in srgb, var(--text-primary) 6%, transparent);
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD ROWS
═══════════════════════════════════════════════════════════════ */

/* Range tabs */
.range-tabs {
  display: flex; gap: 2px;
  background: var(--bg-2); padding: 2px;
  border-radius: 0;
}
.range-tab {
  padding: 4px 8px; border-radius: 0;
  font-size: var(--fs-xs); font-weight: 600;
  color: var(--text-muted);
  cursor: pointer; transition: all 0.12s;
}
.range-tab:hover { color: var(--text-primary); }
.range-tab.active { background: var(--bg-3); color: var(--text-primary); }

/* Top items lists */

.up { color: var(--green); }
.down { color: var(--red); }

/* Donut */

/* Alert cards */
.alert {
  position: relative; border-radius: 0;
  padding: 12px; border: 1px solid; overflow: hidden;
  cursor: pointer; transition: transform 0.12s;
}
.alert:hover { transform: translateY(-1px); }

/* Activity */

.btn-block {
  width: 100%; padding: 8px;
  font-size: var(--fs-sm); font-weight: 600;
  border-radius: 0;
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer; transition: all 0.12s;
  margin-top: 12px;
}
.btn-block:hover { background: var(--bg-3); color: var(--text-primary); }

/* Exposure progress bars */

/* ═══════════════════════════════════════════════════════════════
   DATA TABLE
═══════════════════════════════════════════════════════════════ */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em;
  color: var(--text-muted); text-transform: uppercase;
  text-align: left; padding: 0 8px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table thead th.r { text-align: right; }
.data-table tbody td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr {
  cursor: pointer;
  /* content-visibility: pula render das linhas fora da viewport (menos custo
     com ~1700 linhas). contain: isola layout/paint de cada linha, então o
     repaint do :hover afeta SÓ a linha sob o cursor, não a tabela inteira —
     é o que elimina o lag ao passar o mouse. Sem transição de background:
     animar o fundo em cada linha sob o cursor multiplicava o repaint. */
  content-visibility: auto;
  contain-intrinsic-size: auto 56px;
  contain: paint style;
}
.data-table tbody tr:hover { background: var(--bg-2); }
.data-table td.r {
  text-align: right;
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
}
.item-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }

.item-text { min-width: 0; }
.item-name {
  font-size: var(--fs-md); font-weight: 600; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 340px;
}
.item-sub { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }

/* Badges */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 0;
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-sticker { background: color-mix(in srgb, var(--blue) 15%, transparent); color: var(--blue); }
.badge-skin    { background: color-mix(in srgb, var(--purple) 15%, transparent); color: var(--purple); }
.badge-knife   { background: color-mix(in srgb, var(--red) 15%, transparent);  color: var(--red); }
.badge-glove   { background: color-mix(in srgb, var(--green) 15%, transparent);  color: var(--green); }
.badge-case    { background: color-mix(in srgb, var(--yellow) 15%, transparent); color: var(--yellow); }
.badge-graffiti{ background: color-mix(in srgb, var(--teal) 15%, transparent); color: var(--teal); }
.badge-souvenir{ background: color-mix(in srgb, var(--yellow) 15%, transparent);  color: var(--yellow); }

.badge-other   { background: color-mix(in srgb, var(--text-muted) 15%, transparent);color: var(--text-secondary); }

/* ═══════════════════════════════════════════════════════════════
   INVENTORY VIEW
═══════════════════════════════════════════════════════════════ */
.filters-bar {
  display: flex; gap: 8px; align-items: center;
  flex-wrap: wrap;
}
.filter-search {
  position: relative; flex: 1; min-width: 260px;
  max-width: 380px;
  display: flex; align-items: center;
}
.filter-search svg {
  position: absolute; left: 12px; color: var(--text-muted);
}
.filter-search input {
  width: 100%;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 0;
  padding: 8px 12px 8px 32px;
  font-size: var(--fs-md);
  transition: border-color 0.12s;
}
.filter-search input:focus { border-color: var(--accent); }
.filter-search input::placeholder { color: var(--text-muted); }

.inv-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.inv-kpi {
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: 0; padding: 12px 12px;
}
.inv-kpi .label {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em;
  color: var(--text-muted); text-transform: uppercase;
}
.inv-kpi .value {
  font-family: var(--font-ui);
  font-size: var(--fs-xl); font-weight: 700;
  margin-top: 4px;
}
.inv-kpi .sub {
  font-size: var(--fs-xs); color: var(--text-secondary);
  margin-top: 2px;
}

.inv-table-card { padding: 16px 0 0; overflow: hidden; }
.inv-table-card .data-table thead th:first-child { padding-left: 16px; }
.inv-table-card .data-table tbody td:first-child { padding-left: 16px; }
.inv-table-card .data-table tbody td:last-child { padding-right: 16px; }
.inv-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: var(--fs-sm); color: var(--text-secondary);
}

.empty-state {
  text-align: center; padding: 40px 16px;
  color: var(--text-muted);
}
.empty-state .big {
  font-size: var(--fs-lg); font-weight: 600;
  color: var(--text-primary); margin-bottom: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   IMPORTAR VIEW
═══════════════════════════════════════════════════════════════ */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: 0;
  padding: 48px 24px;
  display: flex; flex-direction: column; align-items: center;
  gap: 12px;
  text-align: center;
  background: var(--bg-2);
  transition: all 0.12s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 4%, transparent);
}
.dz-icon { color: var(--text-muted); transition: color 0.12s; }
.dropzone:hover .dz-icon, .dropzone.dragover .dz-icon { color: var(--accent); }
.dz-title { font-size: var(--fs-lg); font-weight: 700; }
.dz-sub { font-size: var(--fs-md); color: var(--text-secondary); margin-top: 4px; }
.dz-formats { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 12px; }
.dz-formats b { color: var(--text-secondary); font-weight: 600; }

.progress-wrap {
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: 0; padding: 12px 16px;
}
.progress-label {
  font-size: var(--fs-sm); font-weight: 600; margin-bottom: 8px;
  color: var(--text-secondary);
}
.progress-bar {
  height: 6px; background: var(--bg-3);
  border-radius: 0; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; width: 0%;
  background: var(--accent);
  transition: width 0.12s;
}

.help-card { padding: 16px; }
.help-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.help-item {
  display: flex; gap: 12px;
  padding: 12px;
  background: var(--bg-2);
  border-radius: 0;
  border: 1px solid var(--border);
}
.help-icon {
  width: 36px; height: 36px;
  background: var(--bg-3); border-radius: 0;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.help-title { font-size: var(--fs-md); font-weight: 700; margin-bottom: 4px; }
.help-text { font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.45; }
.help-text code {
  font-family: var(--font-mono);
  background: var(--bg-3); padding: 1px 4px;
  border-radius: 0; font-size: var(--fs-xs);
}
.help-text b { color: var(--text-primary); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════════════════ */
.toast-stack {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999;
  max-width: 380px;
}
.toast {
  background: var(--bg-2); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 12px 16px; border-radius: 0;
  font-size: var(--fs-md); line-height: 1.4;
  box-shadow: var(--shadow-float);
  animation: toastIn .25s ease-out;
  white-space: pre-line;
}
.toast.success { border-left-color: var(--green); }
.toast.error   { border-left-color: var(--red); }
.toast.warning { border-left-color: var(--yellow); }
@keyframes toastIn {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════
   DRAWER (item detail)
═══════════════════════════════════════════════════════════════ */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 100;
  opacity: 0; pointer-events: none;
  transition: opacity 0.12s;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: 480px; max-width: 90vw;
  background: var(--bg-1); border-left: 1px solid var(--border);
  z-index: 101;
  transform: translateX(100%);
  transition: transform 0.12s;
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }

.drawer-body { flex: 1; overflow-y: auto; padding: 16px; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */
@media (max-width: 1400px) {

  .help-grid { grid-template-columns: 1fr; }

}
@media (max-width: 900px) {

  .inv-kpis { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════════════════════
   DRAWER v2 — item detail panel
═══════════════════════════════════════════════════════════════ */
.drawer {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: 520px; max-width: 95vw;
  background: var(--bg-1); border-left: 1px solid var(--border);
  z-index: 101;
  transform: translateX(100%);
  transition: transform 0.12s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.drawer.open { transform: translateX(0); }

/* Hero */
.drawer-hero {
  position: relative; flex-shrink: 0;
  height: 200px;
  background: var(--bg-2);
  overflow: hidden;
  transition: background 0.12s;
}
.drawer-hero-img {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.drawer-hero-img img {
  max-width: 85%; max-height: 85%;
  object-fit: contain;
  filter: drop-shadow(0 4px 24px rgba(0,0,0,.7));
  transition: transform 0.12s;
  cursor: zoom-in;
}
.drawer-hero-img img:hover { transform: scale(1.05); }

/* Hero overlay: badge + actions */
.drawer-hero-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}
.drawer-hero-badge {
  padding: 12px 12px;
  pointer-events: none;
}
.drawer-hero-badge .badge { font-size: var(--fs-xs); }

#drawerFavBtn.fav { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

/* Name + meta */

.drawer-name {
  font-size: var(--fs-lg); font-weight: 700; line-height: 1.35;
  color: var(--text-primary);
}
.drawer-meta-chips {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px;
}
.meta-chip {
  padding: 2px 8px; border-radius: 0;
  font-size: var(--fs-xs); font-weight: 600;
  background: var(--bg-3); border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}
.meta-chip.player { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 30%, transparent); background: color-mix(in srgb, var(--blue) 8%, transparent); }
.meta-chip.variant { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.meta-chip.source { color: var(--text-muted); font-size: var(--fs-xs); }
.meta-chip.warn { color: var(--yellow); border-color: color-mix(in srgb, var(--yellow) 30%, transparent); background: color-mix(in srgb, var(--yellow) 7%, transparent); }

/* Tabs */
.drawer-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 8px 16px 0;
  flex-shrink: 0;
}
.drawer-tab {
  padding: 8px 12px;
  font-size: var(--fs-md); font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.drawer-tab:hover { color: var(--text-primary); }
.drawer-tab.active { color: var(--text-primary); border-bottom-color: var(--accent); }

/* Tab bodies */
.drawer-body {
  flex: 1; overflow-y: auto; padding: 0;
}
.dtab { display: none; padding: 16px 16px 24px; }
.dtab.active { display: block; }

/* ═══════════════════════════════════════════════════════════════
   MODAL MODE — desktop (≥1024px) vira modal largo centralizado
═══════════════════════════════════════════════════════════════ */
@media (min-width: 1025px) {
  .drawer {
    position: fixed;
    top: 50%; left: 50%; right: auto; bottom: auto;
    transform: translate(-50%, -50%) scale(.97);
    width: min(1800px, 98vw);
    max-width: 98vw;
    height: min(1100px, 98vh);
    max-height: 98vh;
    border-radius: 0;
    border: 1px solid color-mix(in srgb, var(--text-primary) 8%, transparent);
    background: var(--bg-0);
    box-shadow: var(--shadow-float);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s, transform 0.12s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
  }
  .drawer.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
  }

  /* ============================================================
     LAYOUT: tela única, zero scroll. Header+tabs fixos no topo;
     sidebar+main ocupam o restante com altura limitada (min-height:0).
     ============================================================ */
  .drawer-modal-grid {
    display: grid !important;
    grid-template-columns: 300px 1fr;
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas:
      "header  header"
      "tabs    tabs"
      "sidebar main";
    column-gap: 12px;
    row-gap: 8px;
    height: 100%;
    overflow: hidden;
    padding: 12px 16px 12px;
    background: var(--bg-0);
    min-height: 0;
  }

  /* HEADER */
  .drawer-modal-grid > .drawer-header {
    grid-area: header;
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 12px;
    padding: 0 48px 0 0;
    margin: 0;
    border-bottom: none;
  }
  .drawer-modal-grid > .drawer-header .drawer-meta-main { flex: 1; min-width: 0; }
  .drawer-modal-grid > .drawer-header .drawer-name {
    font-size: var(--fs-2xl); font-weight: 700;
    line-height: 1.15; margin: 0 0 8px;
    color: var(--text-primary);
  }
  .drawer-modal-grid > .drawer-header .drawer-meta-chips {
    display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  }
  .drawer-modal-grid > .drawer-header .meta-chip {
    font-size: var(--fs-sm); padding: 4px 12px; border-radius: 0;
  }
  .drawer-modal-grid > .drawer-header .drawer-refresh-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    font-size: var(--fs-md);
    border-radius: 0;
    height: 38px;
  }

  /* Quick actions inline no header (S/C/L) */
  .drawer-header-actions {
    display: flex; align-items: center; gap: 4px;
    flex-shrink: 0;
    align-self: center;
  }
  .dh-quick-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 8px 4px 4px;
    background: color-mix(in srgb, var(--text-primary) 3%, transparent);
    border: 1px solid color-mix(in srgb, var(--text-primary) 8%, transparent);
    border-radius: 0;
    color: var(--text-secondary);
    font-size: var(--fs-sm); font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.12s;
    height: 30px;
  }
  .dh-quick-btn:hover {
    background: color-mix(in srgb, var(--text-primary) 6%, transparent);
    color: var(--text-primary);
    border-color: color-mix(in srgb, var(--text-primary) 15%, transparent);
  }
  .dh-quick-key {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px;
    background: color-mix(in srgb, var(--text-primary) 8%, transparent);
    border-radius: 0;
    font-size: var(--fs-xs); font-weight: 700;
    color: var(--text-muted);
    font-family: var(--font-ui);
  }
  .dh-quick-btn:hover .dh-quick-key { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
  .dh-quick-label { line-height: 1; }

  /* TABS */
  .drawer-modal-grid > .drawer-tabs {
    grid-area: tabs;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 24px;
    border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 6%, transparent);
  }
  .drawer-modal-grid > .drawer-tabs .drawer-tab {
    font-size: var(--fs-md);
    font-weight: 600;
    padding: 8px 2px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    border-bottom: 2px solid transparent;
    transition: color 0.12s;
  }
  .drawer-modal-grid > .drawer-tabs .drawer-tab:hover { color: var(--text-primary); }
  .drawer-modal-grid > .drawer-tabs .drawer-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
  }

  /* SIDEBAR (col 1): 3 cards empilhados — altura limitada */
  .drawer-modal-grid > .drawer-modal-left {
    grid-area: sidebar;
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border-right: none;
    background: transparent;
    padding: 0;
  }

  /* MAIN (col 2): flex column, sem scroll, distribui altura */
  .drawer-modal-grid > .drawer-modal-right {
    grid-area: main;
    display: flex !important;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: transparent;
    padding: 0;
  }
  .drawer-modal-right .drawer-body {
    padding: 0;
    display: flex; flex-direction: column;
    flex: 1; min-height: 0;
  }
  .drawer-modal-right .dtab {
    padding: 0;
    min-height: 0;
  }
  .drawer-modal-right .dtab.active {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 8px;
  }

  /* ── Quando aba "Visão geral" está ativa: sidebar SOME e main ocupa largura toda
     (layout denso conforme imagem alvo). Imagem fica DENTRO do main. ── */
  .drawer[data-active-tab="overview"] .drawer-modal-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "tabs"
      "main";
  }
  .drawer[data-active-tab="overview"] .drawer-modal-grid > .drawer-modal-left {
    display: none !important;
  }

  /* Card 1: Imagem */
  .drawer-image-card {
    position: relative;
    background: color-mix(in srgb, var(--bg-1) 60%, transparent);
    border: 1px solid color-mix(in srgb, var(--text-primary) 8%, transparent);
    border-radius: 0;
    padding: 12px;
    display: flex; flex-direction: column; align-items: center;
    overflow: hidden;
  }
  .drawer-image-card::before {
    content: '';
    position: absolute; inset: 0;
    background: color-mix(in srgb, var(--green) 10%, transparent);
    pointer-events: none;
  }
  /* Botão favorito no canto superior esquerdo */
  .dimg-fav-btn {
    position: absolute; top: 14px; left: 14px; z-index: 3;
    width: 32px; height: 32px;
    background: rgba(0,0,0,.45);
    border: 1px solid color-mix(in srgb, var(--text-primary) 10%, transparent);
    border-radius: 0;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.12s;
  }
  .dimg-fav-btn:hover { color: var(--yellow); border-color: color-mix(in srgb, var(--yellow) 40%, transparent); }
  .dimg-fav-btn.fav { color: var(--yellow); background: color-mix(in srgb, var(--yellow) 12%, transparent); border-color: color-mix(in srgb, var(--yellow) 35%, transparent); }
  .dimg-fav-btn.fav svg { fill: currentColor; }

  /* Card 1: Imagem com altura FIXA (não usa aspect-ratio 1:1 pra liberar espaço) */
  .drawer-image-card {
    flex-shrink: 0;
  }
  .drawer-modal-left .drawer-hero {
    position: relative; z-index: 1;
    width: 100%;
    height: 180px;                  /* altura fixa em vez de aspect-ratio */
    background: transparent;
    display: flex; align-items: center; justify-content: center;
    margin: 0;
    overflow: visible;
    border: none;
  }
  .drawer-modal-left .drawer-hero-img {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
  }
  .drawer-modal-left .drawer-hero-img img {
    width: auto; max-width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    image-rendering: auto;
    image-rendering: high-quality;
    filter: contrast(1.05) saturate(1.04) drop-shadow(0 8px 20px color-mix(in srgb, var(--green) 15%, transparent));
  }
  .drawer-modal-left .drawer-hero-overlay { display: none; }
  .drawer-modal-left .drawer-hero-badge { display: none; }

  /* Pill com o tipo abaixo da imagem */
  .drawer-type-pill {
    position: relative; z-index: 1;
    margin-top: 8px;
    padding: 4px 12px;
    background: color-mix(in srgb, var(--text-primary) 4%, transparent);
    border: 1px solid color-mix(in srgb, var(--text-primary) 10%, transparent);
    border-radius: 0;
    color: var(--text-primary);
    font-size: var(--fs-sm); font-weight: 600;
    display: inline-flex; align-items: center; gap: 4px;
    cursor: default;
    align-self: center;
  }

  /* Cards 2 e 3 da sidebar (Ações rápidas, Informações) */
  .drawer-side-card {
    background: color-mix(in srgb, var(--bg-1) 50%, transparent);
    border: 1px solid color-mix(in srgb, var(--text-primary) 8%, transparent);
    border-radius: 0;
    padding: 12px 12px;
    flex-shrink: 0;
  }
  /* Card "Informações" cresce pra preencher altura restante */
  #drawerInfoCard {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
  }
  .drawer-side-card-title {
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
  }

  /* Card 2: Ações rápidas — botões verticais */
  .drawer-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .dqa-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    background: color-mix(in srgb, var(--text-primary) 2.5%, transparent);
    border: 1px solid color-mix(in srgb, var(--text-primary) 7%, transparent);
    border-radius: 0;
    color: var(--text-primary);
    font-size: var(--fs-sm); font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.12s;
    font-family: inherit;
  }
  .dqa-btn:hover {
    background: color-mix(in srgb, var(--text-primary) 5%, transparent);
    border-color: color-mix(in srgb, var(--text-primary) 15%, transparent);
    transform: translateX(2px);
  }
  .dqa-btn svg { opacity: .7; }
  .dqa-btn.primary {
    background: color-mix(in srgb, var(--purple) 20%, transparent);
    border-color: color-mix(in srgb, var(--purple) 40%, transparent);
    color: var(--purple);
  }
  .dqa-btn.primary:hover {
    background: color-mix(in srgb, var(--purple) 30%, transparent);
    box-shadow: none;
  }
  .dqa-btn.primary svg { opacity: 1; }

  /* Card 3: Informações — lista key-value */
  .drawer-info-list {
    display: flex;
    flex-direction: column;
  }
  .drawer-info-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 4px 0;
    font-size: var(--fs-sm);
    border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 4%, transparent);
  }
  .drawer-info-row:last-child { border-bottom: none; }
  .drawer-info-row .label { color: var(--text-muted); }
  .drawer-info-row .value { color: var(--text-primary); font-weight: 500; text-align: right; }

  /* ══════════════════════════════════════════════════════════════
     VISÃO GERAL — layout denso (todo o espaço, sem scroll)
     Row 1: Hero (imagem + ações) + KPIs strip
     Row 2: 8 mini-stats
     Row 3: Chart + Baixa rápida + Resumo financeiro
     Row 4: Buy orders + Sell orders + Last transactions
     ══════════════════════════════════════════════════════════════ */
  .dov-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
  }
  /* ── Row 1: HERO (300×260) + COLUNA DIREITA com KPIs em cima e Stats embaixo ── */
  .dov-row1 {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 8px;
    flex-shrink: 0;
    height: 260px;
  }

  /* Container da coluna direita: KPIs em cima (1 linha), Stats embaixo (2 linhas × 4 col) */
  .dov-right-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    min-width: 0;
  }
  .dov-right-stack > .dov-kpi-strip {
    flex: 0 0 118px;
    min-height: 0;
  }
  .dov-right-stack > .dov-stats {
    flex: 1;             /* ocupa o resto (~134px) */
    min-height: 0;
    height: auto;
    grid-template-columns: repeat(4, 1fr);   /* 4 cards em 1 linha */
    grid-template-rows: 1fr;
  }

  /* Hero: imagem maior (300×260 = ~50% mais que antes) */
  .dov-hero-card {
    position: relative;
    background: var(--bg-2);
    border: 1px solid color-mix(in srgb, var(--text-primary) 8%, transparent);
    border-radius: 0;
    padding: 4px;
    overflow: hidden;
    display: flex; flex-direction: column;
  }
  .dov-hero-card::before { display: none; }
  .dov-hero-card .drawer-hero {
    position: relative; z-index: 1;
    flex: 1; width: 100%;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    overflow: visible;
    border: none;
    aspect-ratio: auto;
    min-height: 0;
  }
  .dov-hero-card .drawer-hero-img {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
  }
  .dov-hero-card .drawer-hero-img img {
    max-width: 95%; max-height: 95%;
    object-fit: contain;
    filter: contrast(1.05) saturate(1.05) drop-shadow(0 8px 22px color-mix(in srgb, var(--green) 22%, transparent));
  }
  .dov-hero-fav {
    position: absolute; top: 8px; left: 8px; z-index: 3;
    width: 26px; height: 26px;
    background: rgba(0,0,0,.5);
    border: 1px solid color-mix(in srgb, var(--text-primary) 8%, transparent);
    border-radius: 0;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.12s;
  }
  .dov-hero-fav:hover { color: var(--yellow); border-color: color-mix(in srgb, var(--yellow) 35%, transparent); }
  .dov-hero-fav.fav { color: var(--yellow); background: color-mix(in srgb, var(--yellow) 12%, transparent); border-color: color-mix(in srgb, var(--yellow) 32%, transparent); }
  .dov-hero-fav.fav svg { fill: currentColor; }
  .dov-hero-fav svg { width: 13px; height: 13px; }

  /* KPI strip — 4 cards horizontais. Ícone à esquerda, valor grande, sub 2 linhas. */
  .dov-kpi-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    align-items: stretch;
  }
  .dov-kpi-big {
    background: color-mix(in srgb, var(--bg-1) 45%, transparent);
    border: 1px solid color-mix(in srgb, var(--text-primary) 7%, transparent);
    border-radius: 0;
    padding: 0 16px;
    display: flex; align-items: center; gap: 12px;
    min-height: 0;
    overflow: hidden;
    transition: border-color 0.12s, background 0.12s;
  }
  .dov-kpi-big:hover {
    border-color: color-mix(in srgb, var(--text-primary) 13%, transparent);
    background: color-mix(in srgb, var(--bg-1) 55%, transparent);
  }
  .dov-kpi-icon-wrap {
    width: 44px; height: 44px;
    border-radius: 0;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .dov-kpi-icon-wrap svg { width: 21px; height: 21px; }
  .dov-kpi-big[data-tone="amber"]   .dov-kpi-icon-wrap { background: color-mix(in srgb, var(--accent) 12%, transparent);  color: var(--accent); }
  .dov-kpi-big[data-tone="pos"]     .dov-kpi-icon-wrap { background: color-mix(in srgb, var(--green) 12%, transparent);  color: var(--green); }
  .dov-kpi-big[data-tone="neg"]     .dov-kpi-icon-wrap { background: color-mix(in srgb, var(--red) 12%, transparent);  color: var(--red); }
  .dov-kpi-big[data-tone="purple"]  .dov-kpi-icon-wrap { background: color-mix(in srgb, var(--purple) 14%, transparent); color: var(--purple); }
  .dov-kpi-big[data-tone="neutral"] .dov-kpi-icon-wrap { background: color-mix(in srgb, var(--text-primary) 5%, transparent); color: var(--text-muted); }

  .dov-kpi-content { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
  .dov-kpi-big-label {
    font-size: var(--fs-xs); color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase; letter-spacing: .07em;
    font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .dov-kpi-big-val {
    font-family: var(--font-ui);
    font-size: var(--fs-2xl); font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.05; margin-bottom: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    color: var(--text-primary);
  }
  .dov-kpi-big-val.amber  { color: var(--accent); }
  .dov-kpi-big-val.pos    { color: var(--green); }
  .dov-kpi-big-val.neg    { color: var(--red); }
  .dov-kpi-big-val.purple { color: var(--purple); }
  .dov-kpi-big-sub {
    font-size: var(--fs-xs); color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }

  /* Esconde estrutura antiga */

  /* ── Row 2: Stats — 4 cards essenciais (não-redundantes) ── */
  .dov-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    flex-shrink: 0;
  }
  .dov-stat-card {
    background: color-mix(in srgb, var(--bg-1) 45%, transparent);
    border: 1px solid color-mix(in srgb, var(--text-primary) 7%, transparent);
    border-radius: 0;
    padding: 12px 16px;
    display: flex; flex-direction: column; justify-content: center;
    overflow: hidden;
    transition: border-color 0.12s;
  }
  .dov-stat-card:hover { border-color: color-mix(in srgb, var(--text-primary) 13%, transparent); }

  /* Destaque pro Lucro Total */
  .dov-stat-card.is-highlight {
    background: color-mix(in srgb, var(--green) 5%, transparent);
    border-color: color-mix(in srgb, var(--green) 22%, transparent);
  }
  .dov-stat-card.is-highlight[data-tone="neg"] {
    background: color-mix(in srgb, var(--red) 5%, transparent);
    border-color: color-mix(in srgb, var(--red) 22%, transparent);
  }
  .dov-stat-card.is-highlight:hover { border-color: color-mix(in srgb, var(--green) 35%, transparent); }

  .dov-stat-head {
    display: flex; align-items: center; gap: 4px;
    margin-bottom: 4px;
    color: var(--text-muted);
  }
  .dov-stat-head svg { width: 13px; height: 13px; opacity: .7; flex-shrink: 0; }
  .dov-stat-card[data-tone="pos"]    .dov-stat-head svg { color: var(--green); opacity: .9; }
  .dov-stat-card[data-tone="neg"]    .dov-stat-head svg { color: var(--red); opacity: .9; }
  .dov-stat-card[data-tone="blue"]   .dov-stat-head svg { color: var(--blue); opacity: .9; }
  .dov-stat-card[data-tone="purple"] .dov-stat-head svg { color: var(--purple); opacity: .9; }
  .dov-stat-label {
    font-size: var(--fs-xs); color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    text-transform: uppercase; letter-spacing: .06em;
    font-weight: 600;
  }
  .dov-stat-val {
    font-family: var(--font-ui);
    font-size: var(--fs-2xl); font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    color: var(--text-primary);
    margin-bottom: 4px;
  }
  .dov-stat-card.is-highlight .dov-stat-val { font-size: var(--fs-2xl); }
  .dov-stat-val.amber { color: var(--accent); }
  .dov-stat-val.pos   { color: var(--green); }
  .dov-stat-val.neg   { color: var(--red); }
  .dov-stat-val.purple{ color: var(--purple); }
  .dov-stat-val.blue  { color: var(--blue); }
  .dov-stat-sub {
    font-size: var(--fs-xs); color: var(--text-muted);
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  /* ── Row 3: Chart + Baixa rápida + Resumo financeiro ── */
  .dov-row3 {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 8px;
    flex-shrink: 0;
    height: 300px;
  }
  .dov-card {
    background: color-mix(in srgb, var(--bg-1) 50%, transparent);
    border: 1px solid color-mix(in srgb, var(--text-primary) 8%, transparent);
    border-radius: 0;
    padding: 12px 12px;
    display: flex; flex-direction: column;
    min-height: 0; min-width: 0;
    overflow: hidden;
  }
  .dov-card-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
    flex-shrink: 0;
  }
  .dov-card-title {
    font-size: var(--fs-xs); font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
  }
  .dov-card-body { flex: 1; min-height: 0; min-width: 0; overflow-y: auto; }
  #dovPriceChart { overflow: hidden; }

  /* Baixa rápida form */
  .dov-baixa-form { display: flex; flex-direction: column; gap: 8px; }
  .dov-baixa-form label {
    font-size: var(--fs-xs); color: var(--text-secondary);
    margin-bottom: 2px; display: block;
    font-weight: 500;
  }
  .dov-baixa-form input,
  .dov-baixa-form select,
  .dov-baixa-form textarea {
    width: 100%;
    padding: 8px 8px;
    background: rgba(0,0,0,.25);
    border: 1px solid color-mix(in srgb, var(--text-primary) 8%, transparent);
    border-radius: 0;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: var(--fs-sm);
    box-sizing: border-box;
  }
  .dov-baixa-form input:focus,
  .dov-baixa-form select:focus,
  .dov-baixa-form textarea:focus {
    outline: none; border-color: color-mix(in srgb, var(--purple) 50%, transparent);
  }
  .dov-baixa-qty-row {
    display: flex; align-items: center; gap: 4px;
  }
  .dov-baixa-qty-btn {
    width: 26px; height: 30px;
    border-radius: 0;
    background: color-mix(in srgb, var(--text-primary) 4%, transparent);
    border: 1px solid color-mix(in srgb, var(--text-primary) 8%, transparent);
    color: var(--text-primary);
    cursor: pointer; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: var(--fs-lg);
    flex-shrink: 0;
  }
  .dov-baixa-qty-btn:hover { background: color-mix(in srgb, var(--text-primary) 8%, transparent); }
  .dov-baixa-submit {
    margin-top: 4px;
    padding: 8px;
    background: var(--purple);
    color: var(--text-primary); border: none; border-radius: 0;
    font-size: var(--fs-md); font-weight: 700; cursor: pointer;
    font-family: inherit;
    transition: box-shadow 0.12s;
  }
  .dov-baixa-submit:hover { box-shadow: none; }
  .dov-baixa-stockafter {
    font-size: var(--fs-xs); color: var(--text-muted);
    text-align: center;
    padding: 2px 0;
  }
  .dov-baixa-sugestao {
    font-size: var(--fs-xs); color: var(--text-muted);
    font-weight: 400;
    margin-left: 4px;
  }
  .dov-baixa-sugestao b { color: var(--accent); font-weight: 700; }

  /* Resumo financeiro: linhas agrupadas */
  .dov-finrow-group {
    padding: 4px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 6%, transparent);
  }
  .dov-finrow-group:last-child { border-bottom: none; }
  .dov-finrow {
    display: flex; justify-content: space-between; align-items: center;
    padding: 4px 0;
    font-size: var(--fs-sm);
  }
  .dov-finrow .label { color: var(--text-secondary); }
  .dov-finrow .val {
    font-family: var(--font-ui);
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
  }
  .dov-finrow .val.pos    { color: var(--green); }
  .dov-finrow .val.neg    { color: var(--red); }
  .dov-finrow .val.blue   { color: var(--blue); }
  .dov-finrow .val.amber  { color: var(--accent); }

  /* ── Row 4: Orders compra + Orders venda + Últimas transações ── */
  .dov-row4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr;
    gap: 12px;
    flex-shrink: 0;
    height: 370px;
  }
  /* Orderbook 3 colunas (preço | qty | total) com barra de volume embutida — visual sóbrio */
  .dov-ob-head {
    display: grid; grid-template-columns: 1fr 1fr 1fr;
    gap: 8px; padding: 4px 8px 4px;
    font-size: var(--fs-xs); color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .05em;
    font-weight: 600;
    border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 5%, transparent);
    margin-bottom: 2px;
  }
  .dov-ob-head .qty, .dov-ob-head .total { text-align: right; }
  .dov-ob-row {
    position: relative;
    display: grid; grid-template-columns: 1fr 1fr 1fr;
    gap: 8px; padding: 4px 8px;
    font-family: var(--font-ui);
    font-size: var(--fs-md); font-variant-numeric: tabular-nums;
    border-radius: 0;
    overflow: hidden;
  }
  .dov-ob-row .price, .dov-ob-row .qty, .dov-ob-row .total { position: relative; z-index: 1; }
  .dov-ob-row .qty   { text-align: right; color: var(--text-primary); font-weight: 500; }
  .dov-ob-row .total { text-align: right; color: var(--text-muted); }
  .dov-ob-row .depth-bar {
    position: absolute; top: 0; bottom: 0; right: 0;
    width: var(--bar-pct, 0%); z-index: 0; border-radius: 0;
  }
  .dov-ob-row.buy  .price { color: var(--green); font-weight: 600; }
  .dov-ob-row.buy  .depth-bar { background: color-mix(in srgb, var(--green) 2%, transparent); }
  .dov-ob-row.sell .price { color: var(--red); font-weight: 600; }
  .dov-ob-row.sell .depth-bar { background: color-mix(in srgb, var(--red) 2%, transparent); }
  .dov-ob-row:hover { background: color-mix(in srgb, var(--text-primary) 1.5%, transparent); }
  .dov-ob-spread {
    margin-top: auto;
    padding-top: 4px;
    border-top: 1px solid color-mix(in srgb, var(--text-primary) 4%, transparent);
    text-align: center;
    font-size: var(--fs-xs); color: var(--text-secondary);
    font-family: var(--font-mono);
    flex-shrink: 0;
  }
  .dov-ob-spread b { color: var(--text-primary); font-weight: 700; }

  /* ═══ Order book v3 — redesign fiel ao mockup ═══ */
  .ob-card {
    position: relative;
    display: flex; flex-direction: column;
    background: var(--bg-1);
    border: 1px solid color-mix(in srgb, var(--text-primary) 7%, transparent);
    border-radius: 0;
    padding: 16px 16px 12px;
    overflow: hidden;
    min-height: 0;
  }
  /* glow inferior temático (linha luminosa na base) */
  .ob-card::after {
    content: ''; position: absolute; left: 10%; right: 10%; bottom: 0; height: 3px;
    border-radius: 0; filter: blur(3px); opacity: .8;
  }
  .ob-card.buy  { border-color: color-mix(in srgb, var(--green) 28%, transparent); box-shadow: none; }
  .ob-card.sell { border-color: color-mix(in srgb, var(--red) 28%, transparent);  box-shadow: none; }
  .ob-card.buy::after  { background: var(--green); }
  .ob-card.sell::after { background: var(--red); }

  /* cabeçalho: ícone circular + título + total grande */
  .ob-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
  .ob-ico {
    display: grid; place-items: center;
    width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%;
  }
  .ob-ico.buy  { background: color-mix(in srgb, var(--green) 10%, transparent); color: var(--green); box-shadow: none; }
  .ob-ico.sell { background: color-mix(in srgb, var(--red) 10%, transparent);  color: var(--red); box-shadow: none; }
  .ob-title {
    font-size: var(--fs-lg); font-weight: 700; letter-spacing: .01em;
    text-transform: uppercase; color: var(--text-primary); flex: 1; min-width: 0;
  }
  .ob-title .ob-sub { font-size: var(--fs-md); font-weight: 600; color: var(--text-muted); text-transform: none; letter-spacing: 0; margin-left: 2px; }
  .ob-total { display: flex; flex-direction: column; align-items: flex-end; line-height: 1; white-space: nowrap; }
  .ob-total-lbl { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
  .ob-total b { font-size: var(--fs-2xl); font-weight: 700; font-variant-numeric: tabular-nums; }
  .ob-card.buy  .ob-total b { color: var(--green); }
  .ob-card.sell .ob-total b { color: var(--red); }

  .ob-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  /* área das linhas: cresce e o spread fica colado no rodapé via margin-top:auto */

  /* cabeçalho de colunas */
  .ob-card .dov-ob-head {
    border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 7%, transparent);
    padding: 0 12px 8px; margin-bottom: 4px;
    font-size: var(--fs-xs); letter-spacing: .04em; color: var(--text-muted);
    text-transform: uppercase; font-weight: 600;
  }
  /* linhas com barra de profundidade da direita */
  .ob-card .dov-ob-row {
    position: relative; overflow: hidden;
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
    padding: 12px 12px; border-radius: 0; margin-bottom: 1px;
    font-family: var(--font-ui);
    font-size: var(--fs-lg); font-variant-numeric: tabular-nums;
    align-items: center;
  }
  .ob-card .dov-ob-row .price, .ob-card .dov-ob-row .qty, .ob-card .dov-ob-row .total { position: relative; z-index: 1; }
  .ob-card .dov-ob-row .qty   { text-align: center; color: var(--text-primary); font-weight: 700; }
  .ob-card .dov-ob-row .total { text-align: right; color: var(--text-muted); }
  .ob-card .dov-ob-row .depth-bar {
    position: absolute; top: 0; bottom: 0; right: 0;
    width: var(--bar-pct, 0%); z-index: 0; border-radius: 0;
  }
  .ob-card.buy  .dov-ob-row .price { color: var(--green); font-weight: 700; }
  .ob-card.sell .dov-ob-row .price { color: var(--red); font-weight: 700; }
  .ob-card.buy  .dov-ob-row .depth-bar { background: color-mix(in srgb, var(--green) 3%, transparent); }
  .ob-card.sell .dov-ob-row .depth-bar { background: color-mix(in srgb, var(--red) 3%, transparent); }
  /* destaque sutil na maior ordem (última linha, maior qty) — como no mockup */
  .ob-card .dov-ob-row:last-of-type .depth-bar { opacity: 1; }
  .ob-card .dov-ob-row:hover { background: color-mix(in srgb, var(--text-primary) 2.5%, transparent); }

  /* spread: bloco com ícone circular à esquerda, sempre no rodapé */
  .ob-card .dov-ob-spread {
    display: flex; align-items: center; gap: 12px;
    margin-top: auto; padding: 12px 16px; border-radius: 0;
    background: color-mix(in srgb, var(--text-primary) 1.8%, transparent); border: 1px solid color-mix(in srgb, var(--text-primary) 6%, transparent);
    font-size: var(--fs-lg); color: var(--text-muted);
    flex-shrink: 0;
  }
  .ob-spread-ico {
    display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  }
  .ob-card.buy  .ob-spread-ico { background: color-mix(in srgb, var(--green) 10%, transparent); color: var(--green); }
  .ob-card.sell .ob-spread-ico { background: color-mix(in srgb, var(--red) 10%, transparent);  color: var(--red); }
  .ob-card .dov-ob-spread b { color: var(--text-primary); font-weight: 700; }
  .ob-spread-pct { color: var(--text-muted); }

  /* Última transações: tabela */
  .dov-trans-tabs {
    display: flex; gap: 2px;
    margin-left: 8px;
    flex-shrink: 0;
  }
  .dov-trans-tab {
    padding: 2px 8px;
    background: transparent;
    border: none;
    border-radius: 0;
    font-size: var(--fs-xs); font-weight: 600;
    color: var(--text-muted);
    cursor: pointer; font-family: inherit;
    white-space: nowrap;
  }
  .dov-trans-tab.active {
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    color: var(--accent);
  }
  .dov-trans-table {
    width: 100%; border-collapse: collapse;
    font-size: var(--fs-sm);
  }
  .dov-trans-table thead th {
    text-align: left;
    padding: 4px 4px;
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .04em;
    border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 5%, transparent);
    white-space: nowrap;
  }
  .dov-trans-table thead th.r { text-align: right; }
  .dov-trans-table thead th.c { text-align: center; }
  .dov-trans-table tbody td {
    padding: 4px 4px;
    border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 2.5%, transparent);
    font-family: var(--font-ui);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--text-primary);
  }
  .dov-trans-table tbody td.r { text-align: right; }
  .dov-trans-table tbody td.c { text-align: center; }
  .dov-trans-table tbody tr:hover td { background: color-mix(in srgb, var(--text-primary) 2%, transparent); }
  /* Tipo: cor sutil — não chamativa */
  .dov-trans-table .tx-buy  { color: var(--red); font-weight: 500; }
  .dov-trans-table .tx-sell { color: var(--green); font-weight: 500; }
}

/* Em mobile (<1024px): wrapper transparente, hero/tabs ficam no fluxo do drawer */
.drawer-modal-grid, .drawer-modal-left, .drawer-modal-right { display: contents; }
@media (max-width: 1023px) {

  .drawer-modal-close { display: none; }
}
.drawer-modal-close {
  position: absolute; top: 18px; right: 18px;
  width: 38px; height: 38px;
  display: none; align-items: center; justify-content: center;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 0; color: var(--text-secondary);
  cursor: pointer; z-index: 10;
  transition: all 0.12s;
}
.drawer-modal-close:hover { color: var(--text-primary); border-color: var(--accent); }
@media (min-width: 1024px) {
  .drawer-modal-close { display: flex; }
}

/* ── Side action buttons (modal mode) ── */

/* ═══════════════════════════════════════════════════════════════
   OVERVIEW REDESIGN — KPIs grandes, painéis lado a lado
═══════════════════════════════════════════════════════════════ */

/* KPIs PREMIUM (estilo dashboard trading) */
.dkpi-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; margin-bottom: 0;
  flex-shrink: 0;
}
.dkpi-card {
  background: color-mix(in srgb, var(--bg-1) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--text-primary) 8%, transparent);
  border-radius: 0;
  padding: 8px 12px 0;
  position: relative; overflow: hidden;
  min-height: 110px;
  display: flex; flex-direction: column;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.dkpi-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--text-primary) 15%, transparent);
}
.dkpi-card.accent  {
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
  background: color-mix(in srgb, var(--accent) 40%, transparent);
}
.dkpi-card.accent:hover { box-shadow: none; }
.dkpi-card.pos {
  border-color: color-mix(in srgb, var(--green) 28%, transparent);
  background: color-mix(in srgb, var(--green) 40%, transparent);
}
.dkpi-card.pos:hover { box-shadow: none; }
.dkpi-card.neg {
  border-color: color-mix(in srgb, var(--red) 32%, transparent);
  background: color-mix(in srgb, var(--red) 40%, transparent);
}
.dkpi-card.neg:hover { box-shadow: none; }
.dkpi-card.purple {
  border-color: color-mix(in srgb, var(--purple) 30%, transparent);
  background: color-mix(in srgb, var(--purple) 40%, transparent);
}
.dkpi-card.purple:hover { box-shadow: none; }

.dkpi-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
  position: relative; z-index: 2;
}
.dkpi-icon {
  width: 28px; height: 28px;
  border-radius: 0;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dkpi-icon svg { width: 14px; height: 14px; }
.dkpi-card.accent .dkpi-icon { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.dkpi-card.pos .dkpi-icon    { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.dkpi-card.neg .dkpi-icon    { background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); }
.dkpi-card.purple .dkpi-icon { background: color-mix(in srgb, var(--purple) 20%, transparent); color: var(--purple); }
.dkpi-card.neutral .dkpi-icon{ background: color-mix(in srgb, var(--text-primary) 6%, transparent); color: var(--text-muted); }
.dkpi-title {
  font-size: var(--fs-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted);
}

.dkpi-val {
  font-family: var(--font-ui);
  font-size: var(--fs-2xl); font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative; z-index: 2;
}
.dkpi-val.amber  { color: var(--accent); }
.dkpi-val.pos    { color: var(--green); }
.dkpi-val.neg    { color: var(--red); }
.dkpi-val.purple { color: var(--purple); }
.dkpi-sub {
  font-size: var(--fs-xs); color: var(--text-secondary);
  margin-top: 4px;
  position: relative; z-index: 2;
  line-height: 1.35;
}

.dkpi-card.purple .dkpi-sub { margin-top: 12px; }

/* Stats premium com ícone à esquerda */

/* Painéis premium (gráfico + profundidade) — ocupam o espaço restante */

.dpanel {
  background: color-mix(in srgb, var(--bg-1) 50%, transparent);
  border: 1px solid color-mix(in srgb, var(--text-primary) 8%, transparent);
  border-radius: 0; padding: 8px 12px;
  display: flex; flex-direction: column;
  min-width: 0; min-height: 0;
  overflow: hidden;
}

.dpanel-title {
  font-size: var(--fs-sm); font-weight: 700;
  color: var(--text-primary);
}

.dpanel-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--text-muted); font-size: var(--fs-sm); text-align: center;
}

/* Range tabs (7D, 30D...) */
.dpanel-range-tabs {
  display: inline-flex; gap: 2px;
  background: color-mix(in srgb, var(--text-primary) 4%, transparent); padding: 2px; border-radius: 0;
}
.dpanel-range-tab {
  padding: 4px 12px; border: none; background: transparent;
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary);
  border-radius: 0; cursor: pointer; font-family: inherit;
  transition: background 0.12s, color 0.12s;
}
.dpanel-range-tab:hover { color: var(--text-primary); }
.dpanel-range-tab.active {
  background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent);
}

/* Profundidade de mercado — 2 colunas (compra | venda) com barras embutidas */

/* Cada linha: barra de fundo proporcional à quantidade, números por cima */

/* Barra de fundo proporcional (--bar-pct definido inline em cada linha) */

/* Tabela de transações premium */
.dtxs-inline {
  background: color-mix(in srgb, var(--bg-1) 50%, transparent);
  border: 1px solid color-mix(in srgb, var(--text-primary) 8%, transparent);
  border-radius: 0; overflow: hidden;
}
.dtxs-inline-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 5%, transparent);
}
.dtxs-inline-head .dpanel-title { font-size: var(--fs-lg); }
.dtxs-inline-table {
  width: 100%; border-collapse: collapse;
}
.dtxs-inline-table th, .dtxs-inline-table td {
  padding: 12px 24px;
  font-size: var(--fs-md); text-align: left;
}
.dtxs-inline-table th {
  font-size: var(--fs-xs); text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-muted);
  font-weight: 700;
  border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 5%, transparent);
}
.dtxs-inline-table td { border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 4%, transparent); }
.dtxs-inline-table tr:last-child td { border-bottom: none; }
.dtxs-inline-table tr:hover td { background: color-mix(in srgb, var(--text-primary) 2%, transparent); }
.dtxs-inline-table td.r { text-align: right; font-family: var(--font-ui); }
.dtxs-inline-table .tx-buy  { color: var(--red); font-weight: 600; }
.dtxs-inline-table .tx-sell { color: var(--green); font-weight: 600; }

/* Bottom section: transações + formulário baixa manual lado a lado */

/* ═══════════════════════════════════════════════════════════════
   ANALYTICS TAB — widgets de inteligência
═══════════════════════════════════════════════════════════════ */

/* Liquidez bar */

/* Health Score arc */

/* Spread/Tempo/Volatilidade cards: valor centrado grande */

/* ═══════════════════════════════════════════════════════════════
   INSIGHTS TAB
═══════════════════════════════════════════════════════════════ */

/* Distribuição de compras: barras horizontais */

/* Carteira ranking */

/* Responsivo: empilha painéis em telas estreitas */
@media (max-width: 1100px) {
  .dkpi-row    { grid-template-columns: repeat(2, 1fr); }

}
@media (max-width: 600px) {
  .dkpi-row    { grid-template-columns: 1fr 1fr; }

}

/* ── Overview tab ── */

/* Sparkline section */

/* ── Transactions tab ── */
.tx-table-wrap { overflow-x: auto; }
.tx-table {
  width: 100%; border-collapse: collapse;
  font-size: var(--fs-sm);
}
.tx-table thead th {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em;
  color: var(--text-muted); text-transform: uppercase;
  text-align: left; padding: 0 8px 8px;
  border-bottom: 1px solid var(--border);
}
.tx-table thead th.r { text-align: right; }
.tx-table tbody td {
  padding: 8px 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.tx-table tbody tr:last-child td { border-bottom: none; }
.tx-table tbody tr:hover { background: var(--bg-2); }
.tx-table td.r {
  text-align: right; font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
}
.tx-table .td-date {
  color: var(--text-muted); font-family: var(--font-ui);
  font-size: var(--fs-xs);
}
.tx-table .td-total { font-weight: 700; }

/* Tx filter bar */
.tx-filter {
  display: flex; gap: 4px; margin-bottom: 12px;
}
.tx-filter-btn {
  padding: 4px 12px; border-radius: 0;
  font-size: var(--fs-sm); font-weight: 600;
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer;
  transition: all 0.12s;
}
.tx-filter-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.tx-filter-btn.active { background: color-mix(in srgb, var(--accent) 10%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent); }

/* ── Market tab ── */
.mkt-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px;
  background: var(--bg-2); border-radius: 0; border: 1px solid var(--border);
  margin-bottom: 4px;
}
.mkt-row-label { font-size: var(--fs-sm); color: var(--text-secondary); font-weight: 500; }
.mkt-row-val {
  font-family: var(--font-ui);
  font-size: var(--fs-md); font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ── Writeoff tab ── */
.writeoff-form {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 0; padding: 16px;
}
.writeoff-field { margin-bottom: 12px; }
.writeoff-label {
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-muted); margin-bottom: 4px;
}
.writeoff-input, .writeoff-select {
  width: 100%; padding: 8px 12px;
  background: var(--bg-3); border: 1px solid var(--border-strong);
  border-radius: 0; font-size: var(--fs-md); font-weight: 600;
  color: var(--text-primary); font-family: var(--font-ui);
  transition: border-color 0.12s;
}
.writeoff-input:focus, .writeoff-select:focus {
  outline: none; border-color: var(--accent);
}
.writeoff-select {
  font-family: inherit; font-weight: 500;
  cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a94a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 32px;
}
.writeoff-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.writeoff-submit {
  width: 100%; padding: 12px; border-radius: 0;
  background: var(--accent); color: var(--on-accent);
  font-size: var(--fs-md); font-weight: 700; cursor: pointer;
  transition: background 0.12s;
}
.writeoff-submit:hover { background: var(--accent-2); }
.writeoff-submit:disabled { opacity: .5; cursor: not-allowed; }
.writeoff-status {
  margin-top: 8px; font-size: var(--fs-sm);
  font-family: var(--font-ui);
  color: var(--text-muted); min-height: 16px;
}
.writeoff-status.ok  { color: var(--green); }
.writeoff-status.err { color: var(--red); }
.writeoff-preview {
  padding: 8px 12px; border-radius: 0;
  background: color-mix(in srgb, var(--accent) 7%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  font-size: var(--fs-sm); color: var(--text-secondary); margin-bottom: 12px;
}
.writeoff-preview b { color: var(--text-primary); font-family: var(--font-mono); }

/* ═══════════════════════════════════════════════════════════════
   LIGHTBOX — fullscreen image viewer
═══════════════════════════════════════════════════════════════ */
.lightbox {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.12s;
}
.lightbox.open { opacity: 1; pointer-events: auto; }

.lightbox-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, .88);
  }

.lightbox-box {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  max-width: min(90vw, 700px);
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--border-strong);
  border-radius: 0;
  overflow: hidden;
  box-shadow: var(--shadow-float);
  transform: scale(.92);
  transition: transform 0.12s cubic-bezier(.4,0,.2,1);
}
.lightbox.open .lightbox-box { transform: scale(1); }

.lightbox-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  flex-shrink: 0;
}
.lightbox-name {
  font-size: var(--fs-md); font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 70%;
}
.lightbox-actions { display: flex; gap: 8px; }

.lightbox-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 0;
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer; text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.lightbox-btn:hover { background: var(--bg-1); color: var(--text-primary); }
#lightboxClose:hover { color: var(--red); }

.lightbox-img-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
  background: color-mix(in srgb, var(--text-primary) 4%, transparent);
  min-height: 300px;
  cursor: zoom-in;
  position: relative;
}
.lightbox-img-wrap.zoomed { cursor: zoom-out; }

.lightbox-img-wrap img {
  max-width: 100%; max-height: 56vh;
  object-fit: contain;
  filter: drop-shadow(0 8px 40px rgba(0,0,0,.6));
  border-radius: 0;
  transition: transform 0.12s cubic-bezier(.4,0,.2,1);
  transform-origin: center center;
  user-select: none;
}
.lightbox-img-wrap.zoomed img { transform: scale(1.9); }

.lightbox-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  font-size: var(--fs-sm); color: var(--text-muted);
  font-family: var(--font-ui);
  display: flex; gap: 16px; align-items: center;
  flex-shrink: 0;
}
.lightbox-footer span { display: flex; align-items: center; gap: 4px; }

/* ═══════════════════════════════════════════════════════════════
   INSPECT OVERLAY — viewer 3D com partículas e efeitos por variante
   (portado do sistema original)
═══════════════════════════════════════════════════════════════ */

@keyframes ib-in { from { opacity: 0; } to { opacity: 1; } }

/* ── Stage 3D ── */

@keyframes inspect-drop {
  from { opacity: 0; transform: scale(0.6) translateY(-40px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.08); }
}

/* ── HUD inferior ── */

/* Barra de wear */

/* Hint */

/* Cantos decorativos CS2-style */

/* ── EFEITOS POR VARIANTE ── */

/* GLITTER */

@keyframes glitter-pulse {
  from { filter: drop-shadow(0 0 14px color-mix(in srgb, var(--yellow) 70%, transparent)) drop-shadow(0 0 30px color-mix(in srgb, var(--yellow) 40%, transparent)); }
  to   { filter: drop-shadow(0 0 28px var(--yellow)) drop-shadow(0 0 55px color-mix(in srgb, var(--yellow) 70%, transparent)); }
}
@keyframes glitter-shine { from { opacity: 0.3; } to { opacity: 0.85; } }

/* HOLO */

@keyframes holo-rainbow {
  0%   { background: color-mix(in srgb, var(--red) 50%, transparent); }
  16%  { background: color-mix(in srgb, var(--yellow) 50%, transparent); }
  33%  { background: color-mix(in srgb, var(--green) 50%, transparent); }
  50%  { background: color-mix(in srgb, var(--blue) 50%, transparent); }
  66%  { background: color-mix(in srgb, var(--purple) 50%, transparent); }
  83%  { background: color-mix(in srgb, var(--pink) 50%, transparent); }
  100% { background: color-mix(in srgb, var(--red) 50%, transparent); }
}

@keyframes holo-glow {
  0%   { background: color-mix(in srgb, var(--red) 15%, transparent); }
  33%  { background: color-mix(in srgb, var(--green) 15%, transparent); }
  66%  { background: color-mix(in srgb, var(--blue) 15%, transparent); }
  100% { background: color-mix(in srgb, var(--red) 15%, transparent); }
}

/* GOLD */

@keyframes gold-shimmer {
  from { filter: drop-shadow(0 0 20px color-mix(in srgb, var(--yellow) 80%, transparent)) brightness(1.10) saturate(1.2); }
  to   { filter: drop-shadow(0 0 35px var(--yellow)) drop-shadow(0 0 60px color-mix(in srgb, var(--yellow) 60%, transparent)) brightness(1.25) saturate(1.5); }
}

@keyframes gold-shine-sweep {
  0%   { transform: translateX(-100%) skewX(-20deg); opacity: 0; }
  30%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { transform: translateX(200%) skewX(-20deg); opacity: 0; }
}

/* FOIL */

@keyframes foil-chrome {
  0%   { background: color-mix(in srgb, var(--blue) 50%, transparent); }
  25%  { background: color-mix(in srgb, var(--text-primary) 60%, transparent); }
  50%  { background: color-mix(in srgb, var(--blue) 40%, transparent); }
  75%  { background: color-mix(in srgb, var(--blue) 30%, transparent); }
  100% { background: color-mix(in srgb, var(--blue) 50%, transparent); }
}

/* EMBROIDERED */

@keyframes emb-pulse {
  from { filter: drop-shadow(0 4px 16px color-mix(in srgb, var(--yellow) 50%, transparent)) drop-shadow(0 0 6px color-mix(in srgb, var(--yellow) 30%, transparent)); }
  to   { filter: drop-shadow(0 4px 24px color-mix(in srgb, var(--yellow) 70%, transparent)) drop-shadow(0 0 12px color-mix(in srgb, var(--yellow) 50%, transparent)); }
}

/* LENTICULAR */

@keyframes lenti-flip {
  0%   { background: color-mix(in srgb, var(--green) 40%, transparent); }
  50%  { background: color-mix(in srgb, var(--pink) 40%, transparent); }
  100% { background: color-mix(in srgb, var(--blue) 40%, transparent); }
}

/* Glows por tipo de item */

/* ── Colunas de liquidez (À venda / Qtd mín / % mín) ── */
.qty-min-cell {
  font-weight: 600;
}
.data-table thead th[title] {
  cursor: help;
  border-bottom: 1px dashed var(--border-strong);
}

/* ═══════════════════════════════════════════════════════════════
   COLUMN CONFIGURATOR — panel + draggable headers
═══════════════════════════════════════════════════════════════ */

/* ── Draggable th ── */
.inv-table thead th {
  user-select: none;
  white-space: nowrap;
  position: relative;
}
.inv-table thead th[draggable="true"] {
  cursor: grab;
}
.inv-table thead th[draggable="true"]:active { cursor: grabbing; }
.inv-table thead th.col-drag-over {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  outline: 2px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: -2px;
  border-radius: 0;
}
.inv-table thead th.col-dragging {
  opacity: .35;
}

/* Sort indicator in th */
.th-inner {
  display: inline-flex; align-items: center; gap: 4px;
  width: 100%;
  cursor: pointer;
}
.th-inner.r { justify-content: flex-end; }
.th-sort-icon {
  width: 12px; color: var(--text-muted); flex-shrink: 0;
  opacity: 0; transition: opacity 0.12s;
}
.inv-table thead th:hover .th-sort-icon,
.inv-table thead th.sorted .th-sort-icon { opacity: 1; }
.inv-table thead th.sorted { color: var(--text-primary); }
.inv-table thead th.sorted .th-sort-icon { color: var(--accent); }

/* drag handle in th */
.th-drag-handle {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 6px; cursor: grab;
  display: flex; align-items: center; justify-content: center;
  color: transparent;
  transition: color 0.12s;
}
.inv-table thead th:hover .th-drag-handle { color: var(--border-strong); }

/* ── Column panel backdrop ── */
/* ── Column panel ── */
.col-panel {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: 320px; z-index: 301;
  background: var(--bg-1); border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.12s cubic-bezier(.4,0,.2,1);
  box-shadow: none;
}
.col-panel.open { transform: translateX(0); }

.col-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.col-panel-title { font-size: var(--fs-lg); font-weight: 700; }
.col-panel-reset {
  font-size: var(--fs-sm); font-weight: 600;
  color: var(--text-muted); cursor: pointer;
  padding: 4px 8px; border-radius: 0;
  border: 1px solid var(--border);
  background: var(--bg-2);
  transition: all 0.12s;
}
.col-panel-reset:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.col-panel-hint {
  font-size: var(--fs-xs); color: var(--text-muted);
  padding: 8px 16px 4px;
  flex-shrink: 0;
}

/* ── Col list (draggable) ── */
.col-list {
  flex: 1; overflow-y: auto;
  padding: 8px 12px 16px;
  display: flex; flex-direction: column; gap: 4px;
}

.col-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 0;
  cursor: grab;
  transition: background 0.12s, border-color 0.12s, transform 0.12s, box-shadow 0.12s;
  user-select: none;
}
.col-item:active { cursor: grabbing; }
.col-item:hover { background: var(--bg-3); border-color: var(--border-strong); }
.col-item.col-item-drag-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  transform: scale(1.01);
}
.col-item.col-item-dragging {
  opacity: .4; transform: scale(.97);
}
.col-item.col-fixed { cursor: default; opacity: .7; }

/* Drag handle dots */
.col-drag-dots {
  display: flex; flex-direction: column; gap: 2px;
  flex-shrink: 0; color: var(--text-muted);
}
.col-drag-dots span {
  display: flex; gap: 2px;
}
.col-drag-dots b {
  width: 3px; height: 3px; border-radius: 50%;
  background: currentColor; display: block;
}

/* Eye toggle */
.col-eye {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 0; cursor: pointer;
  color: var(--text-secondary);
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}
.col-eye:hover { background: var(--bg-1); color: var(--text-primary); }
.col-item.col-hidden .col-eye { color: var(--text-muted); }
.col-item.col-hidden .col-label { opacity: .45; text-decoration: line-through; }

.col-label { flex: 1; font-size: var(--fs-md); font-weight: 500; }
.col-desc { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 1px; }
.col-fixed-badge {
  font-size: var(--fs-xs); font-weight: 700; padding: 1px 4px;
  border-radius: 0; background: var(--bg-3);
  color: var(--text-muted); letter-spacing: .04em;
}

/* ── Fixes de drag + sort no thead ── */

/* th usa th-col como classe base agora */
.inv-table thead th.th-col { white-space: nowrap; }
.inv-table thead th.th-col.r { text-align: right; }
.inv-table thead th.th-col.sorted { color: var(--text-primary); }
.inv-table thead th.th-col.sorted .th-sort-icon { color: var(--accent); opacity: 1; }

/* Cursor: pointer só em colunas sortáveis, grab só em draggable */
.inv-table thead th[data-sortable] { cursor: pointer; }
.inv-table thead th[draggable="true"] { cursor: grab; }
.inv-table thead th[draggable="true"]:active { cursor: grabbing; }
.inv-table thead th[data-sortable][draggable="true"] { cursor: grab; }

/* Filho pointer-events none durante drag para evitar dragleave falso */
.inv-table thead th.col-dragging * { pointer-events: none; }

/* Placeholder do handle para colunas fixas (mantém alinhamento) */
.th-drag-handle-placeholder { width: 14px; display: inline-block; }

/* Sort icon: só aparece no hover ou quando sorted */
.inv-table thead th.th-col .th-sort-icon { opacity: 0; transition: opacity 0.12s; }
.inv-table thead th.th-col:hover .th-sort-icon { opacity: 0.5; }
.inv-table thead th.th-col.sorted .th-sort-icon { opacity: 1; }

/* Drop target mais visível */
.inv-table thead th.col-drag-over {
  background: color-mix(in srgb, var(--accent) 14%, transparent) !important;
  outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent);
  outline-offset: -2px;
  border-radius: 0;
}

/* ═══════════════════════════════════════════════════════════════
   ADVANCED FILTER PANEL — drawer da direita, z-index global
═══════════════════════════════════════════════════════════════ */

/* Compact filter bar */
.filters-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.filter-btn-advanced {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 0;
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text-primary); font-size: var(--fs-md); font-weight: 600;
  cursor: pointer; transition: all 0.12s; white-space: nowrap; flex-shrink: 0;
}
.filter-btn-advanced:hover { background: var(--bg-3); border-color: var(--border-strong); }
.filter-btn-advanced.active {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
}
.adv-filter-badge {
  background: var(--accent); color: var(--on-accent);
  font-size: var(--fs-xs); font-weight: 700;
  padding: 1px 4px; border-radius: 0;
  min-width: 18px; text-align: center;
}

/* Active filter tags row */
.filter-active-tags {
  display: flex; flex-wrap: wrap; gap: 4px;
  min-width: 0; flex: 1;
}
.filter-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 0;
  background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  font-size: var(--fs-xs); font-weight: 600; color: var(--accent);
  white-space: nowrap;
}
.filter-tag button {
  display: flex; align-items: center;
  opacity: .55; cursor: pointer; padding: 0;
  transition: opacity 0.12s;
}
.filter-tag button:hover { opacity: 1; }

/* ── Backdrops (shared style) ── */
.adv-filter-backdrop,
.col-panel-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .55);
  opacity: 0; pointer-events: none;
  transition: opacity 0.12s;
}
.adv-filter-backdrop { z-index: 300; }
.col-panel-backdrop  { z-index: 300; }
.adv-filter-backdrop.open,
.col-panel-backdrop.open  { opacity: 1; pointer-events: auto; }

/* ── Filter panel — drawer direito ── */
.adv-filter-panel {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: 440px; max-width: 95vw;
  z-index: 301;
  background: var(--bg-1); border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.12s cubic-bezier(.4, 0, .2, 1);
  box-shadow: var(--shadow-float);
}
.adv-filter-panel.open { transform: translateX(0); }

.adv-filter-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px 16px; border-bottom: 1px solid var(--border);
  flex-shrink: 0; gap: 12px;
}
.adv-filter-title { font-size: var(--fs-lg); font-weight: 700; }
.adv-filter-subtitle { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 2px; }

.adv-filter-body {
  flex: 1; overflow-y: auto; padding: 16px 16px 40px;
  display: flex; flex-direction: column; gap: 16px;
}

/* Filter section */
.flt-section { display: flex; flex-direction: column; gap: 8px; }
.flt-section-title {
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-muted);
  display: flex; align-items: center; justify-content: space-between;
}
.flt-section-title .flt-clear-section {
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted);
  cursor: pointer; opacity: .6; transition: opacity 0.12s;
}
.flt-section-title .flt-clear-section:hover { opacity: 1; color: var(--accent); }

/* Chip group */
.flt-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.flt-chip {
  padding: 4px 12px; border-radius: 0;
  font-size: var(--fs-sm); font-weight: 500;
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer;
  transition: all 0.12s; white-space: nowrap;
}
.flt-chip:hover { border-color: var(--border-strong); color: var(--text-primary); }
.flt-chip.active {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
}
.flt-chip.chip-green.active {
  background: color-mix(in srgb, var(--green) 10%, transparent); border-color: color-mix(in srgb, var(--green) 40%, transparent); color: var(--green);
}
.flt-chip.chip-red.active {
  background: color-mix(in srgb, var(--red) 10%, transparent); border-color: color-mix(in srgb, var(--red) 40%, transparent); color: var(--red);
}
.flt-chip.chip-blue.active {
  background: color-mix(in srgb, var(--blue) 10%, transparent); border-color: color-mix(in srgb, var(--blue) 40%, transparent); color: var(--blue);
}
.flt-chip.chip-purple.active {
  background: color-mix(in srgb, var(--purple) 10%, transparent); border-color: color-mix(in srgb, var(--purple) 40%, transparent); color: var(--purple);
}

/* Range row */
.flt-range {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 4px;
}
.flt-range-sep { font-size: var(--fs-xs); color: var(--text-muted); text-align: center; }
.flt-input {
  width: 100%; padding: 8px 8px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 0; font-size: var(--fs-md); font-weight: 500;
  color: var(--text-primary); font-family: var(--font-ui);
  transition: border-color 0.12s;
}
.flt-input:focus { outline: none; border-color: var(--accent); }
.flt-input::placeholder { color: var(--text-muted); font-weight: 400; }

/* Toggle */

/* Divider */
.flt-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* Slider range visual */

/* ── Filter group cards (Quantidades / Percentuais / Valores) ── */
.flt-group-header {
  font-size: var(--fs-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-muted);
  padding: 4px 0 4px;
  display: flex; align-items: center; gap: 8px;
}
.flt-group-header::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.flt-group-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 12px;
  display: flex; flex-direction: column; gap: 12px;
}

/* Tighten rangeRow inside group card */
.flt-group-card .flt-section { gap: 4px; }
.flt-group-card .flt-section-title {
  font-size: var(--fs-xs); letter-spacing: .06em; margin-bottom: 2px;
  color: var(--text-secondary);
}
.flt-group-card .flt-input { padding: 4px 8px; font-size: var(--fs-sm); }

/* ═══════════════════════════════════════════════════════════════
   INVENTORY TABLE — larger thumb + row action buttons
═══════════════════════════════════════════════════════════════ */

/* Item name column min-width so buttons have room */
.td-item-name { min-width: 260px; }

/* Larger thumbnail */
.item-thumb-lg {
  width: 56px; height: 56px;
  border-radius: 0;
  background: var(--bg-3);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.item-thumb-lg img {
  width: 100%; height: 100%;
  object-fit: contain; padding: 4px;
}
/* Glow on row hover */
.data-table tbody tr:hover .item-thumb-lg {
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  box-shadow: none;
}

/* Row action buttons — hidden by default, slide in on row hover */
.row-actions {
  align-items: center; gap: 4px;
  margin-top: 0;
  /* Animar height força REFLOW da tabela inteira a cada frame — com ~1700
     linhas isso trava o hover. Usamos grid-rows (0fr→1fr) + opacity, que o
     navegador anima sem re-layout custoso das outras linhas. */
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  overflow: hidden;
  transition: grid-template-rows 0.12s, opacity 0.12s, margin-top 0.12s;
}
.row-actions > * { min-height: 0; }
/* wrapper interno mantém os botões em linha (o grid externo só anima a altura) */
.row-actions-inner { display: flex; align-items: center; gap: 4px; }
.data-table tbody tr:hover .row-actions {
  grid-template-rows: 1fr;
  margin-top: 4px;
  opacity: 1;
}

.row-action-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 0;
  font-size: var(--fs-xs); font-weight: 600;
  cursor: pointer; text-decoration: none;
  border: 1px solid var(--border-strong);
  background: var(--bg-3);
  color: var(--text-secondary);
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
  line-height: 1.4;
}
.row-action-btn:hover {
  background: var(--bg-1);
  color: var(--text-primary);
}

/* Copy button — turns green briefly when copied */
.copy-btn { color: var(--text-muted); }
.copy-btn.copied {
  color: var(--green) !important;
  border-color: color-mix(in srgb, var(--green) 40%, transparent) !important;
  background: color-mix(in srgb, var(--green) 8%, transparent) !important;
}

/* Steam button */
.steam-btn { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 30%, transparent); }
.steam-btn:hover {
  color: var(--blue) !important;
  background: color-mix(in srgb, var(--blue) 8%, transparent) !important;
  border-color: color-mix(in srgb, var(--blue) 50%, transparent) !important;
}

/* Keep row height consistent — thumb is 56px, padding compensates */
.inv-table tbody td { padding: 8px 8px; vertical-align: middle; }
.inv-table .td-item-name { padding: 8px 8px; }

/* ═══════════════════════════════════════════════════════════════
   CONFIG VIEW — monitor + APIs + sistema
═══════════════════════════════════════════════════════════════ */

/* ── Abas de Configurações ── */
.cfg-tabs {
  display: flex; align-items: center; gap: 4px;
  flex-wrap: wrap; margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.cfg-tab {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; border: none; background: transparent;
  color: var(--text-secondary); cursor: pointer;
  font-size: var(--fs-md); font-weight: 600; font-family: inherit;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: all 0.12s;
  white-space: nowrap;
}
.cfg-tab:hover { color: var(--text-primary); }
.cfg-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.cfg-tab svg { opacity: .85; }
.cfg-tab-panel {
  display: none;
  animation: cfgFade .2s ease;
  max-width: 720px;
}
.cfg-tab-panel.active { display: flex; flex-direction: column; gap: 12px; }
@keyframes cfgFade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (max-width: 640px) {
  .cfg-tab { padding: 8px 12px; font-size: var(--fs-sm); }
  .cfg-tab span { display: inline; }
}

/* ── Sincronização de quantidades + cota ── */
.qty-sync-box {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border);
}
.qty-cota-row {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-sm);
}
.qty-cota-label { color: var(--text-secondary); white-space: nowrap; }
.qty-cota-bar {
  flex: 1; height: 8px; border-radius: 0;
  background: var(--bg-2); overflow: hidden;
}
.qty-cota-fill {
  display: block; height: 100%; width: 0;
  background: var(--accent);
  transition: width 0.12s ease;
}
.qty-cota-val { color: var(--text-primary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.qty-sync-status {
  margin-top: 8px; font-size: var(--fs-sm); color: var(--text-secondary);
  min-height: 16px;
}

/* toggle automático */
.qty-auto-toggle {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; font-size: var(--fs-md); color: var(--text-primary);
  cursor: pointer; user-select: none;
}
.qty-auto-toggle input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* estimativa de cota */
.qty-estimate {
  margin-top: 8px; padding: 8px 12px; border-radius: 0;
  font-size: var(--fs-sm); line-height: 1.5;
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text-secondary);
}
.qty-estimate.ok     { border-color: color-mix(in srgb, var(--green) 30%, transparent);  color: var(--green, var(--green)); }
.qty-estimate.warn   { border-color: color-mix(in srgb, var(--yellow) 35%, transparent); color: var(--yellow); }
.qty-estimate.danger { border-color: color-mix(in srgb, var(--red) 40%, transparent);  color: var(--red, var(--red)); }
.qty-estimate b { color: var(--text-primary); }

/* feed ao vivo */
.qty-feed-wrap {
  margin-top: 12px; border: 1px solid var(--border);
  border-radius: 0; overflow: hidden; background: var(--bg-0);
}
.qty-feed-head, .qty-feed-row {
  display: grid; grid-template-columns: 1fr 80px 80px; gap: 8px;
  padding: 8px 12px; font-size: var(--fs-sm); align-items: center;
}
.qty-feed-head {
  background: var(--bg-2); color: var(--text-muted);
  font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.qty-feed { max-height: 240px; overflow-y: auto; }
.qty-feed-row { border-top: 1px solid var(--border); }
.qty-feed-row .r { text-align: right; font-variant-numeric: tabular-nums; }
.qty-feed-row .accent { color: var(--accent); }
.qty-feed-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }

/* Config card */
.cfg-card {
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: 0; padding: 16px;
}
.cfg-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.cfg-card-title {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-md); font-weight: 700;
  color: var(--text-primary);
}

/* ── Monitor ── */
.cfg-monitor { border-color: color-mix(in srgb, var(--accent) 20%, transparent); }
.cfg-monitor-status {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-sm); font-weight: 600;
}
.monitor-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.monitor-dot.idle    { background: var(--text-muted); }
.monitor-dot.running { background: var(--green); animation: pulse 1.5s infinite; }
.monitor-dot.error   { background: var(--red); }
.monitor-dot.done    { background: var(--blue); }

.monitor-progress-wrap { margin-bottom: 12px; }
.monitor-progress-bar {
  height: 6px; background: var(--bg-3); border-radius: 0; overflow: hidden;
}
.monitor-progress-fill {
  height: 100%; width: 0%;
  background: var(--accent);
  border-radius: 0;
  transition: width 0.12s ease;
}
.monitor-progress-labels {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 4px;
}
.monitor-item-label {
  font-size: var(--fs-xs); color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 80%;
}
.monitor-pct {
  font-size: var(--fs-xs); font-weight: 700; color: var(--accent);
  font-family: var(--font-mono);
}

.monitor-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 12px;
}
.monitor-stat {
  background: var(--bg-2); border-radius: 0; padding: 8px 12px;
  border: 1px solid var(--border);
}
.monitor-stat-label {
  font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); font-weight: 700; margin-bottom: 4px;
}
.monitor-stat-val {
  font-family: var(--font-mono); font-size: var(--fs-lg); font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.monitor-stat-val.red    { color: var(--red); }
.monitor-stat-val.accent { color: var(--accent); }
.monitor-stat-val.green  { color: var(--green); }

.monitor-controls {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
}
.monitor-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 12px; border-radius: 0;
  font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-2);
  color: var(--text-primary); transition: all 0.12s;
}
.monitor-btn:hover { background: var(--bg-3); }
.monitor-btn.start { background: color-mix(in srgb, var(--green) 10%, transparent); border-color: color-mix(in srgb, var(--green) 30%, transparent); color: var(--green); }
.monitor-btn.start:hover { background: color-mix(in srgb, var(--green) 18%, transparent); }
.monitor-btn.stop  { background: color-mix(in srgb, var(--red) 10%, transparent); border-color: color-mix(in srgb, var(--red) 30%, transparent); color: var(--red); }
.monitor-btn.stop:hover  { background: color-mix(in srgb, var(--red) 18%, transparent); }
.monitor-btn.refresh { background: color-mix(in srgb, var(--accent) 10%, transparent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--accent); }
.monitor-btn.refresh:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.monitor-btn:disabled { opacity: .4; cursor: not-allowed; }

.monitor-interval { margin-bottom: 16px; }
.monitor-interval-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.cfg-slider {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 4px; background: var(--bg-3); border-radius: 0;
  outline: none;
}
.cfg-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
  box-shadow: none;
}
.monitor-interval-val {
  font-size: var(--fs-sm); font-weight: 700; color: var(--accent);
  font-family: var(--font-mono); white-space: nowrap;
}

/* Log */
.monitor-log-wrap { }

.monitor-log-clear {
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted);
  cursor: pointer; transition: color 0.12s;
}
.monitor-log-clear:hover { color: var(--accent); }
.monitor-log {
  background: var(--bg-0); border: 1px solid var(--border);
  border-radius: 0; padding: 8px 12px;
  height: 200px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}
.log-line {
  font-family: var(--font-mono); font-size: var(--fs-xs);
  line-height: 1.5; color: var(--text-secondary);
  white-space: pre-wrap; word-break: break-all;
}
.log-line.ok    { color: var(--green); }
.log-line.err   { color: var(--red); }
.log-line.warn  { color: var(--yellow); }
.log-line.info  { color: var(--blue); }
.log-line.muted { color: var(--text-muted); }

/* ── Source chips ── */

/* ── API keys ── */
.cfg-api-list { display: flex; flex-direction: column; gap: 12px; }
.cfg-api-item {
  padding: 12px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 0;
}
.cfg-api-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 8px; margin-bottom: 8px;
}
.cfg-api-name {
  font-size: var(--fs-md); font-weight: 700; margin-bottom: 2px;
  display: flex; align-items: center; gap: 8px;
}
.cfg-api-badge {
  font-size: var(--fs-xs); font-weight: 700; padding: 2px 8px; border-radius: 0;
  letter-spacing: .04em;
}
.cfg-api-badge.free     { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.cfg-api-badge.freemium { background: color-mix(in srgb, var(--blue) 15%, transparent); color: var(--blue); }
.cfg-api-badge.paid     { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
.cfg-api-desc { font-size: var(--fs-sm); color: var(--text-muted); }
.cfg-api-desc a { color: var(--accent); }
.cfg-api-status {
  font-size: var(--fs-xs); font-weight: 700; white-space: nowrap;
  font-family: var(--font-ui);
  padding: 2px 8px; border-radius: 0;
}
.cfg-api-status.ok  { color: var(--green); background: color-mix(in srgb, var(--green) 10%, transparent); }
.cfg-api-status.err { color: var(--red);   background: color-mix(in srgb, var(--red) 10%, transparent); }
.cfg-api-input-row {
  display: flex; gap: 4px;
}
.cfg-input {
  flex: 1;
  background: var(--bg-3); border: 1px solid var(--border-strong);
  border-radius: 0; padding: 8px 12px;
  font-size: var(--fs-md); color: var(--text-primary);
  font-family: var(--font-ui);
  transition: border-color 0.12s;
}
.cfg-input:focus { outline: none; border-color: var(--accent); }
.cfg-btn-eye {
  width: 36px; height: 36px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 0; background: var(--bg-3);
  border: 1px solid var(--border-strong);
  color: var(--text-muted); cursor: pointer;
  transition: all 0.12s;
}
.cfg-btn-eye:hover { color: var(--text-primary); }

/* ── Sistema ── */
.cfg-sys-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cfg-field { display: flex; flex-direction: column; gap: 4px; }
.cfg-label { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.cfg-hint  { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 4px; }
.cfg-actions-row { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 1100px) {

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

/* ── Monitor tabs ── */
.monitor-tabs {
  display: flex; align-items: center; gap: 4px;
  margin-bottom: 8px; flex-wrap: wrap;
}
.monitor-tab {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: 0;
  font-size: var(--fs-sm); font-weight: 600;
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer; transition: all 0.12s;
}
.monitor-tab:hover { color: var(--text-primary); background: var(--bg-3); }
.monitor-tab.active {
  background: color-mix(in srgb, var(--accent) 10%, transparent); border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--accent);
}

/* ── Request feed ── */
.monitor-feed-wrap, .monitor-log-wrap {
  background: var(--bg-0); border: 1px solid var(--border);
  border-radius: 0; overflow: hidden;
}
.feed-header {
  display: grid;
  grid-template-columns: 2fr 3fr 60px 90px 70px;
  gap: 8px; padding: 8px 12px;
  background: var(--bg-2); border-bottom: 1px solid var(--border);
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted);
}
.monitor-feed {
  height: 260px; overflow-y: auto;
  display: flex; flex-direction: column;
}
.feed-empty {
  padding: 24px 12px; text-align: center;
  font-size: var(--fs-sm); color: var(--text-muted);
  font-family: var(--font-mono);
}
.feed-row {
  display: grid;
  grid-template-columns: 2fr 3fr 60px 90px 70px;
  gap: 8px; padding: 4px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  font-size: var(--fs-sm);
  transition: background 0.1s;
  animation: feedIn .2s ease-out;
}
.feed-row:last-child { border-bottom: none; }
.feed-row:hover { background: var(--bg-2); }
@keyframes feedIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* New item highlight */
.feed-row.new {
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  animation: feedIn .2s ease-out, feedHighlight 1.5s ease-out forwards;
}
@keyframes feedHighlight {
  0%   { background: color-mix(in srgb, var(--accent) 10%, transparent); }
  100% { background: transparent; }
}
.feed-col-name {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text-primary); font-weight: 500;
}
.feed-col-url {
  font-family: var(--font-mono); font-size: var(--fs-xs);
  color: var(--text-muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.feed-col-url a {
  color: var(--blue); text-decoration: none;
}
.feed-col-url a:hover { text-decoration: underline; }
.feed-col-status {
  font-family: var(--font-mono); font-weight: 700;
  text-align: center;
}
.feed-col-status.ok200  { color: var(--green); }
.feed-col-status.e429   { color: var(--yellow); }
.feed-col-status.err    { color: var(--red); }
.feed-col-status.cached { color: var(--text-muted); font-style: italic; }
.feed-col-price {
  font-family: var(--font-mono); font-weight: 600;
  text-align: right; color: var(--text-primary);
}
.feed-col-time {
  font-family: var(--font-mono); font-size: var(--fs-xs);
  text-align: right; color: var(--text-muted);
}

/* Log wrap */
.monitor-log-wrap { padding: 0; }
.monitor-log {
  height: 260px; overflow-y: auto; padding: 8px 12px;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--bg-0);
}

/* ═══════════════════════════════════════════════════════════════
   PRICE HISTORY — drawer tab content
═══════════════════════════════════════════════════════════════ */

.hist-loading {
  padding: 40px 16px; text-align: center;
  color: var(--text-muted); font-size: var(--fs-md);
}

/* Range tabs (7d/30d/90d/...) */
.hist-range-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.hist-range-tab {
  padding: 4px 12px; border-radius: 0;
  font-size: var(--fs-xs); font-weight: 600;
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer;
  transition: all 0.12s;
}
.hist-range-tab:hover { background: var(--bg-3); color: var(--text-primary); }
.hist-range-tab.active {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent);
}

/* Stats row */
.hist-stats {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 8px; margin-bottom: 16px;
}
.hist-stat {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 0; padding: 8px 8px;
}
.hist-stat-label {
  font-size: var(--fs-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); margin-bottom: 2px;
}
.hist-stat-val {
  font-family: var(--font-ui);
  font-size: var(--fs-sm); font-weight: 600;
  color: var(--text-primary);
}
.hist-stat-val.up  { color: var(--green); }
.hist-stat-val.down{ color: var(--red); }
.hist-stat-val.pos { color: var(--green); }
.hist-stat-val.neg { color: var(--red); }

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

/* Chart */
.hist-chart-wrap {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 0; padding: 12px;
  margin-bottom: 16px;
}
.hist-chart-title {
  font-size: var(--fs-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); margin-bottom: 8px;
}
.hist-chart {
  width: 100%; height: 200px;
  position: relative;
}
.hist-chart-tooltip {
  position: absolute; z-index: 10;
  background: var(--bg-1);
  border: 1px solid var(--border-strong);
  border-radius: 0; padding: 8px 8px;
  font-size: var(--fs-xs); pointer-events: none;
  box-shadow: var(--shadow-float);
  min-width: 140px;
}
.hist-chart-tooltip .ttip-date {
  font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: 2px;
}
.hist-chart-tooltip .ttip-price {
  font-family: var(--font-ui);
  font-size: var(--fs-lg); font-weight: 700;
  color: var(--accent);
}
.hist-chart-tooltip .ttip-meta {
  font-size: var(--fs-xs); color: var(--text-secondary);
  margin-top: 2px;
}

/* History table */
.hist-table-wrap {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 0; overflow: hidden;
}
.hist-table-head {
  padding: 8px 12px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted);
}
.hist-table {
  max-height: 320px; overflow-y: auto;
}
.hist-row {
  display: grid;
  grid-template-columns: 130px 90px 70px 1fr;
  gap: 8px; padding: 8px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  font-size: var(--fs-sm);
  align-items: center;
}
.hist-row:hover { background: var(--bg-3); }
.hist-row:last-child { border-bottom: none; }
.hist-row-date {
  font-family: var(--font-ui);
  font-size: var(--fs-xs); color: var(--text-muted);
}
.hist-row-price {
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--text-primary);
}
.hist-delta {
  font-family: var(--font-ui);
  font-size: var(--fs-xs); font-weight: 600;
}
.hist-delta.pos { color: var(--green); }
.hist-delta.neg { color: var(--red); }
.hist-delta.neutral { color: var(--text-muted); }
.hist-row-meta {
  display: flex; gap: 8px; flex-wrap: wrap;
  font-size: var(--fs-xs); color: var(--text-muted);
}
.hist-meta {
  font-family: var(--font-ui);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .hist-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "date price" "delta meta";
  }
  .hist-row-date  { grid-area: date; }
  .hist-row-price { grid-area: price; text-align: right; }
  .hist-row-delta { grid-area: delta; }
  .hist-row-meta  { grid-area: meta; justify-content: flex-end; }
}

/* Botão durante bulk Steam rodando */

@keyframes bulkPulse {
  0%, 100% { box-shadow: none; }
  50%      { box-shadow: none; }
}

/* Bulk API result rows */
.bulk-api-result {
  margin-top: 12px; padding: 12px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.bulk-result-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: var(--fs-sm);
}
.bulk-result-label {
  color: var(--text-muted); font-weight: 600;
}
.bulk-result-val {
  font-family: var(--font-ui);
  font-weight: 700; color: var(--text-primary);
}
.bulk-result-val.accent { color: var(--accent); }

/* Drawer: botão de refresh via Steam ao lado dos meta chips */

.drawer-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 0;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s;
  flex-shrink: 0;
}
.drawer-refresh-btn:hover {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  transform: translateY(-1px);
}
.drawer-refresh-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}
.drawer-refresh-btn.refreshing svg {
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Title row com legenda no chart de quantidades */
.hist-chart-title-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.hist-chart-title-row .hist-chart-title { margin-bottom: 0; }
.hist-legend {
  display: flex; gap: 12px;
  font-size: var(--fs-xs); color: var(--text-secondary);
  font-weight: 600;
}
.hist-legend-item {
  display: inline-flex; align-items: center; gap: 4px;
  white-space: nowrap;
}
.hist-legend-dot {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block;
}

/* Empty state mini para chart de quantidades sem dados */
.hist-empty-mini {
  padding: 32px 16px; text-align: center;
  font-size: var(--fs-sm); color: var(--text-muted);
  font-style: italic;
}

/* Tooltip do qty chart - linhas de quantidade */
.hist-chart-tooltip .ttip-qty {
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  font-weight: 700;
  margin-top: 2px;
}

/* User dropdown (topbar) */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px); right: 0;
  background: var(--bg-1);
  border: 1px solid var(--border-strong);
  border-radius: 0;
  min-width: 220px;
  padding: 8px;
  box-shadow: var(--shadow-float);
  z-index: 100;
}
.user-dropdown-header {
  padding: 8px 8px 8px;
}
.user-dropdown-name { font-size: var(--fs-md); font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.user-dropdown-email { font-size: var(--fs-xs); color: var(--text-muted); }
.user-dropdown-provider {
  display: inline-block;
  margin-top: 4px;
  font-size: var(--fs-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  padding: 2px 8px; border-radius: 0;
  background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent);
}
.user-dropdown-divider {
  height: 1px; background: var(--border); margin: 4px 4px;
}
.user-dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 8px; border-radius: 0;
  font-size: var(--fs-md); font-weight: 600;
  color: var(--text-secondary); text-decoration: none;
  cursor: pointer;
}
.user-dropdown-item:hover {
  background: var(--bg-2); color: var(--red);
}

/* ═══════════════ IMPORT MODAL (colar transações) ═══════════════ */

.import-controls { display: flex; gap: 12px; margin-bottom: 12px; }
.import-ctl { display: flex; flex-direction: column; gap: 4px; flex: 1; margin-bottom: 12px; }
.import-ctl label {
  font-size: var(--fs-xs); color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: .04em; font-weight: 600;
}
.import-ctl select, .import-ctl textarea {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: var(--fs-md);
  font-family: inherit;
  outline: none;
  transition: border-color 0.12s;
}
.import-ctl select:focus, .import-ctl textarea:focus { border-color: var(--accent); }
.import-ctl textarea {
  resize: vertical;
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  line-height: 1.45;
}
.import-actions { display: flex; justify-content: flex-end; margin-bottom: 4px; }

.import-preview-info {
  font-size: var(--fs-sm); color: var(--text-secondary);
  margin: 8px 0 8px;
}
.import-preview-scroll {
  max-height: 320px; overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 0;
}
.import-preview-table {
  width: 100%; border-collapse: collapse;
  font-size: var(--fs-sm);
}
.import-preview-table thead th {
  position: sticky; top: 0;
  background: var(--bg-3);
  color: var(--text-secondary);
  text-align: left;
  padding: 8px 8px;
  font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  z-index: 1;
}
.import-preview-table thead th.r { text-align: right; }
.import-preview-table tbody td {
  padding: 8px 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 3%, transparent);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  white-space: nowrap;
}
.import-preview-table tbody td.r { text-align: right; }
.import-preview-table tbody td.imp-name {
  font-family: inherit;
  max-width: 240px; overflow: hidden; text-overflow: ellipsis;
}
.import-preview-table tbody tr.imp-dup { opacity: .5; }
.import-preview-table tbody tr:hover td { background: color-mix(in srgb, var(--text-primary) 2%, transparent); }
.import-preview-table .imp-buy  { color: var(--red); font-weight: 500; }
.import-preview-table .imp-sell { color: var(--green); font-weight: 500; }
.imp-dup-tag { color: var(--text-muted); font-size: var(--fs-xs); }
.imp-new-tag { color: var(--green); font-size: var(--fs-xs); }
.imp-chk { cursor: pointer; width: 15px; height: 15px; accent-color: var(--accent); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 0;
  font-size: var(--fs-md); font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}
.btn-ghost:hover { background: color-mix(in srgb, var(--text-primary) 5%, transparent); color: var(--text-primary); border-color: var(--border-strong); }
.btn-ghost:disabled { opacity: .45; cursor: not-allowed; }

/* ── Adicionar item: validação + drop ── */
.additem-validate-info {
  margin-top: 8px;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  min-height: 16px;
  line-height: 1.4;
}
.additem-validate-info.ok  { color: var(--green); }
.additem-validate-info.err { color: var(--red); }
.additem-drop {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-md); color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.additem-drop input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }

.additem-force-link {
  background: none; border: none; padding: 0;
  color: var(--accent); cursor: pointer;
  font-size: inherit; font-family: inherit;
  text-decoration: underline; text-underline-offset: 2px;
}
.additem-force-link:hover { color: var(--accent-2); }

/* ═══════════════ IMPORTAR — abas internas ═══════════════ */
.imp-tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.imp-tab {
  display: flex; align-items: center; gap: 8px;
  background: transparent; border: none;
  color: var(--text-secondary);
  padding: 12px 16px;
  font-size: var(--fs-md); font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
}
.imp-tab:hover { color: var(--text-primary); }
.imp-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.imp-tab svg { opacity: .85; }

.imp-panel { display: none; animation: impFade .2s ease; }
.imp-panel.active { display: block; }
@keyframes impFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.imp-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 24px 24px;
}
.imp-card-title { font-size: var(--fs-lg); font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.imp-card-sub { font-size: var(--fs-md); color: var(--text-secondary); margin-bottom: 16px; line-height: 1.5; }

/* Adicionar item — grid form + prévia */
.imp-add-grid { display: grid; grid-template-columns: 1fr 260px; gap: 24px; align-items: start; }
.imp-add-form { display: flex; flex-direction: column; gap: 4px; }
.imp-add-preview {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 16px;
  text-align: center;
}
.imp-add-preview-img {
  width: 100%; aspect-ratio: 1; border-radius: 0;
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px; overflow: hidden;
}
.imp-add-preview-ph { color: var(--text-muted); font-size: var(--fs-sm); padding: 16px; line-height: 1.5; }
.imp-add-preview-name { font-size: var(--fs-md); font-weight: 600; color: var(--text-primary); margin-bottom: 4px; word-break: break-word; }
.imp-add-preview-price { font-size: var(--fs-sm); color: var(--accent); font-family: var(--font-mono); }

/* Gerenciar — stats */
.imp-manage-stats { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.imp-stat {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 0; padding: 12px 16px; flex: 1; min-width: 120px;
}
.imp-stat-wide { flex: 2; min-width: 220px; }
.imp-stat-lbl { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--text-secondary); margin-bottom: 4px; font-weight: 600; }
.imp-stat-val { font-size: var(--fs-2xl); font-weight: 700; color: var(--text-primary); font-family: var(--font-ui); }
.imp-stat-sm { font-size: var(--fs-sm); font-weight: 500; line-height: 1.5; }

/* Gerenciar — barra de filtros */
.imp-manage-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.imp-search {
  flex: 1; min-width: 200px;
  background: var(--bg-0); border: 1px solid var(--border);
  border-radius: 0; color: var(--text-primary);
  padding: 8px 12px; font-size: var(--fs-md); font-family: inherit; outline: none;
}
.imp-search:focus { border-color: var(--accent); }
.imp-filter {
  background: var(--bg-0); border: 1px solid var(--border);
  border-radius: 0; color: var(--text-primary);
  padding: 8px 12px; font-size: var(--fs-md); font-family: inherit; outline: none; cursor: pointer;
}
.imp-manage-actions { display: flex; gap: 8px; margin-left: auto; }
.imp-danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.imp-danger:hover { background: color-mix(in srgb, var(--red) 8%, transparent); color: var(--red); border-color: color-mix(in srgb, var(--red) 50%, transparent); }

/* Gerenciar — tabela */
.imp-manage-scroll { border: 1px solid var(--border); border-radius: 0; overflow: hidden; }
.imp-manage-table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.imp-manage-table thead th {
  position: sticky; top: 0; background: var(--bg-3);
  color: var(--text-secondary); text-align: left;
  padding: 8px 12px; font-size: var(--fs-xs); text-transform: uppercase;
  letter-spacing: .04em; font-weight: 600; border-bottom: 1px solid var(--border);
}
.imp-manage-table thead th.r { text-align: right; }
.imp-manage-table tbody td {
  padding: 8px 12px; border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 3%, transparent);
  font-family: var(--font-ui); font-variant-numeric: tabular-nums;
  color: var(--text-primary); white-space: nowrap;
}
.imp-manage-table tbody td.r { text-align: right; }
.imp-manage-table tbody td.imp-mname {
  font-family: inherit; max-width: 320px; overflow: hidden; text-overflow: ellipsis;
}
.imp-manage-table tbody tr:hover td { background: color-mix(in srgb, var(--text-primary) 2%, transparent); }
.imp-manage-table .imp-buy { color: var(--red); }
.imp-manage-table .imp-sell { color: var(--green); }
.imp-src-tag {
  font-family: inherit; font-size: var(--fs-xs);
  background: color-mix(in srgb, var(--text-primary) 5%, transparent); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 0; color: var(--text-secondary);
}
.imp-row-chk, #impSelectAll { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.imp-row-del {
  background: transparent; border: none; color: var(--text-muted);
  cursor: pointer; padding: 4px; border-radius: 0;
  display: inline-flex; transition: all 0.12s;
}
.imp-row-del:hover { color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }
.imp-manage-more { padding: 12px; text-align: center; font-size: var(--fs-sm); color: var(--text-secondary); background: var(--bg-2); }

.additem-validate-info code {
  background: color-mix(in srgb, var(--text-primary) 6%, transparent);
  padding: 1px 4px; border-radius: 0;
  font-family: var(--font-mono); font-size: var(--fs-xs);
  color: var(--text-primary);
}

/* ═══════════════ Config: Provedor & Fila Steam ═══════════════ */
.cfg-card-sub { font-size: var(--fs-md); color: var(--text-secondary); line-height: 1.5; margin: 0 0 16px; }
.cfg-provider-options { display: flex; flex-direction: column; gap: 8px; }
.cfg-provider-opt {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; border: 1px solid var(--border); border-radius: 0;
  cursor: pointer; transition: border-color 0.12s, background 0.12s;
}
.cfg-provider-opt:hover { border-color: var(--border-strong); background: color-mix(in srgb, var(--text-primary) 2%, transparent); }
.cfg-provider-opt input { margin-top: 2px; accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.cfg-provider-opt span { font-size: var(--fs-md); color: var(--text-primary); line-height: 1.5; }
.cfg-provider-opt small { color: var(--text-secondary); font-size: var(--fs-sm); }
.cfg-provider-opt:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, transparent); }

.cfg-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; }
.cfg-grid-2 .cfg-field { display: flex; flex-direction: column; gap: 4px; }
.cfg-grid-2 .cfg-field label { font-size: var(--fs-xs); color: var(--text-secondary); text-transform: uppercase; letter-spacing: .03em; font-weight: 600; }
.cfg-grid-2 .cfg-field input {
  background: var(--bg-0); border: 1px solid var(--border); border-radius: 0;
  color: var(--text-primary); padding: 8px 12px; font-size: var(--fs-md);
  font-family: var(--font-ui); outline: none;
}
.cfg-grid-2 .cfg-field input:focus { border-color: var(--accent); }

.cfg-toggle { display: flex; align-items: center; gap: 8px; font-size: var(--fs-md); color: var(--text-primary); cursor: pointer; }
.cfg-toggle input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.monitor-dot.warn { background: var(--yellow); box-shadow: none; }

/* ═══════════════ Central de Atualização (Bloco 2 — Dashboard) ═══════════════ */

/* Controles topo */

/* Config rápida */

/* Linha 1 — cards */

.ce-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
.ce-dot.running { background: var(--green); box-shadow: none; animation: cePulse 1.4s infinite; }
.ce-dot.paused  { background: var(--yellow); }
.ce-dot.cooldown,.ce-dot.protection { background: var(--red); box-shadow: none; }
.ce-dot.recovering { background: var(--blue); animation: cePulse 1.4s infinite; }
.ce-dot.idle { background: var(--text-muted); }
@keyframes cePulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* Linha 2 — progresso */

/* Seções */

/* Timeline */

.ce-tl-row { display: flex; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-md); }
.ce-tl-row:last-child { border-bottom: none; }
.ce-tl-time { color: var(--text-muted); font-family: var(--font-ui); flex-shrink: 0; min-width: 58px; }
.ce-tl-msg { color: var(--text-primary); }
.ce-tl-row.protection .ce-tl-msg, .ce-tl-row.item_error .ce-tl-msg { color: var(--red); }
.ce-tl-row.recovered .ce-tl-msg, .ce-tl-row.start .ce-tl-msg { color: var(--green); }

/* Tabela */

.ce-st { padding: 2px 8px; border-radius: 0; font-size: var(--fs-xs); font-weight: 600; }
.ce-st.Sucesso { background: var(--green-soft); color: var(--green); }
.ce-st.Erro    { background: var(--red-soft); color: var(--red); }
.ce-st.Cooldown{ background: color-mix(in srgb, var(--yellow) 12%, transparent); color: var(--yellow); }
.ce-st.Cache   { background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue); }
.ce-st.Retry   { background: color-mix(in srgb, var(--purple) 12%, transparent); color: var(--purple); }
.ce-http-ok  { color: var(--green); font-weight: 700; }
.ce-http-err { color: var(--red); font-weight: 700; }
.ce-empty { text-align: center; color: var(--text-muted); padding: 16px; font-size: var(--fs-md); }

/* ── Bloco 2 ajustes: cards menores, saúde, proteção, simulação ── */

/* Linha 2: saúde + proteção lado a lado */

/* Painel de simulação */

.ce-sim-btn {
  padding: 8px 12px; border-radius: 0; border: 1px solid var(--border-strong);
  background: var(--bg-3); color: var(--text-primary); font-size: var(--fs-md); font-weight: 600; cursor: pointer;
  transition: all 0.12s;
}
.ce-sim-btn:hover { border-color: var(--purple); color: var(--purple); }

/* Timeline: cores por severidade */
.ce-tl-sev { font-family: var(--font-ui); font-size: var(--fs-xs); font-weight: 700; padding: 1px 4px; border-radius: 0; flex-shrink: 0; min-width: 74px; text-align: center; }
.ce-tl-sev.INFO       { background: color-mix(in srgb, var(--text-secondary) 15%, transparent); color: var(--text-secondary); }
.ce-tl-sev.SUCCESS    { background: var(--green-soft); color: var(--green); }
.ce-tl-sev.WARNING    { background: color-mix(in srgb, var(--yellow) 15%, transparent); color: var(--yellow); }
.ce-tl-sev.ERROR      { background: var(--red-soft); color: var(--red); }
.ce-tl-sev.PROTECTION { background: color-mix(in srgb, var(--red) 20%, transparent); color: var(--red); }
.ce-tl-sev.RECOVERY   { background: color-mix(in srgb, var(--blue) 15%, transparent); color: var(--blue); }
.ce-tl-sev.CACHE      { background: color-mix(in srgb, var(--purple) 15%, transparent); color: var(--purple); }

/* ════ Steam Engines (aba Steam — layout v2, alinhado ao mockup) ════ */
.se-wrap { display: grid; grid-template-columns: 1fr 460px; gap: 16px; align-items: stretch; }
/* a aba Steam usa a largura toda (as outras abas mantêm o limite de 720px) */
.cfg-tab-panel[data-cfgpanel="central"] { max-width: none; width: 100%; }
.se-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.se-head { }
.se-title { font-size: var(--fs-xl); font-weight: 700; display: flex; align-items: center; gap: 8px; letter-spacing: -.2px; }
.se-title-icon { color: var(--accent); }
.se-badge { font-size: var(--fs-xs); background: var(--accent); color: var(--bg-0); padding: 2px 8px; border-radius: 0; font-weight: 700; letter-spacing: .3px; }
.se-sub { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: 4px; }

/* ── config (seleção + ações) ── */
.se-config { background: var(--bg-2); border: 1px solid var(--border); border-radius: 0; padding: 16px; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.se-config-left { display: flex; flex-direction: column; gap: 12px; flex: 1; min-width: 280px; }
.se-streams { display: flex; gap: 16px; flex-wrap: wrap; }
.se-check { display: flex; align-items: center; gap: 8px; font-size: var(--fs-md); cursor: pointer; font-weight: 600; }
.se-check small { opacity: .5; font-size: var(--fs-xs); font-weight: 400; }
.se-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.se-dot.pricing { background: var(--accent); box-shadow: none; }
.se-dot.orderbook { background: var(--blue); box-shadow: none; }
.se-dot.enrichment { background: var(--purple); box-shadow: none; }
.se-mode { display: flex; align-items: center; gap: 8px; }
.se-switch { display: flex; align-items: center; gap: 8px; font-size: var(--fs-md); cursor: pointer; font-weight: 600; }
.se-mode-hint { font-size: var(--fs-xs); color: var(--text-muted); }
.se-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.se-act-btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 0; padding: 12px 16px; font-size: var(--fs-md); font-weight: 700; cursor: pointer; border: 1px solid var(--border-strong); background: var(--bg-3); color: var(--text-primary); transition: all 0.12s; }
.se-act-btn:hover { transform: translateY(-1px); }
.se-act-start { background: var(--accent); color: var(--bg-0); border-color: transparent; }
.se-act-start:hover { box-shadow: none; }
.se-act-pause:hover { border-color: var(--yellow); }
.se-act-stop:hover { border-color: var(--red); }

/* ── 3 cards de engine ── */
.se-engines { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.se-engine { background: var(--bg-2); border: 1px solid var(--border); border-radius: 0; padding: 16px; display: flex; flex-direction: column; gap: 12px; transition: border-color 0.12s, box-shadow 0.12s; }
.se-engine[data-engine="pricing"].running { border-color: color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: none; animation: sePulseOrange 2.4s ease-in-out infinite; }
.se-engine[data-engine="orderbook"].running { border-color: color-mix(in srgb, var(--blue) 50%, transparent); box-shadow: none; animation: sePulseBlue 2.4s ease-in-out infinite; }
.se-engine[data-engine="enrichment"].running { border-color: color-mix(in srgb, var(--purple) 50%, transparent); box-shadow: none; animation: sePulsePurple 2.4s ease-in-out infinite; }
@keyframes sePulseOrange { 0%,100% { box-shadow: none; } 50% { box-shadow: none; } }
@keyframes sePulseBlue { 0%,100% { box-shadow: none; } 50% { box-shadow: none; } }
@keyframes sePulsePurple { 0%,100% { box-shadow: none; } 50% { box-shadow: none; } }
.se-engine-head { display: flex; justify-content: space-between; align-items: center; }
.se-engine-name { font-weight: 700; font-size: var(--fs-lg); display: flex; align-items: center; gap: 8px; }
.se-engine-state { font-size: var(--fs-xs); padding: 4px 12px; border-radius: 0; background: var(--bg-3); color: var(--text-secondary); font-weight: 700; }
.se-engine-state.is-running { background: var(--green-soft); color: var(--green); }
.se-engine-state.is-paused { background: color-mix(in srgb, var(--yellow) 14%, transparent); color: var(--yellow); }
.se-engine-state.is-stopped { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.se-engine-state.is-cooldown, .se-engine-state.is-protection { background: color-mix(in srgb, var(--yellow) 14%, transparent); color: var(--yellow); }
.se-engine-meta { font-size: var(--fs-xs); color: var(--text-muted); margin-top: -8px; }
.se-engine-ctl { display: flex; gap: 8px; }
.se-mini { background: var(--bg-3); border: 1px solid var(--border-strong); border-radius: 0; padding: 8px; cursor: pointer; color: var(--text-primary); font-size: var(--fs-md); font-weight: 600; transition: all 0.12s; }
.se-mini:hover { background: var(--bg-1); border-color: var(--text-muted); }
.se-mini:disabled { opacity: .35; cursor: not-allowed; }
.se-mini:disabled:hover { background: var(--bg-3); border-color: var(--border-strong); }
.se-mini-primary { flex: 1; }
.se-mini-stop { min-width: 42px; }
.se-engine[data-engine="pricing"] .se-mini-primary { background: var(--accent); color: var(--bg-0); border-color: transparent; }
.se-engine[data-engine="orderbook"] .se-mini-primary { background: var(--blue); color: var(--bg-0); border-color: transparent; }
.se-engine[data-engine="enrichment"] .se-mini-primary { background: var(--purple); color: var(--bg-0); border-color: transparent; }
/* toggle: quando executando o primário vira "Pausar" (tom de aviso) */
.se-mini-primary.is-running { background: color-mix(in srgb, var(--yellow) 16%, transparent) !important; color: var(--yellow) !important; border: 1px solid color-mix(in srgb, var(--yellow) 40%, transparent) !important; }
.se-mini-primary.is-running:hover { background: color-mix(in srgb, var(--yellow) 24%, transparent) !important; }
/* pausado/parado: primário vira "Retomar" mais suave */
.se-mini-primary.is-paused { opacity: .92; }
.se-mini-stop:not(:disabled) { color: var(--red); }
.se-mini-stop:not(:disabled):hover { background: var(--red-soft); border-color: var(--red); }
.se-engine-metarow { display: flex; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.se-mr-item { display: flex; flex-direction: column; gap: 2px; }
.se-mr-label { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 700; }
.se-mr-val { font-size: var(--fs-sm); font-weight: 700; }
.se-prio-high { color: var(--accent); }
.se-prio-mid { color: var(--blue); }
.se-prio-low { color: var(--purple); }

/* ── cards de sistema (linha de status) ── */
.se-syscards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.se-syscard { background: var(--bg-2); border: 1px solid var(--border); border-radius: 0; padding: 12px 16px; }
.se-sc-label { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 700; }
.se-sc-val { font-size: var(--fs-xl); font-weight: 700; margin-top: 4px; letter-spacing: -.3px; }
.se-sc-val.se-sc-state.is-active { color: var(--green); }
.se-sc-val.se-sc-prot.is-ok { color: var(--green); }
.se-sc-val.se-sc-prot.is-warn { color: var(--yellow); }
.se-sc-sub { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }

/* ── seções (Progresso / Resumo) ── */
.se-section { background: var(--bg-2); border: 1px solid var(--border); border-radius: 0; padding: 16px; }
.se-section-title { font-size: var(--fs-lg); font-weight: 700; margin-bottom: 16px; }

/* Progresso por engine */
.se-prog-list { display: flex; flex-direction: column; gap: 16px; }
.se-prog-row { display: grid; grid-template-columns: 200px 1fr auto auto auto; gap: 16px; align-items: center; }
.se-prog-id { display: flex; align-items: center; gap: 12px; }
.se-prog-icon { width: 34px; height: 34px; border-radius: 0; display: flex; align-items: center; justify-content: center; font-size: var(--fs-lg); flex-shrink: 0; }
.se-prog-icon.pricing { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.se-prog-icon.orderbook { background: color-mix(in srgb, var(--blue) 14%, transparent); }
.se-prog-icon.enrichment { background: color-mix(in srgb, var(--purple) 14%, transparent); }
.se-prog-name { font-size: var(--fs-md); font-weight: 700; }
.se-prog-meta { font-size: var(--fs-xs); color: var(--text-muted); }
.se-prog-bar-wrap { height: 9px; background: var(--bg-0); border-radius: 0; overflow: hidden; min-width: 120px; }
.se-prog-bar { height: 100%; width: 0; border-radius: 0; transition: width 0.12s ease; }
.se-prog-bar.pricing { background: var(--accent-2); }
.se-prog-bar.orderbook { background: var(--blue); }
.se-prog-bar.enrichment { background: var(--purple); }
.se-prog-nums { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 96px; }
.se-prog-count { font-size: var(--fs-lg); font-weight: 700; font-variant-numeric: tabular-nums; }
.se-prog-pct { font-size: var(--fs-sm); font-weight: 700; }
.se-prog-pct.pricing { color: var(--accent); }
.se-prog-pct.orderbook { color: var(--blue); }
.se-prog-pct.enrichment { color: var(--purple); }
.se-prog-eta, .se-prog-spd { display: flex; flex-direction: column; gap: 2px; min-width: 72px; }
.se-prog-eta-label { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 700; }
.se-prog-eta-val { font-size: var(--fs-md); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Resumo do sistema (6 cards) */
.se-summary { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.se-sum-card { background: var(--bg-1); border: 1px solid var(--border); border-radius: 0; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.se-sum-ico { width: 26px; height: 26px; border-radius: 0; display: flex; align-items: center; justify-content: center; font-size: var(--fs-md); font-weight: 700; }
.se-sum-ico.ok { background: var(--green-soft); color: var(--green); }
.se-sum-ico.pend { background: color-mix(in srgb, var(--text-secondary) 14%, transparent); color: var(--text-secondary); }
.se-sum-ico.err { background: var(--red-soft); color: var(--red); }
.se-sum-ico.retry { background: color-mix(in srgb, var(--yellow) 14%, transparent); color: var(--yellow); }
.se-sum-ico.cool { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.se-sum-ico.block { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.se-sum-label { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; font-weight: 700; line-height: 1.3; }
.se-sum-val { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }

.se-footer { font-size: var(--fs-xs); color: var(--text-muted); text-align: left; padding-top: 4px; }

/* ── painel de logs (direita) ── */
.se-logs { background: var(--bg-2); border: 1px solid var(--border); border-radius: 0; padding: 12px; display: flex; flex-direction: column; gap: 12px; align-self: stretch; max-height: calc(100vh - 60px); position: sticky; top: 12px; }
.se-logs-head { display: flex; flex-direction: column; gap: 8px; }
.se-logs-title { font-weight: 700; font-size: var(--fs-lg); }
.se-logs-filters { display: flex; gap: 4px; flex-wrap: wrap; }
.se-lf { background: var(--bg-3); border: 1px solid var(--border-strong); border-radius: 0; padding: 4px 8px; cursor: pointer; color: var(--text-secondary); font-size: var(--fs-xs); font-weight: 600; transition: all 0.12s; }
.se-lf.active { background: var(--accent); border-color: var(--accent); color: var(--bg-0); }
.se-logs-list { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; min-height: 240px; }
.se-log { display: flex; gap: 8px; align-items: flex-start; padding: 8px 8px; border-radius: 0; cursor: pointer; font-size: var(--fs-sm); }
.se-log:hover { background: var(--bg-3); }
.se-log.sel { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.se-log-time { color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: var(--fs-xs); flex-shrink: 0; padding-top: 1px; }
.se-log-lvl { font-size: var(--fs-xs); padding: 2px 8px; border-radius: 0; font-weight: 700; letter-spacing: .3px; flex-shrink: 0; }
.se-log-lvl.INFO { background: color-mix(in srgb, var(--blue) 18%, transparent); color: var(--blue); }
.se-log-lvl.SUCCESS { background: var(--green-soft); color: var(--green); }
.se-log-lvl.WARN { background: color-mix(in srgb, var(--yellow) 18%, transparent); color: var(--yellow); }
.se-log-lvl.ERROR { background: var(--red-soft); color: var(--red); }
.se-log-src { color: var(--text-secondary); font-weight: 700; min-width: 62px; flex-shrink: 0; }
.se-log-msg { flex: 1; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--text-secondary); line-height: 1.35; }
.se-logs-detail { border-top: 1px solid var(--border); padding-top: 12px; }
.se-ld-title { font-size: var(--fs-md); font-weight: 700; margin-bottom: 8px; }
.se-ld-empty { font-size: var(--fs-xs); color: var(--text-muted); }
.se-ld-row { display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-sm); padding: 4px 0; align-items: baseline; }
.se-ld-row span:first-child { color: var(--text-muted); flex-shrink: 0; }
.se-ld-row span:last-child { font-weight: 600; text-align: right; word-break: break-word; }

@media (max-width: 1100px) {
  .se-wrap { grid-template-columns: 1fr; }
  .se-logs { position: static; max-height: none; }
  .se-prog-row { grid-template-columns: 160px 1fr auto; }
  .se-prog-eta, .se-prog-spd { display: none; }
  .se-summary { grid-template-columns: repeat(3, 1fr); }
  .se-syscards { grid-template-columns: repeat(2, 1fr); }
}

/* ── Aba Análises (Fase 4): cores genéricas pos/neg em células e KPIs ── */
.data-table td.pos { color: var(--green); }
.data-table td.neg { color: var(--red); }

/* ── Aba Gráficos (Fase 5): linha de top e legenda inline ── */

/* ── Aba Análises (Fase 6): badges do ranking de decisão ── */

/* ── Análises/Gráficos v2 (Fases C/D) ── */

/* ═══════ ABA ANÁLISES (refeita — fidelidade ao design) ═══════ */

.liq-chip { display:inline-block; padding: 1px 8px; border-radius: 0; font-size: var(--fs-xs); font-weight:700; }
.liq-alta { background:color-mix(in srgb, var(--green) 15%, transparent); color:var(--green); }
.liq-media { background:color-mix(in srgb, var(--yellow) 15%, transparent); color:var(--yellow); }
.liq-baixa { background:color-mix(in srgb, var(--red) 15%, transparent); color:var(--red); }
.liq-na { background:color-mix(in srgb, var(--text-muted) 15%, transparent); color:var(--text-secondary); }

/* ── Coluna "Variação": número (%) + mini-gráfico, com seletor de janela ── */
.spark-cell { white-space: nowrap; }
.spark-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
}
.spark-wrap .chg-val {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 52px;
  text-align: right;
  color: var(--text-muted, var(--text-secondary));
  flex: 0 0 auto;
}
.spark-wrap .chg-val.up   { color: var(--green); }
.spark-wrap .chg-val.down { color: var(--red); }
.spark-wrap .row-spark {
  flex: 0 0 auto;
  width: 72px;
  height: 28px;
}

/* cabeçalho da coluna Variação: label + seletor lado a lado, sem vazar */
.th-col[data-col-id="spark"] .th-inner { margin-right: 4px; }
.spark-range-sel {
  background: var(--bg-elevated, var(--bg-3));
  color: var(--text, var(--text-primary));
  border: 1px solid var(--border-strong, var(--border-strong));
  border-radius: 0;
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 1px 2px;
  margin-left: 2px;
  cursor: pointer;
  outline: none;
  max-width: 56px;
  vertical-align: middle;
}
.spark-range-sel:hover { border-color: var(--accent, var(--blue)); }

/* ── Itens não reconhecidos (nome sem preço no mercado) ── */
.badge-unrecognized {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 2px 8px;
  margin-left: 4px;
  border-radius: 0;
  background: color-mix(in srgb, var(--yellow) 15%, transparent);
  color: var(--yellow);
  border: 1px solid color-mix(in srgb, var(--yellow) 40%, transparent);
  vertical-align: middle;
  white-space: nowrap;
}
.unrec-banner {
  grid-column: 1 / -1;
  background: color-mix(in srgb, var(--yellow) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--yellow) 35%, transparent);
  border-radius: 0;
  padding: 12px 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.unrec-head { font-size: var(--fs-md); color: var(--text, var(--text-primary)); line-height: 1.5; }
.unrec-head b { color: var(--yellow); }
.unrec-lbl { font-size: var(--fs-sm); color: var(--text-muted, var(--text-secondary)); }
.unrec-sugg-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.unrec-sugg {
  font-size: var(--fs-sm); font-weight: 600;
  padding: 4px 12px; border-radius: 0;
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  color: var(--blue); border: 1px solid color-mix(in srgb, var(--blue) 40%, transparent);
  cursor: pointer; transition: all 0.12s;
}
.unrec-sugg:hover { background: color-mix(in srgb, var(--blue) 26%, transparent); }
.unrec-edit-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.unrec-input {
  flex: 1; min-width: 260px;
  padding: 8px 12px; font-size: var(--fs-md);
  background: var(--bg-input, var(--bg-1));
  border: 1px solid var(--border, var(--border-strong));
  border-radius: 0; color: var(--text, var(--text-primary));
}
.unrec-input:focus { outline: none; border-color: var(--blue); }
.unrec-save, .unrec-hide {
  padding: 8px 16px; font-size: var(--fs-md); font-weight: 600;
  border-radius: 0; cursor: pointer; border: 1px solid transparent;
  transition: all 0.12s;
}
.unrec-save { background: var(--green); color: var(--on-accent); }
.unrec-save:hover { background: var(--green); }
.unrec-hide {
  background: transparent; color: var(--text-muted, var(--text-secondary));
  border-color: var(--border, var(--border-strong));
}
.unrec-hide:hover { background: color-mix(in srgb, var(--text-secondary) 10%, transparent); color: var(--text, var(--text-primary)); }

/* ── Overlay de itens ocultos ── */
.flt-hidden-btn {
  font-size: var(--fs-sm); font-weight: 600; padding: 8px 12px;
  background: transparent; color: var(--text-muted, var(--text-secondary));
  border: 1px solid var(--border, var(--border-strong)); border-radius: 0;
  cursor: pointer; width: 100%; transition: all 0.12s;
}
.flt-hidden-btn:hover { background: color-mix(in srgb, var(--text-secondary) 10%, transparent); color: var(--text, var(--text-primary)); }
.flt-hidden-count:not(:empty) {
  display: inline-block; margin-left: 4px; font-size: var(--fs-xs);
  background: color-mix(in srgb, var(--yellow) 20%, transparent); color: var(--yellow);
  padding: 1px 8px; border-radius: 0;
}
.hidden-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center;
}
.hidden-modal {
  background: var(--bg-card, var(--bg-3)); border: 1px solid var(--border, var(--border-strong));
  border-radius: 0; padding: 16px; width: min(560px, 92vw);
  max-height: 80vh; display: flex; flex-direction: column;
}
.hidden-modal-head { display: flex; align-items: center; justify-content: space-between; }
.hidden-modal-head h3 { margin: 0; font-size: var(--fs-lg); color: var(--text, var(--text-primary)); }

.hidden-close {
  background: transparent; border: none; color: var(--text-muted, var(--text-secondary));
  font-size: var(--fs-xl); cursor: pointer; padding: 4px 8px; border-radius: 0;
}
.hidden-close:hover { background: color-mix(in srgb, var(--text-secondary) 10%, transparent); }
.hidden-modal-sub { font-size: var(--fs-sm); color: var(--text-muted, var(--text-secondary)); margin: 8px 0 12px; line-height: 1.5; }

/* ── Diálogos de exportação e backup ── */
.exp-group { margin: 12px 0; }
.exp-lbl { display: block; font-size: var(--fs-sm); color: var(--text-muted, var(--text-secondary)); margin-bottom: 4px; }
.exp-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.exp-btns button { flex: 1; min-width: 130px; }
.bkp-section {
  margin-top: 16px; padding: 12px;
  background: color-mix(in srgb, var(--text-secondary) 5%, transparent);
  border: 1px solid var(--border, var(--border-strong)); border-radius: 0;
}
.bkp-title { font-size: var(--fs-md); font-weight: 700; color: var(--text, var(--text-primary)); margin-bottom: 4px; }
.bkp-desc { font-size: var(--fs-xs); color: var(--text-muted, var(--text-secondary)); line-height: 1.5; margin-bottom: 8px; }

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVIDADE — iPhone / iPad (retrato e paisagem)
   Cobre: layout/sidebar, topbar, tabela e modal (drawer).
═══════════════════════════════════════════════════════════════════ */

/* Botão hambúrguer e backdrop da sidebar: escondidos no desktop */
.mobile-menu-btn { display: none; background: none; border: none; color: var(--text); cursor: pointer; padding: 4px; margin-right: 8px; border-radius: 0; }
.mobile-menu-btn:hover { background: var(--bg-2); }
.sidebar-backdrop { display: none; }

/* ───────── TABLET e abaixo (≤ 1024px) ───────── */
@media (max-width: 1024px) {
  /* Sidebar vira gaveta deslizante sobre o conteúdo */
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100vh;
    z-index: 200; width: 260px;
    transform: translateX(-100%);
    transition: transform 0.12s ease;
    box-shadow: none;
  }
  .app.sidebar-open .sidebar { transform: translateX(0); }
  .app.sidebar-open .sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: 150;
    background: rgba(0,0,0,.5); }
  .mobile-menu-btn { display: inline-flex; align-items: center; }
  .main { width: 100%; }

  /* Drawer (modal) mais largo, quase cheio */
  .drawer { width: 640px; max-width: 96vw; }

  /* Tabela no iPad: rola na horizontal se as colunas não couberem, primeira
     coluna fixa como referência. contain/content-visibility desligados pois
     quebram o sticky. */
  .inv-table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .inv-table { min-width: 860px; }
  .data-table th, .data-table td { white-space: nowrap; }
  .data-table tbody tr { contain: none !important; content-visibility: visible !important; }
  .data-table thead th { background: var(--bg-1); }
  .data-table thead th:first-child,
  .data-table tbody td:first-child {
    position: sticky; left: 0; z-index: 2;
    background: var(--bg-1); box-shadow: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   MODAL (drawer) — CELULAR e TABLET (até 1024px)
   ---------------------------------------------------------------------
   PROBLEMA que isto resolve: todo o dimensionamento do modal (tamanhos de
   ícone, fontes, alturas de card) vive dentro de @media (min-width:1025px).
   Abaixo disso NADA daquilo se aplica, então SVGs sem width/height explícito
   esticavam até preencher o container (o "cifrão gigante" dos prints).
   Aqui redefinimos, de forma completa, o dimensionamento para telas menores.
═══════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  /* ---- Container: painel deslizante em tela cheia ---- */
  .drawer {
    position: fixed; right: 0; top: 0; bottom: 0; left: auto;
    width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh;
    border-radius: 0; border-left: none;
    transform: translateX(100%);
    transition: transform 0.12s ease;
    opacity: 1; pointer-events: auto;
  }
  .drawer.open { transform: translateX(0); }

  /* ---- Desfaz o grid de áreas do desktop → coluna única rolável ---- */
  .drawer-modal-grid {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    grid-template-areas: none !important;
    height: 100%; width: 100%;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 16px; gap: 12px;
  }
  .drawer-modal-grid > .drawer-header,
  .drawer-modal-grid > .drawer-tabs,
  .drawer-modal-grid > .drawer-modal-left,
  .drawer-modal-grid > .drawer-modal-right {
    grid-area: auto !important; width: 100% !important; min-width: 0 !important;
    max-width: 100% !important; overflow: visible !important; height: auto !important;
  }
  .drawer-modal-left, .drawer-modal-right { width: 100% !important; max-width: 100% !important; }
  .drawer-modal-right .dtab { height: auto !important; }

  /* CRÍTICO: a coluna direita (main) contém os KPIs, stats, ordens, gráfico e
     transações. No desktop ela é flex com altura limitada e overflow hidden; no
     mobile precisa fluir com altura automática, senão os dados do item ficam
     colapsados/invisíveis (era o "modal sem dados" dos prints). */
  .drawer-modal-right {
    display: flex !important; flex-direction: column !important;
    flex: none !important; min-height: 0 !important; height: auto !important;
    overflow: visible !important;
  }
  .drawer-modal-right .drawer-body { display: block !important; flex: none !important; height: auto !important; overflow: visible !important; padding: 0 !important; }
  .drawer-modal-right .dtab.active {
    display: flex !important; flex-direction: column !important;
    flex: none !important; height: auto !important; min-height: 0 !important;
    overflow: visible !important; gap: 12px; padding: 0 !important;
  }
  .dov-grid { display: flex !important; flex-direction: column !important; height: auto !important; gap: 12px; }

  /* A aba OVERVIEW já contém TUDO (hero + KPIs + stats + ordens + gráfico +
     transações). Então, como no desktop, escondemos a SIDEBAR quando overview
     está ativa — evita duplicar a imagem e mostra os dados completos. Nas outras
     abas (Atividade/Analytics/Insights) a sidebar aparece normalmente. */
  .drawer[data-active-tab="overview"] .drawer-modal-left { display: none !important; }

  /* ---- CABEÇALHO ---- */
  .drawer-header { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; padding: 2px 0 12px; }
  .drawer-name { font-size: var(--fs-xl); font-weight: 700; line-height: 1.2; width: 100%; }
  .drawer-meta-chips { display: flex; flex-wrap: wrap; gap: 4px; }
  .drawer-header-actions { display: flex; flex-wrap: wrap; gap: 4px; width: 100%; }
  .dh-quick-btn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; font-size: var(--fs-sm); border-radius: 0; }
  .dh-quick-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
  .drawer-refresh-btn { width: 100%; justify-content: center; margin-top: 2px; padding: 8px; font-size: var(--fs-md); }
  .drawer-refresh-btn svg { width: 16px; height: 16px; }

  /* ---- ABAS: roláveis na horizontal ---- */
  .drawer-tabs { display: flex; gap: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch;
    white-space: nowrap; flex-shrink: 0; border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 6%, transparent); }
  .drawer-tab { font-size: var(--fs-md); font-weight: 600; padding: 8px 2px; flex-shrink: 0;
    background: transparent; border: none; border-bottom: 2px solid transparent; color: var(--text-muted); }
  .drawer-tab.active { color: var(--text-primary); border-bottom-color: var(--accent); }

  /* ---- ROWS do overview empilham ---- */
  .dov-grid { display: flex; flex-direction: column; gap: 12px; }
  .dov-row1, .dov-row3, .dov-row4 {
    display: flex !important; flex-direction: column !important;
    grid-template-columns: none !important; height: auto !important; gap: 8px;
  }
  .dov-right-stack { display: flex; flex-direction: column; gap: 8px; min-height: 0; }

  /* ---- HERO (imagem da arma): altura FIXA e contida ---- */
  .dov-hero-card, .drawer-hero {
    position: relative; height: 220px !important; width: 100%;
    border-radius: 0; overflow: hidden; flex-shrink: 0;
  }
  .dov-hero-card .drawer-hero-img, .drawer-hero-img {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  }
  .dov-hero-card .drawer-hero-img img, .drawer-hero-img img {
    max-width: 88%; max-height: 88%; width: auto; height: auto; object-fit: contain;
  }

  /* ---- KPIs (Preço atual, Multiplicador, etc.): 2 colunas, ícone contido ---- */
  .dov-kpi-strip { display: grid !important; grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }
  .dov-kpi-big { display: flex; align-items: center; gap: 12px; padding: 12px 12px; min-height: 0;
    border: 1px solid color-mix(in srgb, var(--text-primary) 7%, transparent); border-radius: 0;
    background: color-mix(in srgb, var(--bg-1) 45%, transparent); overflow: hidden; }
  .dov-kpi-icon-wrap { width: 40px; height: 40px; border-radius: 0; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; }
  /* AQUI o fix do "cifrão gigante": ícone com tamanho FIXO */
  .dov-kpi-icon-wrap svg { width: 20px !important; height: 20px !important; flex-shrink: 0; }
  .dov-kpi-content { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
  .dov-kpi-big-label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em;
    font-weight: 600; color: var(--text-muted); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dov-kpi-big-val { font-family: var(--font-ui); font-size: var(--fs-xl); font-weight: 700;
    line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dov-kpi-big-sub { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* ---- STATS (Estoque, Compras, Vendas, Lucro): 2 colunas ---- */
  .dov-stats { display: grid !important; grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }
  .dov-stat-card { padding: 12px; border-radius: 0; border: 1px solid color-mix(in srgb, var(--text-primary) 7%, transparent);
    display: flex; flex-direction: column; gap: 4px; min-height: 0; }
  .dov-stat-head { display: flex; align-items: center; gap: 4px; }
  .dov-stat-head svg { width: 13px !important; height: 13px !important; opacity: .7; flex-shrink: 0; }
  .dov-stat-label { font-size: var(--fs-xs); color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; }
  .dov-stat-val { font-family: var(--font-ui); font-size: var(--fs-xl); font-weight: 700; line-height: 1.05; }
  .dov-stat-sub { font-size: var(--fs-xs); color: var(--text-muted); }

  /* ---- CARDS de ordens / gráfico / transações: empilhados ---- */
  .dov-card, .ob-card { min-height: 0; width: 100%; border-radius: 0; }
  .dov-card svg, .ob-card svg, .dov-card-head svg, .ob-head svg { width: 18px; height: 18px; flex-shrink: 0; }
  .ob-ico svg { width: 18px !important; height: 18px !important; }
  .dov-card-title, .ob-title { font-size: var(--fs-md); }
  .dov-ob-row { font-size: var(--fs-sm); }

  /* ---- Tabelas internas do modal ---- */
  .dov-trans-table, .dtxs-inline-table { font-size: var(--fs-xs); width: 100%; }
  .dov-trans-table th, .dov-trans-table td { padding: 4px 8px; }

  /* ---- SIDEBAR do modal (Ações rápidas, Informações) ---- */
  .drawer-side-card { padding: 12px; border-radius: 0; border: 1px solid color-mix(in srgb, var(--text-primary) 6%, transparent); }
  .drawer-side-card-title { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 8px; }
  .drawer-side-card a svg, .drawer-side-card button svg { width: 15px !important; height: 15px !important; flex-shrink: 0; }
  /* Ações rápidas: cada ação em linha própria, ícone + texto alinhados */
  .drawer-side-card a, .drawer-side-card button {
    display: flex; align-items: center; gap: 8px; font-size: var(--fs-md);
  }
  /* Informações: rótulo à esquerda, valor à direita, sem colar ("TipoSouvenir") */
  .drawer-info-row, .dov-finrow {
    display: flex !important; justify-content: space-between; align-items: baseline;
    gap: 12px; padding: 8px 0; border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 4%, transparent);
  }
  .drawer-info-row .label, .dov-finrow .label { font-size: var(--fs-sm); color: var(--text-muted); flex-shrink: 0; }
  .drawer-info-row .value, .dov-finrow .value { font-size: var(--fs-sm); color: var(--text-primary); text-align: right; word-break: break-word; }

  /* ---- Gráficos ECharts: nunca limitar o SVG interno ---- */
  .drawer [_echarts_instance_] svg,
  #dovPriceChart svg, #dovPriceChart canvas, #dovPriceChart > div {
    max-width: none !important; max-height: none !important;
  }

  /* ═══════ COMPONENTES INTERNOS DO OVERVIEW (faltavam no mobile) ═══════ */

  /* ---- Cards de seção (Ordens, Gráfico, Transações, Baixa, Resumo) ---- */
  .dov-card, .ob-card {
    background: color-mix(in srgb, var(--bg-1) 50%, transparent);
    border: 1px solid color-mix(in srgb, var(--text-primary) 8%, transparent);
    border-radius: 0;
    padding: 12px 12px;
    display: flex; flex-direction: column;
    min-height: 0; min-width: 0; width: 100%;
    overflow: hidden;
  }
  .dov-card-head, .ob-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-bottom: 8px; flex-shrink: 0; flex-wrap: wrap;
  }
  .dov-card-title, .ob-title {
    font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--text-muted);
  }
  .ob-ico { width: 30px; height: 30px; border-radius: 0; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center; }
  .ob-ico svg { width: 16px !important; height: 16px !important; }
  .ob-sub { font-size: var(--fs-xs); color: var(--text-muted); }
  .ob-total { font-family: var(--font-ui); font-size: var(--fs-lg); font-weight: 700; }
  .ob-total-lbl { font-size: var(--fs-xs); text-transform: uppercase; color: var(--text-muted); }
  .dov-card-body, .ob-body { min-height: 0; overflow-y: auto; max-height: 320px; }

  /* ---- LIVRO DE ORDENS: grid de 3 colunas Preço | Qtd | Total ---- */
  .dov-ob-head {
    display: grid !important; grid-template-columns: 1fr 1fr 1fr;
    gap: 8px; padding: 4px 8px 4px;
    font-size: var(--fs-xs); color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .05em; font-weight: 600;
    border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 5%, transparent); margin-bottom: 2px;
  }
  .dov-ob-head .qty, .dov-ob-head .total { text-align: right; }
  .dov-ob-row {
    position: relative;
    display: grid !important; grid-template-columns: 1fr 1fr 1fr;
    gap: 8px; padding: 4px 8px;
    font-family: var(--font-ui);
    font-size: var(--fs-sm); font-variant-numeric: tabular-nums;
    border-radius: 0; overflow: hidden;
  }
  .dov-ob-row .price, .dov-ob-row .qty, .dov-ob-row .total { position: relative; z-index: 1; }
  .dov-ob-row .qty   { text-align: right; color: var(--text-primary); font-weight: 500; }
  .dov-ob-row .total { text-align: right; color: var(--text-muted); }
  .dov-ob-row .depth-bar { position: absolute; inset: 0; z-index: 0; }
  .dov-ob-row.buy  .price { color: var(--green); font-weight: 600; }
  .dov-ob-row.buy  .depth-bar { background: color-mix(in srgb, var(--green) 2%, transparent); }
  .dov-ob-row.sell .price { color: var(--red); font-weight: 600; }
  .dov-ob-row.sell .depth-bar { background: color-mix(in srgb, var(--red) 2%, transparent); }
  .dov-ob-spread {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px; margin-top: 4px; font-size: var(--fs-sm);
    border-top: 1px solid color-mix(in srgb, var(--text-primary) 5%, transparent); color: var(--text-muted);
  }
  .ob-spread-pct { font-family: var(--font-mono); font-weight: 700; }

  /* ---- GRÁFICO (Histórico de preços): ALTURA EXPLÍCITA, senão o ECharts
     desenha com 0px e o gráfico "não aparece" ---- */
  #dovPriceChart { height: 260px !important; min-height: 260px; width: 100% !important; overflow: hidden; }
  .dpanel-range-tabs { display: flex; gap: 4px; flex-wrap: wrap; }

  /* ---- TRANSAÇÕES: abas + tabela ---- */
  .dov-trans-tabs { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
  .dov-trans-tab {
    font-size: var(--fs-xs); padding: 4px 12px; border-radius: 0;
    background: color-mix(in srgb, var(--text-primary) 4%, transparent); border: 1px solid color-mix(in srgb, var(--text-primary) 7%, transparent);
    color: var(--text-muted);
  }
  .dov-trans-tab.active { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
  .dov-trans-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
  .dov-trans-table th {
    text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em;
    color: var(--text-muted); padding: 4px 8px; border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 6%, transparent);
  }
  .dov-trans-table td { padding: 8px 8px; border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 3%, transparent); }
  .dov-trans-table td.r, .dov-trans-table th.r { text-align: right; }

  /* ---- BAIXA RÁPIDA (formulário) ---- */
  .dov-baixa-form { display: flex; flex-direction: column; gap: 8px; }
  .dov-baixa-form label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
  .dov-baixa-form input, .dov-baixa-form select, .dov-baixa-form textarea {
    width: 100%; padding: 8px 8px; font-size: var(--fs-md); border-radius: 0;
    background: color-mix(in srgb, var(--text-primary) 4%, transparent); border: 1px solid color-mix(in srgb, var(--text-primary) 8%, transparent); color: var(--text-primary);
  }
  .dov-baixa-qty-row { display: flex; align-items: center; gap: 4px; }
  .dov-baixa-qty-btn { width: 36px; height: 36px; flex-shrink: 0; border-radius: 0;
    background: color-mix(in srgb, var(--text-primary) 5%, transparent); border: 1px solid color-mix(in srgb, var(--text-primary) 8%, transparent);
    color: var(--text-primary); font-size: var(--fs-lg); }
  .dov-baixa-submit { width: 100%; padding: 8px; border-radius: 0; font-size: var(--fs-md); font-weight: 700; }
  .dov-baixa-stockafter, .dov-baixa-sugestao { font-size: var(--fs-xs); color: var(--text-muted); }

  /* ---- RESUMO FINANCEIRO ---- */
  .dov-finrow-group { padding: 4px 0; border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 5%, transparent); }
  .dov-finrow-group:last-child { border-bottom: none; }
  .dov-finrow {
    display: flex !important; justify-content: space-between; align-items: baseline;
    gap: 12px; padding: 4px 0; font-size: var(--fs-sm);
  }
  .dov-finrow .label { color: var(--text-secondary); flex-shrink: 0; }
  .dov-finrow .val { font-family: var(--font-ui); font-weight: 600; text-align: right; }
  .dov-finrow .val.pos { color: var(--green); } .dov-finrow .val.neg { color: var(--red); }
  .dov-finrow .val.blue { color: var(--blue); } .dov-finrow .val.amber { color: var(--accent); }

  /* ---- dtxs (transações inline) ---- */
  .dtxs-inline-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
  .dtxs-inline-table { width: 100%; font-size: var(--fs-xs); border-collapse: collapse; }
  .dtxs-inline-table td, .dtxs-inline-table th { padding: 4px 8px; }
}

/* ───────── CELULAR (≤ 640px) ───────── */
@media (max-width: 640px) {
  /* Topbar compacta */
  .topbar { padding: 8px 12px; gap: 8px; flex-wrap: wrap; }
  .search-wrap { min-width: 0; flex: 1; }
  .search-wrap .kbd { display: none; }
  .content { padding: 12px; }

  /* ═══ TABELA no CELULAR: cada linha vira um CARD ═══
     Nada de scroll horizontal: o item fica no topo (foto + nome + ações) e
     as colunas visíveis viram uma grade de dados com rótulos pequenos —
     o mesmo conteúdo, legível de verdade num celular. Os rótulos vêm do
     data-label injetado em cada célula pelo buildInvRowHtml. */
  .inv-table-card { overflow-x: visible; }
  .inv-table { min-width: 0 !important; width: 100%; }
  .inv-table thead { display: none; }
  .inv-table tbody { display: block; }
  .inv-table tbody tr {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px 12px;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid color-mix(in srgb, var(--text-primary) 7%, transparent) !important;
    border-radius: 0;
    background: color-mix(in srgb, var(--bg-1) 35%, transparent);
    min-height: 0 !important;
  }
  .inv-table td {
    display: block !important;
    padding: 0 !important;
    border: none !important;
    white-space: normal !important;
    font-size: var(--fs-md);
    min-width: 0;
  }
  /* Célula do ITEM: ocupa a largura toda no topo do card (anula o sticky
     e a largura fixa herdados do bloco tablet) */
  .inv-table td[data-col="name"] {
    grid-column: 1 / -1;
    position: static !important;
    width: auto !important; max-width: none !important;
    background: transparent !important; box-shadow: none;
    border-bottom: 1px solid color-mix(in srgb, var(--text-primary) 6%, transparent) !important;
    padding-bottom: 8px !important;
  }
  .item-cell { display: flex; align-items: center; gap: 8px; }
  .item-thumb-lg { width: 44px; height: 44px; flex-shrink: 0; }
  .item-name { font-size: var(--fs-md); line-height: 1.3; white-space: normal; }
  .item-sub { font-size: var(--fs-xs); }
  /* Ações (copiar/steam) compactas ao lado do nome */
  .row-actions { grid-template-rows: 1fr !important; opacity: 1 !important; margin-top: 4px; }
  .row-actions-inner { gap: 4px; }
  .row-action-btn { padding: 4px 8px; font-size: var(--fs-xs); border-radius: 0; }
  .row-action-btn svg { width: 13px; height: 13px; }

  /* Demais células: rótulo pequeno em cima, valor embaixo */
  .inv-table td:not([data-col="name"])::before {
    content: attr(data-label);
    display: block;
    font-size: var(--fs-xs); font-weight: 600;
    text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: 2px;
  }
  .inv-table td:not([data-col="name"]) {
    font-family: var(--font-ui);
    font-variant-numeric: tabular-nums;
  }
  /* Badge de tipo e sparkline cabem no chip normalmente */

  .inv-table td[data-col="change"] svg { max-width: 100%; }

  /* Cabeçalho da view + botões viram coluna */
  .view-header { flex-direction: column; align-items: stretch; gap: 8px; }
  .view-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .view-actions .btn-secondary, .view-actions .btn-primary { flex: 1 1 auto; justify-content: center; min-width: 0; }

  /* (O modal/drawer é tratado no bloco @media max-width:1024px acima, que
     cobre celular e tablet com dimensionamento completo.) */

  /* Diálogos (export, backup, ocultos) ocupam quase a tela */
  .hidden-modal { width: 94vw !important; max-height: 88vh; }
  .exp-btns { flex-direction: column; }
  .exp-btns button { min-width: 0; }
}

/* ───────── CELULAR EM PAISAGEM (altura baixa) ───────── */
@media (max-width: 900px) and (orientation: landscape) {
  .dov-row1 { height: auto !important; }
  .dov-hero-card, .drawer-hero { height: 180px; }
  .drawer-header { padding: 8px 12px; }
}

/* Toques mais confortáveis (alvos maiores) em telas touch */
@media (hover: none) and (pointer: coarse) {
  .nav-item, .dh-quick-btn, .row-action-btn, .btn-secondary, .btn-primary { min-height: 40px; }
  .data-table tbody tr { min-height: 48px; }
}

/* ═══════════════════════════════════════════════════════════════════
   MOVIMENTAÇÕES (fase 3, 18/11/2026) — livro de compras e vendas
═══════════════════════════════════════════════════════════════════ */
.mv-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 12px; }
.mv-search { flex: 1 1 220px; min-width: 160px; padding: 8px 12px; border-radius: 0; font-size: var(--fs-md);
  background: var(--bg-1); border: 1px solid var(--border); color: var(--text-primary); }
.mv-select { padding: 8px 8px; border-radius: 0; font-size: var(--fs-md); background: var(--bg-1);
  border: 1px solid var(--border); color: var(--text-primary); }
.mv-custom { display: inline-flex; align-items: center; gap: 4px; }
.mv-custom[hidden] { display: none; }
.mv-ate { font-size: var(--fs-sm); color: var(--text-muted); }
.mv-clear { padding: 8px 12px; border-radius: 0; font-size: var(--fs-sm); background: transparent;
  border: 1px solid var(--border); color: var(--text-muted); cursor: pointer; }
.mv-clear:hover { color: var(--text-primary); }
.mv-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 12px; }
.mv-card { padding: 0; overflow: hidden; }
.mv-bulk { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 12px; background: color-mix(in srgb, var(--accent) 8%, transparent); border-bottom: 1px solid var(--border); font-size: var(--fs-md); }
.mv-bulk[hidden] { display: none; }
.mv-danger { color: var(--red) !important; border-color: color-mix(in srgb, var(--red) 35%, transparent) !important; }
.mv-table-wrap { overflow-x: auto; }
.mv-table { width: 100%; min-width: 900px; }
.mv-table th, .mv-table td { padding: 8px 12px; font-size: var(--fs-md); white-space: nowrap; vertical-align: middle; }
.mv-table td.r, .mv-table th.r { text-align: right; }
.mv-table tbody tr { cursor: default; content-visibility: visible; contain: none; }
.mv-table tbody.mv-loading { opacity: .5; transition: opacity 0.12s; }
.mv-chk { width: 34px; }
.mv-act { width: 64px; text-align: right; }
.mv-type { display: inline-block; padding: 2px 8px; border-radius: 0; font-size: var(--fs-xs); font-weight: 600; }
.mv-type.buy  { color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); }
.mv-type.sell { color: var(--yellow); background: color-mix(in srgb, var(--yellow) 12%, transparent); }
.mv-item-cell { max-width: 340px; white-space: normal; }
.mv-item { background: none; border: none; padding: 0; color: var(--text-primary); font: inherit; font-weight: 600;
  text-align: left; cursor: pointer; }
.mv-item:hover { color: var(--accent); text-decoration: underline; }
.mv-reason { display: block; font-size: var(--fs-xs); color: var(--text-muted); }
.mv-pnl .mv-pct { display: block; font-size: var(--fs-xs); }
.mv-pnl .up, .mv-pct.up { color: var(--green); }
.mv-pnl .down, .mv-pct.down { color: var(--red); }
.mv-muted { color: var(--text-muted); }
.mv-src { color: var(--text-secondary); font-size: var(--fs-sm); }
.mv-icon { width: 26px; height: 26px; border-radius: 0; border: 1px solid var(--border); background: transparent;
  color: var(--text-muted); cursor: pointer; margin-left: 4px; font-size: var(--fs-sm); line-height: 1; }
.mv-icon:hover { color: var(--text-primary); border-color: var(--border-strong, var(--border-strong)); }
.mv-del:hover { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.mv-empty { text-align: center; padding: 32px 12px !important; color: var(--text-muted); white-space: normal !important; }
.mv-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 8px 12px; border-top: 1px solid var(--border); font-size: var(--fs-md); color: var(--text-secondary); }
.mv-pager-btns { display: inline-flex; align-items: center; gap: 4px; }
.mv-pager-btns button { padding: 4px 8px; border-radius: 0; border: 1px solid var(--border); background: var(--bg-1);
  color: var(--text-primary); cursor: pointer; font-size: var(--fs-sm); }
.mv-pager-btns button:disabled { opacity: .35; cursor: default; }
.mv-pageno { min-width: 64px; text-align: center; font-family: var(--font-ui); }
.mv-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.mv-form label { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); color: var(--text-muted); }
.mv-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mv-form-total { font-size: var(--fs-md); color: var(--text-secondary); font-family: var(--font-ui); }

@media (max-width: 1024px) {
  .mv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Celular: cada movimentação vira um cartão com rótulos (mesma técnica do Inventário) */
@media (max-width: 640px) {
  .mv-filters { gap: 4px; }
  .mv-search { flex-basis: 100%; }
  .mv-select { flex: 1 1 45%; min-width: 0; }
  .mv-table { min-width: 0; }
  .mv-table thead { display: none; }
  .mv-table, .mv-table tbody { display: block; }
  .mv-table tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 8px;
    padding: 12px; border-bottom: 1px solid var(--border); position: relative; }
  .mv-table td { display: block; padding: 0 !important; white-space: normal; text-align: left !important; border: none !important; }
  .mv-table td[data-label]::before { content: attr(data-label); display: block; font-size: var(--fs-xs); font-weight: 600;
    text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 2px; }
  .mv-table td.mv-chk { position: absolute; top: 12px; right: 12px; width: auto; }
  .mv-table td.mv-item-cell { grid-column: 1 / -1; order: -1; padding-right: 32px !important; max-width: none; }
  .mv-table td.mv-act { grid-column: 1 / -1; text-align: right !important; }
  .mv-table td.mv-empty { grid-column: 1 / -1; }
  .mv-pager { justify-content: center; }
  .mv-form-row { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════
   PAINEL (fase 3, 18/11/2026) — como está a carteira hoje
═══════════════════════════════════════════════════════════════════ */
.pn-cards { grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.25fr); margin-bottom: 12px; }
.pn-card .value { font-size: var(--fs-xl); }
.pn-card .sub b { color: var(--text-primary); font-family: var(--font-ui); }
.pn-card .value.up { color: var(--green); }
.pn-card .value.down { color: var(--red); }
.pn-card-var { display: flex; flex-direction: column; gap: 2px; }
.pn-card-var .label { margin-bottom: 2px; cursor: help; }
.pn-var-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 8px; align-items: baseline;
  font-family: var(--font-ui); font-size: var(--fs-md); }
.pn-var-row span { color: var(--text-muted); font-family: 'Sora', system-ui, sans-serif; font-size: var(--fs-sm); }
.pn-var-row b { font-weight: 700; }
.pn-var-row em { font-style: normal; font-size: var(--fs-xs); }
.pn-loading { grid-column: 1 / -1; padding: 24px; text-align: center; color: var(--text-muted);
  border: 1px dashed var(--border); border-radius: 0; }
.pn-reload { display: inline-flex; align-items: center; gap: 4px; }
.pn-reload.running { opacity: .6; pointer-events: none; }
.pn-reload.running svg { animation: pnSpin 1s linear infinite; }
@keyframes pnSpin { to { transform: rotate(360deg); } }

.pn-row { display: grid; gap: 12px; margin-bottom: 12px; }
.pn-row-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.pn-row-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.pn-row > .card { min-width: 0; }
.pn-evo-chart { height: 260px; width: 100%; }
.pn-legend { display: flex; gap: 12px; font-size: var(--fs-xs); color: var(--text-secondary); margin: -4px 0 4px; }
.pn-legend span { display: inline-flex; align-items: center; gap: 4px; }
.pn-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 0; }
.pn-legend i.dash { background: var(--text-secondary) 0; }
.pn-note { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: 8px; line-height: 1.5; }
.pn-note b.up, .pn-note .up { color: var(--green); }
.pn-note b.down, .pn-note .down { color: var(--red); }
.pn-empty { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 120px;
  color: var(--text-muted); font-size: var(--fs-sm); text-align: center; padding: 12px; }
.pn-empty.sm { min-height: 60px; }

/* Altas e quedas */
.pn-movers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pn-col-title { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.pn-mover { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 4px 4px; border-radius: 0; cursor: pointer; }
.pn-mover:hover { background: var(--bg-2); }
.pn-thumb { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pn-thumb img { max-width: 30px; max-height: 30px; }
.pn-mover-txt { min-width: 0; }
.pn-mover-name { font-size: var(--fs-md); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-mover-sub { font-size: var(--fs-xs); color: var(--text-muted); font-family: var(--font-ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-mover-val { text-align: right; font-family: var(--font-ui); }
.pn-mover-val b { display: block; font-size: var(--fs-md); }
.pn-mover-val em { display: block; font-style: normal; font-size: var(--fs-xs); }

/* Distribuição */
.pn-dist { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; padding-right: 2px; }
.pn-dist-row { padding: 4px 4px; border-radius: 0; }
.pn-dist-row.clickable { cursor: pointer; }
.pn-dist-row.clickable:hover { background: var(--bg-2); }
.pn-dist-head { display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-md); }
.pn-dist-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.pn-dist-name i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pn-dist-val { font-family: var(--font-ui); white-space: nowrap; }
.pn-dist-val em { font-style: normal; color: var(--text-muted); font-size: var(--fs-xs); margin-left: 4px; }
.pn-bar { height: 5px; background: var(--bg-3); border-radius: 0; margin: 4px 0 4px; overflow: hidden; }
.pn-bar div { height: 100%; border-radius: 0; }
.pn-dist-sub { font-size: var(--fs-xs); color: var(--text-muted); }

/* Avisos */
.pn-alerts { display: flex; flex-direction: column; gap: 8px; }
.pn-alert { border: 1px solid var(--border); border-left-width: 3px; border-radius: 0; padding: 8px 12px; background: var(--bg-2); }
.pn-alert.good { border-left-color: var(--green); }
.pn-alert.warn { border-left-color: var(--yellow); }
.pn-alert.muted { border-left-color: var(--border-strong); }
.pn-alert-title { font-size: var(--fs-md); font-weight: 700; }
.pn-alert-body { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: 4px; line-height: 1.55; }
.pn-alert-body b { color: var(--text-primary); }
.pn-link { margin-top: 4px; background: none; border: none; padding: 0; color: var(--accent); font: inherit;
  font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.pn-link:hover { text-decoration: underline; }
.pn-item-link { background: none; border: none; padding: 0; color: var(--text-primary); font: inherit; font-size: var(--fs-sm);
  font-weight: 600; cursor: pointer; text-align: left; }
.pn-item-link:hover { color: var(--accent); text-decoration: underline; }

@media (max-width: 1280px) {
  .pn-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pn-card-var { grid-column: 1 / -1; }
  .pn-row-1, .pn-row-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .pn-card .value { font-size: var(--fs-lg); }
  .pn-movers { grid-template-columns: minmax(0, 1fr); }
  .pn-evo-chart { height: 220px; }
  .pn-dist { max-height: none; }
}

/* ── Preço suspeito (mercado raso): item avaliado pela maior ordem de compra ── */
.badge-suspect {
  display: inline-block; font-size: var(--fs-xs); font-weight: 700; padding: 2px 8px; margin-left: 4px;
  border-radius: 0; background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue);
  border: 1px solid color-mix(in srgb, var(--blue) 40%, transparent); vertical-align: middle; white-space: nowrap; cursor: help;
}
.badge-suspect.warn { background: color-mix(in srgb, var(--yellow) 15%, transparent); color: var(--yellow); border-color: color-mix(in srgb, var(--yellow) 40%, transparent); }
.price-list-sub { display: block; font-size: var(--fs-xs); color: var(--text-muted); }
.price-list-sub.strike { text-decoration: line-through; }

/* ── Configurações → Carteira: forma de avaliação ── */
.val-intro { font-size: var(--fs-md); color: var(--text-secondary); margin: 0 0 12px; line-height: 1.5; }
.val-options { display: flex; flex-direction: column; gap: 8px; }
.val-opt { display: grid; grid-template-columns: 20px 1fr; gap: 8px; align-items: start; padding: 12px 12px;
  border: 1px solid var(--border); border-radius: 0; background: var(--bg-2); cursor: pointer; }
.val-opt:hover { border-color: var(--border-strong); }
.val-opt.active { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.val-opt input { margin-top: 2px; accent-color: var(--accent); }
.val-name { font-size: var(--fs-md); font-weight: 700; }
.val-opt p { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: 2px; line-height: 1.5; }
.val-tag { font-size: var(--fs-xs); font-weight: 700; padding: 1px 4px; border-radius: 0; margin-left: 4px;
  background: var(--bg-3); color: var(--text-secondary); vertical-align: middle; }
.val-note { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 12px; line-height: 1.5; }
.val-status { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: 8px; min-height: 16px; }

/* ── Configurações → Carteira: taxas por origem ── */
.cfg-tab-panel[data-cfgpanel="carteira"] .cfg-card + .cfg-card { margin-top: 12px; }
.fee-grid { display: flex; flex-direction: column; gap: 4px; }
.fee-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 0; background: var(--bg-2); }
.fee-row b { display: block; font-size: var(--fs-md); }
.fee-row em { display: block; font-style: normal; font-size: var(--fs-sm); color: var(--text-secondary); margin-top: 2px; line-height: 1.45; }
.fee-in { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-md); color: var(--text-secondary); white-space: nowrap; }
.fee-in input { width: 78px; padding: 8px 8px; border-radius: 0; border: 1px solid var(--border); background: var(--bg-1);
  color: var(--text-primary); font-family: var(--font-ui); font-size: var(--fs-md); text-align: right; }
.fee-rules { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: 12px; line-height: 1.5; padding: 8px 12px;
  border-radius: 0; background: var(--bg-2); border: 1px dashed var(--border); }
.fee-rules b { color: var(--text-primary); }
.fee-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.fee-actions .val-status { margin-top: 0; }
@media (max-width: 640px) { .fee-row { grid-template-columns: 1fr; } }
.mv-type.external { color: var(--purple); background: color-mix(in srgb, var(--purple) 12%, transparent); }
.mv-type.trade    { color: var(--text-secondary); background: var(--bg-3); }
.mv-type.use, .mv-type.loss { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }

/* ═══════════════════════════════════════════════════════════════════
   DESEMPENHO (fase 3, 20/11/2026)
═══════════════════════════════════════════════════════════════════ */
.ds-cards { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 12px; }
.ds-cards .pn-card .sub { line-height: 1.45; }
.pn-card .value.warn { color: var(--yellow); }
.ds-month-card, .ds-group-card, .ds-rank-card { margin-bottom: 12px; }
.ds-head-tabs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ds-month-chart { height: 280px; width: 100%; }
.ds-table-wrap { overflow-x: auto; }
.ds-table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.ds-table th { font-size: var(--fs-xs); letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); font-weight: 700;
  text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ds-table td { padding: 8px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ds-table .r { text-align: right; }
.ds-table .mono { font-family: var(--font-ui); }
.ds-table td.up { color: var(--green); } .ds-table td.down { color: var(--red); }
.ds-table tr.clickable { cursor: pointer; }
.ds-table tr.clickable:hover td { background: var(--bg-2); }
.ds-table tr.ds-total td { border-top: 2px solid var(--border-strong); border-bottom: none; }
.ds-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.ds-row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.ds-row3 > .card { min-width: 0; }
.ds-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.ds-sub-title { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin: 12px 0 4px; }
.ds-line { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; background: none; border: none;
  padding: 4px 4px; border-radius: 0; cursor: pointer; text-align: left; font: inherit; color: var(--text-primary); }
.ds-line:hover { background: var(--bg-2); }
.ds-line span { font-size: var(--fs-sm); font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-line em { font-style: normal; font-size: var(--fs-xs); color: var(--text-muted); font-family: var(--font-ui); }
@media (max-width: 1400px) { .ds-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .ds-row3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .ds-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ds-month-chart { height: 230px; }
  .ds-table thead { display: none; }
  .ds-table, .ds-table tbody, .ds-table tr, .ds-table td { display: block; width: 100%; }
  .ds-table tr { border: 1px solid var(--border); border-radius: 0; margin-bottom: 8px; padding: 4px 4px; }
  .ds-table td { border: none; padding: 2px 8px; display: flex; justify-content: space-between; text-align: right; }
  .ds-table td::before { content: attr(data-label); color: var(--text-muted); font-size: var(--fs-xs); text-align: left; margin-right: 8px; }
}

/* ═══════════════════════════════════════════════════════════════════
   ATUALIZAÇÃO (fase 3, 20/11/2026) — tela própria
═══════════════════════════════════════════════════════════════════ */
.up-top { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; margin-bottom: 12px; }
.up-top > .card { min-width: 0; }
.up-cov { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.up-cov-item { border: 1px solid var(--border); border-left-width: 3px; border-radius: 0; padding: 8px 12px; background: var(--bg-2); }
.up-cov-item .label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.up-cov-item .value { font-family: var(--font-ui); font-size: var(--fs-xl); font-weight: 700; margin-top: 4px; }
.up-cov-item .value em { font-style: normal; font-size: var(--fs-xs); color: var(--text-muted); font-weight: 500; }
.up-cov-item .sub { font-size: var(--fs-xs); color: var(--text-secondary); margin-top: 2px; }
.up-cov-item.day { border-left-color: var(--green); } .up-cov-item.week { border-left-color: var(--blue); }
.up-cov-item.old { border-left-color: var(--yellow); } .up-cov-item.never { border-left-color: var(--red); }
.up-cov-bar { display: flex; height: 8px; border-radius: 0; overflow: hidden; margin: 12px 0 4px; background: var(--bg-3); }
.up-cov-bar .day { background: var(--green); } .up-cov-bar .week { background: var(--blue); }
.up-cov-bar .old { background: var(--yellow); } .up-cov-bar .never { background: var(--red); }
.up-sel-intro { font-size: var(--fs-sm); color: var(--text-secondary); margin: 4px 0 8px; line-height: 1.5; }
.up-sel-opts { display: flex; flex-direction: column; gap: 4px; }
.up-sel-opts .val-opt { padding: 8px 12px; }
.up-n { width: 64px; padding: 2px 4px; border-radius: 0; border: 1px solid var(--border); background: var(--bg-1);
  color: var(--text-primary); font-family: var(--font-ui); font-size: var(--fs-sm); text-align: right; }
.up-engines { min-width: 0; }
@media (max-width: 1100px) { .up-top { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .up-cov { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── Modal do item: abas Movimentações e Anotações e alvos (20/11/2026) ── */
.dmoves-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.dmoves-head .pn-link { margin-top: 0; }
.dmoves-wrap { max-height: 420px; overflow: auto; }
.dmoves-table { width: 100%; font-size: var(--fs-sm); }
.dmoves-table th, .dmoves-table td { padding: 8px 8px; white-space: nowrap; }
.dmoves-table .up { color: var(--green); } .dmoves-table .down { color: var(--red); }
.dnotes-targets { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.dnotes-targets label { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); color: var(--text-secondary); }
.dnotes-targets input, .dnotes textarea { padding: 8px 12px; border-radius: 0; border: 1px solid var(--border); background: var(--bg-1);
  color: var(--text-primary); font: inherit; font-size: var(--fs-md); }
.dnotes-targets input { font-family: var(--font-ui); }
.dnotes-targets em { font-style: normal; font-size: var(--fs-xs); color: var(--text-muted); min-height: 14px; }
.dnotes-targets em .up { color: var(--green); font-weight: 600; }
.dnotes textarea { width: 100%; margin-top: 8px; resize: vertical; line-height: 1.5; box-sizing: border-box; }
.dnotes-help { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 8px; line-height: 1.5; }
@media (max-width: 640px) { .dnotes-targets { grid-template-columns: 1fr; } }

/* ═══════════════════════════════════════════════════════════════════
   INVENTÁRIO — filtros salvos, agrupamento, seleção em lote (20/11/2026)
═══════════════════════════════════════════════════════════════════ */
.inv-views { position: relative; }
.inv-views-menu { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 260px; max-width: 340px;
  background: var(--bg-1); border: 1px solid var(--border-strong); border-radius: 0; padding: 4px; box-shadow: var(--shadow-float); }
.inv-views-menu.open { display: block; }
.inv-view-item { display: flex; align-items: center; gap: 4px; }
.inv-view-apply { flex: 1; text-align: left; background: none; border: none; color: var(--text-primary); font: inherit; font-size: var(--fs-md);
  padding: 8px 8px; border-radius: 0; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-view-apply:hover { background: var(--bg-2); }
.inv-view-del { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px 8px; border-radius: 0; }
.inv-view-del:hover { color: var(--red); background: var(--bg-2); }
.inv-view-save { width: 100%; margin-top: 4px; padding: 8px 8px; border-radius: 0; border: 1px dashed var(--border-strong);
  background: none; color: var(--accent); font: inherit; font-size: var(--fs-md); font-weight: 600; cursor: pointer; text-align: left; }
.inv-views-empty { font-size: var(--fs-sm); color: var(--text-muted); padding: 8px 8px; }
.inv-groupby { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); color: var(--text-secondary); }
.inv-groupby select { padding: 8px 8px; border-radius: 0; border: 1px solid var(--border); background: var(--bg-2); color: var(--text-primary); font: inherit; font-size: var(--fs-md); }
#btnSelectMode.active { border-color: var(--accent); color: var(--accent); }

.inv-group-row td { background: var(--bg-2); padding: 0 !important; border-bottom: 1px solid var(--border-strong); cursor: pointer; }
.inv-group-row:hover td { background: var(--bg-3); }
.inv-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; font-size: var(--fs-md); }
.inv-group-caret { color: var(--text-muted); width: 12px; }
.inv-group-name { font-size: var(--fs-md); }
.inv-group-n { color: var(--text-muted); font-size: var(--fs-sm); }
.inv-group-tot { margin-left: auto; color: var(--text-secondary); font-family: var(--font-ui); font-size: var(--fs-sm); }
.inv-group-tot .up { color: var(--green); } .inv-group-tot .down { color: var(--red); }
.inv-group-sel { background: none; border: 1px solid var(--border-strong); color: var(--text-secondary); border-radius: 0; padding: 2px 8px; font: inherit; font-size: var(--fs-xs); cursor: pointer; }
.inv-group-sel:hover { color: var(--accent); border-color: var(--accent); }

.inv-sel, .inv-sel-th { width: 34px; text-align: center; padding-left: 8px !important; padding-right: 0 !important; }
.inv-sel input, .inv-sel-th input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.inv-table tr.inv-selected td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.inv-bulk { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px; margin-bottom: 8px; border-radius: 0; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); background: var(--bg-1); }
.inv-bulk-info { font-size: var(--fs-md); color: var(--text-secondary); }
.inv-bulk-info b { color: var(--text-primary); }
.inv-bulk-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.inv-bulk-btns .btn-secondary { padding: 4px 8px; font-size: var(--fs-sm); }
.inv-bulk-btns .btn-secondary[disabled] { opacity: .45; pointer-events: none; }
.inv-tgt-row { display: grid; grid-template-columns: 130px 1fr 110px; gap: 8px; align-items: center; font-size: var(--fs-md); }
.inv-dialog .mv-form-total .up { color: var(--green); } .inv-dialog .mv-form-total .down { color: var(--red); }
.inv-dialog-status { font-size: var(--fs-sm); color: var(--yellow); min-height: 16px; margin: 4px 0 2px; }

.inv-target { font-family: var(--font-ui); font-size: var(--fs-sm); color: var(--text-secondary); white-space: nowrap; }
.inv-target.hit { color: var(--green); font-weight: 700; }
.inv-note-ico { font-size: var(--fs-sm); cursor: help; margin-left: 4px; }

@media (max-width: 640px) {
  .inv-group { padding: 8px 12px; }
  .inv-group-tot { margin-left: 0; width: 100%; }
  .inv-table tr.inv-group-row { display: block; }
  .inv-table tr.inv-group-row td { display: block; width: 100%; }
  .inv-table td.inv-sel { position: absolute; top: 10px; right: 10px; width: auto; }
  .inv-table td.inv-sel::before { content: none !important; }
  .inv-tgt-row { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════
   TAGS e ORGANIZAÇÃO (fase 4, 20/11/2026)
═══════════════════════════════════════════════════════════════════ */
.tag-chip { display: inline-block; font-size: var(--fs-xs); font-weight: 700; padding: 2px 8px; margin: 1px 4px 1px 0; border-radius: 0;
  color: var(--tag); background: color-mix(in srgb, var(--tag) 14%, transparent); border: 1px solid color-mix(in srgb, var(--tag) 45%, transparent); white-space: nowrap; }
.inv-tags-cell { max-width: 220px; white-space: normal !important; }
.tag-toggle { font: inherit; font-size: var(--fs-sm); font-weight: 600; padding: 4px 8px; margin: 0 4px 4px 0; border-radius: 0; cursor: pointer;
  color: var(--text-secondary); background: var(--bg-2); border: 1px dashed var(--border-strong); }
.tag-toggle.on { color: var(--tag); background: color-mix(in srgb, var(--tag) 14%, transparent); border: 1px solid color-mix(in srgb, var(--tag) 55%, transparent); }
.dnotes-tags { margin-top: 8px; }
.dnotes-newtag { display: inline-flex; gap: 4px; vertical-align: top; }
.dnotes-newtag input { width: 130px; padding: 4px 8px; border-radius: 0; border: 1px solid var(--border); background: var(--bg-1); color: var(--text-primary); font: inherit; font-size: var(--fs-sm); }
.dnotes-newtag button { padding: 4px 8px; border-radius: 0; border: 1px solid var(--border-strong); background: var(--bg-2); color: var(--text-secondary); font: inherit; font-size: var(--fs-sm); cursor: pointer; }

.org-tabs { margin-bottom: 12px; display: inline-flex; }
.org-panel { min-height: 200px; }
.org-newtag { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.org-newtag .unrec-input { flex: 1; min-width: 240px; }
.org-swatches { display: inline-flex; gap: 4px; }
.org-swatch input { display: none; }
.org-swatch i { display: block; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; }
.org-swatch input:checked + i { border-color: var(--text-primary); }
.org-tag-list { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.org-tag { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 8px; border: 1px solid var(--border); border-radius: 0; background: var(--bg-2); }
.org-tag-color { width: 30px; height: 30px; padding: 0; border: none; background: none; cursor: pointer; }
.org-tag-name { width: 200px; font-weight: 600; }
.org-tag-stats { flex: 1; font-size: var(--fs-sm); color: var(--text-secondary); }
.org-tag-stats .up { color: var(--green); } .org-tag-stats .down { color: var(--red); }
.org-tag .pn-link { margin-top: 0; }
.org-del { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: var(--fs-lg); padding: 4px 8px; border-radius: 0; }
.org-del:hover { color: var(--red); background: var(--bg-3); }
.org-note { white-space: normal !important; max-width: 340px; font-size: var(--fs-sm); color: var(--text-secondary); }
.org-unrec-list, .org-hidden-list, .org-ren-list { display: flex; flex-direction: column; gap: 4px; }
.org-unrec { padding: 8px 12px; border: 1px solid var(--border); border-left: 3px solid var(--yellow); border-radius: 0; background: var(--bg-2); }
.org-unrec-name { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: var(--fs-md); }
.org-unrec-name span { color: var(--text-muted); font-size: var(--fs-sm); }
.org-unrec-fix { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.org-unrec-fix .unrec-input { flex: 1; min-width: 260px; }
.org-unrec-fix button { padding: 4px 12px; font-size: var(--fs-sm); }
.org-ren { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-sm); padding: 4px 8px; border-radius: 0; background: var(--bg-2); }
.org-ren em { font-style: normal; color: var(--text-muted); }
.org-ren .pn-link { margin: 0 0 0 auto; }
.org-hidden { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 8px; border: 1px solid var(--border); border-radius: 0; background: var(--bg-2); font-size: var(--fs-md); }
.org-hidden-name { flex: 1; font-weight: 600; min-width: 200px; }
.org-hidden button { padding: 4px 8px; font-size: var(--fs-sm); }
@media (max-width: 640px) { .org-tag-name { width: 100%; } .org-newtag .unrec-input, .org-unrec-fix .unrec-input { min-width: 0; width: 100%; } }

/* ═══════════════════════════════════════════════════════════════════
   REESTRUTURAÇÃO DE LAYOUT (20/11/2026) — quadrado, dois temas, densidade
   Fica no fim do arquivo de propósito: estas regras valem sobre as antigas.
   Medidas vêm das variáveis do :root (tema e densidade).
═══════════════════════════════════════════════════════════════════ */
.grain { display: none; }
html { scrollbar-color: var(--border-strong) transparent; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
button:focus:not(:focus-visible) { outline: none; }

/* Botão de recolher o menu: só no computador (no celular o menu já abre por cima) */
.nav-toggle { display: none; }
/* Moldura: menu de 200 px (recolhível para 48 px) e topo de 40/48 px */
@media (min-width: 1025px) {
  .sidebar { width: var(--sidebar-w); }
  :root[data-nav="mini"] .sidebar { width: 48px; }
  :root[data-nav="mini"] .logo { padding: 8px 6px; justify-content: center; }
  :root[data-nav="mini"] .logo > div:not(.logo-mark),
  :root[data-nav="mini"] .nav-section,
  :root[data-nav="mini"] .nav-item span,
  :root[data-nav="mini"] .sidebar-footer { display: none; }
  :root[data-nav="mini"] .nav { padding: 4px 6px; }
  :root[data-nav="mini"] .nav-item { justify-content: center; padding: 8px 0; }
  .nav-toggle { display: flex !important; }
}
.logo { padding: 12px 12px; }
.logo-mark { width: 28px; height: 28px; background: var(--accent); }
.nav { padding: 0 8px 12px; }
.nav-section { padding: 12px 8px 4px; }
.nav-item { padding: 0 8px; min-height: 32px; border-left: 2px solid transparent; }
.nav-item.active { border-left-color: var(--accent); background: var(--bg-3); }
.sidebar-footer { padding: 12px; gap: 8px; }
.topbar { min-height: var(--topbar-h); padding: 4px 16px; gap: 8px; }
.search-wrap input { padding: 4px 56px 4px 32px; min-height: 28px; border: 1px solid var(--line-ctl); }
.pill-select { min-height: 28px; padding: 0 8px; }
.icon-btn { width: 28px; height: 28px; }
#btnTheme svg { display: none; }
#btnTheme[data-mode="system"] .ico-sys, #btnTheme[data-mode="light"] .ico-light, #btnTheme[data-mode="dark"] .ico-dark { display: block; }

/* Conteúdo: título e ações numa linha, respiros menores */
.content { padding: 12px 16px 16px; gap: 8px; }
.view-header { align-items: center; margin-bottom: 0; min-height: 32px; }
.view-title { font-size: var(--fs-xl); line-height: 1.2; }
.view-sub { font-size: var(--fs-sm); margin-top: 0; }
.view-header > div:first-child { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.card { padding: 12px; }
.card-strong { border-radius: 0; }
.cfg-card { padding: 12px 16px; }

/* Controles: altura da barra, borda com contraste 3:1 */
.btn-primary, .btn-secondary, .filter-btn-advanced { min-height: var(--bar-h); padding: 0 12px; font-size: var(--fs-sm); }
.btn-secondary, .filter-btn-advanced { border: 1px solid var(--line-ctl); }
.btn-icon { width: var(--bar-h); height: var(--bar-h); border: 1px solid var(--line-ctl); }
.cfg-input, .unrec-input, .filter-search input, .inv-groupby select, .mv-filters input, .mv-filters select {
  border: 1px solid var(--line-ctl); border-radius: 0; min-height: var(--bar-h);
}
.filter-search input { padding-top: 0; padding-bottom: 0; }
.filters-bar { gap: 8px; flex-wrap: wrap; align-items: center; }
.range-tabs { border-radius: 0; gap: 0; padding: 0; border: 1px solid var(--line-ctl); }
.range-tab { border-radius: 0; padding: 4px 12px; border-right: 1px solid var(--border); }
.range-tab:last-child { border-right: none; }
.range-tab.active { background: var(--accent); color: var(--on-accent); }
.cfg-tabs { gap: 0; border-bottom: 1px solid var(--border); }
.cfg-tab { border-radius: 0; border-bottom: 2px solid transparent; }
.cfg-tab.active { border-bottom-color: var(--accent); }

/* Menu "Mais" */
.more-wrap { position: relative; }
.more-menu { display: none; position: absolute; right: 0; top: calc(100% + 4px); z-index: 60; min-width: 180px;
  background: var(--bg-1); border: 1px solid var(--border-strong); box-shadow: var(--shadow-float); padding: 4px 0; }
.more-wrap.open .more-menu { display: block; }
.more-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 0 12px; min-height: 32px;
  font-size: var(--fs-sm); color: var(--text-primary); text-align: left; }
.more-item:hover { background: var(--bg-2); }
.filters-bar .filter-active-tags { flex-basis: 100%; }
.filters-bar .filter-active-tags:empty { display: none; }

/* ── Tabelas: um padrão para todas (fora do celular, que vira cartões) ── */
@media (min-width: 641px) {
  .data-table thead th, .ds-table th, .mv-table th, .imp-manage-table th, .tx-table th, .dov-trans-table th {
    height: var(--head-h); padding: 0 var(--cell-px); font-size: var(--fs-xs); font-weight: 600;
    letter-spacing: .04em; color: var(--text-muted); background: var(--bg-2);
    border-bottom: 1px solid var(--border-strong); vertical-align: middle;
    position: sticky; top: 0; z-index: 2;
  }
  .data-table tbody td, .ds-table td, .mv-table td, .imp-manage-table td, .tx-table td, .dov-trans-table td {
    height: var(--row-h); padding: 2px var(--cell-px); font-size: var(--cell-fs);
    border-bottom: 1px solid var(--border); vertical-align: middle;
  }
  .inv-table tbody td, .inv-table .td-item-name { padding: 2px var(--cell-px); }
  .inv-table-card .data-table thead th:first-child, .inv-table-card .data-table tbody td:first-child { padding-left: 12px; }
  .inv-table-card .data-table tbody td:last-child { padding-right: 12px; }
  .data-table tbody tr:hover, .ds-table tbody tr:hover, .mv-table tbody tr:hover { background: var(--bg-2); }
  .data-table tbody tr.kb-focus { background: var(--bg-3); box-shadow: inset 2px 0 0 var(--accent); }
  .item-thumb-lg { width: var(--thumb); height: var(--thumb); border: none; background: transparent; }
  .item-thumb-lg img { padding: 0; }
  .item-cell { gap: 8px; }
  td.r, th.r, .data-table td.r { text-align: right; }

  /* Inventário: a tabela rola dentro do cartão, com cabeçalho fixo e totais embaixo */
  .view[data-view="inventario"] .content { height: calc(100vh - var(--topbar-h)); min-height: 420px; padding-bottom: 8px; }
  .inv-table-card { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
  .inv-scroll { flex: 1; min-height: 0; overflow: auto; }
  .inv-footer { padding: 4px 12px; min-height: 28px; font-size: var(--fs-xs); }
  /* Movimentações e Desempenho: área própria de rolagem para o cabeçalho ficar fixo */
  .mv-table-wrap, .ds-table-wrap { max-height: calc(100vh - var(--topbar-h) - 160px); overflow: auto; }
  /* Primeira coluna fixa ao rolar para os lados */
  .mv-table td:first-child, .mv-table th:first-child, .ds-table td:first-child, .ds-table th:first-child,
  .inv-table td:first-child, .inv-table th:first-child { position: sticky; left: 0; }
  .mv-table td:first-child, .ds-table td:first-child, .inv-table td:first-child { background: var(--bg-1); z-index: 1; }
  .mv-table th:first-child, .ds-table th:first-child, .inv-table th:first-child { z-index: 3; }
  .data-table tbody tr:hover td:first-child, .ds-table tbody tr:hover td:first-child { background: var(--bg-2); }
}

/* Totais: faixa fina (Inventário embaixo da tabela; Painel no topo) */
.inv-kpis { gap: 0; border: 1px solid var(--border); background: var(--bg-1); }
.inv-kpis .inv-kpi { border: none; border-right: 1px solid var(--border); padding: 8px 12px; background: transparent; }
.inv-kpis .inv-kpi:last-child { border-right: none; }
.inv-kpi .label { font-size: var(--fs-xs); letter-spacing: .04em; font-weight: 600; }
.inv-kpi .value { font-size: var(--fs-lg); margin-top: 2px; }
.inv-totals .inv-kpi { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 4px 12px; }
.inv-totals .inv-kpi .value { font-size: var(--fs-md); margin-top: 0; }
.inv-totals .inv-kpi .sub { margin-top: 0; }

/* Ganho e perda: além da cor, o sinal ▲ ▼ */
td.up::before, td.down::before, .value.up::before, .value.down::before, b.up::before, b.down::before,
.mv-pct.up::before, .mv-pct.down::before, .sub.up::before, .sub.down::before {
  font-size: .75em; margin-right: 2px; vertical-align: 1px;
}
td.up::before, .value.up::before, b.up::before, .mv-pct.up::before, .sub.up::before { content: '▲'; }
td.down::before, .value.down::before, b.down::before, .mv-pct.down::before, .sub.down::before { content: '▼'; }

/* Painel */
.pn-evo-chart { height: clamp(260px, 36vh, 460px); }

/* Modal do item: mantém o tamanho de antes (janela grande no computador,
   640 px no iPad, tela cheia no celular); só cantos retos, sombra e respiro */
.drawer { box-shadow: var(--shadow-float); }
.drawer-body { padding: 16px; }
.drawer-tabs { gap: 0; border-bottom: 1px solid var(--border); }
.drawer-tab { border-radius: 0; border-bottom: 2px solid transparent; }
.drawer-tab.active { border-bottom-color: var(--accent); }

/* Configurações → Aparência */
.ap-rows { display: flex; flex-direction: column; }
.ap-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.ap-label { font-weight: 600; font-size: var(--fs-md); display: flex; flex-direction: column; gap: 2px; max-width: 420px; }
.ap-label span { font-weight: 400; font-size: var(--fs-xs); color: var(--text-muted); }
.seg { display: inline-flex; border: 1px solid var(--line-ctl); }
.seg button { min-height: var(--bar-h); padding: 0 12px; font-size: var(--fs-sm); color: var(--text-secondary); border-right: 1px solid var(--border); display: inline-flex; align-items: center; gap: 4px; }
.seg button:last-child { border-right: none; }
.seg button.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.ap-sw { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.ap-sw.up { background: #4ade80; } .ap-sw.dn { background: #f87171; }
.ap-sw.up.b { background: #60a5fa; } .ap-sw.dn.o { background: #fb923c; }

/* iPhone e iPad: alvos de toque de 44 px e bordas da tela */
@media (pointer: coarse) {
  .btn-primary, .btn-secondary, .filter-btn-advanced, .seg button, .more-item, .nav-item { min-height: 44px; }
  .icon-btn, .btn-icon { width: 44px; height: 44px; }
}
.topbar { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.content { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }

/* Menos movimento quando o sistema pede */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Inventário: nome e coleção numa linha no compacto; ações da linha sobrepostas
   (passar o mouse não muda mais a altura da linha) */
@media (min-width: 641px) {
  .inv-table .item-name { font-size: var(--cell-fs); max-width: 360px; }
  :root:not([data-density="padrao"]) .inv-table .item-text { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
  :root:not([data-density="padrao"]) .inv-table .item-sub { margin-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .inv-table .td-item-name { position: relative; }
  .inv-table .row-actions { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); margin-top: 0 !important;
    grid-template-rows: 1fr !important; opacity: 0; pointer-events: none; background: var(--bg-2); padding: 2px 4px; z-index: 2; }
  .data-table tbody tr:hover .row-actions { opacity: 1; pointer-events: auto; margin-top: 0; }
}
.inv-footer { display: block; }
/* Movimentações: mesma moldura do Inventário (tabela rola dentro do cartão, paginação embaixo) */
@media (min-width: 641px) {
  .view[data-view="movimentacoes"] .content { height: calc(100vh - var(--topbar-h)); min-height: 420px; padding-bottom: 8px; }
  .mv-card { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
  .mv-card .mv-table-wrap { flex: 1; min-height: 0; max-height: none; }
  .mv-pager { padding: 4px 12px; border-top: 1px solid var(--border); }
}
/* Topo em telas menores: os seletores fixos (fonte e moeda) saem; a busca ocupa a linha */
@media (max-width: 1100px) { .topbar .pill-select { display: none; } }
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  .topbar .search-wrap { order: 10; flex: 1 1 100%; max-width: none; width: 100%; }
  .topbar .search-wrap input { padding-right: 12px; }
}
/* Carregamento: linhas de espera com a altura das linhas reais (a tabela não pula) */
.sk-row td { height: var(--row-h); padding: 0 12px; border-bottom: 1px solid var(--border); }
.sk-bar { display: block; height: 10px; background: var(--bg-3); }
@media (prefers-reduced-motion: no-preference) { .sk-bar { animation: sk-pulse 1.2s ease-in-out infinite alternate; } }
@keyframes sk-pulse { from { opacity: .45; } to { opacity: 1; } }
/* Contraste conferido por ferramenta (20/11/2026): três ajustes finais */
.avatar { background: var(--accent); color: var(--on-accent); width: 28px; height: 28px; border-radius: 0; }
.row-action-btn { color: var(--text-primary); }
.pro-badge { background: color-mix(in srgb, var(--accent) 10%, transparent); }
/* Miniaturas maiores no Inventário (pedido de 20/11/2026): 64 px no compacto, 80 px no padrão.
   A linha cresce junto (68 e 84 px); as outras tabelas continuam com 32 e 40 px. */
@media (min-width: 641px) {
  .inv-table .item-thumb-lg { width: var(--thumb); height: var(--thumb); }
  .inv-table .item-thumb-lg img { width: 100%; height: 100%; object-fit: contain; padding: 0; }
  .inv-table tbody td { height: calc(var(--thumb) + 4px); }
}

/* ═══════════════════════════════════════════════════════════════════
   FUNÇÕES NOVAS (Plano de Novas Funções, 20/11/2026)
   Vender, Comprar, Mercado, Investimento, aba Negociar do modal, sino de
   avisos, Organização (metas e tags automáticas). Prefixo fx-.
═══════════════════════════════════════════════════════════════════ */
.fx-tabs { margin: 12px 0 8px; flex-wrap: wrap; }
.fx-pad { padding: 12px; }
.fx-cards { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 0; }
.fx-cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 10px; }
.fx-cards .pn-card .sub { line-height: 1.45; }
.view[data-view="vender"] .fx-cards, .view[data-view="investimento"] .fx-cards { margin-bottom: 0; }
.fx-help { font-size: var(--fs-xs); color: var(--text-muted); font-weight: 400; white-space: normal; }

/* tabelas */
.fx-tbl td { vertical-align: middle; }
.fx-tbl th { white-space: nowrap; }
.fx-tbl tr.fx-hit td { background: var(--green-soft, rgba(74,222,128,.07)); }
.fx-tbl.fx-kv td { padding: 4px 8px; }
.fx-foot { font-size: var(--fs-sm); color: var(--text-secondary); padding: 8px 2px 0; }
.fx-item { display: flex; align-items: center; gap: 8px; min-width: 220px; max-width: 420px; }
.fx-thumb { flex: 0 0 auto; width: 44px; height: 44px; background: var(--bg-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.fx-item-t { min-width: 0; }
.fx-item-n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-item-s { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; font-size: var(--fs-xs); color: var(--text-muted); white-space: normal; }
.fx-sug { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.fx-sug span { font-size: var(--fs-xs); }
.fx-ul { margin: 0; padding-left: 16px; white-space: normal; font-size: var(--fs-sm); color: var(--text-secondary); }

/* chips, pills */
.fx-chip { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; font-size: var(--fs-xs); font-weight: 600; border: 1px solid var(--border-strong); color: var(--text-secondary); background: var(--bg-2); white-space: nowrap; }
.fx-chip.good { color: var(--green); border-color: currentColor; }
.fx-chip.warn { color: var(--yellow); border-color: currentColor; }
.fx-chip.bad { color: var(--red); border-color: currentColor; }
.fx-chip.muted { color: var(--text-muted); }
.fx-line { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.fx-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.fx-pill { height: 26px; padding: 0 10px; border: 1px solid var(--line-ctl); background: var(--bg-1); color: var(--text-secondary); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.fx-pill:hover { color: var(--text-primary); background: var(--bg-2); }
.fx-pill.active { background: var(--bg-3); color: var(--text-primary); border-color: var(--text-secondary); }

/* faixa de 90 dias */
.fx-range { position: relative; display: inline-block; width: 64px; height: 6px; vertical-align: middle; background: linear-gradient(90deg, var(--red), var(--yellow) 50%, var(--green)); opacity: .85; }
.fx-range i { position: absolute; top: -4px; width: 3px; height: 14px; margin-left: -1px; background: var(--text-primary); box-shadow: 0 0 0 1px var(--bg-0); }
.fx-range-pct { display: inline-block; min-width: 32px; text-align: right; margin-left: 6px; font-size: var(--fs-xs); color: var(--text-secondary); vertical-align: middle; }
.pn-card .value .fx-range { width: 90px; }

/* formulários */
.fx-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; }
.fx-form label { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-secondary); }
.fx-form em, .fx-cfg-in em { font-style: normal; color: var(--text-muted); font-size: var(--fs-sm); }
.fx-form .unrec-input, .fx-cfg-in .unrec-input { height: var(--bar-h, 32px); flex: 0 1 auto; min-width: 0; width: auto; padding: 4px 8px; }
.fx-form input.unrec-input:not(.fx-in-sm):not(.fx-in-name) { width: 200px; }
.fx-form .fx-in-name { flex: 1 1 320px; min-width: 220px; }
.fx-form-grid .unrec-input { width: 100% !important; }
.fx-form .fx-wide .unrec-input { flex: 1 1 auto; width: 100%; }
.fx-form textarea.unrec-input { height: auto; }
.fx-form .fx-in-sm, .fx-in-sm { width: 90px; }
.fx-in-name { flex: 1 1 320px; min-width: 220px; }
.fx-form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }
.fx-form-grid label { flex-direction: column; align-items: stretch; gap: 4px; }
.fx-form-grid .fx-wide { grid-column: 1 / -1; }
.fx-sm { min-height: 26px !important; padding: 0 8px !important; font-size: var(--fs-xs) !important; }
.fx-check { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-secondary); cursor: pointer; }
.vd-tools { justify-content: flex-start; }
.vd-tools #vdSearch { width: 220px; }

/* seções (modal e telas) */
.fx-sec { margin-top: 16px; }
.fx-sec-t { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.fx-chart { width: 100%; height: 240px; }
.fx-chart-lg { height: 320px; }
.fx-chart-card { margin-top: 10px; }
.fx-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 10px; }
.fx-cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.fx-mks { display: flex; flex-wrap: wrap; gap: 6px; }
.fx-mk { display: inline-flex; gap: 6px; align-items: baseline; padding: 4px 8px; border: 1px solid var(--border); background: var(--bg-2); font-size: var(--fs-sm); color: var(--text-secondary); }
.fx-mk b { color: var(--text-primary); font-weight: 600; }
.fx-mk-btn { cursor: pointer; font: inherit; font-size: var(--fs-sm); }
.fx-mk-btn:hover { border-color: var(--line-ctl); }
.fx-det { margin-top: 8px; font-size: var(--fs-sm); }
.fx-det summary { cursor: pointer; color: var(--accent); }
.fx-prog { height: 4px; background: var(--bg-3); margin-top: 6px; }
.fx-prog i { display: block; height: 100%; background: var(--accent); }

/* barras horizontais (orçamento, alocação) */
.fx-bars { display: flex; flex-direction: column; gap: 4px; }
.fx-bar-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 170px; gap: 8px; align-items: center; font-size: var(--fs-sm); }
.fx-bar-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-secondary); }
.fx-bar-row em { font-style: normal; color: var(--text-muted); font-size: var(--fs-xs); text-align: right; }
.fx-bar { position: relative; height: 10px; background: var(--bg-2); }
.fx-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--blue); }
.fx-bar i.over { background: var(--red); }
.fx-bar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-primary); }
.fx-cols3 .fx-bar-row { grid-template-columns: 100px minmax(0, 1fr) 120px; }
.fx-alloc { position: relative; display: block; width: 100%; min-width: 80px; height: 6px; margin-top: 4px; background: var(--bg-3); }
.fx-alloc i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); }
.fx-alloc b, .fx-alloc u { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--red); }
.fx-alloc u { background: var(--green); text-decoration: none; }

/* diário */
.fx-diary { border-top: 1px solid var(--border); padding-top: 12px; }
.fx-diary-new { display: flex; gap: 8px; align-items: flex-start; }
.fx-diary-new textarea { flex: 1; resize: vertical; min-height: 44px; font: inherit; padding: 6px 8px; }
.fx-diary-list { display: flex; flex-direction: column; margin-top: 10px; }
.fx-diary-it { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.fx-diary-it .mv-muted { font-size: var(--fs-xs); }

/* sino */
.fx-bell { position: fixed; z-index: 1200; width: 400px; max-width: calc(100vw - 16px); max-height: min(70vh, 640px); display: none; flex-direction: column;
  background: var(--bg-1); border: 1px solid var(--border-strong); box-shadow: 0 12px 32px rgba(0,0,0,.35); }
.fx-bell.open { display: flex; }
.fx-bell-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.fx-bell-head b { font-size: var(--fs-md); }
.fx-bell-head .mv-muted { font-size: var(--fs-xs); flex: 1; }
.fx-bell-head .pn-link { margin: 0; font-size: var(--fs-xs); }
.fx-bell-pn { display: block; width: 100%; text-align: left; padding: 8px 12px; border: none; border-bottom: 1px solid var(--border); background: var(--bg-2); color: var(--accent); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.fx-bell-list { overflow-y: auto; flex: 1; }
.fx-al { display: flex; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.fx-al:hover { background: var(--bg-2); }
.fx-al.seen { opacity: .62; }
.fx-al-dot { flex: 0 0 8px; width: 8px; height: 8px; margin-top: 5px; background: var(--text-muted); }
.fx-al.good .fx-al-dot { background: var(--green); }
.fx-al.bad .fx-al-dot { background: var(--red); }
.fx-al.warn .fx-al-dot { background: var(--yellow); }
.fx-al-t { font-size: var(--fs-sm); font-weight: 600; }
.fx-al-k { font-size: var(--fs-xs); font-weight: 400; color: var(--text-muted); margin-left: 4px; }
.fx-al-i { font-size: var(--fs-sm); color: var(--text-primary); }
.fx-al-x { font-size: var(--fs-xs); color: var(--text-secondary); }
.fx-bell-more { padding: 6px 12px; font-size: var(--fs-xs); border-bottom: 1px solid var(--border); }
.fx-bell-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; padding: 8px 12px; }
.fx-bell-foot .pn-link { margin: 0; font-size: var(--fs-xs); }
#btnBell { position: relative; }

/* Configurações → Vender, comprar e avisos */
.fx-cfg-sec { margin-top: 10px; }
.fx-cfg-title { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); padding: 6px 0; border-bottom: 1px solid var(--border); }
.fx-cfg-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); color: var(--text-secondary); }
.fx-cfg-in { display: inline-flex; align-items: center; gap: 6px; }
.fx-cfg-in em { min-width: 24px; }
.fx-cfg-in .unrec-input { width: 110px; text-align: right; flex: 0 0 auto; }
.fx-cfg-actions { display: flex; gap: 10px; align-items: center; margin-top: 12px; }

@media (max-width: 1100px) {
  .fx-row2, .fx-cols3 { grid-template-columns: minmax(0, 1fr); }
  .fx-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .fx-cards-3 { grid-template-columns: minmax(0, 1fr); }
  .fx-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fx-form-grid { grid-template-columns: minmax(0, 1fr); }
  .fx-item { min-width: 0; }
  .fx-cfg-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .fx-bar-row { grid-template-columns: 80px minmax(0, 1fr); }
  .fx-bar-row em { grid-column: 1 / -1; text-align: left; }
  .fx-diary-it { grid-template-columns: minmax(0, 1fr) auto; }
  .fx-diary-it .mv-muted { grid-column: 1 / -1; }
  .fx-bell { left: 8px; right: 8px !important; width: auto; }
}
td[data-col="fxRange"], td[data-col="fxLocked"] { white-space: nowrap; }
/* Tabelas pequenas das funções novas continuam tabela no celular (rolam de lado). */
@media (max-width: 640px) {
  .ds-table.fx-keep { display: block; overflow-x: auto; white-space: nowrap; }
  .ds-table.fx-keep thead { display: table-header-group; }
  .ds-table.fx-keep tbody { display: table-row-group; }
  .ds-table.fx-keep tr { display: table-row; border: none; margin: 0; padding: 0; }
  .ds-table.fx-keep td { display: table-cell; width: auto; border-bottom: 1px solid var(--border); padding: 4px 8px; text-align: left; }
  .ds-table.fx-keep td.r { text-align: right; }
  .ds-table.fx-keep td::before { content: none; }
}
.dtab .ds-table td:first-child, .dtab .ds-table th:first-child { position: static; background: transparent; }
.fx-tbl tr.fx-hit td:first-child { background: inherit; }
.fx-hit .fx-help { color: var(--text-secondary); }

/* Importar → Contas Steam (sincronização automática) */
.cs-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.cs-acc-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; font-size: var(--fs-sm); color: var(--text-secondary); }
.cs-decide { padding: 10px 12px; border: 1px solid var(--yellow); background: var(--bg-2); font-size: var(--fs-sm); color: var(--text-secondary); }
.cs-decide b { color: var(--text-primary); }
.cs-decide .fx-form { margin: 8px 0 0; }
.cs-qr { display: flex; gap: 16px; align-items: flex-start; padding: 12px; border: 1px solid var(--border-strong); background: var(--bg-2); margin: 8px 0; }
.cs-qr-img { flex: 0 0 auto; width: 200px; height: 200px; background: #fff; padding: 8px; }
.cs-qr-img svg { width: 100%; height: 100%; display: block; }
.cs-qr-img.off { opacity: .25; }
.cs-qr-txt p { margin: 6px 0 10px; font-size: var(--fs-sm); color: var(--text-secondary); }
.cs-missing pre { background: var(--bg-2); border: 1px solid var(--border); padding: 8px 10px; font-size: var(--fs-md); }
@media (max-width: 640px) {
  .cs-qr { flex-direction: column; }
}

/* ── Livro de movimentos (25-livro.js) ── */
.lv-card { margin-top: 12px; }
.lv-card:empty { display: none; }
.lv-h { margin: 0 0 6px; font-size: var(--fs-lg); }
.lv-accs { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.lv-acc .fx-help { margin-top: 3px; }
.lv-acc .fx-help b { color: var(--text-secondary); font-weight: 600; }
.lv-loc { display: inline-block; margin: 1px 6px 1px 0; padding: 1px 6px; border: 1px solid var(--border); background: var(--bg-2); font-size: var(--fs-xs); white-space: nowrap; }
.lv-loc.un { border-color: var(--border-strong); }
.lv-box { margin: 0 0 12px; }
.lv-box .ds-table { margin-top: 6px; }
.lv-card pre { background: var(--bg-2); border: 1px solid var(--border); padding: 8px 10px; font-size: var(--fs-md); }
.lv-val { width: 90px; margin-right: 6px; }
.lv-ta { width: 100%; max-width: 520px; font-family: inherit; }
.lv-on { border-color: var(--green, #3fb950); margin: 6px 0 10px; }
.lv-box label { display: inline-flex; flex-direction: column; gap: 4px; margin-right: 12px; font-size: var(--fs-sm); color: var(--text-secondary); }
.lv-painel td { vertical-align: top; min-width: 150px; }
.lv-cel { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lv-bar { width: 70px; height: 6px; background: var(--bg-2); border: 1px solid var(--border); position: relative; }
.lv-bar span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent, #ff7a1a); }

/* ═══════════════════════════════════════════════════════════════════
   CENTRAL DE DADOS (26-dados.js) — Importar + Atualização + fontes de preço
═══════════════════════════════════════════════════════════════════ */
.dd-main { min-width: 0; }
.dd-panel { display: none; }
.dd-panel.active { display: flex; flex-direction: column; gap: 12px; }
.dd-ppanel { display: none; }
.dd-ppanel.active { display: flex; flex-direction: column; gap: 12px; }
.dd-ppanel .cfg-tab-panel { max-width: none; }
.dd-fsub { margin-top: 0; }
.dd-sub { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; }
.dd-sub:empty { display: none; }
.dd-sub-btn { background: none; border: 1px solid var(--border); color: var(--text-secondary); padding: 4px 10px; font: inherit; font-size: var(--fs-xs); cursor: pointer; }
.dd-sub-btn.active { color: var(--text-primary); border-color: var(--border-strong); background: var(--bg-2); }
.dd-go { cursor: pointer; }
.dd-go:hover td { background: var(--bg-1); }
.dd-hist { margin-top: 4px; }
.dd-panel[data-dpanel="livro"] .lv-card { margin-top: 0; }
/* cartão da conta: as 8 áreas */
@media (max-width: 900px) {
}
.mv-type.barter { color: var(--yellow); background: color-mix(in srgb, var(--yellow) 12%, transparent); }
.lv-radio { display: block; margin: 6px 0; font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.45; }
.lv-radio b { color: var(--text-primary); }

/* ── Central de Dados: layout com abas no topo (21/11/2026) ── */
.dd-head { align-items: flex-start; }
.dd-diag-btn { display: inline-flex; align-items: center; gap: 6px; }
.dd-diag-btn.active { border-color: var(--accent); color: var(--text-primary); }
.dd-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 14px 0 16px; overflow-x: auto; }
.dd-tabs .dd-nav-item { background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--text-secondary); padding: 9px 14px; font: inherit; font-size: var(--fs-md); cursor: pointer; white-space: nowrap; }
.dd-tabs .dd-nav-item:hover { color: var(--text-primary); }
.dd-tabs .dd-nav-item.active { color: var(--text-primary); border-bottom-color: var(--accent); font-weight: 600; }
.dd-wrap { display: block; }
#ddGeral:empty, #csBody:empty { display: none; }
.dd-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dd-cards .inv-kpi { border: 1px solid var(--border); background: var(--bg-1); padding: 12px 14px; }
.dd-cards .inv-kpi .value { font-size: var(--fs-2xl); }
.dd-need.on { border-color: color-mix(in srgb, var(--red) 55%, var(--border)); background: color-mix(in srgb, var(--red) 8%, var(--bg-1)); }
.dd-need.on .value { color: var(--red); }
.dd-warn-ic { font-size: .8em; }
.cs-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.cs-bar .btn-primary, .cs-bar .btn-secondary { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; }
.cs-list { gap: 12px; margin-top: 0; }
.cs-acc { border: 1px solid var(--border); background: var(--bg-1); }
.cs-acc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.cs-acc-name { font-weight: 700; font-size: var(--fs-lg); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cs-acc-name .mv-muted { font-weight: 400; font-size: var(--fs-sm); }
.cs-acc-meta { margin-top: 4px; }
.cs-acc-act { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
.cs-more { padding: 7px 12px; font-size: var(--fs-lg); line-height: 1; letter-spacing: 1px; }
.cs-menu { position: relative; }
.cs-menu-list { display: none; position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 250px; background: var(--bg-2); border: 1px solid var(--border-strong); box-shadow: 0 8px 24px rgba(0,0,0,.35); padding: 4px; }
.cs-menu.open .cs-menu-list { display: flex; flex-direction: column; }
.cs-menu-list button { text-align: left; background: none; border: none; color: var(--text-primary); padding: 8px 10px; font: inherit; font-size: var(--fs-sm); cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.cs-menu-list button span { color: var(--text-muted); font-size: var(--fs-xs); }
.cs-menu-list button:hover:not(:disabled) { background: var(--bg-1); }
.cs-menu-list button:disabled { opacity: .45; cursor: not-allowed; }
.cs-menu-list button.danger { color: var(--red); border-top: 1px solid var(--border); margin-top: 2px; }
.cs-areas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cs-area { padding: 12px 16px; min-width: 0; border-bottom: 1px solid var(--border); }
.cs-area:nth-child(odd) { border-right: 1px solid var(--border); }
.cs-area.dd-go:hover { background: var(--bg-2); }
.cs-area-top { display: flex; align-items: center; gap: 8px; }
.cs-area-n { flex: 1 1 auto; min-width: 0; font-size: var(--fs-md); color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-area-p { font-variant-numeric: tabular-nums; }
.cs-warn { color: var(--red); margin-right: 6px; }
.cs-area.st-pausa .cs-warn, .cs-area.st-aviso .cs-warn, .cs-area.st-reconectar .cs-warn { color: var(--yellow); }
.cs-area-bar { height: 6px; background: var(--bg-2); margin-top: 8px; position: relative; overflow: hidden; }
.cs-area-bar span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--text-muted); }
.cs-area.st-ok .cs-area-bar span { background: var(--green); }
.cs-area.st-baixando .cs-area-bar span { background: var(--accent); }
.cs-area.st-erro .cs-area-bar span { background: var(--red); }
.cs-area.st-pausa .cs-area-bar span, .cs-area.st-aviso .cs-area-bar span, .cs-area.st-reconectar .cs-area-bar span { background: var(--yellow); }
.cs-area-msg { margin-top: 6px; font-size: var(--fs-xs); color: var(--text-secondary); }
.cs-area.st-erro .cs-area-msg { color: var(--red); }
.cs-acc > .cs-decide, .cs-acc > .fx-help { margin: 12px 16px; }
@media (max-width: 900px) {
  .dd-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-areas { grid-template-columns: minmax(0, 1fr); }
  .cs-area:nth-child(odd) { border-right: none; }
  .cs-acc-head { flex-direction: column; }
}
.view-header.dd-head > div:first-child { display: block; }
.dd-head .view-sub { margin-top: 4px; }

/* ── Acompanhamento das atualizações: cartão detalhado + janela ── */
.cs-area[data-cs="area"] { cursor: pointer; }
.cs-area[data-cs="area"]:hover { background: var(--bg-2); }
.cs-area[data-cs="area"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cs-area-now { margin-top: 7px; font-size: var(--fs-xs); color: var(--text-primary); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cs-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; flex: 0 0 auto; animation: csPulse 1.2s ease-in-out infinite; }
@keyframes csPulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .cs-dot { animation: none; } }
.cs-area-lines { margin-top: 6px; font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.55; }
.cs-area-lines div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-area.is-now .cs-area-bar span { background-image: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent); background-size: 200% 100%; animation: csBar 1.6s linear infinite; }
@keyframes csBar { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .cs-area.is-now .cs-area-bar span { animation: none; } }
.cs-modal .hidden-modal-head h3 .mv-muted { font-weight: 400; font-size: var(--fs-md); }
.cs-m-prog { margin: 4px 0 10px; }
.cs-m-prog .cs-area-bar { height: 8px; }
.cs-m-pct { margin-left: auto; font-size: var(--fs-xl); font-variant-numeric: tabular-nums; }
.cs-m-prog.st-ok .cs-area-bar span { background: var(--green); }
.cs-m-prog.st-baixando .cs-area-bar span { background: var(--accent); }
.cs-m-prog.st-erro .cs-area-bar span { background: var(--red); }
.cs-m-prog.st-pausa .cs-area-bar span, .cs-m-prog.st-aviso .cs-area-bar span, .cs-m-prog.st-reconectar .cs-area-bar span { background: var(--yellow); }
.cs-m-now { padding: 8px 10px; border: 1px solid var(--border); background: var(--bg-1); font-size: var(--fs-sm); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cs-m-now.on { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.cs-m-err, .cs-m-warn { margin-top: 8px; padding: 8px 10px; font-size: var(--fs-sm); border: 1px solid; }
.cs-m-err { border-color: color-mix(in srgb, var(--red) 60%, var(--border)); color: var(--red); background: color-mix(in srgb, var(--red) 8%, transparent); }
.cs-m-warn { border-color: color-mix(in srgb, var(--yellow) 60%, var(--border)); color: var(--text-secondary); }
.cs-m-h { margin: 14px 0 6px; font-size: var(--fs-md); }
.cs-m-log li:last-child { border-bottom: none; }
.cs-m-log .fx-chip { justify-self: start; }
.cs-m-t { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cs-m-log li.t-erro span:last-child { color: var(--red); }
.cs-m-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.cs-m-acts .mv-muted { margin-left: auto; font-size: var(--fs-xs); }

/* ── Ferramentas (27-ferramentas.js) ── */
.ft-fcell b { font-variant-numeric: tabular-nums; font-family: var(--font-mono, monospace); font-size: var(--fs-sm); }
.ft-fbar { display: block; position: relative; width: 140px; height: 8px; margin-top: 4px; background: linear-gradient(90deg, #22c55e 0 7%, #84cc16 7% 15%, #eab308 15% 38%, #f97316 38% 45%, #ef4444 45% 100%); opacity: .9; }
.ft-fr { position: absolute; top: -2px; bottom: -2px; border: 1px solid var(--text-secondary); }
.ft-fm { position: absolute; top: -4px; width: 2px; height: 16px; background: var(--text-primary); transform: translateX(-1px); }
.ft-ctr input { font-size: var(--fs-sm); }
.ft-meu { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.ft-uns { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin: 10px 0; }
.ft-un { border: 1px solid var(--border); background: var(--bg-1); padding: 8px 10px; }
.ft-un.on { border-color: var(--accent); }
.ft-passos { margin: 0 0 12px 18px; font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.7; }

/* ── Janela de detalhes das áreas: maior, rolagem só no conteúdo ── */
.hidden-modal.cs-modal { width: min(1120px, 96vw); height: min(90vh, 940px); max-height: none; padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.cs-m-top { flex: 0 0 auto; padding: 16px 20px 0; border-bottom: 1px solid var(--border); }
.cs-m-top .hidden-modal-head h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cs-m-tabs { display: flex; gap: 4px; margin-top: 10px; }
.cs-m-tabs button { background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--text-secondary); padding: 8px 12px; font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.cs-m-tabs button.active { color: var(--text-primary); border-bottom-color: var(--accent); font-weight: 600; }
.cs-m-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 16px 20px; }
.cs-m-foot { flex: 0 0 auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--bg-1); }
.cs-m-foot .mv-muted { margin-left: auto; font-size: var(--fs-xs); }
.cs-m-desc { margin: 0 0 12px; font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.5; }
.cs-m-lbl { font-size: var(--fs-sm); color: var(--text-secondary); }
.cs-m-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--border); margin-top: 12px; }
.cs-m-kv { display: grid; grid-template-columns: minmax(130px, 38%) minmax(0, 1fr); gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); min-width: 0; }
.cs-m-kv:nth-child(odd) { border-right: 1px solid var(--border); }
.cs-m-kv span { color: var(--text-secondary); }
.cs-m-kv b { font-weight: 500; overflow-wrap: anywhere; word-break: break-word; }
.cs-m-log { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); }
.cs-m-log li { display: grid; grid-template-columns: 120px 58px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 6px 10px; font-size: var(--fs-xs); border-bottom: 1px solid var(--border); }
.cs-m-msg { overflow-wrap: anywhere; line-height: 1.45; }
.cs-m-filtros { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0 0 10px; }
.cs-m-tw { border: 1px solid var(--border); overflow-x: auto; }
.cs-m-tbl { margin: 0; }
.cs-m-tbl td { overflow-wrap: anywhere; vertical-align: top; font-size: var(--fs-sm); }
.cs-m-tbl thead th { position: sticky; top: 0; background: var(--bg-2); z-index: 1; }
@media (max-width: 760px) {
  .hidden-modal.cs-modal { width: 100vw; height: 100vh; }
  .cs-m-grid { grid-template-columns: minmax(0, 1fr); }
  .cs-m-kv:nth-child(odd) { border-right: none; }
  .cs-m-log li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
.cs-m-filtros select.unrec-input { max-width: 280px; }

/* ── Armazenamento (28-armazenamento.js) ── */
.am-contas { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.am-conta { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 14px; background: var(--bg-1); border: 1px solid var(--border); color: var(--text-primary); font: inherit; cursor: pointer; }
.am-conta span { font-size: var(--fs-xs); color: var(--text-muted); }
.am-conta.active { border-color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.am-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0 8px; }
.am-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.am-card { text-align: left; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: var(--bg-1); border: 1px solid var(--border); color: var(--text-primary); font: inherit; cursor: pointer; transition: border-color .12s, background .12s; }
.am-card:hover { border-color: var(--border-strong); background: var(--bg-2); }
.am-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.am-card.principal { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.am-card.erro { border-color: color-mix(in srgb, var(--red) 50%, var(--border)); }
.am-card-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.am-ico { font-size: 20px; line-height: 1; }
.am-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-md); }
.am-capa { display: flex; gap: 6px; min-height: 44px; align-items: center; }
.am-th { width: 44px; height: 44px; background: var(--bg-2); display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.am-th img, .am-img img { width: 100%; height: 100%; object-fit: contain; }
.am-meta { display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-sm); color: var(--text-secondary); }
.am-meta b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.am-lot { height: 5px; background: var(--bg-2); overflow: hidden; }
.am-lot span { display: block; height: 100%; background: var(--green); }
.am-lot span.quase { background: var(--yellow); }
.am-lot span.cheia { background: var(--red); }
.am-cats { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-ph { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--text-muted); font-weight: 700; }
.am-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.am-head-t { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; }
.am-head-t h2 { margin: 0; font-size: var(--fs-xl); }
.am-ir { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-secondary); }
.am-ir select { max-width: 240px; }
.am-cats-f { display: flex; gap: 6px; flex-wrap: wrap; }
.am-modo { display: inline-flex; border: 1px solid var(--border); margin-left: auto; }
.am-modo button { background: none; border: none; color: var(--text-secondary); padding: 6px 12px; font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.am-modo button.active { background: var(--bg-2); color: var(--text-primary); font-weight: 600; }
.am-itens { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.am-item { background: var(--bg-1); border: 1px solid var(--border); padding: 8px; display: flex; flex-direction: column; gap: 4px; min-width: 0; cursor: default; }
.am-item:hover { border-color: var(--border-strong); }
.am-img { position: relative; height: 96px; background: radial-gradient(circle at 50% 45%, var(--bg-2), transparent 70%); display: flex; align-items: center; justify-content: center; }
.am-qtd { position: absolute; top: 4px; right: 4px; background: var(--bg-3, #000); border: 1px solid var(--border-strong); padding: 1px 6px; font-size: var(--fs-xs); font-weight: 700; font-variant-numeric: tabular-nums; }
.am-trava { position: absolute; top: 4px; left: 4px; font-size: 12px; }
.am-inome { font-size: var(--fs-xs); line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.7em; }
.am-ival { font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .am-modo { margin-left: 0; } .am-itens { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); } }
.am-bar select.unrec-input { width: auto; max-width: 200px; }
.am-bar input.unrec-input { width: auto; flex: 0 1 280px; }

/* ── Integração (29-integracao.js): aba "Onde está" e atalhos ── */
.int-onde { display: flex; flex-direction: column; gap: 14px; padding: 4px 0; }
.int-cards { margin: 0; }
.int-sec { border: 1px solid var(--border); background: var(--bg-1); padding: 10px 12px; }
.int-sec-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.int-sec-h h4 { margin: 0; font-size: var(--fs-md); }
.int-sec .ds-table { margin: 0; }
.int-acts { white-space: nowrap; }
.int-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; font-size: var(--fs-sm); }
.int-kv span { color: var(--text-secondary); }
.int-kv b { font-weight: 500; overflow-wrap: anywhere; }
.int-cell { font-size: var(--fs-xs); white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.ft-link { cursor: pointer; }
.ft-link:hover { background: var(--bg-2); }
.lv-arm { margin-left: 8px; font-size: var(--fs-xs); }

/* ── Configurar atualizações (26-dados.js) ── */
.cs-cfg { margin-left: auto; }
.dd-cfg-g { margin-bottom: 12px; }
.dd-cfg-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px 130px; gap: 12px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.dd-cfg-row:last-child { border-bottom: none; }
.dd-cfg-row.mudou .dd-cfg-r::before { content: '●'; color: var(--accent); margin-right: 6px; }
.dd-cfg-r small { display: block; color: var(--text-muted); font-size: var(--fs-xs); margin-top: 2px; }
.dd-cfg-v { display: flex; align-items: center; gap: 6px; }
.dd-cfg-v input { width: 110px; }
.dd-cfg-v em { font-style: normal; color: var(--text-secondary); font-size: var(--fs-xs); }
.dd-cfg-p { color: var(--text-muted); font-size: var(--fs-xs); }
.dd-cfg-row input[type="checkbox"] { width: 18px; height: 18px; justify-self: start; }
@media (max-width: 760px) { .dd-cfg-row { grid-template-columns: minmax(0, 1fr); } }
.dd-cfg-v input.unrec-input { width: 110px; min-width: 0; max-width: 110px; flex: 0 0 110px; }

/* ── Play / pause / stop (26-dados.js) ── */
.dd-head .view-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dd-ctl { display: flex; align-items: center; gap: 8px; }
.dd-ctl-st { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-secondary); }
.dd-ctl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.dd-ctl-st.pausado .dd-ctl-dot { background: var(--yellow); }
.dd-ctl-st.parado .dd-ctl-dot { background: var(--red); }
.dd-ctl-st.pausado, .dd-ctl-st.parado { color: var(--text-primary); font-weight: 600; }
.dd-ctl-btns { display: inline-flex; border: 1px solid var(--border-strong); }
.dd-ctl-btns button { background: var(--bg-1); border: none; border-right: 1px solid var(--border); color: var(--text-primary); width: 36px; height: 32px; font-size: 14px; cursor: pointer; }
.dd-ctl-btns button:last-child { border-right: none; }
.dd-ctl-btns button:hover:not(:disabled) { background: var(--bg-2); }
.dd-ctl-btns button:disabled { opacity: .35; cursor: default; }
.dd-ctl-pr { font-size: var(--fs-xs); color: var(--text-secondary); display: inline-flex; align-items: center; gap: 4px; }
.dd-ctl-badge { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 9000; padding: 7px 14px; border: 1px solid var(--yellow); background: var(--bg-2); color: var(--text-primary); font: inherit; font-size: var(--fs-sm); cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.dd-ctl-badge.parado { border-color: var(--red); }
.dd-cf-ruim td { background: color-mix(in srgb, var(--red) 6%, transparent); }
.cs-m-foot .dd-ctl-btns button { width: auto; padding: 0 12px; font-size: var(--fs-sm); }

/* ── Organizar unidades (30-organizar.js) ── */
.am-bar .am-org { margin-left: auto; }
.org-ov .btn-sm { padding: 4px 10px; font-size: var(--fs-xs); }
.org-aviso { padding: 8px 12px; margin: 8px 0; border-left: 3px solid var(--border-strong); background: var(--bg-1); font-size: var(--fs-sm); line-height: 1.45; }
.org-aviso.erro { border-left-color: var(--red); }
.org-aviso.aviso { border-left-color: var(--yellow); }
.org-aviso.info { border-left-color: var(--accent); }
.org-aviso.ok { border-left-color: var(--green); }
.org-tbl td { vertical-align: top; }
.org-nome { font-family: var(--font-mono, ui-monospace, monospace); font-size: var(--fs-sm); white-space: nowrap; }
.org-falta td { background: color-mix(in srgb, var(--red) 6%, transparent); }
.org-livres { display: flex; flex-wrap: wrap; gap: 6px; }
.org-passos-lista { font-size: var(--fs-sm); color: var(--text-secondary); columns: 2; column-gap: 24px; }
.org-passos { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-secondary); }
.org-passos input.unrec-input { width: 90px; min-width: 0; }
.org-job { border: 1px solid var(--border); padding: 10px 12px; margin-bottom: 12px; background: var(--bg-1); }
.org-job.ok { border-color: var(--green); }
.org-job.erro { border-color: var(--red); }
.org-job-t { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: var(--fs-sm); margin-bottom: 6px; }
.org-job-t span { color: var(--text-secondary); }
.org-abrev { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 14px; }
.org-abrev label { display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-xs); color: var(--text-secondary); }
.org-abrev input.unrec-input { min-width: 0; width: 100%; }
.org-in-l.unrec-input { width: 220px; max-width: 220px; flex: 0 0 220px; }
@media (max-width: 760px) { .org-passos-lista { columns: 1; } }
.org-ov .dd-cfg-row { grid-template-columns: minmax(0, 1fr) 250px 140px; }
.org-ov .dd-cfg-v select.unrec-input { width: 100%; min-width: 0; }
.org-ov .dd-cfg-v input.unrec-input.org-in-l { width: 240px; max-width: 240px; flex: 0 0 240px; }
.org-ov td.org-acoes { white-space: nowrap; }
@media (max-width: 760px) { .org-ov .dd-cfg-row { grid-template-columns: minmax(0, 1fr); } }

/* ── Radar (31-radar.js) ── */
.rd-est { display: flex; align-items: center; gap: 16px; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; }
.rd-est-l { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; font-size: var(--fs-sm); }
.rd-est-l .am-lot { max-width: 520px; margin-top: 4px; }
.rd-est-b { display: flex; gap: 8px; flex-wrap: wrap; }
.rd-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.rd-bar input[type="search"].unrec-input { min-width: 280px; }
.rd-tbl td { vertical-align: top; }
.rd-row { cursor: pointer; }
.rd-row:hover td { background: var(--bg-2); }
.rd-nao td { opacity: .7; }
.rd-it { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rd-it b { font-weight: 600; }
.rd-img { width: 40px; height: 30px; object-fit: contain; flex: 0 0 40px; }
.rd-img-v { display: inline-block; background: var(--bg-2); }
.rd-it-g .rd-img { width: 72px; height: 54px; flex-basis: 72px; }
.rd-it-g { margin-bottom: 12px; }
.rd-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.rd-sort.on { color: var(--text-primary); }
.rd-star { background: none; border: none; color: var(--text-secondary); font-size: 16px; cursor: pointer; padding: 2px 6px; }
.rd-star.on { color: var(--yellow); }
.rd-pag { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 12px; }
.rd-regra { border: 1px solid var(--border); background: var(--bg-1); padding: 12px 14px; margin-bottom: 12px; }
.rd-regra.off { opacity: .6; }
.rd-rg-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.rd-rg-n { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-2); font-size: var(--fs-xs); font-weight: 700; }
.rd-regra input.unrec-input.rd-nome { min-width: 0; width: 320px; max-width: 100%; font-weight: 600; }
.rd-rg-acts { margin-left: auto; display: inline-flex; border: 1px solid var(--border-strong); }
.rd-rg-acts button { background: var(--bg-1); border: none; border-right: 1px solid var(--border); color: var(--text-primary); width: 32px; height: 28px; cursor: pointer; }
.rd-rg-acts button:last-child { border-right: none; }
.rd-rg-acts button:disabled { opacity: .3; cursor: default; }
.rd-rg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rd-rg-col { display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-sm); }
.rd-rg-col h5 { margin: 4px 0 0; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); }
.rd-rg-col label { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rd-rg-col small { color: var(--text-secondary); font-size: var(--fs-xs); width: 100%; }
.rd-regra input.unrec-input.rd-in, .rd-regra select.unrec-input.rd-in, .rd-geral input.unrec-input { min-width: 0; width: 180px; }
.rd-regra input.unrec-input.rd-l { width: 100%; flex: 1 1 240px; }
.rd-regra input.unrec-input.rd-n { width: 76px; }
.rd-chks { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.rd-chks > span { color: var(--text-secondary); width: 100%; font-size: var(--fs-xs); }
.rd-esc { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rd-ate td { background: color-mix(in srgb, var(--green) 9%, transparent); }
.rd-barra { width: 34%; }
.rd-barra span { display: block; height: 8px; }
.rd-barra span.v { background: var(--red); opacity: .65; }
.rd-barra span.c { background: var(--green); opacity: .65; }
.rd-spark { width: 100%; height: 80px; color: var(--accent); display: block; }
.rd-spark-l { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--text-secondary); }
@media (max-width: 900px) { .rd-rg-grid, .rd-esc { grid-template-columns: 1fr; } }
.rd-regra .unrec-input, .rd-geral .unrec-input { flex: 0 0 auto; }
.rd-regra input.unrec-input.rd-n, .rd-geral input.unrec-input.rd-n { width: 76px; max-width: 76px; flex: 0 0 76px; min-width: 0; }
.rd-regra select.unrec-input.rd-in, .rd-regra input.unrec-input.rd-in:not(.rd-n):not(.rd-l):not(.rd-nome) { width: 220px; max-width: 100%; flex: 0 1 220px; }
.rd-regra input.unrec-input.rd-l { flex: 1 1 260px; width: auto; max-width: none; }
.rd-regra input.unrec-input.rd-nome { flex: 0 1 340px; }
.rd-bar select.unrec-input { width: auto; min-width: 200px; flex: 0 0 auto; }
.rd-busca { font-size: var(--fs-xs); color: var(--text-secondary); max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Início, menu por áreas, motores, ajustes (32-inicio.js) ── */
.in-nav .in-area { padding: 12px 12px; gap: 12px; align-items: center; position: relative; }
.in-area-ic { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-2); flex: 0 0 34px; }
.in-area-ic svg { width: 20px; height: 20px; }
.in-area.active .in-area-ic { background: var(--accent); color: #fff; }
.in-area-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.in-area-t b { font-size: var(--fs-md); font-weight: 600; color: var(--text-primary); }
.in-area.active .in-area-t b { color: var(--accent); }
.in-area-t small { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.in-area-n { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; }
.in-abas { display: flex; align-items: stretch; gap: 0; border-bottom: 1px solid var(--border); margin: 0 0 16px; overflow-x: auto; }
.in-abas-area { display: inline-flex; align-items: center; gap: 8px; padding: 0 16px 0 2px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }
.in-abas-area svg { width: 16px; height: 16px; }
.in-aba { background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-secondary); font: inherit; font-size: var(--fs-md); font-weight: 500; padding: 10px 14px; cursor: pointer; white-space: nowrap; }
.in-aba:hover { color: var(--text-primary); background: var(--bg-1); }
.in-aba.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
/* as abas da área substituem as barras internas dessas duas telas */
.view[data-view="ferramentas"] #ftTabs, .view[data-view="dados"] #ddNav { display: none; }
.in-topo { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 16px; }
.in-oi { font-size: 28px; font-weight: 700; margin: 0; }
.in-data { color: var(--text-secondary); margin: 2px 0 0; text-transform: capitalize; }
.in-hoje { border: 1px solid var(--border); background: var(--bg-1); padding: 14px 16px; margin-bottom: 20px; }
.in-hoje h2 { font-size: var(--fs-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 8px; }
.in-hoje-l { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); }
.in-hoje-l:first-of-type { border-top: none; }
.in-ponto { width: 9px; height: 9px; border-radius: 50%; background: var(--text-muted); flex: 0 0 9px; }
.in-hoje-l.erro .in-ponto { background: var(--red); } .in-hoje-l.aviso .in-ponto { background: var(--yellow); } .in-hoje-l.bom .in-ponto { background: var(--green); }
.in-hoje-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.in-hoje-t span { color: var(--text-secondary); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.in-vazio { color: var(--text-secondary); font-size: var(--fs-sm); padding: 6px 0; }
.in-blocos { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.in-bloco { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 20px 18px 16px; min-height: 172px; background: var(--bg-1); border: 1px solid var(--border); color: var(--text-primary); font: inherit; cursor: pointer; transition: border-color .12s, transform .12s, background .12s; }
.in-bloco:hover { border-color: var(--accent); background: var(--bg-2); transform: translateY(-2px); }
.in-bloco:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.in-bloco-ic { width: 56px; height: 56px; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); margin-bottom: 8px; }
.in-bloco-ic svg { width: 30px; height: 30px; }
.in-bloco-n { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.in-bloco-v { font-size: 22px; font-weight: 700; line-height: 1.2; }
.in-bloco-s { font-size: var(--fs-sm); color: var(--text-secondary); }
.in-bloco-a { position: absolute; top: 14px; right: 14px; font-size: var(--fs-xs); font-weight: 600; padding: 3px 8px; border: 1px solid var(--yellow); color: var(--text-primary); background: var(--bg-2); }
.in-bloco.ok .in-bloco-a { border-color: var(--green); } .in-bloco.bad .in-bloco-a { border-color: var(--red); } .in-bloco.muted .in-bloco-a { border-color: var(--border-strong); }
.in-sino { position: relative; }
.in-sino svg { width: 18px; height: 18px; }
.in-sino-n { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.in-sino-pop { position: fixed; top: 56px; right: 16px; width: min(460px, calc(100vw - 32px)); max-height: 70vh; overflow: auto; z-index: 9500; background: var(--bg-1); border: 1px solid var(--border-strong); box-shadow: 0 12px 40px rgba(0,0,0,.5); padding: 12px 16px; }
.in-sino-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.mo-perfil { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 0 6px; font-size: var(--fs-sm); }
.mo-perfis button { width: auto; padding: 0 14px; font-size: var(--fs-sm); }
.mo-perfis button.on { background: var(--accent); color: #fff; opacity: 1; }
.mo-janela { display: inline-flex; align-items: center; gap: 6px; }
.mo-janela input.unrec-input, input.unrec-input.aj-n { width: 70px; min-width: 0; flex: 0 0 70px; }
.mo-cfg { margin-left: auto; }
.mo-g { font-size: var(--fs-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin: 20px 0 8px; }
.mo-lista { display: flex; flex-direction: column; gap: 8px; }
.mo-card { display: grid; grid-template-columns: minmax(0, 1fr) 230px auto; gap: 16px; align-items: center; padding: 12px 14px; background: var(--bg-1); border: 1px solid var(--border); border-left: 3px solid var(--green); }
.mo-card.erro { border-left-color: var(--red); } .mo-card.pausa, .mo-card.aviso, .mo-card.pausa-geral { border-left-color: var(--yellow); } .mo-card.rodando { border-left-color: var(--accent); } .mo-card.desligado, .mo-card.pendente { border-left-color: var(--border-strong); }
.mo-card.desligado .mo-c1 { opacity: .6; }
.mo-nome { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mo-d { color: var(--text-secondary); font-size: var(--fs-sm); }
.mo-det { color: var(--text-muted); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.mo-erro { color: var(--red); font-size: var(--fs-sm); margin-top: 2px; }
.mo-c2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: var(--fs-sm); }
.mo-c2 span { display: block; color: var(--text-muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; }
.mo-c3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.mo-sw { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-secondary); min-width: 92px; }
.mo-ir { background: none; border: none; color: var(--accent); font: inherit; font-size: var(--fs-sm); cursor: pointer; padding: 4px; }
.aj-tbl td.c, .aj-tbl th.c { text-align: center; width: 120px; }
.aj-tbl input[type="checkbox"] { width: 18px; height: 18px; }
@media (max-width: 900px) { .mo-card { grid-template-columns: 1fr; } .mo-c3 { justify-content: flex-start; } }
.in-area-n[hidden], .in-sino-n[hidden] { display: none; }

/* ── Oficina de contratos (33-oficina.js) ── */
.of-vazio { padding: 24px; text-align: center; color: var(--text-secondary); }
.of-sugs, .of-grupos { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
.of-sug, .of-g { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 14px; background: var(--bg-1); border: 1px solid var(--border); color: var(--text-primary); font: inherit; font-size: var(--fs-sm); cursor: pointer; min-width: 180px; }
.of-sug span, .of-g span { color: var(--text-secondary); } .of-g small { color: var(--text-muted); font-size: var(--fs-xs); }
.of-sug:hover, .of-g:hover { border-color: var(--accent); }
.of-sug.bom { border-left: 3px solid var(--green); }
.of-g.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.of-slots { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.of-slot { aspect-ratio: 4 / 3.4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1px dashed var(--border-strong); background: var(--bg-1); color: var(--text-muted); font: inherit; font-size: var(--fs-xs); padding: 4px; min-width: 0; }
.of-slot.cheio { border-style: solid; border-color: var(--accent); cursor: pointer; color: var(--text-secondary); }
.of-slot img, .of-skin img, .of-saida img { width: 100%; max-width: 110px; height: 62px; object-fit: contain; }
.of-slot img { height: 44px; }
.of-semimg { display: block; width: 100%; max-width: 110px; height: 62px; background: var(--bg-2); }
.of-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.of-skin { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; padding: 10px 8px; background: var(--bg-1); border: 1px solid var(--border); color: var(--text-primary); font: inherit; font-size: var(--fs-sm); cursor: pointer; min-width: 0; }
.of-skin b { font-weight: 600; font-size: var(--fs-sm); line-height: 1.25; }
.of-skin span { color: var(--text-secondary); } .of-skin small { color: var(--text-muted); font-size: var(--fs-xs); }
.of-skin:hover:not(:disabled) { border-color: var(--accent); }
.of-skin.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.of-skin:disabled { opacity: .4; cursor: default; }
.of-saidas { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin: 12px 0; }
.of-saida { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; padding: 26px 10px 12px; background: var(--bg-1); border: 1px solid var(--border); font-size: var(--fs-sm); }
.of-saida.bom { border-top: 3px solid var(--green); } .of-saida.ruim { border-top: 3px solid var(--red); }
.of-saida b { font-weight: 600; line-height: 1.25; } .of-saida span { color: var(--text-secondary); }
.of-saida span.up { color: var(--green); } .of-saida span.down { color: var(--red); }
.of-chance { position: absolute; top: 6px; left: 8px; font-weight: 700; font-size: var(--fs-md); }
.of-barra { width: 100%; height: 4px; background: var(--bg-2); margin-top: 6px; } .of-barra span { display: block; height: 4px; background: var(--accent); }
@media (max-width: 900px) { .of-slots { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.rd-bar input.unrec-input.rd-pn { width: 110px; min-width: 0; flex: 0 0 110px; }
.in-acoes { margin-bottom: 14px; }
.in-acoes-b { display: flex; flex-wrap: wrap; gap: 8px; }
.rd-ov { z-index: 10050; }

/* ── Layout enxuto: barra da área com ícones, página da área, ajuda recolhida ── */
.in-abas { display: block; border-bottom: none; margin: 0 0 18px; overflow: visible; }
.in-abas-l { display: flex; align-items: stretch; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.in-volta { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 84px; padding: 10px 12px; background: none; border: 1px solid transparent; border-right: 1px solid var(--border); color: var(--text-muted); font: inherit; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.in-volta svg { width: 24px; height: 24px; }
.in-volta:hover { color: var(--accent); }
.in-aba { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-width: 104px; padding: 10px 14px; background: var(--bg-1); border: 1px solid var(--border); border-bottom: 1px solid var(--border); color: var(--text-secondary); font: inherit; font-size: var(--fs-sm); font-weight: 500; cursor: pointer; white-space: nowrap; }
.in-aba-ic { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-2); color: var(--text-secondary); }
.in-aba-ic svg { width: 22px; height: 22px; }
.in-aba:hover { border-color: var(--accent); color: var(--text-primary); background: var(--bg-1); }
.in-aba.active { border-color: var(--accent); border-bottom-color: var(--accent); color: var(--text-primary); font-weight: 600; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.in-aba.active .in-aba-ic { background: var(--accent); color: #fff; }
.in-subs { display: inline-flex; margin-top: 12px; border: 1px solid var(--border-strong); }
.in-sub { background: var(--bg-1); border: none; border-right: 1px solid var(--border); color: var(--text-secondary); font: inherit; font-size: var(--fs-md); padding: 8px 18px; cursor: pointer; }
.in-sub:last-child { border-right: none; }
.in-sub:hover { color: var(--text-primary); }
.in-sub.active { background: var(--accent); color: #fff; font-weight: 600; }
/* subtítulos e barras duplicadas saem; o título fica menor */
.in-enxuto .view:not([data-view="inicio"]):not([data-view="area"]) .view-header .view-sub { display: none; }
.in-enxuto .view .view-header { margin-bottom: 10px; }
.in-enxuto .view .view-header .view-title { font-size: 20px; }
.in-enxuto .range-tabs.fx-tabs .range-tab { padding: 9px 16px; font-size: var(--fs-md); }
details.in-info { margin: 0 0 12px; }
details.in-info > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text-muted); font-size: var(--fs-sm); list-style: none; padding: 2px 0; }
details.in-info > summary::before { content: 'i'; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border: 1px solid currentColor; border-radius: 50%; font-size: 11px; font-weight: 700; font-style: italic; }
details.in-info > summary::-webkit-details-marker { display: none; }
details.in-info > summary:hover { color: var(--accent); }
details.in-info[open] > summary { margin-bottom: 6px; }
details.in-info > p, details.in-info > div { margin: 0; }
.hub-topo { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.hub-ic { width: 64px; height: 64px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; }
.hub-ic svg { width: 34px; height: 34px; }
.hub-d { text-transform: none; }
.hub-blocos { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.hub-blocos .in-bloco { min-height: 190px; }
.hub-blocos .in-bloco-n { font-size: var(--fs-md); letter-spacing: 0; text-transform: none; color: var(--text-primary); font-weight: 700; }
.hub-blocos .in-bloco-ic { width: 64px; height: 64px; } .hub-blocos .in-bloco-ic svg { width: 34px; height: 34px; }
.hub-desc { line-height: 1.4; }
.hub-subs { margin-top: auto; padding-top: 8px; font-size: var(--fs-xs); color: var(--text-muted); }
.in-passos .am-lot { margin-bottom: 6px; max-width: 320px; }
.search-wrap { position: relative; }
.in-busca { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 9400; background: var(--bg-1); border: 1px solid var(--border-strong); box-shadow: 0 12px 30px rgba(0,0,0,.45); padding: 6px; }
.in-busca[hidden] { display: none; }
.in-busca-h { font-size: var(--fs-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); padding: 4px 8px; }
.in-busca button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: none; color: var(--text-primary); font: inherit; padding: 6px 8px; cursor: pointer; }
.in-busca button:hover { background: var(--bg-2); }
.in-busca small { display: block; color: var(--text-muted); font-size: var(--fs-xs); }
.aj-perm { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.aj-perm-l { display: grid; grid-template-columns: 56px minmax(0, 1fr) 260px; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); background: var(--bg-1); }
.aj-perm-l .in-bloco-ic { margin: 0; }
.aj-perm-l div span { display: block; color: var(--text-secondary); font-size: var(--fs-sm); }
.aj-perm-l select.unrec-input { width: 100%; min-width: 0; }
@media (max-width: 760px) { .aj-perm-l { grid-template-columns: 1fr; } .in-aba { min-width: 86px; } }
