/* ══════════════════════════════════════════════════════════════
   ELETRONICADS — design system v0.3 · família 1x1ads
   Sidebar dark (DNA 1x1ads) + área de trabalho clara, padrão
   SaaS dos parceiros (painel de produtor Sympla/Ingresse).
   Space Grotesk (títulos) · Inter (interface) · JetBrains Mono (dados).
   ══════════════════════════════════════════════════════════════ */

:root {
  /* zona clara (área de trabalho) */
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --surface-2: #F1F2F5;
  --surface-3: #E9EBEF;
  --line: #E5E7EC;
  --line-strong: #D2D5DD;
  --ink: #17171C;
  --ink-2: #43454E;
  --muted: #6E7076;
  --faint: #9B9DA6;

  /* zona escura (sidebar / lateral do login) */
  --dk-bg: #0B0B0E;
  --dk-surface: #141419;
  --dk-line: #24242C;
  --dk-ink: #F2F2F4;
  --dk-muted: #8E8E96;

  /* marca 1x1ads */
  --brand: #EA580C;
  --brand-2: #FF6B2C;
  --brand-strong: #E8590C;   /* laranja de dado (validado p/ gráfico) */
  --brand-soft: rgba(234, 88, 12, 0.10);
  --blue-data: #2F6FDE;
  --green-data: #0E9F6E;
  --amber: #B45309;

  --good: #0B8A61;
  --warn: #B45309;
  --bad: #DC2626;

  --font-brand: "Space Grotesk", sans-serif;
  --font-ui: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --radius: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 1px 2px rgba(23, 23, 28, 0.04), 0 4px 16px -8px rgba(23, 23, 28, 0.08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ── marca ─────────────────────────────────────────────── */
.logo {
  font-family: var(--font-brand);
  font-weight: 700;
  letter-spacing: 0.01em;
  font-size: 18px;
  color: var(--dk-ink);
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
.logo .dot { color: var(--brand-2); }
.logo-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dk-muted);
  display: block;
  margin-top: 3px;
}

/* ── layout do app ─────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
@media (max-width: 900px) { .shell { grid-template-columns: 1fr; } .sidebar { display: none; } }

.sidebar {
  background: var(--dk-bg);
  border-right: 1px solid var(--dk-line);
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--dk-muted);
  font-weight: 500;
  font-size: 14px;
}
.nav a:hover { background: var(--dk-surface); text-decoration: none; color: var(--dk-ink); }
.nav a.active { background: rgba(255, 107, 44, 0.13); color: var(--brand-2); }
.nav a .soon {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: #5F5F68;
  border: 1px solid var(--dk-line);
  border-radius: 999px;
  padding: 1px 7px;
}
.nav .icon { width: 17px; height: 17px; flex: none; opacity: 0.9; }
.sidebar .foot { margin-top: auto; font-size: 12px; color: #5F5F68; }

.main { padding: 26px 30px 60px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.topbar h1 { font-family: var(--font-brand); font-weight: 700; font-size: 21px; margin: 0; letter-spacing: -0.01em; }
.topbar .spacer { flex: 1; }

/* ── controles ─────────────────────────────────────────── */
.select, .input {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  border-radius: 9px;
  padding: 8px 12px;
  font-family: var(--font-ui);
  font-size: 14px;
}
.select:hover, .input:hover { border-color: var(--faint); }
.input:focus, .select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.input::placeholder { color: var(--faint); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #FFFFFF;
  border: 0;
  border-radius: 9px;
  padding: 9px 16px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 6px 18px -8px rgba(234, 88, 12, 0.55);
  transition: transform 0.08s ease, filter 0.12s ease;
}
.btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line-strong); box-shadow: none; }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn[disabled] { opacity: 0.55; cursor: default; }

/* ── badges e pills ────────────────────────────────────── */
.badge-demo {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  border: 1px solid rgba(180, 83, 9, 0.35);
  background: rgba(245, 158, 11, 0.10);
  border-radius: 999px;
  padding: 3px 10px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 10px;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--good); background: rgba(14, 159, 110, 0.10); }
.pill.pend { color: var(--warn); background: rgba(245, 158, 11, 0.12); }
.pill.bad { color: var(--bad); background: rgba(220, 38, 38, 0.08); }

/* ── cards / KPIs ──────────────────────────────────────── */
.grid-kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1100px) { .grid-kpi { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-kpi { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  min-width: 0;
  box-shadow: var(--shadow-card);
}
.kpi .label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.kpi .value {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: clamp(22px, 2.4vw, 30px);
  margin-top: 8px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.kpi .value .unit { font-size: 0.55em; color: var(--muted); font-family: var(--font-mono); font-weight: 400; margin-right: 4px; }
.kpi .delta { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.kpi .delta b { color: var(--good); font-weight: 600; }
.kpi.hero { border-color: rgba(234, 88, 12, 0.35); background: linear-gradient(160deg, rgba(255, 107, 44, 0.07), var(--surface) 55%); }
.kpi.hero .value { color: var(--brand); }

/* ── seção de gráficos ─────────────────────────────────── */
.grid-charts { display: grid; grid-template-columns: 3fr 2fr; gap: 14px; margin-bottom: 14px; align-items: start; }
.grid-charts.rev { grid-template-columns: 2fr 3fr; }
@media (max-width: 1100px) { .grid-charts, .grid-charts.rev { grid-template-columns: 1fr; } }
.chart-card h2, .table-card h2 {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 14.5px;
  margin: 0 0 2px;
}
.chart-card .sub { font-size: 12.5px; color: var(--muted); margin: 0 0 14px; }
.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 300px; }

/* ── tabela ────────────────────────────────────────────── */
.table-card { margin-bottom: 14px; }
.table-scroll { overflow-x: auto; margin: 12px -20px -18px; padding: 0 20px 12px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
table.data th {
  text-align: left;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
table.data tr:hover td { background: #F8F9FB; }

/* ── estados vazios ────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--muted);
}
.empty h3 { font-family: var(--font-brand); font-weight: 700; color: var(--ink); font-size: 17px; margin: 0 0 8px; }
.empty p { max-width: 46ch; margin: 0 auto 18px; font-size: 14px; }

/* ── modal ─────────────────────────────────────────────── */
.modal-back {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(23, 23, 28, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  width: min(480px, 100%);
  padding: 26px;
  box-shadow: 0 24px 60px -20px rgba(23, 23, 28, 0.35);
}
.modal h2 { font-family: var(--font-brand); font-weight: 700; font-size: 17px; margin: 0 0 6px; }
.modal p { font-size: 13.5px; color: var(--muted); margin: 0 0 16px; }
.modal .row { display: flex; gap: 10px; margin-top: 16px; justify-content: flex-end; }
.modal label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin: 12px 0 5px; }
.modal .input { width: 100%; }
.msg { font-size: 13px; margin-top: 10px; min-height: 18px; }
.msg.ok { color: var(--good); }
.msg.err { color: var(--bad); }

/* ── página de login ───────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
@media (max-width: 860px) { .login-wrap { grid-template-columns: 1fr; } .login-side { display: none; } }
.login-side {
  background: var(--dk-bg);
  border-right: 1px solid var(--dk-line);
  padding: 48px 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-side::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(700px 500px at 20% 110%, rgba(249, 115, 22, 0.14), transparent 60%);
}
.login-side > * { position: relative; }
.login-side .pitch { font-family: var(--font-brand); font-weight: 700; font-size: clamp(24px, 3vw, 36px); line-height: 1.22; max-width: 14em; text-wrap: balance; color: var(--dk-ink); letter-spacing: -0.01em; }
.login-side .pitch em { font-style: normal; color: var(--brand-2); }
.login-side .feats { display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: #C0C0C7; }
.login-side .feats span::before { content: "◆ "; color: var(--brand-2); font-size: 10px; }
.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.login-card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 34px 32px;
  box-shadow: var(--shadow-card);
}
.login-card .logo { color: var(--ink); }
.login-card .logo .dot { color: var(--brand); }
.login-card h1 { font-family: var(--font-brand); font-weight: 700; font-size: 20px; margin: 22px 0 4px; letter-spacing: -0.01em; }
.login-card .sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.login-card label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin: 14px 0 5px; }
.login-card .input { width: 100%; }
.login-card .btn { width: 100%; margin-top: 20px; padding: 11px; }
.login-card .alt { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 16px; }
.login-card .demo-link { display: block; text-align: center; margin-top: 20px; font-size: 13px; color: var(--muted); }
.login-card .demo-link b { color: var(--brand); font-weight: 600; }

/* ── funil VIP (kanban) ────────────────────────────────── */
.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(230px, 1fr));
  gap: 12px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 20px;
}
.col { min-width: 230px; }
.col-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px 10px 0 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: 3px solid var(--col-cor, var(--line-strong));
}
.col-head h2 { font-family: var(--font-ui); font-weight: 700; font-size: 13px; margin: 0; }
.col-head .qtd { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.col-head .soma { margin-left: auto; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.col-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 8px 16px;
  min-height: 220px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  transition: background 0.15s ease;
}
.col-body.drag-over { background: var(--brand-soft); }
.lead {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: grab;
  box-shadow: var(--shadow-card);
}
.lead:active { cursor: grabbing; }
.lead.dragging { opacity: 0.5; }
.lead .topo { display: flex; align-items: center; gap: 8px; }
.lead .nome { font-weight: 600; font-size: 13.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead .valor { font-family: var(--font-mono); font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.lead .meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.lead .prod {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 1px 8px;
  background: var(--brand-soft);
  color: var(--brand);
}
.lead .prod.lista { background: rgba(47, 111, 222, 0.10); color: #2F6FDE; }
.lead .prod.bistro { background: rgba(14, 159, 110, 0.10); color: #0E9F6E; }
.lead a.zap { color: var(--good); font-weight: 600; font-size: 11.5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* ── eventos ───────────────────────────────────────────── */
.eventos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.evento-card { display: flex; flex-direction: column; gap: 10px; }
.evento-card .cab { display: flex; align-items: flex-start; gap: 10px; }
.evento-card h3 { font-family: var(--font-brand); font-weight: 700; font-size: 15.5px; margin: 0; flex: 1; min-width: 0; }
.badge-plat {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}
.badge-plat.sympla { background: rgba(47, 111, 222, 0.10); color: #2F6FDE; }
.badge-plat.manual { background: var(--brand-soft); color: var(--brand); }
.badge-plat.exemplo { background: rgba(245, 158, 11, 0.12); color: var(--amber); }
.evento-card .info { font-size: 13px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.evento-card .nums { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); }
.evento-card .nums b { display: block; font-family: var(--font-mono); font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.progress { height: 7px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-2), var(--brand)); }
.progress-label { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); font-family: var(--font-mono); margin-top: 4px; }
.evento-card .acoes { display: flex; gap: 8px; margin-top: 2px; }
.btn.mini { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.empty .btn + .btn { margin-left: 8px; }

/* legenda de gráfico custom */
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-top: 10px; }
.legend .item { display: inline-flex; align-items: center; gap: 7px; }
.legend .swatch { width: 10px; height: 10px; border-radius: 3px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
