:root {
  --bg: #0d1014;
  --panel: #151a21;
  --panel-2: #1b222b;
  --linha: #242c37;
  --texto: #e6edf3;
  --muted: #8b98a8;
  --acento: #3ddc97;
  --acento-2: #4a9eff;
  --warn: #f0b429;
  --bad: #ff6b6b;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--texto);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--acento-2); text-decoration: none; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code { background: #0b0f13; border: 1px solid var(--linha); border-radius: 5px; padding: 1px 5px; font-size: .88em; }
code.mini { font-size: .78em; color: var(--muted); }

.shell { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }

/* ---------------------------------------------------------------- sidebar */
.side {
  background: #0a0d11;
  border-right: 1px solid var(--linha);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--acento), var(--acento-2));
  color: #06110b; font-weight: 800; font-size: 13px; letter-spacing: .5px;
}
.brand strong { display: block; font-size: 16px; }
.brand span { color: var(--muted); font-size: 12px; }

.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a {
  color: #a9b6c5; padding: 9px 12px; border-radius: 8px; font-size: 14px;
}
.side nav a:hover { background: var(--panel); color: #fff; }
.side nav a.on { background: var(--panel-2); color: #fff; box-shadow: inset 2px 0 0 var(--acento); }
.side-foot { margin-top: auto; color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 7px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.ok { background: var(--acento); box-shadow: 0 0 8px rgba(61, 220, 151, .55); }

/* ------------------------------------------------------------------- main */
.main { padding: 26px 32px 48px; max-width: 1180px; width: 100%; }
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.top h1 { margin: 0; font-size: 24px; letter-spacing: -.2px; }
.muted { color: var(--muted); margin: 4px 0 0; }
.who { display: flex; align-items: center; gap: 12px; }
.who-email { color: var(--muted); font-size: 13px; }
.tag {
  background: rgba(61, 220, 151, .12); color: var(--acento);
  border: 1px solid rgba(61, 220, 151, .3); border-radius: 999px;
  padding: 1px 8px; font-size: 11px; margin-left: 6px;
}

/* ------------------------------------------------------------------ cards */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  background: var(--panel);
  border: 1px solid var(--linha);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.card.destaque { border-color: rgba(61, 220, 151, .45); box-shadow: 0 0 0 1px rgba(61, 220, 151, .08); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 12px; }
.card-head h2 { margin: 0; font-size: 15px; letter-spacing: .2px; }

.kpi { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.kpi-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .7px; }
.kpi-valor { font-size: 30px; line-height: 1.2; font-weight: 700; }
.kpi-valor.small { font-size: 19px; text-transform: uppercase; letter-spacing: .5px; }
.kpi-sub { color: var(--muted); font-size: 12px; }

/* ----------------------------------------------------------------- tabela */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--linha); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255, 255, 255, .02); }
table.densa th, table.densa td { padding: 7px 8px; font-size: 13px; }
.nowrap { white-space: nowrap; }
.trunc { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acoes { text-align: right; }
.acoes form { display: inline; }
.lista { margin: 0; padding-left: 20px; color: #c3cedb; }
.lista li { margin: 6px 0; }
.vazio { color: var(--muted); margin: 6px 0; }

/* ------------------------------------------------------------------ pills */
.pill {
  display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: 12px;
  border: 1px solid var(--linha); color: var(--muted);
}
.pill.ok { color: var(--acento); border-color: rgba(61, 220, 151, .35); background: rgba(61, 220, 151, .1); }
.pill.warn, .warn { color: var(--warn); }
.pill.warn { border-color: rgba(240, 180, 41, .35); background: rgba(240, 180, 41, .1); }
.pill.bad { color: var(--bad); border-color: rgba(255, 107, 107, .35); background: rgba(255, 107, 107, .1); }
.pill.off { color: #7a8798; }
.bad { color: var(--bad); }

/* --------------------------------------------------------------- formulario */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: end; }
.form.inline { grid-template-columns: 2fr 1fr auto; }
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
input, select {
  background: #0b0f13; border: 1px solid var(--linha); color: var(--texto);
  border-radius: 8px; padding: 10px 12px; font-size: 14px; width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--acento-2); box-shadow: 0 0 0 3px rgba(74, 158, 255, .14); }
.dica { color: var(--muted); font-size: 12px; }
.filtro { display: flex; gap: 8px; align-items: center; }
.filtro input { width: 200px; padding: 7px 10px; }

.btn {
  appearance: none; border: 1px solid transparent; border-radius: 8px; cursor: pointer;
  background: var(--acento); color: #05130c; font-weight: 700; font-size: 14px;
  padding: 10px 16px; white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); }
.btn.small { padding: 6px 11px; font-size: 13px; }
.btn.ghost { background: transparent; border-color: var(--linha); color: var(--texto); font-weight: 500; }
.btn.google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #fff; color: #1f1f1f; width: 100%; margin-top: 18px; font-weight: 600;
}
button.link {
  background: none; border: none; color: var(--acento-2); cursor: pointer; padding: 0 6px 0 0; font-size: 13px;
}
button.link.danger { color: var(--bad); }

/* ------------------------------------------------------------------ login */
.login-wrap { display: grid; place-items: center; min-height: 60vh; }
.login { max-width: 400px; width: 100%; padding: 30px; }
.login h2 { margin: 0 0 6px; font-size: 21px; }
.fine { color: var(--muted); font-size: 12px; text-align: center; margin: 16px 0 0; }

.alert { border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; border: 1px solid var(--linha); }
.alert.ok { color: var(--acento); border-color: rgba(61, 220, 151, .35); background: rgba(61, 220, 151, .08); }
.alert.erro { color: var(--bad); border-color: rgba(255, 107, 107, .35); background: rgba(255, 107, 107, .08); }

.segredo {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  background: #0b0f13; border: 1px dashed rgba(61, 220, 151, .45);
  border-radius: 8px; padding: 14px; margin: 12px 0;
}
.segredo code { background: none; border: none; font-size: 15px; word-break: break-all; }
.bloco {
  background: #0b0f13; border: 1px solid var(--linha); border-radius: 8px;
  padding: 14px; overflow-x: auto; font-size: 13px; color: #c3cedb; margin: 12px 0 0;
}

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; gap: 16px; overflow-x: auto; }
  .side nav { flex-direction: row; }
  .side-foot { margin: 0; }
  .grid, .grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main { padding: 20px; }
  .form, .form.inline { grid-template-columns: 1fr; }
}
