/* ═══════════════════════════════════════════════════════════════════════════
   macacuts studio — Design System v3 (extensão azul da marca)
   Escuro por padrão, claro em [data-theme="light"]. Navegação em barra no
   topo, cartões arredondados com borda de luz, destaque azul.
   Tokens → base → layout → componentes. Nada de cor solta fora dos tokens.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Urbanist variável limitada a 400–700 (os pesos usados) e ao alfabeto latino,
   em WOFF2 (20 KB; o TTF completo tinha 85 KB). URL relativa: resolve dentro de
   /v/<versão>/ junto com o CSS — a mesma URL do preload no HTML. */
@font-face {
  font-family: 'Urbanist';
  src: url('../fonts/Urbanist-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F,
    U+2074, U+20AC, U+2122, U+2190-2199, U+2212, U+2215, U+221E, U+FEFF, U+FFFD;
}

:root {
  --font: 'Urbanist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --fs-2xs: 11px;
  --fs-xs: 12px;
  --fs-sm: 12.5px;
  --fs-md: 13.5px;
  --fs-base: 14px;
  --fs-lg: 15px;
  --fs-xl: 17px;
  --fs-2xl: 20px;
  --fs-3xl: 22px;
  --fs-4xl: 26px;
  --fs-display: 34px;

  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-full: 999px;
  --gap: 16px;
  --pad: 28px;
  --max: 1520px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --h-ctl: 40px;
  --h-ctl-sm: 32px;

  /* ── tema escuro ── */
  --bg: #0c1119;
  --card: #151d29;
  --card-2: rgba(255, 255, 255, 0.035);
  --card-3: rgba(255, 255, 255, 0.075);
  --panel: #1b2533;
  --ink: #f3f3f5;
  --ink-2: #d3dbe8;
  --muted: #a2afc2;
  --faint: #6c6f79;
  --line: rgba(155, 184, 231, 0.085);
  --line-2: rgba(155, 184, 231, 0.16);
  --rim: inset 0 0 0 1px rgba(155, 184, 231, 0.085);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 16px 34px -22px rgba(0, 0, 0, 0.9);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.5), 0 30px 64px -26px rgba(0, 0, 0, 0.95);
  --scrim: rgba(4, 5, 8, 0.66);

  --accent: #5b8cff;
  --accent-from: #79a1ff;
  --accent-to: #4377f2;
  --accent-ink: #06122e;
  --accent-soft: rgba(91, 140, 255, 0.16);
  --accent-text: #9cb9ff;
  --accent-glow: rgba(91, 140, 255, 0.45);

  --ok: #5fd39a;
  --ok-soft: rgba(95, 211, 154, 0.14);
  --warn: #f3b25a;
  --warn-soft: rgba(243, 178, 90, 0.15);
  --bad: #ff8569;
  --bad-soft: rgba(255, 133, 105, 0.14);
  --info: #6cc7e8;
  --info-soft: rgba(108, 199, 232, 0.14);
  --violet: #b59cff;
  --violet-soft: rgba(181, 156, 255, 0.15);

  --inverse: #f3f3f5;
  --inverse-ink: #111216;
  color-scheme: dark;
}

[data-theme='light'] {
  --bg: #eef2f7;
  --card: #fcfdff;
  --card-2: rgba(20, 24, 36, 0.035);
  --card-3: rgba(20, 24, 36, 0.075);
  --panel: #f7fafe;
  --ink: #162033;
  --ink-2: #364257;
  --muted: #5b6980;
  --faint: #8a8e99;
  --line: rgba(35, 69, 120, 0.09);
  --line-2: rgba(35, 69, 120, 0.16);
  --rim: inset 0 0 0 1px rgba(35, 69, 120, 0.09);
  --shadow: 0 1px 2px rgba(20, 24, 36, 0.05), 0 12px 28px -20px rgba(20, 24, 36, 0.32);
  --shadow-lg: 0 2px 6px rgba(20, 24, 36, 0.08), 0 30px 64px -26px rgba(20, 24, 36, 0.4);
  --scrim: rgba(20, 24, 36, 0.42);

  --accent: #2456d3;
  --accent-from: #3a6ae6;
  --accent-to: #1c47b8;
  --accent-ink: #ffffff;
  --accent-soft: rgba(36, 86, 211, 0.12);
  --accent-text: #1c43a8;
  --accent-glow: rgba(36, 86, 211, 0.4);

  --ok: #12734a;
  --ok-soft: rgba(18, 115, 74, 0.12);
  --warn: #92600c;
  --warn-soft: rgba(196, 130, 20, 0.16);
  --bad: #b3371b;
  --bad-soft: rgba(179, 55, 27, 0.11);
  --info: #0d6a8c;
  --info-soft: rgba(13, 106, 140, 0.11);
  --violet: #5b3fc4;
  --violet-soft: rgba(91, 63, 196, 0.11);

  --inverse: #15161a;
  --inverse-ink: #ffffff;
  color-scheme: light;
}

/* ── base ─────────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 500 var(--fs-base) / 1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
h1 {
  font-size: var(--fs-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
h2 {
  font-size: var(--fs-2xl);
  font-weight: 600;
  letter-spacing: -0.01em;
}
h3 {
  font-size: var(--fs-lg);
  font-weight: 600;
}
a {
  color: var(--accent-text);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
img,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}
::selection {
  background: var(--accent-soft);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
[hidden] {
  display: none !important;
}
code,
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}
.muted {
  color: var(--muted);
}
.faint {
  color: var(--faint);
}
.num {
  font-variant-numeric: tabular-nums;
}
.nowrap {
  white-space: nowrap;
}
.trunc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* scrollbars discretas */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

/* ── layout ───────────────────────────────────────────────────────────────── */
.shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad) 64px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.row.wrap {
  flex-wrap: wrap;
}
.row.top {
  align-items: flex-start;
}
.row.between {
  justify-content: space-between;
}
.row.end {
  justify-content: flex-end;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-width: 0;
}
.stack.tight {
  gap: 8px;
}
.stack.loose {
  gap: 24px;
}
.grow {
  flex: 1 1 0;
  min-width: 0;
}
.grid {
  display: grid;
  gap: var(--gap);
}
.grid.c2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid.c3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid.c4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.grid.side {
  grid-template-columns: minmax(0, 1fr) 420px;
}
.grid.side-l {
  grid-template-columns: 340px minmax(0, 1fr);
}
.grid.auto {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
@media (max-width: 1180px) {
  .grid.c4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid.c3,
  .grid.side,
  .grid.side-l {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 760px) {
  :root {
    --pad: 16px;
    --fs-display: 26px;
  }
  .grid.c2,
  .grid.c4 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ── barra do topo ────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px var(--pad);
  background: linear-gradient(var(--bg) 72%, transparent);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: var(--fs-2xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  flex: none;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--accent-from), var(--accent-to));
  color: var(--accent-ink);
  box-shadow:
    0 6px 18px -8px var(--accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
/* marca macacuts studio: rosto do macaco no lugar do símbolo (38 px) e o
   wordmark em curvas, com uma versão para cada tema. Ver js/brand.js. */
.brand-mark:has(picture) {
  background: #0d1524;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.brand-mark picture,
.brand-mark img {
  width: 38px;
  height: 38px;
  object-fit: cover;
}
.brand-name:has(.brand-word) {
  width: 126px;
  line-height: 1;
}
.brand-word {
  width: 126px;
  height: 31px;
  object-fit: contain;
  margin-top: -4px;
}
.brand-sub {
  display: block;
  font: 600 8px var(--font);
  letter-spacing: 0.27em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 4px;
  margin-top: -2px;
}
.brand-light {
  display: none;
}
[data-theme='light'] .brand-dark {
  display: none;
}
[data-theme='light'] .brand-light {
  display: block;
}
.pnav {
  display: flex;
  gap: 2px;
  padding: 5px;
  height: 48px;
  border-radius: var(--r-full);
  background: var(--card);
  box-shadow: var(--rim), var(--shadow);
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}
.pnav::-webkit-scrollbar {
  display: none;
}
.pnav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  height: 38px;
  border-radius: var(--r-full);
  color: var(--ink-2);
  font-weight: 500;
  white-space: nowrap;
  transition:
    background 0.18s var(--ease),
    color 0.18s var(--ease);
}
.pnav a:hover {
  background: var(--card-3);
  color: var(--ink);
  text-decoration: none;
}
.pnav a.on {
  background: linear-gradient(180deg, var(--accent-from), var(--accent-to));
  color: var(--accent-ink);
  font-weight: 600;
  box-shadow:
    0 6px 16px -8px var(--accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.pnav .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.pnav a.on .dot {
  background: var(--accent-ink);
}
.topbar-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
@media (max-width: 1450px) {
  .topbar {
    flex-wrap: wrap;
  }
  .pnav {
    order: 3;
    width: max-content;
    max-width: 100%;
    margin: 0 auto;
  }
}
@media (max-width: 760px) {
  .pnav {
    width: 100%;
    margin: 0;
  }
}

/* ── cabeçalho de página ──────────────────────────────────────────────────── */
.ph {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 26px 0 20px;
}
.ph-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: 8px;
  color: var(--muted);
  font-size: var(--fs-lg);
  max-width: 760px;
}
.ph-sub .sep {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--faint);
}
.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px var(--ok-soft);
  display: inline-block;
  margin-right: 6px;
}

/* ── cartão ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--rim), var(--shadow);
  padding: 20px;
  min-width: 0;
}
.card.flush {
  padding: 0;
  overflow: hidden;
}
.card.soft {
  background: var(--card-2);
  box-shadow: var(--rim);
}
.card-h {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.card.flush > .card-h {
  padding: 20px 20px 0;
}
.card-t {
  font-size: var(--fs-xl);
  font-weight: 600;
}
.card-s {
  color: var(--muted);
  font-size: var(--fs-md);
  margin-top: 2px;
}
.card-f {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.divider {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
  border: 0;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
}

/* ── botões ───────────────────────────────────────────────────────────────── */
.btn {
  --_bg: var(--card-2);
  --_ink: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--h-ctl);
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--_bg);
  color: var(--_ink);
  font-weight: 600;
  font-size: var(--fs-base);
  box-shadow: inset 0 0 0 1px var(--line-2);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition:
    transform 0.12s var(--ease),
    background 0.18s var(--ease),
    box-shadow 0.18s var(--ease),
    opacity 0.18s;
}
.btn:hover {
  background: var(--card-3);
  text-decoration: none;
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled,
.btn.is-busy {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.btn.primary {
  background: linear-gradient(180deg, var(--accent-from), var(--accent-to));
  color: var(--accent-ink);
  box-shadow:
    0 8px 20px -10px var(--accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn.primary:hover {
  filter: brightness(1.06);
}
.btn.inverse {
  background: var(--inverse);
  color: var(--inverse-ink);
  box-shadow: none;
  border-radius: var(--r-full);
}
.btn.inverse:hover {
  filter: brightness(0.94);
}
.btn.quiet {
  background: transparent;
  box-shadow: none;
  color: var(--ink-2);
}
.btn.quiet:hover {
  background: var(--card-3);
  color: var(--ink);
}
.btn.danger {
  color: var(--bad);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 40%, transparent);
}
.btn.danger:hover {
  background: var(--bad-soft);
}
.btn.danger.solid {
  background: var(--bad);
  color: #1a0803;
  box-shadow: none;
}
.btn.pill {
  border-radius: var(--r-full);
}
.btn.sm {
  height: var(--h-ctl-sm);
  padding: 0 12px;
  font-size: var(--fs-md);
  border-radius: var(--r-xs);
}
.btn.lg {
  height: 46px;
  padding: 0 22px;
  font-size: var(--fs-lg);
  border-radius: 12px;
}
.btn.icon {
  width: var(--h-ctl);
  padding: 0;
}
.btn.icon.sm {
  width: var(--h-ctl-sm);
}
.btn.block {
  width: 100%;
}
.btn svg {
  width: 17px;
  height: 17px;
  flex: none;
}
.btn.sm svg {
  width: 15px;
  height: 15px;
}

/* ── campos ───────────────────────────────────────────────────────────────── */
.fld {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.fld > span,
.lbl {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink-2);
}
.fld small,
.hint {
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.in,
select.in,
textarea.in {
  width: 100%;
  height: var(--h-ctl);
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--card-2);
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--ink);
  transition:
    box-shadow 0.16s var(--ease),
    background 0.16s var(--ease);
}
textarea.in {
  height: auto;
  min-height: 88px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.5;
}
.in::placeholder {
  color: var(--faint);
}
.in:hover {
  background: var(--card-3);
}
.in:focus {
  outline: 0;
  box-shadow:
    inset 0 0 0 1.5px var(--accent),
    0 0 0 4px var(--accent-soft);
  background: var(--card-2);
}
.in.sm {
  height: var(--h-ctl-sm);
  font-size: var(--fs-md);
}
.in[type='color'] {
  padding: 4px;
  width: 56px;
  cursor: pointer;
}
.in[type='number'] {
  font-variant-numeric: tabular-nums;
}
.in:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
select.in {
  appearance: none;
  padding-right: 34px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239b9ea8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.search {
  position: relative;
  flex: 1 1 260px;
  max-width: 360px;
}
.search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  translate: 0 -50%;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}
.search .in {
  padding-left: 36px;
}
.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}
.err-text {
  color: var(--bad);
  font-size: var(--fs-md);
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 600;
}
.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.switch i {
  width: 40px;
  height: 24px;
  border-radius: 99px;
  background: var(--card-3);
  box-shadow: inset 0 0 0 1px var(--line-2);
  position: relative;
  transition: background 0.2s var(--ease);
  flex: none;
}
.switch i::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink);
  transition:
    translate 0.2s var(--ease),
    background 0.2s;
}
.switch input:checked + i {
  background: linear-gradient(180deg, var(--accent-from), var(--accent-to));
  box-shadow: none;
}
.switch input:checked + i::after {
  translate: 16px 0;
  background: var(--accent-ink);
}
.switch input:focus-visible + i {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}
.check input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}
input[type='range'] {
  accent-color: var(--accent);
  width: 100%;
}

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 28px 20px;
  border-radius: var(--r-md);
  border: 1.5px dashed var(--line-2);
  background: var(--card-2);
  color: var(--muted);
  cursor: pointer;
  transition:
    border-color 0.18s,
    background 0.18s;
}
.drop:hover,
.drop.over {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}
.drop svg {
  width: 26px;
  height: 26px;
  color: var(--accent-text);
}
.drop b {
  color: var(--ink);
}

/* ── segmentos, abas, chips ───────────────────────────────────────────────── */
.seg {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--rim);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.seg button,
.seg a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px;
  border: 0;
  background: transparent;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-weight: 600;
  font-size: var(--fs-md);
  cursor: pointer;
  white-space: nowrap;
}
.seg button:hover,
.seg a:hover {
  color: var(--ink);
  text-decoration: none;
}
.seg .on {
  background: var(--card-3);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}
.stack > .seg {
  align-self: flex-start;
}
.seg.inset {
  background: var(--card-2);
}
.count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--fs-2xs);
  font-weight: 700;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border: 0;
  cursor: pointer;
  border-radius: var(--r-sm);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--ink-2);
  font-weight: 600;
  font-size: var(--fs-md);
  white-space: nowrap;
}
.chip:hover {
  background: var(--card-3);
}
.chip em {
  font-style: normal;
  color: var(--muted);
  font-weight: 600;
}
.chip.on {
  background: var(--inverse);
  color: var(--inverse-ink);
  box-shadow: none;
}
.chip.on em {
  color: inherit;
  opacity: 0.6;
}

/* ── etiquetas e status ───────────────────────────────────────────────────── */
.pill {
  --_c: var(--muted);
  --_b: var(--card-3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 99px;
  background: var(--_b);
  color: var(--_c);
  font-size: var(--fs-xs);
  font-weight: 700;
  white-space: nowrap;
}
.pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill.plain::before {
  display: none;
}
.pill.ok {
  --_c: var(--ok);
  --_b: var(--ok-soft);
}
.pill.warn {
  --_c: var(--warn);
  --_b: var(--warn-soft);
}
.pill.bad {
  --_c: var(--bad);
  --_b: var(--bad-soft);
}
.pill.info {
  --_c: var(--info);
  --_b: var(--info-soft);
}
.pill.accent {
  --_c: var(--accent-text);
  --_b: var(--accent-soft);
}
.pill.violet {
  --_c: var(--violet);
  --_b: var(--violet-soft);
}
.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 7px;
  background: var(--card-3);
  color: var(--ink-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
}
.kbd {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--card-3);
  color: var(--muted);
  font: 600 var(--fs-2xs) var(--mono);
}

/* avatar e "tile" de iniciais */
.av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex: none;
  font-size: var(--fs-xs);
  font-weight: 700;
  background: #e9d9b8;
  color: #3b2c0e;
}
.av.lg {
  width: 44px;
  height: 44px;
  font-size: var(--fs-base);
}
.av.sm {
  width: 26px;
  height: 26px;
  font-size: 10px;
}
.tile {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  flex: none;
  font-size: var(--fs-xs);
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 30%, transparent);
}
.tile.lg {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  font-size: var(--fs-lg);
}
.tone-0 {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.tone-1 {
  background: var(--ok-soft);
  color: var(--ok);
}
.tone-2 {
  background: var(--warn-soft);
  color: var(--warn);
}
.tone-3 {
  background: var(--bad-soft);
  color: var(--bad);
}
.tone-4 {
  background: var(--violet-soft);
  color: var(--violet);
}
.tone-5 {
  background: var(--info-soft);
  color: var(--info);
}
.who {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.who b {
  display: block;
  font-weight: 600;
}
.who small {
  display: block;
  color: var(--muted);
  font-size: var(--fs-sm);
}

/* ── tabela ───────────────────────────────────────────────────────────────── */
.tbl-wrap {
  overflow-x: auto;
}
.tbl {
  width: 100%;
  border-collapse: collapse;
}
.tbl th {
  text-align: left;
  padding: 10px 16px;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.tbl td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.tbl tr:last-child td {
  border-bottom: 0;
}
.tbl tbody tr {
  transition: background 0.14s;
}
.tbl tbody tr:hover {
  background: var(--card-2);
}
.tbl .r {
  text-align: right;
}
.tbl .c {
  text-align: center;
}
.tbl td.act {
  text-align: right;
  white-space: nowrap;
  width: 1%;
}
.tbl td.act .btn + .btn {
  margin-left: 6px;
}
.tbl .idx {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  width: 1%;
}

/* ── progresso, medidores ─────────────────────────────────────────────────── */
.bar {
  height: 6px;
  border-radius: 99px;
  background: var(--card-3);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-to), var(--accent-from));
  transition: width 0.4s var(--ease);
}
.bar.ok > i {
  background: var(--ok);
}
.bar.warn > i {
  background: var(--warn);
}
.bar.bad > i {
  background: var(--bad);
}
.bar.lg {
  height: 10px;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat small {
  color: var(--muted);
  font-size: var(--fs-md);
}
.stat b {
  font-size: var(--fs-2xl);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.stat.big b {
  font-size: 40px;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 16px;
  padding: 16px 0;
  border-block: 1px solid var(--line);
}
.delta {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 7px;
  border-radius: 7px;
  font-size: var(--fs-xs);
  font-weight: 700;
  background: var(--ok-soft);
  color: var(--ok);
}
.delta.down {
  background: var(--bad-soft);
  color: var(--bad);
}

/* ── avisos ───────────────────────────────────────────────────────────────── */
.note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--card-2);
  box-shadow: var(--rim);
  color: var(--ink-2);
}
.note svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 1px;
  color: var(--accent-text);
}
.note.ok {
  background: var(--ok-soft);
  box-shadow: none;
}
.note.ok svg {
  color: var(--ok);
}
.note.warn {
  background: var(--warn-soft);
  box-shadow: none;
}
.note.warn svg {
  color: var(--warn);
}
.note.bad {
  background: var(--bad-soft);
  box-shadow: none;
}
.note.bad svg {
  color: var(--bad);
}
.note b {
  color: var(--ink);
}
.banner {
  background: linear-gradient(100deg, var(--accent-soft), transparent 60%), var(--card);
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 56px 24px;
  color: var(--muted);
}
.empty svg {
  width: 34px;
  height: 34px;
  color: var(--faint);
}
.empty b {
  color: var(--ink);
  font-size: var(--fs-xl);
  font-weight: 600;
}
.empty p {
  max-width: 420px;
}

.spin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid var(--line-2);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
  flex: none;
}
.spin.lg {
  width: 28px;
  height: 28px;
}
@keyframes spin {
  to {
    rotate: 360deg;
  }
}
.skel {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--card-2) 25%, var(--card-3) 50%, var(--card-2) 75%);
  background-size: 200% 100%;
  animation: skel 1.3s linear infinite;
  min-height: 16px;
}
@keyframes skel {
  to {
    background-position: -200% 0;
  }
}
.loading {
  display: grid;
  place-items: center;
  padding: 64px 0;
}

/* ── menu suspenso ────────────────────────────────────────────────────────── */
.menu-anchor {
  position: relative;
}
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
  min-width: 230px;
  padding: 6px;
  background: var(--panel);
  border-radius: var(--r-md);
  box-shadow: var(--rim), var(--shadow-lg);
  animation: pop 0.16s var(--ease);
}
.menu.left {
  right: auto;
  left: 0;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  border-radius: var(--r-xs);
  color: var(--ink-2);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.menu-item:hover {
  background: var(--card-3);
  color: var(--ink);
  text-decoration: none;
}
.menu-item.on {
  color: var(--accent-text);
  font-weight: 600;
}
.menu-item.danger {
  color: var(--bad);
}
.menu-item svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.menu-item small {
  margin-left: auto;
  color: var(--muted);
}
.menu-label {
  padding: 8px 10px 4px;
  color: var(--faint);
  font-size: var(--fs-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.menu-sep {
  height: 1px;
  background: var(--line);
  margin: 6px 4px;
}
@keyframes pop {
  from {
    opacity: 0;
    translate: 0 -6px;
    scale: 0.98;
  }
}

/* ── modal e gaveta ───────────────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--scrim);
  backdrop-filter: blur(6px);
  animation: fade 0.18s;
}
.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-radius: var(--r-xl);
  box-shadow: var(--rim), var(--shadow-lg);
  animation: rise 0.24s var(--ease);
}
.modal.wide {
  width: min(920px, 100%);
}
.modal.full {
  width: min(1240px, 100%);
  height: calc(100vh - 40px);
}
.modal-h {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 0;
}
.modal-h h2 {
  font-size: var(--fs-3xl);
}
.modal-b {
  padding: 18px 24px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.modal-f {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 22px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.overlay.side {
  place-items: stretch end;
  padding: 0;
}
.overlay.side .modal {
  width: min(520px, 100%);
  max-height: none;
  height: 100vh;
  border-radius: var(--r-xl) 0 0 var(--r-xl);
  animation: slide 0.26s var(--ease);
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes rise {
  from {
    opacity: 0;
    translate: 0 14px;
    scale: 0.985;
  }
}
@keyframes slide {
  from {
    translate: 40px 0;
    opacity: 0;
  }
}

/* ── toasts ───────────────────────────────────────────────────────────────── */
.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(420px, calc(100vw - 40px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--r-md);
  background: var(--panel);
  box-shadow: var(--rim), var(--shadow-lg);
  animation: rise 0.24s var(--ease);
  font-weight: 500;
}
.toast svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 1px;
  color: var(--accent-text);
}
.toast.ok svg {
  color: var(--ok);
}
.toast.bad svg {
  color: var(--bad);
}
.toast.warn svg {
  color: var(--warn);
}
.toast.out {
  opacity: 0;
  translate: 0 8px;
  transition: all 0.2s;
}

/* ── listas ───────────────────────────────────────────────────────────────── */
.list {
  display: flex;
  flex-direction: column;
}
.list > * {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.list > *:last-child {
  border-bottom: 0;
}
.kv {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 20px;
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
}
.code-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--card-2);
  box-shadow: inset 0 0 0 1px var(--line-2);
  font: 500 var(--fs-md) var(--mono);
  word-break: break-all;
}
.code-box span {
  flex: 1;
}
