/* Don Smash Hub — tema escuro premium.
   Regra visual (aprovada): preto/grafite, texto creme, âmbar SÓ no número principal e no item ativo. */

:root {
  --bg: #0c0c0d;
  --panel: #141416;
  --panel-2: #1b1b1e;
  --line: #26262a;
  --line-2: #323238;
  --text: #f2e9d8;
  --muted: #a79f90;
  --dim: #6e685f;
  --amber: #f0b23a;
  --up: #9cc79a;
  --down: #e3907f;
  --bar: rgba(242, 233, 216, 0.58);
  --bar-hover: rgba(242, 233, 216, 0.92);
  --radius: 14px;
  --radius-sm: 9px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
[hidden] { display: none !important; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted); }

:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 6px; }

/* ---------- Marca (provisória em texto até receber o logo original) ---------- */
.wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0.06em;
  font-size: 20px;
  line-height: 1;
  color: var(--text);
  white-space: nowrap;
}
.brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; }
.brand-sub {
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted);
}

/* ---------- Boot ---------- */
.boot { min-height: 100%; display: grid; place-content: center; justify-items: center; gap: 18px; }
.boot-dots { display: flex; gap: 6px; }
.boot-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); animation: pulse 1.2s infinite ease-in-out; }
.boot-dots i:nth-child(2) { animation-delay: 0.15s; }
.boot-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* ---------- Login ---------- */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 32px 28px;
}
.brand-auth { margin-bottom: 28px; }
.brand-auth .wordmark { font-size: 26px; }
.auth-title { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.field input {
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  color: var(--text); padding: 11px 12px; font: inherit; font-size: 15px;
}
.field input:focus { outline: none; border-color: var(--text); }
.form-msg { font-size: 13px; color: var(--down); }
.form-msg.ok { color: var(--up); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--panel-2);
  padding: 10px 16px; cursor: pointer; font-weight: 600; text-decoration: none;
}
.btn:hover { border-color: var(--dim); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--text); color: #141414; border-color: var(--text); }
.btn-primary:hover { background: #fff7e6; }
.btn-link { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; justify-self: start; }
.btn-link:hover { color: var(--text); }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--line-2); cursor: pointer;
}
.icon-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Estrutura ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100%; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 32px;
  padding: 26px 18px; border-right: 1px solid var(--line); background: #0f0f10;
}
.sidebar > .brand { padding: 0 10px; }
.nav { display: grid; gap: 4px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-weight: 500;
}
.nav-item svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
a.nav-item:hover { color: var(--text); background: var(--panel); }
.nav-item.active { color: var(--text); background: var(--panel-2); }
.nav-item.active::before {
  content: ""; position: absolute; left: -18px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--amber);
}
.nav-item.active svg { color: var(--amber); }
.nav-soon { color: var(--dim); cursor: default; }
.nav-soon small { margin-left: auto; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); }
.sidebar-foot { margin-top: auto; display: grid; gap: 6px; padding: 0 12px; font-size: 12px; color: var(--muted); }
.user-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.env-badge {
  justify-self: start; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  border: 1px solid var(--line-2); border-radius: 99px; padding: 2px 8px; color: var(--muted);
}

.view { padding: 32px 40px 48px; max-width: 1180px; width: 100%; min-width: 0; outline: none; }

/* ---------- Cabeçalho da página ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.month-nav { display: flex; align-items: center; gap: 10px; }
.month-label { min-width: 132px; text-align: center; font-weight: 600; }

/* ---------- Cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.card-title { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }

.kpis { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.kpi { display: grid; gap: 8px; align-content: start; }
.kpi-value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.kpi-main .kpi-value { font-size: 40px; color: var(--amber); }
.delta { font-size: 13px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.delta b { font-weight: 600; }
.delta .up { color: var(--up); }
.delta .down { color: var(--down); }

/* ---------- Barras por dia ---------- */
.readout { font-size: 13px; color: var(--muted); min-height: 19px; }
.readout b { color: var(--text); font-weight: 600; }
.chart { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; }
.y-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--dim); text-align: right; height: 200px; }
.plot { position: relative; height: 200px; border-bottom: 1px solid var(--line-2); }
.gridline { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 4px; }
.bar {
  flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center;
  background: none; border: 0; padding: 0; cursor: pointer; border-radius: 4px 4px 0 0;
}
.bar i { display: block; width: 100%; height: var(--h, 0%); background: var(--bar); border-radius: 4px 4px 0 0; transition: background 0.12s; }
.bar:hover i, .bar.sel i { background: var(--bar-hover); }
.bar.off i { height: 4px; width: 4px; border-radius: 50%; background: var(--line-2); margin-bottom: 4px; }
.bar.future { cursor: default; }
.bar.future i { height: 0; }
.x-axis { grid-column: 2; display: flex; gap: 4px; font-size: 10px; color: var(--dim); }
.x-axis span { flex: 1; min-width: 0; text-align: center; }
.chart-legend { margin-top: 10px; font-size: 12px; color: var(--dim); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.chart-legend .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); margin-right: 6px; vertical-align: middle; }

/* ---------- Canais ---------- */
.section-title { font-size: 13px; font-weight: 600; color: var(--muted); margin: 26px 0 12px; letter-spacing: 0.02em; }
.channels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.channel { display: grid; gap: 12px; }
.channel-name { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.channel-share { color: var(--muted); font-weight: 500; }
.channel-value { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.meter { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; width: var(--w, 0%); background: var(--bar); }
.channel-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 13px; }
.channel-stats dt { color: var(--muted); font-size: 12px; }
.channel-stats dd { margin: 2px 0 0; font-weight: 600; }
.channel-note { font-size: 12px; color: var(--dim); }

.footnote { margin-top: 26px; font-size: 12px; color: var(--dim); max-width: 760px; }

/* ---------- Estados ---------- */
.skeleton { background: linear-gradient(90deg, var(--panel-2) 0%, #222226 50%, var(--panel-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; border-radius: 8px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-line { height: 14px; width: 40%; }
.sk-value { height: 36px; width: 70%; }
.sk-chart { height: 200px; }
.state { text-align: center; padding: 56px 24px; display: grid; gap: 12px; justify-items: center; }
.state h2 { font-size: 18px; }
.state p { color: var(--muted); max-width: 460px; }
.state-icon { width: 40px; height: 40px; color: var(--dim); fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Importar ---------- */
.dropzone {
  display: grid; justify-items: center; gap: 10px; text-align: center; padding: 34px 20px; cursor: pointer;
  border: 1.5px dashed var(--line-2); border-radius: var(--radius); background: var(--panel); color: var(--muted);
}
.dropzone:hover, .dropzone.drag { border-color: var(--muted); color: var(--text); }
.dropzone strong { color: var(--text); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-list { display: grid; gap: 10px; margin: 16px 0; }
.file-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: center; }
.file-name { font-weight: 600; word-break: break-all; }
.file-meta { font-size: 13px; color: var(--muted); }
.file-status { font-size: 13px; text-align: right; }
.file-errors { grid-column: 1 / -1; font-size: 12px; color: var(--down); margin: 4px 0 0; padding-left: 18px; }
.tag { font-size: 11px; border-radius: 99px; padding: 2px 9px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.tag.ok { color: var(--up); border-color: rgba(156, 199, 154, 0.35); }
.tag.warn { color: var(--down); border-color: rgba(227, 144, 127, 0.35); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 13px; }
table.list th { text-align: left; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.list td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list td.num, table.list th.num { text-align: right; }
.help { font-size: 13px; color: var(--muted); margin: 0 0 18px; max-width: 720px; }
.help li { margin: 4px 0; }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi-main { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sidebar {
    position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; align-items: center; gap: 12px;
    padding: 12px 14px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto;
    padding-top: max(12px, env(safe-area-inset-top));
  }
  .sidebar > .brand { padding: 0; }
  .sidebar .wordmark { font-size: 16px; }
  .sidebar .brand-sub { display: none; }
  .nav { display: flex; gap: 2px; }
  .nav-item { padding: 8px 10px; }
  .nav-item.active::before { left: 10px; right: 10px; top: auto; bottom: 0; width: auto; height: 2px; border-radius: 2px; }
  .nav-soon { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; padding: 0; display: flex; align-items: center; gap: 10px; }
  .user-email, .env-badge { display: none !important; }
  .view { padding: 20px 16px 40px; }
  .channels { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .nav-item span { display: none; }
  .nav-item svg { width: 20px; height: 20px; }
  .page-head { align-items: stretch; flex-direction: column; }
  .month-nav { justify-content: space-between; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { padding: 16px; }
  .kpi-value { font-size: 22px; }
  .kpi-main .kpi-value { font-size: 34px; }
  .chart { grid-template-columns: minmax(0, 1fr); }
  .x-axis { grid-column: 1; }
  .y-axis { display: none; }
  .bars, .x-axis { gap: 2px; }
  .x-axis span:not(.tick) { visibility: hidden; }
  .x-axis span { font-size: 9px; overflow: visible; white-space: nowrap; }
  .file-row { grid-template-columns: 1fr; }
  .file-status { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
