﻿/* ============================================================
   SHARED.CSS — Design system único da Envia Ofertas
   Paleta: base slate neutra (sem marrom), acento âmbar.
   Sidebar fixa à esquerda que EMPURRA o conteúdo (não sobrepõe).
   ============================================================ */

:root {
  /* ---- base (slate neutro, frio) ---- */
  --bg: #0e131b;              /* fundo da página */
  --bg-soft: #131a24;         /* blocos internos */
  --chrome: #090d14;          /* header e sidebar — mais escuro */
  --chrome-2: #0b1017;

  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);

  --text: #eef2f7;
  --text-dim: rgba(238, 242, 247, 0.66);
  --text-muted: rgba(238, 242, 247, 0.42);

  /* ---- acento ---- */
  --accent: #f59e0b;          /* âmbar */
  --accent-2: #fbbf24;
  --accent-soft: rgba(245, 158, 11, 0.12);
  --accent-line: rgba(245, 158, 11, 0.30);

  --green: #34d399;
  --blue: #60a5fa;
  --pink: #f472b6;
  --purple: #a78bfa;
  --cyan: #22d3ee;
  --red: #f87171;

  /* ---- espaçamento (escala 4pt) ---- */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 40px; --sp-9: 56px;

  /* ---- raio ---- */
  --r-sm: 9px; --r-md: 13px; --r-lg: 18px; --r-xl: 22px; --r-full: 999px;

  /* ---- layout ---- */
  --rail: 72px;
  --rail-open: 244px;
  --gutter: var(--sp-8);      /* respiro maior das páginas */
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --header-h: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

html, body { background: var(--bg); color: var(--text); overflow-x: hidden; }

body {
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background:
    radial-gradient(ellipse 900px 560px at 82% -5%, rgba(96, 165, 250, 0.07), transparent 62%),
    radial-gradient(ellipse 700px 500px at 8% 105%, rgba(245, 158, 11, 0.05), transparent 62%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}

::selection { background: rgba(245, 158, 11, 0.3); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--r-full);
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); background-clip: content-box; }

/* ============================================================
   SIDEBAR — fixa no canto esquerdo, empurra o conteúdo
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--rail);
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding: var(--sp-3) var(--sp-2);
  border-right: 1px solid var(--border);
  background: var(--chrome);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: width 0.24s var(--ease), transform 0.24s var(--ease);
}
.sidebar::-webkit-scrollbar { width: 0; }
.sidebar.expanded { width: var(--rail-open); padding: var(--sp-3); }

/* --- cabeçalho do menu --- */
.sidebar-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  height: var(--header-h);
  padding: 0 var(--sp-1);
  margin-bottom: var(--sp-3);
  flex-shrink: 0;
}
.sidebar:not(.expanded) .sidebar-head { justify-content: center; padding: 0; }

.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); min-width: 0; }
.logo {
  width: 46px; height: 46px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-name {
  white-space: nowrap;
  opacity: 0; width: 0; overflow: hidden; transition: opacity 0.16s;
  display: inline-flex; align-items: center;
  flex-shrink: 1; min-width: 0;
}
/* Brand wordmark — texto HTML com Poppins ExtraBold 800.
   Wordmark levemente espaçada, usa as cores oficiais:
   #FDFDFD para "Envia" e #FFD21A para "Ofertas". */
.bn-envia, .bn-ofertas {
  font-family: 'Poppins', 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.03em;
  line-height: 1;
  display: inline-block;
}
.bn-envia { color: #FDFDFD; }
.bn-ofertas { color: #FFD21A; margin-left: 0.18em; }
.sidebar.expanded .brand-name { opacity: 1; width: auto; overflow: visible; transition-delay: 0.06s; }

/* --- itens --- */
.nav-scroll { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 2px; }

.nav-section {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: var(--sp-5) var(--sp-3) var(--sp-2);
  white-space: nowrap;
  overflow: hidden;
}
/* no rail fechado a legenda vira um traço centralizado */
.sidebar:not(.expanded) .nav-section {
  font-size: 0; padding: 0; height: 1px;
  background: var(--border);
  width: 24px; margin: var(--sp-3) auto;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  height: 42px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-sm);
  color: var(--text-dim);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
/* fechado: some o padding e centraliza o ícone — corrige o desalinhamento */
.sidebar:not(.expanded) .nav-item { padding: 0; justify-content: center; gap: 0; }
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; }
.nav-label {
  font-size: 13.5px; font-weight: 500;
  opacity: 0; width: 0; overflow: hidden;
  transition: opacity 0.16s;
}
.sidebar.expanded .nav-label { opacity: 1; width: auto; transition-delay: 0.06s; }
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-2); }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.sidebar:not(.expanded) .nav-item.active::before { left: calc(var(--sp-2) * -1); }

.nav-item .pill {
  margin-left: auto;
  font-size: 10.5px; font-weight: 700;
  padding: 2px 7px; border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  opacity: 0; width: 0; overflow: hidden;
}
.sidebar.expanded .nav-item .pill { opacity: 1; width: auto; }
.nav-item.active .pill { background: var(--accent-soft); color: var(--accent-2); }

.nav-dot {
  position: absolute; top: 9px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
}
.sidebar.expanded .nav-dot { display: none; }
.spacer { flex: 1; min-height: var(--sp-5); }

.sidebar-foot { flex-shrink: 0; padding-top: var(--sp-3); border-top: 1px solid var(--border); margin-top: var(--sp-3); }

/* ============================================================
   SHELL
   ============================================================ */
.app {
  margin-left: var(--rail);
  min-height: 100vh;
  transition: margin-left 0.24s var(--ease);
}
body.nav-open .app { margin-left: var(--rail-open); }

/* ========== HEADER fixo ========== */
header.topbar {
  position: sticky;
  top: 0;
  z-index: 150;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: 0 var(--gutter);
  background: var(--chrome-2);
  border-bottom: 1px solid var(--border);
}
.head-left { display: flex; align-items: center; gap: var(--sp-4); min-width: 0; }
.title { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.subtitle { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

.header-actions { display: flex; gap: var(--sp-2); align-items: center; }
.h-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: transparent;
  border: 1px solid transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-dim);
  position: relative;
  transition: all 0.16s var(--ease);
  flex-shrink: 0;
  text-decoration: none;
}
.h-btn:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.h-btn .dot {
  position: absolute; top: 7px; right: 8px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid var(--chrome-2);
}
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #1a1206; font-size: 13px;
  cursor: pointer; flex-shrink: 0; text-decoration: none;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  border-radius: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.user-info:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}
.user-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}
.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.user-email {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
@media (max-width: 720px) {
  .user-text { display: none; }
  .user-info { padding: 4px; }
}
.menu-btn { display: inline-flex; }

/* ========== conteúdo ========== */
main {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  max-width: 1500px;
  margin: 0 auto;
  padding: var(--gutter);
  min-width: 0;
}

/* ============================================================
   COMPONENTES
   ============================================================ */
.card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
}
.card-flat { background: transparent; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); margin-bottom: var(--sp-5); flex-wrap: wrap;
}
.card-title { font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; }
.card-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.section-title { display: flex; align-items: center; gap: var(--sp-2); font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.section-count {
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: var(--r-full);
  background: var(--accent-soft); color: var(--accent-2);
}

/* ---- ícone em bloco ---- */
.ic {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.ic svg { width: 18px; height: 18px; }
.ic-sm { width: 30px; height: 30px; border-radius: var(--r-sm); }
.ic-sm svg { width: 15px; height: 15px; }
.ic-lg { width: 46px; height: 46px; }
.ic-lg svg { width: 21px; height: 21px; }
.ic-accent { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-2); }
.ic-green  { background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.25); color: var(--green); }
.ic-blue   { background: rgba(96, 165, 250, 0.12); border-color: rgba(96, 165, 250, 0.25); color: var(--blue); }
.ic-pink   { background: rgba(244, 114, 182, 0.12);border-color: rgba(244, 114, 182, 0.25);color: var(--pink); }
.ic-purple { background: rgba(167, 139, 250, 0.12);border-color: rgba(167, 139, 250, 0.25);color: var(--purple); }
.ic-cyan   { background: rgba(34, 211, 238, 0.12); border-color: rgba(34, 211, 238, 0.25); color: var(--cyan); }
.ic-red    { background: rgba(248, 113, 113, 0.12);border-color: rgba(248, 113, 113, 0.25);color: var(--red); }

/* ---- botões ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2);
  height: 38px;
  padding: 0 var(--sp-4);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  text-decoration: none;
  transition: all 0.16s var(--ease);
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:hover { background: rgba(255, 255, 255, 0.09); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  border-color: transparent; color: #1a1206;
}
.btn-primary:hover { filter: brightness(1.08); background: linear-gradient(140deg, var(--accent), var(--accent-2)); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.btn-danger { color: var(--red); border-color: rgba(248, 113, 113, 0.3); background: rgba(248, 113, 113, 0.08); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.16); }
.btn-sm { height: 32px; padding: 0 var(--sp-3); font-size: 12px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-block { width: 100%; }

/* ---- badges ---- */
.badge-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  white-space: nowrap;
}
.badge-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-pill.no-dot::before { display: none; }
.b-green  { color: var(--green);  background: rgba(52, 211, 153, 0.10);  border-color: rgba(52, 211, 153, 0.25); }
.b-accent { color: var(--accent-2); background: var(--accent-soft);       border-color: var(--accent-line); }
.b-blue   { color: var(--blue);   background: rgba(96, 165, 250, 0.10);  border-color: rgba(96, 165, 250, 0.25); }
.b-purple { color: var(--purple); background: rgba(167, 139, 250, 0.10); border-color: rgba(167, 139, 250, 0.25); }
.b-red    { color: var(--red);    background: rgba(248, 113, 113, 0.10); border-color: rgba(248, 113, 113, 0.25); }
.b-muted  { color: var(--text-muted); }
.live::before { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.delta { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.delta svg { width: 13px; height: 13px; }

/* ---- KPI ---- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-4); }
.kpi {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  display: flex; flex-direction: column; gap: var(--sp-3);
  transition: border-color 0.2s;
}
.kpi:hover { border-color: var(--border-strong); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.kpi-label { font-size: 11px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; }
.kpi-value { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-foot { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: var(--sp-2); }

/* ---- inputs ---- */
.field { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.field-label { font-size: 12px; font-weight: 600; color: var(--text-dim); display: flex; align-items: center; gap: var(--sp-2); }
.field-label .opt { color: var(--text-muted); font-weight: 500; }
.field-hint { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }
.input, .select, .textarea {
  width: 100%;
  height: 38px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit; font-size: 13px;
  outline: none;
  transition: border-color 0.16s, background 0.16s, box-shadow 0.16s;
}
.textarea { height: auto; min-height: 90px; padding: var(--sp-3); resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent-line);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.10);
}
.input.mono, .textarea.mono { font-family: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, monospace; font-size: 12.5px; }
.select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: var(--sp-7);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='rgba(238,242,247,0.45)' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
}
.select option { background: #131a24; color: var(--text); }

.search { position: relative; flex: 1; min-width: 180px; }
.search > svg {
  position: absolute; left: var(--sp-3); top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--text-muted); pointer-events: none;
}
.search .input { padding-left: 36px; }

/* ---- switch ---- */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.2s var(--ease);
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff;
  transition: transform 0.2s var(--ease);
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }

.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.switch-row + .switch-row { margin-top: var(--sp-3); }
.switch-row .sr-title { font-size: 13px; font-weight: 600; }
.switch-row .sr-desc { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.5; }

/* ---- tabs ---- */
.tabs { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.tab {
  height: 34px; padding: 0 var(--sp-4);
  display: inline-flex; align-items: center; gap: var(--sp-2);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: all 0.16s var(--ease);
}
.tab:hover { color: var(--text); border-color: var(--border-strong); }
.tab.active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-2); }
.tab .n { font-size: 11px; opacity: 0.7; font-weight: 700; }

.seg { display: inline-flex; padding: 3px; border-radius: var(--r-sm); background: rgba(255,255,255,0.05); border: 1px solid var(--border); gap: 2px; }
.seg button {
  height: 28px; padding: 0 var(--sp-3);
  border: 0; border-radius: 7px;
  background: transparent; color: var(--text-muted);
  font-family: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.16s;
}
.seg button svg { width: 14px; height: 14px; }
.seg button:hover { color: var(--text); }
.seg button.active { background: rgba(255,255,255,0.10); color: var(--text); }

.toolbar {
  display: flex; align-items: center; gap: var(--sp-3);
  flex-wrap: wrap;
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

/* ---- tabela ---- */
.table-wrap { overflow-x: auto; margin: 0 calc(var(--sp-6) * -1) calc(var(--sp-6) * -1); padding: 0 var(--sp-6) var(--sp-6); }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
thead th {
  text-align: left;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 var(--sp-4) var(--sp-3);
  white-space: nowrap;
}
tbody td { padding: var(--sp-4); font-size: 13px; border-top: 1px solid var(--border); vertical-align: middle; }
tbody tr { transition: background 0.14s; }
tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
td .cell { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.cell-title { font-weight: 600; font-size: 13px; }
.cell-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.num { font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: var(--sp-1); justify-content: flex-end; }
.act-btn {
  width: 30px; height: 30px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.16s;
}
.act-btn svg { width: 14px; height: 14px; }
.act-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.act-btn.danger:hover { color: var(--red); background: rgba(248, 113, 113, 0.12); }

/* ---- progresso ---- */
.bar { height: 6px; border-radius: var(--r-full); background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* ---- empty state ---- */
.empty-state {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--sp-3);
  padding: var(--sp-9) var(--sp-5);
  text-align: center;
  color: var(--text-muted);
}
.empty-state .ic { width: 52px; height: 52px; border-radius: var(--r-lg); }
.empty-state .ic svg { width: 23px; height: 23px; }
.empty-title { font-size: 14.5px; font-weight: 700; color: var(--text); }
.empty-desc { font-size: 13px; max-width: 330px; line-height: 1.6; }

/* ---- modal ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(4, 7, 11, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  padding: var(--sp-5);
  z-index: 400;
}
.modal-overlay.open { display: flex; }
.modal {
  width: 100%; max-width: 600px;
  max-height: 88vh; overflow-y: auto;
  border-radius: var(--r-xl);
  border: 1px solid var(--border-strong);
  background: var(--bg-soft);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-6);
  animation: modalIn 0.2s var(--ease);
}
.modal-lg { max-width: 860px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-6); }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.modal-body { display: flex; flex-direction: column; gap: var(--sp-4); }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--sp-3); margin-top: var(--sp-6); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.form-grid .full { grid-column: 1 / -1; }

.hint-box {
  display: flex; gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  font-size: 12.5px; color: var(--accent-2);
  line-height: 1.6;
}
.hint-box.info { border-color: rgba(96,165,250,0.28); background: rgba(96,165,250,0.08); color: var(--blue); }
.hint-box svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }

/* ---- toast ---- */
#toaster {
  position: fixed; bottom: var(--sp-6); right: var(--sp-6);
  z-index: 900;
  display: flex; flex-direction: column; gap: var(--sp-2);
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: var(--sp-3);
  min-width: 250px; max-width: 380px;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--chrome);
  box-shadow: var(--shadow-lg);
  font-size: 13px; font-weight: 500;
  animation: toastIn 0.22s var(--ease);
}
.toast svg { width: 17px; height: 17px; flex-shrink: 0; }
.toast.ok svg { color: var(--green); }
.toast.err svg { color: var(--red); }
.toast.info svg { color: var(--blue); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---- utilitários ---- */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: var(--sp-4); }
.stack { display: flex; flex-direction: column; gap: var(--sp-5); }
.stack-sm { display: flex; flex-direction: column; gap: var(--sp-3); }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.wrap { flex-wrap: wrap; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider { height: 1px; background: var(--border); border: 0; }
.grow { flex: 1; min-width: 0; }
code.tok {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 11.5px;
  padding: 2px 6px; border-radius: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--accent-2);
}

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 1280px) { :root { --gutter: var(--sp-6); } }

@media (max-width: 1024px) {
  :root { --gutter: var(--sp-5); }
  .sidebar {
    width: var(--rail-open);
    padding: var(--sp-3);
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); box-shadow: 20px 0 50px rgba(0, 0, 0, 0.55); }
  .sidebar .sidebar-head { justify-content: flex-start; padding: 0 var(--sp-1); }
  .sidebar .nav-item { padding: 0 var(--sp-3); justify-content: flex-start; gap: var(--sp-3); }
  .sidebar .nav-item.active::before { left: 0; }
  .sidebar .nav-label, .sidebar .brand-name, .sidebar .nav-item .pill { opacity: 1; width: auto; }
  .sidebar .nav-section { font-size: 10px; padding: var(--sp-5) var(--sp-3) var(--sp-2); height: auto; background: none; width: auto; margin: 0; }
  .sidebar .nav-dot { display: none; }
  .app, body.nav-open .app { margin-left: 0; }
  .sidebar-scrim {
    position: fixed; inset: 0;
    background: rgba(4, 7, 11, 0.6);
    z-index: 190;
    opacity: 0; pointer-events: none;
    transition: opacity 0.22s var(--ease);
  }
  .sidebar-scrim.show { opacity: 1; pointer-events: auto; }
  body.drawer-open { overflow: hidden; }
}

@media (max-width: 720px) {
  :root { --gutter: var(--sp-4); }
  .card { padding: var(--sp-4); }
  .table-wrap { margin: 0 calc(var(--sp-4) * -1) calc(var(--sp-4) * -1); padding: 0 var(--sp-4) var(--sp-4); }
  .kpi { padding: var(--sp-4); }
  .kpi-value { font-size: 24px; }
  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: var(--sp-3); }
  .form-grid { grid-template-columns: 1fr; }
  .grid-cards { grid-template-columns: 1fr; }
  .modal { padding: var(--sp-5); }
  main { gap: var(--sp-5); }
  .hide-mobile { display: none !important; }
  #toaster { left: var(--sp-4); right: var(--sp-4); bottom: var(--sp-4); }
  .toast { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
