/* Dashboard Empório Teixeira — tokens do design system da marca (só tema claro). */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("brand/BricolageGrotesque-Variable.ttf") format("truetype-variations");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Raleway";
  src: url("brand/Raleway-Variable.ttf") format("truetype-variations");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  color-scheme: light;
  /* Paleta da marca */
  --et-green: #69b737;
  --et-green-dark: #578f31;
  --et-teal: #027fa0;
  --et-teal-dark: #016578;
  --et-navy: #105481;
  --et-navy-dark: #0c4162;
  --et-cream: #fbf7ee;
  --et-sand: #f2ead9;
  --et-white: #ffffff;
  --et-ink: #20291f;
  --et-ink-soft: #4d564a;

  --color-primary: var(--et-navy);
  --color-secondary: var(--et-teal);
  --surface-page: var(--et-cream);
  --surface-card: var(--et-white);
  --surface-sunken: var(--et-sand);
  --text-body: var(--et-ink);
  --text-soft: var(--et-ink-soft);
  --text-muted: #6f7769;
  --text-inverse: var(--et-white);
  --text-link: var(--et-teal);
  --text-link-hover: var(--et-teal-dark);
  --border-default: #dcd3bd;
  --border-strong: #b9ac8c;
  --border-focus: var(--et-teal);
  --state-success: var(--et-green);
  --state-info: var(--et-teal);
  --state-warning: #c98a2c;
  --state-error: #b3452f;

  --font-display: "Bricolage Grotesque", serif;
  --font-body: "Raleway", sans-serif;
  --weight-medium: 500;
  --weight-heading: 600;
  --tracking-tight: -0.01em;
  --tracking-wide: 0.08em;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px;
  --radius-s: 6px; --radius-m: 12px; --radius-l: 20px; --radius-pill: 999px;

  --shadow-s: 0 1px 2px rgba(16, 84, 129, 0.08);
  --shadow-m: 0 4px 16px rgba(16, 84, 129, 0.10);
  --shadow-l: 0 12px 36px rgba(16, 84, 129, 0.14);
  --ease-standard: cubic-bezier(.4, 0, .2, 1);
  --duration-fast: 120ms;

  /* Gráficos: série única na cor primária; grade quente, discreta */
  --series-1: var(--et-navy);
  --grid: #ebe3cf;
  --axis: var(--border-strong);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-body);
  font: 400 14px/1.5 var(--font-body);
  /* Raleway usa algarismos de estilo antigo por padrão; valores financeiros pedem algarismos alinhados */
  font-variant-numeric: lining-nums;
}
a { color: var(--text-link); text-decoration: none; transition: color var(--duration-fast) var(--ease-standard); }
a:hover { color: var(--text-link-hover); text-decoration: underline; }
code { font-size: 12px; background: var(--surface-sunken); padding: 1px 6px; border-radius: var(--radius-s); }

/* Cabeçalho: logo + navegação no estilo de abas da marca + faixa de renda */
header {
  background: var(--surface-page);
  border-bottom: 1px solid var(--border-default);
  position: sticky; top: 0; z-index: 10;
}
.topbar { max-width: 1280px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; color: var(--color-primary); }
.brand:hover { text-decoration: none; }
.brand img { height: 30px; width: auto; display: block; }
.brand .product { font-family: var(--font-display); font-weight: var(--weight-heading); font-size: 15px; letter-spacing: var(--tracking-tight); color: var(--text-soft); }
nav { display: flex; gap: 24px; overflow-x: auto; align-self: stretch; scrollbar-width: none; }
nav::-webkit-scrollbar { display: none; }
nav a {
  color: var(--text-soft); font-weight: var(--weight-medium); white-space: nowrap;
  display: flex; align-items: center; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
nav a:hover { color: var(--color-primary); text-decoration: none; }
nav a.active { color: var(--color-primary); border-bottom-color: var(--color-secondary); }
.lace {
  height: 18px;
  background: url("brand/lace-pattern.png") center / 90px repeat-x;
  opacity: 0.55;
}

main { max-width: 1280px; margin: 0 auto; padding: 24px 16px 56px; }
h1, h2 { font-family: var(--font-display); font-weight: var(--weight-heading); letter-spacing: var(--tracking-tight); color: var(--text-body); }
h1 { font-size: 1.75rem; line-height: 1.15; margin: 0 0 4px; }
h2 { font-size: 1.125rem; line-height: 1.25; margin: 0 0 12px; }
.sub { color: var(--text-soft); margin: 0 0 24px; }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }

.card {
  background: var(--surface-card); border: 1px solid var(--border-default); border-radius: var(--radius-m);
  box-shadow: var(--shadow-s); padding: var(--space-5); margin-bottom: var(--space-4);
}
.grid { display: grid; gap: 16px; }
.grid-4, .grid-2 { margin-bottom: var(--space-4); }
.grid > .card { margin-bottom: 0; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-2 { grid-template-columns: 1fr; } }
.span-2 { grid-column: span 2; }
@media (max-width: 520px) {
  .grid-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .topbar { gap: 16px; }
  .brand .product { display: none; }
}

/* Indicadores: rótulo em versalete da marca, valor na fonte de destaque */
.tile .label { color: var(--text-link); font-size: 12px; letter-spacing: var(--tracking-wide); text-transform: uppercase; font-weight: var(--weight-medium); }
.tile .value { white-space: nowrap; font-family: var(--font-display); font-size: 1.75rem; font-weight: var(--weight-heading); letter-spacing: var(--tracking-tight); margin-top: 6px; }
.tile .detail { color: var(--text-soft); font-size: 13px; margin-top: 2px; }
.hero {
  background: var(--color-primary); border-color: var(--color-primary); border-radius: var(--radius-l);
  box-shadow: var(--shadow-m); color: var(--text-inverse);
}
.hero .label { color: rgba(255, 255, 255, 0.78); }
.hero .value { font-size: 3rem; line-height: 1.08; color: var(--text-inverse); }
.hero .detail { color: rgba(255, 255, 255, 0.82); }

/* Avisos no estilo Toast da marca */
.flash {
  padding: 12px 16px; border-radius: var(--radius-m); margin-bottom: 16px;
  background: var(--surface-card); border: 1px solid var(--border-default); border-left: 4px solid var(--state-info);
  box-shadow: var(--shadow-s);
}
.flash.ok { border-left-color: var(--state-success); }
.flash.error { border-left-color: var(--state-error); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--grid); text-align: left; vertical-align: middle; }
th {
  font-size: 11px; font-weight: var(--weight-heading); color: var(--text-soft); white-space: nowrap;
  letter-spacing: var(--tracking-wide); text-transform: uppercase; border-bottom-color: var(--border-default);
}
td.num, th.num { text-align: right; font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
tbody tr:hover td { background: var(--surface-page); }
tfoot td { font-weight: 600; border-top: 1px solid var(--border-strong); }

/* Níveis e Buy Box no formato Badge da marca: ícone + texto, nunca só cor */
.status {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: 12px; font-weight: var(--weight-medium); padding: 3px 10px; border-radius: var(--radius-pill);
}
.status .icon { font-size: 10px; line-height: 1; }
.status.critical { background: rgba(179, 69, 47, 0.12); color: #8a3521; }
.status.serious { background: rgba(201, 138, 44, 0.16); color: #7d5418; }
.status.warning { background: rgba(2, 127, 160, 0.12); color: var(--et-teal-dark); }
.status.good { background: rgba(105, 183, 55, 0.16); color: #46742a; }
td.rank { white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.delta { font-size: 11px; margin-left: 2px; }
.delta.up { color: var(--et-green-dark); }
.delta.down { color: var(--text-soft); }
/* Miniatura do produto (fundo branco: as fotos da Amazon têm fundo branco) */
.thumb {
  width: 40px; height: 40px; object-fit: contain; display: block;
  background: var(--et-white); border: 1px solid var(--border-default); border-radius: var(--radius-s);
}
.thumb.empty { background: var(--surface-sunken); }
.thumb.large { width: 96px; height: 96px; border-radius: var(--radius-m); }
td.col-imagem { width: 52px; padding-top: 6px; padding-bottom: 6px; }
td.col-sku { white-space: nowrap; color: var(--text-soft); font-size: 13px; }
td.col-produto { min-width: 200px; }
.name-cell { display: inline; }
.edit-link {
  margin-left: 6px; color: var(--text-muted); font-size: 13px; text-decoration: none;
  opacity: 0; transition: opacity var(--duration-fast) var(--ease-standard);
}
tr:hover .edit-link, .edit-link:focus-visible { opacity: 1; }
@media (hover: none) { .edit-link { opacity: 1; } }
.edit-link:hover { color: var(--text-link); text-decoration: none; }
.product-head { display: flex; gap: 16px; align-items: center; margin-bottom: 20px; }
.field { gap: 6px; font-weight: var(--weight-medium); }
.field .small { font-weight: 400; }

/* Seletor de colunas */
.column-picker { position: relative; }
.column-picker > summary { list-style: none; }
.column-picker > summary::-webkit-details-marker { display: none; }
.picker-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: min(300px, 86vw);
  background: var(--surface-card); border: 1px solid var(--border-default); border-radius: var(--radius-m);
  box-shadow: var(--shadow-l); padding: var(--space-4); display: grid; gap: 12px;
}
.picker-list { display: grid; gap: 8px; max-height: 50vh; overflow-y: auto; }

/* Nome do produto clicável: discreto na tabela, teal ao passar o mouse */
.product-link { color: var(--text-body); }
.product-link:hover { color: var(--text-link); }
.product-link .ext { font-size: 11px; color: var(--text-muted); margin-left: 4px; }
.product-link:hover .ext { color: var(--text-link); }
/* Tag da marca: pílula com borda */
.chip {
  display: inline-block; padding: 2px 10px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-default); background: var(--surface-card); color: var(--text-body);
  font-size: 12px; margin: 1px 4px 1px 0; white-space: nowrap;
}
a.chip:hover { border-color: var(--border-strong); text-decoration: none; }

/* Formulários */
form.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
input, select, button { font: inherit; color: var(--text-body); }
input[type=text], input[type=number], input[type=search], input[type=password], select {
  background: var(--surface-card); border: 1px solid var(--border-default); border-radius: var(--radius-m);
  padding: 8px 12px; min-width: 0; font-size: 14px;
  transition: border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}
input:focus-visible, select:focus-visible {
  outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(2, 127, 160, 0.15);
}
input[type=checkbox] { accent-color: var(--color-secondary); width: 16px; height: 16px; }
input[type=file] { font-size: 13px; color: var(--text-soft); }

/* Botões em pílula: primário marinho, secundário em contorno */
button, .button {
  font-family: var(--font-body); font-weight: var(--weight-medium); font-size: 14px;
  background: var(--color-primary); color: var(--text-inverse); border: 1px solid transparent;
  border-radius: var(--radius-pill); padding: 8px 18px; cursor: pointer; display: inline-block; white-space: nowrap;
  transition: filter var(--duration-fast) var(--ease-standard), background var(--duration-fast) var(--ease-standard);
}
button:hover, .button:hover { filter: brightness(0.92); text-decoration: none; color: var(--text-inverse); }
button:focus-visible, .button:focus-visible, a:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
button:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }
button.secondary, .button.secondary { background: transparent; color: var(--color-primary); border-color: var(--border-strong); }
button.secondary:hover, .button.secondary:hover { filter: none; background: var(--surface-sunken); color: var(--color-primary); }
button.danger { background: var(--state-error); }
label.check { display: inline-flex; gap: 8px; align-items: center; color: var(--text-soft); }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.bulk { position: sticky; bottom: 0; background: var(--surface-card); border-top: 1px solid var(--border-default); padding: 12px 0; margin-top: 8px; }
/* No celular a barra fixa cobriria a tabela inteira */
@media (max-width: 700px) { .bulk { position: static; } }

/* Gráficos */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--text-muted); font-size: 11px; font-family: var(--font-body); font-variant-numeric: lining-nums tabular-nums; }
.chart .bar { fill: var(--series-1); transition: opacity var(--duration-fast) var(--ease-standard); }
.chart .bar.dim { opacity: 0.35; }
.chart .hit { fill: transparent; cursor: default; }
.chart .bar.hover { opacity: 0.8; }
/* Tooltip da marca: fundo tinta, texto branco */
.tooltip {
  position: absolute; pointer-events: none; background: var(--et-ink); color: var(--text-inverse);
  border-radius: var(--radius-s); padding: 7px 10px; font-size: 12px; box-shadow: var(--shadow-m);
  white-space: nowrap; display: none; z-index: 5;
}
.tooltip strong { display: block; font-weight: 600; }
.tooltip span { color: rgba(255, 255, 255, 0.78); }
details summary { cursor: pointer; color: var(--text-link); margin-top: 10px; font-size: 13px; font-weight: var(--weight-medium); }

/* Login */
.login-mark { width: 56px; height: 56px; margin: 0 auto 4px; display: block; }
