/* MAVT Hub — identidade visual MAVT (dark, minimal, azul tech) */
:root {
  color-scheme: dark;
  --page: #0d0d0f;
  --surface: #16161a;
  --surface-2: #1c1c22;
  --ink: #f5f6f8;
  --ink-2: #b8bac2;
  --muted: #82848d;
  --grid: #26262e;
  --border: rgba(255, 255, 255, 0.08);
  --brand: #3b82f6;
  --brand-2: #2563eb;
  --brand-ink: #7fb0f9;
  --brand-grad: linear-gradient(180deg, #60a5fa, #2563eb);
  --good: #0ca30c;
  --good-text: #4ade80;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #ef4444;
  --sidebar-bg: radial-gradient(circle at 50% 30%, #101014 0%, #060607 100%);
}

* { box-sizing: border-box; margin: 0; }
body {
  font-family: 'Outfit', system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--ink);
  font-size: 14px;
  letter-spacing: .01em;
}

/* ---------- wordmark MAVT ---------- */
.wordmark {
  font-weight: 600; letter-spacing: .38em; color: #fff;
  text-transform: uppercase; display: inline-flex; align-items: baseline;
}
.wordmark .logo-a { position: relative; display: inline-block; }
.wordmark .logo-a::after {
  content: ''; position: absolute; left: 42%; bottom: .1em;
  transform: translateX(-50%);
  width: .38em; height: .34em;
  background: var(--brand-grad);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.wordmark .hub {
  font-weight: 300; letter-spacing: .1em; color: var(--brand-ink);
  margin-left: .5em; text-transform: none;
}

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 42%, #17171c 0%, #060607 70%);
}
.login-card { width: 360px; padding: 40px 36px; text-align: center; }
.login-card h1 { font-size: 30px; margin-bottom: 10px; }
.login-card .sub { color: var(--muted); margin-bottom: 30px; font-size: 13px; font-weight: 300; letter-spacing: .08em; }
.login-card label { display: block; text-align: left; font-size: 11.5px; color: var(--ink-2); margin: 14px 0 5px; letter-spacing: .06em; text-transform: uppercase; }
.login-card input {
  width: 100%; padding: 11px 14px; border: 1px solid var(--grid); border-radius: 10px;
  background: rgba(255,255,255,.04); color: var(--ink); font-size: 14px; font-family: inherit;
  transition: border-color .15s;
}
.login-card input:focus { outline: none; border-color: var(--brand); }
.login-card button {
  width: 100%; margin-top: 26px; padding: 12px; border: 0; border-radius: 10px;
  background: var(--brand-grad); color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit; letter-spacing: .04em;
}
.login-card button:hover { filter: brightness(1.12); }
.login-erro { color: var(--critical); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; flex-shrink: 0; background: var(--sidebar-bg); color: var(--ink-2);
  display: flex; flex-direction: column; padding: 22px 0;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--border);
}
.logo { padding: 0 22px 24px; font-size: 17px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 11px 22px;
  color: var(--ink-2); text-decoration: none; font-size: 13.5px; font-weight: 400;
  border-left: 2px solid transparent; transition: background .12s, color .12s;
}
.nav a:hover { background: rgba(255,255,255,.04); color: #fff; }
.nav a.ativa {
  border-left-color: var(--brand); color: #fff;
  background: linear-gradient(90deg, rgba(59,130,246,.14), transparent 80%);
}
.nav .badge {
  margin-left: auto; background: var(--critical); color: #fff; border-radius: 10px;
  font-size: 11px; padding: 1px 7px; font-weight: 600;
}
.sidebar .rodape { margin-top: auto; padding: 16px 22px; font-size: 12px; color: var(--muted); }
.sidebar .rodape button {
  background: none; border: 1px solid var(--grid); color: var(--ink-2);
  border-radius: 8px; padding: 5px 12px; cursor: pointer; font-size: 12px; margin-top: 8px;
  font-family: inherit;
}
.sidebar .rodape button:hover { border-color: var(--brand); color: #fff; }

.main { flex: 1; padding: 28px 32px; max-width: 1280px; }
.main h2 { font-size: 20px; margin-bottom: 2px; font-weight: 600; letter-spacing: .01em; }
.main .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; font-weight: 300; }

/* ---------- stat tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 12px; margin-bottom: 24px; }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px;
}
.tile .rotulo { font-size: 12px; color: var(--ink-2); margin-bottom: 7px; font-weight: 300; letter-spacing: .03em; }
.tile .valor { font-size: 25px; font-weight: 600; letter-spacing: .01em; }
.tile .detalhe { font-size: 12px; color: var(--muted); margin-top: 5px; font-weight: 300; }
.tile .valor.bom { color: var(--good-text); }
.tile .valor.ruim { color: var(--critical); }

/* ---------- tabelas ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; margin-bottom: 20px;
}
.card .card-titulo { padding: 14px 18px; font-weight: 600; font-size: 14px; border-bottom: 1px solid var(--grid); }
.tabela-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); padding: 10px 15px; border-bottom: 1px solid var(--grid);
  font-weight: 500; white-space: nowrap;
}
td { padding: 9px 15px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(59,130,246,.05); }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th.num { text-align: right; }
td .cod { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--brand-ink); cursor: pointer; }
td .cod:hover { text-decoration: underline; }
.nome-loja { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- chips de status (ícone + texto, nunca só cor) ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500;
  padding: 2.5px 10px; border-radius: 20px; white-space: nowrap;
}
.chip::before { font-size: 10px; }
.chip.pago      { background: rgba(12,163,12,.16);  color: var(--good-text); }
.chip.pago::before      { content: "✓"; }
.chip.a-pagar   { background: rgba(130,132,141,.16); color: var(--ink-2); }
.chip.a-pagar::before   { content: "○"; }
.chip.atrasado  { background: rgba(239,68,68,.16);  color: #f87171; }
.chip.atrasado::before  { content: "!"; }
.chip.acordo    { background: rgba(250,178,25,.15); color: var(--warning); }
.chip.acordo::before    { content: "◆"; }
.chip.cancelamento { background: rgba(236,131,90,.15); color: var(--serious); }
.chip.cancelamento::before { content: "⤫"; }

.chip.cresce { background: rgba(12,163,12,.16); color: var(--good-text); }
.chip.cresce::before { content: "▲"; }
.chip.queda  { background: rgba(239,68,68,.16); color: #f87171; }
.chip.queda::before  { content: "▼"; }
.chip.estavel { background: rgba(130,132,141,.16); color: var(--ink-2); }
.chip.estavel::before { content: "●"; }
.chip.neutro { background: rgba(130,132,141,.16); color: var(--ink-2); }

/* ---------- filtros ---------- */
.filtros { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filtros input, .filtros select {
  padding: 8px 12px; border: 1px solid var(--grid); border-radius: 10px;
  background: var(--surface); color: var(--ink); font-size: 13px; font-family: inherit;
}
.filtros input:focus, .filtros select:focus { outline: none; border-color: var(--brand); }
.filtros input[type="text"] { width: 270px; }

/* ---------- botões ---------- */
.btn-pri, .btn-sec, .btn-perigo {
  padding: 9px 18px; border-radius: 10px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; white-space: nowrap; font-family: inherit;
  letter-spacing: .02em;
}
.btn-pri { background: var(--brand-grad); color: #fff; }
.btn-pri:hover { filter: brightness(1.12); }
.btn-sec { background: var(--surface-2); color: var(--ink); border-color: var(--grid); }
.btn-sec:hover { border-color: var(--brand); }
.btn-perigo { background: var(--critical); color: #fff; }
.btn-perigo:hover { filter: brightness(1.12); }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(3px);
}
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 26px; width: 540px; max-width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 70px rgba(0,0,0,.6);
}
.modal h3 { font-size: 17px; margin-bottom: 2px; font-weight: 600; }
.modal .modal-sub { color: var(--muted); font-size: 13px; font-weight: 300; }
.modal-acoes { display: flex; gap: 8px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
.modal input { font-family: inherit; }
.modal input:focus { outline: none; border-color: var(--brand) !important; }

/* ---------- ficha da loja ---------- */
.voltar { color: var(--brand-ink); cursor: pointer; font-size: 13px; margin-bottom: 12px; display: inline-block; }
.voltar:hover { text-decoration: underline; }
.ficha-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 4px 24px; padding: 16px 18px; }
.ficha-grid div { padding: 5px 0; font-size: 13px; }
.ficha-grid .rotulo { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 500; }

/* ---------- relatório ---------- */
.rel-cabecalho { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.rel-marca { font-size: 15px; margin-bottom: 10px; }
.rel-rodape { color: var(--muted); font-size: 11.5px; margin-top: 8px; font-weight: 300; }

.aviso {
  background: rgba(250,178,25,.10); border: 1px solid rgba(250,178,25,.35);
  border-radius: 10px; padding: 11px 15px; font-size: 13px; margin-bottom: 16px;
}
.aviso a { color: var(--brand-ink); }
.vazio { padding: 34px; text-align: center; color: var(--muted); font-weight: 300; }

/* ---------- impressão (relatório sai claro no papel) ---------- */
@media print {
  .sidebar, .nao-imprime { display: none !important; }
  body { background: #fff; color: #111; }
  .main { padding: 0; max-width: none; }
  .card, .tile { background: #fff; border-color: #ccc; break-inside: avoid; }
  .card .card-titulo, .main h2, .tile .valor, td, th { color: #111; }
  .tile .rotulo, .tile .detalhe, .main .sub, .rel-rodape { color: #555; }
  .chip { border: 1px solid #bbb; background: none !important; color: #333 !important; }
  .wordmark { color: #111; }
  .wordmark .hub { color: #2563eb; }
  tbody tr:hover { background: none; }
}
