/* Eagle Buster — sistema visual
   Direção: instrumento de medição térmica. O produto é temperatura (pixel frio
   -> aquecido), então a paleta vai do azul-frio ao ember e a régua térmica é a
   peça central. Tipografia de engenharia, não de landing page. */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@600;700;800&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --void: #0d1219;
  --surface: #141c26;
  --raised: #1b2532;
  --line: #263241;
  --line-soft: #1e2836;
  --ink: #e9eff6;
  --muted: #7a8899;
  --dim: #55637a;

  --ember: #ff5f2e;
  --amber: #ffa62b;
  --real: #2dd4a7;
  --block: #ef4f5e;

  --display: 'Archivo', system-ui, sans-serif;
  --body: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  --r: 10px;
  --sidebar: 244px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--void);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--amber); }

/* ---------- tipografia ---------- */
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: 1.75rem; font-weight: 800; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 0.95rem; font-weight: 700; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }

/* ---------- marca ---------- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: linear-gradient(150deg, var(--amber), var(--ember));
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 15px; color: #1a0d06;
}
.brand-name { font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; font-size: 1.05rem; }
.brand-name span { color: var(--ember); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 380px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 32px;
}
.login-card .brand { justify-content: center; margin-bottom: 6px; }
.login-tag { text-align: center; margin-bottom: 26px; }

/* ---------- layout ---------- */
.shell { display: flex; min-height: 100vh; }

.side {
  width: var(--sidebar); flex: none;
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 22px;
  position: sticky; top: 0; height: 100vh;
}
.side .brand { padding: 0 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 500;
  border: 1px solid transparent;
}
.nav a:hover { background: var(--raised); color: var(--ink); }
.nav a.on { background: var(--raised); color: var(--ink); border-color: var(--line); }
.nav a .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ember); opacity: 0; }
.nav a.on .dot { opacity: 1; }

.side-foot { margin-top: auto; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.who { padding: 0 8px 10px; overflow: hidden; }
.who b { display: block; font-size: 0.85rem; font-weight: 600; }
.who span { font-size: 0.75rem; color: var(--dim); word-break: break-all; }

.main { flex: 1; padding: 26px 30px 60px; max-width: 1180px; min-width: 0; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 18px;
}
.card + .card { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }

.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }

/* ---------- números ---------- */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.stat .n { font-family: var(--display); font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; }
.stat .n.hot { color: var(--ember); }
.stat .n.real { color: var(--real); }
.stat .l { margin-top: 2px; }

/* ---------- RÉGUA TÉRMICA (peça central) ----------
   Movida por dado real: eventos de venda efetivamente aceitos pela Meta.
   O corte de 50 não é enfeite — é o volume semanal de conversões que a Meta
   pede para uma campanha sair da fase de aprendizado. */
.ramp { padding: 20px 18px; }
.ramp-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.ramp-state { font-family: var(--display); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.02em; }
.ramp-state[data-s="frio"] { color: #6f93c4; }
.ramp-state[data-s="morno"] { color: var(--amber); }
.ramp-state[data-s="aquecido"] { color: var(--ember); }

.ramp-track {
  position: relative; height: 14px; border-radius: 7px; overflow: hidden;
  background: linear-gradient(90deg, #24374f 0%, #3d5470 22%, var(--amber) 62%, var(--ember) 100%);
  opacity: 0.28;
}
.ramp-fill {
  position: absolute; inset: 0 auto 0 0; border-radius: 7px;
  background: linear-gradient(90deg, #4a719b 0%, var(--amber) 62%, var(--ember) 100%);
  transition: width .7s cubic-bezier(.2,.7,.2,1);
}
.ramp-live { position: relative; opacity: 1; background: #1a2534; }
.ramp-ticks { display: flex; justify-content: space-between; margin-top: 8px; }
.ramp-ticks span { font-family: var(--mono); font-size: 0.66rem; color: var(--dim); letter-spacing: 0.08em; }
.ramp-note { margin-top: 12px; font-size: 0.84rem; color: var(--muted); }

/* ---------- formulário ---------- */
label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.hint { font-size: 0.76rem; color: var(--dim); margin-top: 5px; }

input, select, textarea {
  width: 100%; padding: 10px 12px;
  background: var(--void); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--body); font-size: 0.9rem;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--amber); outline-offset: 2px;
}
input::placeholder { color: var(--dim); }
input[type="file"] { padding: 8px; cursor: pointer; }
input[type="file"]::file-selector-button {
  background: var(--raised); color: var(--ink); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 12px; margin-right: 10px; cursor: pointer;
  font-family: var(--body); font-weight: 600; font-size: 0.82rem;
}

button {
  font-family: var(--body); font-weight: 600; font-size: 0.88rem;
  padding: 10px 16px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--raised); color: var(--ink); cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--dim); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-hot {
  background: linear-gradient(150deg, var(--amber), var(--ember));
  border-color: transparent; color: #1a0d06; font-weight: 700;
}
.btn-hot:hover:not(:disabled) { filter: brightness(1.08); }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: #4a2b30; color: var(--block); }
.btn-sm { padding: 6px 11px; font-size: 0.79rem; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- tabela ---------- */
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th {
  text-align: left; padding: 9px 10px;
  font-family: var(--mono); font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim);
  border-bottom: 1px solid var(--line);
}
td { padding: 11px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.02); }
.t-wrap { overflow-x: auto; }

/* ---------- selo de status ---------- */
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 5px;
  font-family: var(--mono); font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid;
}
.tag-done   { color: var(--real);  border-color: #1d5745; background: #12281f; }
.tag-block  { color: var(--block); border-color: #5a2b31; background: #2a1518; }
.tag-test   { color: var(--amber); border-color: #5c421a; background: #2a1f0d; }
.tag-neutral{ color: var(--muted); border-color: var(--line); background: var(--raised); }
.tag-hot    { color: var(--ember); border-color: #5c3020; background: #2a1710; }

/* ---------- guardrails (o diferencial, visível) ---------- */
.rails { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.rail { background: var(--surface); padding: 12px 14px; }
.rail b { font-family: var(--display); font-size: 1.35rem; font-weight: 800; display: block; }
.rail.ok b { color: var(--real); }
.rail.no b { color: var(--block); }
.rail.skip b { color: var(--muted); }
.rail.floor b { color: var(--amber); }
.rail span { font-size: 0.74rem; color: var(--dim); }

/* ---------- avisos ---------- */
.note { padding: 12px 14px; border-radius: 8px; border: 1px solid; font-size: 0.86rem; }
.note-block { border-color: #5a2b31; background: #241316; color: #ffc9cd; }
.note-ok    { border-color: #1d5745; background: #10241d; color: #a9f0d9; }
.note-warn  { border-color: #5c421a; background: #241c0d; color: #ffdfa8; }
.note-info  { border-color: var(--line); background: var(--raised); color: var(--muted); }
.note + .note { margin-top: 10px; }

/* ---------- vazio ---------- */
.empty { text-align: center; padding: 34px 20px; }
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--muted); font-size: 0.88rem; margin-bottom: 14px; }

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(5,8,12,0.75);
  display: none; place-items: center; padding: 20px; z-index: 50;
}
.modal.on { display: grid; }
.modal-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.x { background: none; border: none; color: var(--muted); font-size: 1.3rem; padding: 0 6px; line-height: 1; }

/* ---------- aviso de credencial (uma vez só) ---------- */
.cred {
  font-family: var(--mono); font-size: 0.88rem;
  background: var(--void); border: 1px dashed var(--amber);
  border-radius: 8px; padding: 12px; word-break: break-all; margin: 10px 0;
}

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(120%);
  background: var(--raised); border: 1px solid var(--line); color: var(--ink);
  padding: 11px 18px; border-radius: 8px; font-size: 0.86rem; z-index: 60;
  transition: transform .25s ease; max-width: 90vw;
}
.toast.on { transform: translateX(-50%) translateY(0); }
.toast.err { border-color: #5a2b31; }

/* ---------- spinner ---------- */
.spin {
  width: 13px; height: 13px; border: 2px solid rgba(255,255,255,0.25);
  border-top-color: currentColor; border-radius: 50%;
  display: inline-block; vertical-align: -2px; margin-right: 7px;
  animation: rot .7s linear infinite;
}
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- responsivo ---------- */
@media (max-width: 900px) {
  .g4, .g3, .g2 { grid-template-columns: repeat(2, 1fr); }
  .rails { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .shell { flex-direction: column; }
  .side {
    width: 100%; height: auto; position: static;
    flex-direction: row; align-items: center; gap: 12px;
    padding: 12px 14px; overflow-x: auto;
  }
  .side-foot, .who { display: none; }
  .nav { flex-direction: row; }
  .main { padding: 18px 14px 50px; }
  .g4, .g3, .g2 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
