/* =====================================================================
   AUTO LEADS — design system
   Regras em .claude/skills/frontend-design/SKILL.md
   ===================================================================== */

:root {
  /* superfícies */
  --bg:            #ffffff;
  --surface:       #f7f8fa;
  --surface-2:     #eef0f3;
  --border:        #e3e6ea;
  --border-strong: #cfd4db;

  /* sidebar */
  --sidebar-bg:     #0c0f14;
  --sidebar-text:   #aab2bf;
  --sidebar-active: #ffffff;
  --sidebar-hover:  #161b24;
  --sidebar-border: #1c222c;

  /* texto */
  --text:        #0f1419;
  --text-2:      #4b5563;
  --text-muted:  #8a94a6;

  /* marca */
  --green:        #16e07a;
  --green-hover:  #10c96b;
  --green-soft:   #e6fbef;
  --green-text:   #067a41;
  --on-green:     #0c0f14;

  /* semânticas */
  --amber:        #f59e0b; --amber-soft:   #fff4e0; --amber-text:   #92400e;
  --red:          #ef4444; --red-soft:     #fdecec; --red-text:     #991b1b;
  --blue:         #3b82f6; --blue-soft:    #e8f0fe; --blue-text:    #1e40af;
  --neutral-soft: #f0f2f5; --neutral-text: #4b5563;

  /* forma */
  --radius-sm: 6px; --radius: 10px; --radius-lg: 12px; --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(15,20,25,.05);
  --shadow:    0 4px 14px rgba(15,20,25,.07);
  --shadow-lg: 0 12px 32px rgba(15,20,25,.12);
  --focus:     0 0 0 3px rgba(22,224,122,.28);

  /* tipografia */
  --font: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 20px; --fs-2xl: 26px;

  /* layout */
  --sidebar-w: 240px;
  --sidebar-w-compact: 64px;
  --topbar-h: 56px;
  --ease: 150ms ease;
}

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-lg); margin: 32px 0 12px; }
h3 { font-size: var(--fs-md); }
p { margin: 0; }
a { color: inherit; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: none; box-shadow: var(--focus); }

.hidden { display: none !important; }
.mt-6  { margin-top: 6px; }
.mt-12 { margin-top: 12px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ----------------------------------------------------------------- icons */

.icon {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0; vertical-align: -3px;
}
.icon.sm { width: 14px; height: 14px; vertical-align: -2px; }
.icon.lg { width: 22px; height: 22px; }
.icon.xl { width: 32px; height: 32px; stroke-width: 1.5; }

/* --------------------------------------------------------------- sidebar */

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  gap: 8px;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: width var(--ease), transform var(--ease);
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 18px;
  color: var(--sidebar-active);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: 8px;
}

.brand-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--green);
  color: var(--on-green);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.brand-mark .icon { width: 18px; height: 18px; stroke-width: 2.25; }

.sidebar nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: var(--fs-md);
  font-weight: 500;
  position: relative;
  transition: background var(--ease), color var(--ease);
  white-space: nowrap;
}
.nav-item:hover { background: var(--sidebar-hover); color: var(--sidebar-active); }
.nav-item.active { background: var(--sidebar-hover); color: var(--sidebar-active); }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--green);
}
.nav-item .icon { opacity: .9; }

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--sidebar-border);
}

.stats-mini {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  font-size: var(--fs-xs);
  padding: 0 10px;
}
.stats-mini span { color: var(--sidebar-text); }
.stats-mini b { color: var(--sidebar-active); font-weight: 600; text-align: right; }

.sidebar .btn-ghost {
  color: var(--sidebar-text);
  border-color: var(--sidebar-border);
  justify-content: flex-start;
}
.sidebar .btn-ghost:hover { color: var(--sidebar-active); background: var(--sidebar-hover); }

/* -------------------------------------------------------------- topbar (mobile) */

.topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--sidebar-bg);
  color: var(--sidebar-active);
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  z-index: 30;
}
.topbar .brand { padding: 0; border: 0; margin: 0; }

.menu-btn {
  background: transparent;
  border: 0;
  color: var(--sidebar-active);
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  cursor: pointer;
}
.menu-btn:hover { background: var(--sidebar-hover); }

.backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(12,15,20,.5);
  z-index: 15;
}
body.nav-open .backdrop { display: block; }

/* ----------------------------------------------------------------- main */

main {
  flex: 1;
  min-width: 0;
  padding: 32px 36px 48px;
  overflow-y: auto;
  max-height: 100vh;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.page-header .title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.page-header h1 { display: flex; align-items: center; gap: 10px; }
.page-header h1 .icon { color: var(--text-muted); }
.page-header .actions { margin: 0; flex-shrink: 0; }
.page-sub { color: var(--text-2); font-size: var(--fs-md); max-width: 720px; }

.section-title {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin: 28px 0 10px;
}

/* ------------------------------------------------------------------ card */

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.card > h3 { margin-bottom: 16px; }
.card > h3 + .warn-box { margin-top: -4px; }
.card.subtle { background: var(--surface); border-color: transparent; }

/* ------------------------------------------------------------ stat tiles */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.tile {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tile .value { font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.tile .label { color: var(--text-muted); font-size: var(--fs-xs); font-weight: 500; }
.tile.green .value { color: var(--green-text); }
.tile.amber .value { color: var(--amber-text); }
.tile.red   .value { color: var(--red-text); }

/* ---------------------------------------------------------------- forms */

input[type="text"], input[type="password"], input[type="number"], input[type="search"],
select, textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: var(--fs-md);
  transition: border-color var(--ease), box-shadow var(--ease);
}
textarea { height: auto; padding: 10px 12px; }
input::placeholder { color: var(--text-muted); }
input:hover, select:hover { border-color: #b8bfc9; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: var(--focus); outline: none; }
input:disabled, select:disabled { background: var(--surface); color: var(--text-muted); cursor: not-allowed; }

select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a94a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}
select[size], select[multiple] {
  height: auto;
  padding: 4px;
  background-image: none;
}
select[size] option { padding: 8px 10px; border-radius: 4px; }
select[size] option:checked { background: var(--green-soft); color: var(--green-text); font-weight: 500; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > span, .field > label > span { font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); }
.field .help, small.dim { display: block; color: var(--text-muted); font-size: var(--fs-xs); margin-top: 4px; line-height: 1.45; }
.field.compact { margin: 0; }

.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 200px; }
.row.align-end { align-items: flex-end; }
.row > .no-grow { flex: 0 0 auto; min-width: 0; }

.check-grid { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.check-grid.stack { flex-direction: column; align-items: flex-start; gap: 12px; }

label.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
label.check .dim { display: inline; margin: 0; color: var(--text-muted); }

input[type="checkbox"] {
  appearance: none;
  width: 16px; height: 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  background: var(--bg);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--ease), border-color var(--ease);
}
input[type="checkbox"]::before {
  content: "";
  width: 9px; height: 9px;
  transform: scale(0);
  transition: transform 100ms ease;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  background: var(--on-green);
}
input[type="checkbox"]:checked { background: var(--green); border-color: var(--green); }
input[type="checkbox"]:checked::before { transform: scale(1); }
input[type="checkbox"]:disabled { opacity: .45; cursor: not-allowed; }

input[type="radio"] {
  appearance: none;
  width: 16px; height: 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  background: var(--bg);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--ease);
}
input[type="radio"]::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  transform: scale(0);
  transition: transform 100ms ease;
}
input[type="radio"]:checked { border-color: var(--green); }
input[type="radio"]:checked::before { transform: scale(1); }

code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  background: rgba(15,20,25,.06);
  padding: 1px 5px;
  border-radius: 4px;
}

.hood-grid {
  max-height: 260px;
  overflow-y: auto;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px 14px;
}

/* -------------------------------------------------------------- buttons */

.btn, .btn-primary, .btn-secondary, .btn-ghost, .btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-md);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background var(--ease), border-color var(--ease), color var(--ease), transform 80ms ease;
  text-decoration: none;
}
.btn-primary:active, .btn-secondary:active, .btn-danger:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

.btn-primary { background: var(--green); color: var(--on-green); font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: var(--green-hover); }

.btn-secondary { background: var(--bg); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface); border-color: #b8bfc9; }

.btn-ghost { background: transparent; color: var(--text-2); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }

.btn-danger { background: transparent; color: var(--red-text); border-color: var(--red); }
.btn-danger:hover:not(:disabled) { background: var(--red); color: #fff; }

.btn-sm { height: 34px; padding: 0 12px; font-size: var(--fs-sm); }
.btn-block { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; }

.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.actions.end { justify-content: flex-end; }

/* --------------------------------------------------------------- tables */

.table-wrap {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  max-height: 62vh;
}
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
  vertical-align: top;
}
th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface);
  color: var(--text-muted);
  font-weight: 600;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}
th.num, td.num { text-align: right; }
th.check, td.check { width: 40px; text-align: center; }
tbody tr { transition: background var(--ease); }
tbody tr:hover { background: var(--surface); }
tbody tr:last-child td { border-bottom: 0; }
td .primary { font-weight: 500; color: var(--text); }
td small.dim { margin-top: 2px; }
td select { height: 34px; font-size: var(--fs-sm); min-width: 130px; }
.table-foot { color: var(--text-muted); font-size: var(--fs-sm); margin-top: 10px; }

/* ------------------------------------------------------- célula de contatos */
/* WhatsApp provável em destaque; demais canais num expansor nativo (<details>) */

.contact-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.contact-line .link { font-variant-numeric: tabular-nums; }
.contact-line small.dim { display: inline; margin: 0; }

.contact-more { margin-top: 4px; }
.contact-more summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 500;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
}
.contact-more summary::-webkit-details-marker { display: none; }
.contact-more summary::before {
  content: "";
  width: 0; height: 0;
  border: 4px solid transparent;
  border-left-color: currentColor;
  border-right: 0;
  transition: transform var(--ease);
}
.contact-more[open] summary::before { transform: rotate(90deg); }
.contact-more summary:hover { color: var(--text); }
.contact-more ul { list-style: none; margin: 6px 0 0; padding: 8px 10px; background: var(--surface); border-radius: var(--radius-sm); }
.contact-more li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 3px 0; font-variant-numeric: tabular-nums; }
.contact-more li small.dim { display: inline; margin: 0; }

/* --------------------------------------------------------------- badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  letter-spacing: .01em;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* verde */
.badge.nova, .badge.completo, .badge.alta, .badge.cliente, .badge.concluida, .badge.success
  { background: var(--green-soft); color: var(--green-text); }
/* âmbar */
.badge.existente, .badge.parcial, .badge.media, .badge.contatado, .badge.warn
  { background: var(--amber-soft); color: var(--amber-text); }
/* vermelho */
.badge.falhou, .badge.nao_encontrado, .badge.baixa, .badge.bloqueada, .badge.descartado, .badge.danger
  { background: var(--red-soft); color: var(--red-text); }
/* azul */
.badge.enriquecido, .badge.exportado, .badge.reuniao, .badge.respondeu, .badge.info
  { background: var(--blue-soft); color: var(--blue-text); }
/* neutro */
.badge.pendente, .badge.novo, .badge.rodando, .badge.neutral
  { background: var(--neutral-soft); color: var(--neutral-text); }

/* ------------------------------------------------------------- progress */

.progress-bar {
  height: 8px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin: 4px 0 10px;
}
.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: var(--radius-pill);
  transition: width 400ms ease;
}
.progress-text {
  color: var(--text-2);
  font-size: var(--fs-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ----------------------------------------------------------- list cards */

.list-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.list-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.list-card .icon-box {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.list-card .info { flex: 1; min-width: 0; }
.list-card .name { font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-card .meta { color: var(--text-muted); font-size: var(--fs-xs); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-card .count { text-align: right; flex-shrink: 0; }
.list-card .count b { font-size: var(--fs-xl); font-weight: 600; display: block; line-height: 1.1; }
.list-card .count span { color: var(--text-muted); font-size: var(--fs-xs); }
.list-card .chev { color: var(--text-muted); }

/* ------------------------------------------------------------ callouts */

.warn-box, .error-box, .info-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  line-height: 1.55;
  margin-bottom: 16px;
  border: 1px solid;
}
.warn-box  { background: var(--amber-soft); border-color: #f6d9a0; color: var(--amber-text); }
.error-box { background: var(--red-soft);   border-color: #f5b5b5; color: var(--red-text); }
.info-box  { background: var(--blue-soft);  border-color: #bcd3fb; color: var(--blue-text); }
.warn-box .icon, .error-box .icon, .info-box .icon { margin-top: 2px; }
.error-box .actions { margin-top: 10px; }

.error { color: var(--red-text); font-size: var(--fs-sm); min-height: 18px; }
.success { color: var(--green-text); font-size: var(--fs-sm); }

/* -------------------------------------------------------- empty state */

.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty .icon { width: 36px; height: 36px; stroke-width: 1.5; color: var(--border-strong); }
.empty .title { color: var(--text); font-weight: 600; font-size: var(--fs-md); }
.empty p { max-width: 380px; font-size: var(--fs-sm); }
.empty .btn-primary { margin-top: 8px; }
.empty.inline { padding: 28px 16px; flex-direction: row; justify-content: center; }

/* ------------------------------------------------------------ skeleton */

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-line { height: 12px; margin: 8px 0; }
.sk-line.w40 { width: 40%; } .sk-line.w60 { width: 60%; } .sk-line.w80 { width: 80%; }
.sk-tile { height: 78px; }
.sk-row { height: 46px; margin: 0 0 1px; border-radius: 0; }
.sk-card { height: 72px; margin-bottom: 10px; }
.sk-block { height: 160px; }

/* -------------------------------------------------------------- toolbar */

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.toolbar input, .toolbar select { width: auto; min-width: 160px; height: 36px; }
.toolbar .btn-secondary, .toolbar .btn-primary { height: 36px; }
.toolbar .count { color: var(--text-muted); font-size: var(--fs-sm); margin-left: auto; }
.toolbar.tight { margin: 6px 0 10px; }

/* filtro de perfil na lista: caixinha + badge + contagem */
.profile-filter { gap: 16px; }
.profile-filter label.check { color: var(--text-2); }
.profile-filter label.check .badge { margin-right: 2px; }
.profile-filter .count { margin-left: 0; }
.profile-filter #removeHidden { margin-left: auto; }

/* ---------------------------------------------------------------- toast */

.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex; align-items: center; gap: 10px;
  background: var(--sidebar-bg);
  color: var(--sidebar-active);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm);
  max-width: 380px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 200ms ease, transform 200ms ease;
  pointer-events: none;
  z-index: 40;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast .icon { color: var(--green); }
.toast.error .icon { color: var(--red); }

/* --------------------------------------------------------------- links */

a.link { color: var(--green-text); text-decoration: none; font-weight: 500; }
a.link:hover { text-decoration: underline; }

/* -------------------------------------------------------------- spinner */

.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
.btn-primary .spinner { border-color: rgba(12,15,20,.25); border-top-color: var(--on-green); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------------- login */

body.login-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.login-brand {
  background: var(--sidebar-bg);
  color: var(--sidebar-active);
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-brand .brand { border: 0; margin: 0; padding: 0; font-size: 16px; }
.login-brand h2 { font-size: 30px; line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.02em; max-width: 420px; }
.login-brand p  { color: var(--sidebar-text); max-width: 420px; font-size: 15px; }
.login-brand .highlights { display: grid; gap: 14px; margin-top: 36px; }
.login-brand .highlights div { display: flex; gap: 12px; align-items: flex-start; color: var(--sidebar-text); font-size: var(--fs-sm); }
.login-brand .highlights .icon { color: var(--green); margin-top: 2px; }
.login-brand .foot { color: var(--sidebar-text); font-size: var(--fs-xs); }

.login-side { display: grid; place-items: center; padding: 32px; background: var(--surface); }
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login-card h1 { font-size: 22px; }
.login-card .sub { color: var(--text-2); font-size: var(--fs-sm); margin-top: -8px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); }

/* ----------------------------------------------------------- responsive */

@media (max-width: 1199px) {
  .sidebar { width: var(--sidebar-w-compact); padding: 20px 8px; }
  .sidebar .brand { justify-content: center; padding: 4px 0 16px; }
  .sidebar .brand span, .sidebar .nav-item span, .sidebar .stats-mini, .sidebar .btn-ghost span { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .sidebar .btn-ghost { justify-content: center; padding: 0; width: 100%; }
  main { padding: 28px 24px 40px; }
  .page-header { flex-direction: column; }
}

@media (max-width: 767px) {
  body { flex-direction: column; }
  .topbar { display: flex; }
  .backdrop { z-index: 15; }

  .sidebar {
    position: fixed;
    top: var(--topbar-h); left: 0; bottom: 0;
    width: var(--sidebar-w);
    padding: 16px 12px;
    transform: translateX(-100%);
    height: auto;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .sidebar .brand { display: none; }
  .sidebar .nav-item span, .sidebar .stats-mini, .sidebar .btn-ghost span { display: initial; }
  .sidebar .stats-mini { display: grid; }
  .nav-item { justify-content: flex-start; padding: 12px; }
  .sidebar .btn-ghost { justify-content: flex-start; padding: 0 12px; }

  main { padding: calc(var(--topbar-h) + 20px) 16px 40px; max-height: none; }

  .tiles { grid-template-columns: repeat(2, 1fr); }
  .row > * { min-width: 100%; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar input, .toolbar select { width: 100%; min-width: 0; }
  .toolbar .count { margin-left: 0; }
  .actions { flex-direction: column; align-items: stretch; }
  .actions .btn-primary, .actions .btn-secondary, .actions .btn-danger { width: 100%; height: 44px; }
  .hood-grid { grid-template-columns: 1fr 1fr; }
  .list-card .count b { font-size: var(--fs-lg); }

  /* tabela vira lista de cartões */
  .table-wrap { max-height: none; border: 0; background: transparent; overflow: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; }
  .table-wrap thead { display: none; }
  .table-wrap tr {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 0;
    margin-bottom: 10px;
  }
  .table-wrap td {
    border: 0;
    padding: 6px 14px;
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 10px;
    align-items: start;
    font-size: var(--fs-sm);
  }
  .table-wrap td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding-top: 2px;
  }
  .table-wrap td.check { grid-template-columns: 96px auto; }
  .table-wrap td.check::before { content: "Selecionar"; }
  .table-wrap td:not([data-label]) { grid-template-columns: 1fr; }
  .table-wrap td:not([data-label])::before { content: none; }
  td select { width: 100%; }
}

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