/* Paleta do brandbook do DiscaZap (brand/styleguide/styles.css). */
:root {
  --background: #080a08;
  --foreground: #f4f6f1;
  --primary: #9dff50;
  --primary-foreground: #0b1605;
  --primary-hover: #b3ff77;
  --card: #0f120f;
  --secondary: #161b15;
  --accent: #263122;
  --border: #ffffff18;
  --muted: #999f95;
  --ink-soft: #a0a79b;
  --danger: #ff7a6b;
  --danger-soft: #ff7a6b1f;
  --success: #a0d282;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(ellipse at 78% -10%, #57b42a1a, transparent 55%),
    var(--background);
  color: var(--foreground);
  font:
    15px/1.5 ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.oculto {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* ---------- Login ---------- */
.login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.cartao-login {
  width: 100%;
  max-width: 380px;
  padding: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 60px #00000060;
}

.cartao-login .marca {
  display: block;
  margin-bottom: 18px;
  border-radius: 12px;
}

.cartao-login h1 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.01em;
}

.cartao-login .sub {
  margin: 6px 0 24px;
  color: var(--muted);
  font-size: 13px;
}

label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

input,
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 16px;
  color: var(--foreground);
  background: #0b0e0b;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
}

textarea {
  min-height: 72px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #6d746a;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #9dff5066;
  outline: none;
  box-shadow: 0 0 0 3px #9dff5018;
}

/* ---------- Botões ---------- */
.botao {
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}

.botao[disabled] {
  opacity: 0.55;
  cursor: progress;
}

.primario {
  width: 100%;
  color: var(--primary-foreground);
  background: var(--primary);
}

.primario:hover:not([disabled]) {
  background: var(--primary-hover);
}

.modal-acoes .primario,
.barra .primario {
  width: auto;
}

.discreto {
  color: var(--foreground);
  background: var(--secondary);
  border-color: var(--border);
}

.discreto:hover:not([disabled]) {
  background: var(--accent);
}

.perigo {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #ff7a6b3d;
}

.perigo:hover:not([disabled]) {
  background: #ff7a6b30;
}

.erro {
  margin: 0 0 14px;
  padding: 9px 12px;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: 10px;
  font-size: 13px;
}

/* ---------- Topo ---------- */
.topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: #080a08e8;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(8px);
}

.marca-topo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.marca-topo img {
  border-radius: 8px;
}

.marca-topo div {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.marca-topo span {
  color: var(--muted);
  font-size: 12px;
}

.topo-acoes {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quem {
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Conteúdo ---------- */
.conteudo {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}

.resumo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.card-resumo {
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card-resumo strong {
  display: block;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.card-resumo span {
  color: var(--muted);
  font-size: 12px;
}

.card-resumo.destaque strong {
  color: var(--primary);
}

.barra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.barra input[type="search"] {
  flex: 1 1 240px;
  margin-bottom: 0;
}

.filtros {
  display: flex;
  gap: 6px;
}

.chip {
  padding: 8px 12px;
  color: var(--ink-soft);
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.chip.ativo {
  color: var(--primary);
  background: #9dff500d;
  border-color: #9dff5040;
}

.aviso {
  margin: 0 0 16px;
  padding: 10px 14px;
  color: #e4d79a;
  background: #e4d79a14;
  border: 1px solid #e4d79a33;
  border-radius: var(--radius);
  font-size: 13px;
}

/* ---------- Tabela ---------- */
.tabela-area {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.tabela {
  width: 100%;
  border-collapse: collapse;
}

.tabela th {
  padding: 12px 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.tabela td {
  padding: 14px 16px;
  border-bottom: 1px solid #ffffff0d;
  vertical-align: middle;
}

.tabela tr:last-child td {
  border-bottom: none;
}

.tabela tr:hover td {
  background: #ffffff05;
}

.pessoa {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #a9c693;
  background: #23321c;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
}

.pessoa-texto {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}

.pessoa-texto b {
  font-weight: 600;
}

.pessoa-texto small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.selo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.selo::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.selo.ativo {
  color: var(--success);
  background: #a0d2821f;
}

.selo.desativado {
  color: var(--danger);
  background: var(--danger-soft);
}

.marcador {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  color: #e4d79a;
  background: #e4d79a14;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.quando {
  color: var(--ink-soft);
  font-size: 13px;
  white-space: nowrap;
}

.quando small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.acoes {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.acoes .botao {
  padding: 7px 11px;
  font-size: 13px;
}

.vazio {
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

/* ---------- Modal ---------- */
dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 24px;
  color: var(--foreground);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
}

dialog::backdrop {
  background: #04060488;
  backdrop-filter: blur(3px);
}

dialog h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

dialog .explica {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
}

.modal-acoes {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.linha-senha {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.linha-senha input {
  margin-bottom: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.linha-senha .botao {
  flex: none;
  padding: 10px 12px;
  font-size: 13px;
}

.marcar {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 18px;
  color: var(--ink-soft);
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.marcar input {
  width: auto;
  margin: 2px 0 0;
  accent-color: var(--primary);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  padding: 11px 18px;
  color: var(--primary-foreground);
  background: var(--primary);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 30px #00000070;
  z-index: 20;
}

.toast.ruim {
  color: #2a0d09;
  background: var(--danger);
}

@media (max-width: 640px) {
  .conteudo {
    padding: 18px 14px 56px;
  }

  .tabela th:nth-child(3),
  .tabela td:nth-child(3),
  .tabela th:nth-child(4),
  .tabela td:nth-child(4) {
    display: none;
  }
}

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