/* ============================================================
   Realizadores · Sistema · Folha de estilos principal
   ============================================================ */

:root {
  --bg: #0A0908;
  --bg-elev: #161413;
  --bg-card: #1C1917;
  --bg-input: #22201E;
  --ink: #F5F0E6;
  --ink-muted: #9A9288;
  --ink-dim: #5E574E;
  --red: #C8102E;
  --red-bright: #E63946;
  --red-deep: #8B0E21;
  --bronze: #B87333;
  --prata: #BFBFBF;
  --ouro: #E8B84A;
  --diamante: #7FD4D9;
  --inelegivel: #555555;
  --danger: #D4624D;
  --success: #7CB982;
  --warning: #D4A24D;
  --line: rgba(245,240,230,0.08);
  --line-strong: rgba(245,240,230,0.16);
}

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

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Manrope', system-ui, sans-serif;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(200,16,46,0.10) 0%, transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(200,16,46,0.05) 0%, transparent 45%);
  pointer-events: none; z-index: 0;
}
body::after {
  content: ''; position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 0; mix-blend-mode: overlay;
}

/* ============= BOOT SCREEN ============= */
.boot-screen {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 32px;
  transition: opacity 0.4s ease;
}
.boot-screen.fade-out {
  opacity: 0; pointer-events: none;
}
.boot-logo {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 900; font-size: 80px; line-height: 0.9;
  background: linear-gradient(180deg, #FF5062 0%, var(--red) 45%, var(--red-deep) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 16px rgba(200,16,46,0.35));
}
.boot-logo .plus {
  color: var(--red-bright);
  -webkit-text-fill-color: var(--red-bright);
  font-size: 0.7em; vertical-align: super; margin-left: -4px;
}
.boot-loader {
  width: 48px; height: 48px;
  border: 3px solid var(--line-strong);
  border-top-color: var(--red-bright);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============= LOGIN ============= */
.login-screen {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
}
.login-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, #231817 100%);
  border: 1px solid rgba(200,16,46,0.3);
  padding: 48px 40px;
  max-width: 440px; width: 100%;
  position: relative; overflow: hidden;
}
.login-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--red-bright), transparent);
}
.login-logo {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 900; font-size: 64px; line-height: 0.9;
  background: linear-gradient(180deg, #FF5062 0%, var(--red) 45%, var(--red-deep) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 16px rgba(200,16,46,0.35));
  text-align: center;
  margin-bottom: 4px;
}
.login-logo .plus {
  color: var(--red-bright);
  -webkit-text-fill-color: var(--red-bright);
  font-size: 0.7em; vertical-align: super; margin-left: -3px;
}
.login-tagline {
  font-family: 'Instrument Serif', serif; font-style: italic;
  font-size: 16px; color: var(--ink-muted);
  text-align: center;
  margin-bottom: 36px;
}

.login-field { margin-bottom: 18px; }
.login-label {
  display: block;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.2em; color: var(--ink-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.login-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-family: 'Manrope', sans-serif;
  font-size: 15px; font-weight: 500;
  padding: 12px 14px;
  transition: all 0.15s ease;
}
.login-input:focus {
  outline: none;
  border-color: var(--red-bright);
  background: #28231E;
}

.login-submit {
  width: 100%;
  background: var(--red);
  border: 1px solid var(--red);
  color: #FFF;
  font-family: 'Manrope', sans-serif;
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  padding: 14px;
  cursor: pointer;
  margin-top: 12px;
  transition: all 0.2s;
}
.login-submit:hover { background: var(--red-bright); border-color: var(--red-bright); }
.login-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.login-error {
  background: rgba(212,98,77,0.15);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 13px;
  display: none;
}
.login-error.show { display: block; }

.login-footer {
  text-align: center;
  margin-top: 28px;
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ============= APP SHELL ============= */
.app-shell { position: relative; z-index: 1; min-height: 100vh; }

.topbar {
  display: flex; align-items: center;
  padding: 16px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(10,9,8,0.85);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 50;
  gap: 28px;
}
.brand-mini { display: flex; align-items: baseline; gap: 12px; }
.brand-mini .logo {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 900; font-size: 28px; line-height: 1;
  background: linear-gradient(180deg, #FF5062 0%, var(--red) 60%, var(--red-deep) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.01em;
}
.brand-mini .logo .plus {
  color: var(--red-bright);
  -webkit-text-fill-color: var(--red-bright);
  font-size: 0.75em; vertical-align: super; margin-left: -2px;
}
.brand-mini .sub {
  font-family: 'Instrument Serif', serif; font-style: italic;
  font-size: 13px; color: var(--ink-dim);
}

.nav { display: flex; gap: 4px; flex: 1; justify-content: center; flex-wrap: wrap; }
.nav-btn {
  background: transparent; border: none; color: var(--ink-muted);
  font-family: 'Manrope', sans-serif;
  font-size: 11px; font-weight: 600; letter-spacing: 0.2em;
  text-transform: uppercase; padding: 8px 16px;
  cursor: pointer; position: relative;
  transition: color 0.2s;
}
.nav-btn::after {
  content: ''; position: absolute;
  bottom: 0; left: 50%; right: 50%;
  height: 2px; background: var(--red-bright);
  transition: all 0.3s ease;
}
.nav-btn:hover { color: var(--ink); }
.nav-btn.active { color: var(--ink); }
.nav-btn.active::after { left: 16px; right: 16px; }

.topbar-user {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; color: var(--ink-muted);
}
.user-info { text-align: right; }
.user-name {
  font-weight: 600; color: var(--ink);
  font-size: 13px;
}
.user-role {
  font-size: 10px; letter-spacing: 0.18em;
  color: var(--red-bright); text-transform: uppercase;
}
.user-role.diretoria { color: var(--ouro); }
.user-role.vendedor { color: var(--diamante); }

.btn {
  background: transparent; border: 1px solid var(--line-strong);
  color: var(--ink-muted); font-family: 'Manrope', sans-serif;
  font-size: 11px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; padding: 8px 14px;
  cursor: pointer; transition: all 0.2s;
}
.btn:hover { border-color: var(--red-bright); color: var(--red-bright); }
.btn.primary {
  background: var(--red); border-color: var(--red); color: #FFF;
}
.btn.primary:hover { background: var(--red-bright); border-color: var(--red-bright); color: #FFF; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #FFF; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============= PAGES ============= */
.page { max-width: 1920px; margin: 0 auto; padding: 32px 40px 48px; }
.page.hidden { display: none; }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  gap: 20px; flex-wrap: wrap;
}
.page-header h1 {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700; font-size: 36px; letter-spacing: 0.01em;
}
.page-header .sub {
  font-family: 'Instrument Serif', serif; font-style: italic;
  font-size: 15px; color: var(--ink-muted); margin-top: 2px;
}

.placeholder-section {
  background: var(--bg-card);
  border: 1px dashed var(--line-strong);
  padding: 60px 40px;
  text-align: center;
  margin-top: 24px;
}
.placeholder-icon {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 900; font-size: 56px;
  color: var(--red);
  margin-bottom: 16px;
}
.placeholder-title {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700; font-size: 28px;
  margin-bottom: 12px;
}
.placeholder-text {
  font-size: 14px; color: var(--ink-muted);
  max-width: 480px; margin: 0 auto;
  line-height: 1.6;
}


/* ============= TOASTS ============= */
.toast-wrap {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 1000; display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 48px);
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-card);
  border-left: 3px solid var(--success);
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 12px 48px rgba(0,0,0,0.5);
  animation: slideInToast 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: all;
  min-width: 300px;
  max-width: 480px;
}
.toast--leaving {
  animation: fadeOutToast 0.2s ease forwards;
}
.toast-icon {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  flex-shrink: 0;
}
.toast-msg {
  flex: 1;
  word-wrap: break-word;
}
.toast-close {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  margin-left: 4px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.toast-close:hover { color: var(--ink); }

/* Variantes por tipo */
.toast--success {
  border-left-color: var(--success);
}
.toast--success .toast-icon { color: var(--success); }

.toast--error {
  border-left-color: var(--danger);
  border-left-width: 4px;
  background: linear-gradient(90deg, rgba(220,38,38,0.10) 0%, var(--bg-card) 40%);
}
.toast--error .toast-icon {
  color: var(--danger);
  font-size: 18px;
}
.toast--error .toast-msg {
  font-weight: 500;
  color: var(--ink);
}

.toast--warning {
  border-left-color: var(--warning, #F59E0B);
  border-left-width: 4px;
  background: linear-gradient(90deg, rgba(245,158,11,0.08) 0%, var(--bg-card) 40%);
}
.toast--warning .toast-icon {
  color: var(--warning, #F59E0B);
  font-size: 18px;
}

.toast--info {
  border-left-color: var(--ink-muted);
}

@keyframes slideInToast {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOutToast {
  to { opacity: 0; transform: translateX(20px); }
}

/* ============================================================
   ERRO INLINE EM MODAIS E DRAWERS
   ============================================================ */
.modal-error {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(220, 38, 38, 0.10);
  border: 1px solid rgba(220, 38, 38, 0.40);
  border-left: 4px solid var(--danger, #DC2626);
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  animation: shakeError 0.4s ease;
}
.modal-error-icon {
  color: var(--danger, #DC2626);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  flex-shrink: 0;
}
.modal-error-text {
  flex: 1;
}
@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ============= RESPONSIVE ============= */
@media (max-width: 1280px) {
  .topbar { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .nav { order: 3; width: 100%; flex-wrap: wrap; }
  .page { padding: 24px 16px; }
  .home-hero .logo-big { font-size: 72px; }
}
@media (max-width: 720px) {
  .topbar-user { flex-wrap: wrap; }
  .login-card { padding: 32px 24px; }
  .login-logo { font-size: 48px; }
}

/* ============================================================
   APURAÇÃO E PAINEL — estilos adicionais (Sessão B)
   ============================================================ */

/* === Summary bar (acima da tabela) === */
.summary-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 24px;
}
.summary-item {
  background: var(--bg-card);
  padding: 16px 20px;
}
.summary-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.18em;
  color: var(--ink-muted); text-transform: uppercase;
  margin-bottom: 6px;
}
.summary-value {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700; font-size: 26px; color: var(--ink);
  line-height: 1;
}
.summary-value .small {
  font-size: 14px; color: var(--ink-muted); font-weight: 500;
}

/* === Tabela de vendedores === */
.vendor-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--line);
  overflow-x: auto;
  margin-bottom: 16px;
}
table.vendor-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 1200px;
}
table.vendor-table thead th {
  background: #0F0D0C;
  border-bottom: 1px solid var(--line-strong);
  padding: 14px 10px 12px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-muted);
  text-align: center; vertical-align: middle;
  white-space: nowrap;
  position: sticky; top: 0; z-index: 5;
}
table.vendor-table thead th.group-sales { color: var(--red-bright); }
table.vendor-table thead th.group-quality { color: var(--ouro); }
table.vendor-table thead th.group-bonus { color: var(--ink-muted); }
table.vendor-table thead th.group-calc { color: var(--diamante); }
table.vendor-table thead th.name-col { text-align: left; padding-left: 16px; }
table.vendor-table tbody td {
  border-bottom: 1px solid var(--line);
  padding: 6px 8px;
  vertical-align: middle;
}
table.vendor-table tbody td.name-col {
  padding-left: 16px;
  font-weight: 600; font-size: 14px;
  color: var(--ink);
}
table.vendor-table tbody tr:hover {
  background: rgba(200,16,46,0.04);
}
table.vendor-table tbody tr.inelegivel { opacity: 0.65; }
table.vendor-table tbody tr.inelegivel td.name-col { font-style: italic; }
td.calc {
  text-align: center;
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700; font-size: 16px;
  color: var(--ink);
}
td.calc.total {
  font-size: 20px; font-weight: 900;
  background: rgba(200,16,46,0.05);
}
td.tier-cell { text-align: center; }
.tier-badge-sm {
  font-size: 9px; font-weight: 700; letter-spacing: 0.18em;
  padding: 4px 8px; text-transform: uppercase;
  color: #000;
  min-width: 78px; display: inline-block;
  text-align: center;
}
.tier-badge-sm.diamante { background: var(--diamante); }
.tier-badge-sm.ouro { background: var(--ouro); }
.tier-badge-sm.prata { background: var(--prata); }
.tier-badge-sm.bronze { background: var(--bronze); color: var(--ink); }
.tier-badge-sm.inelegivel { background: #555; color: var(--ink); font-style: italic; }
.rank-pill {
  display: inline-block;
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 900; font-size: 18px;
  min-width: 36px; text-align: center;
  padding: 2px 6px;
}
.rank-pill.top-1 { background: var(--red); color: #FFF; }
.rank-pill.top-2 { background: rgba(200,16,46,0.25); color: var(--red-bright); }
.rank-pill.top-3 { background: rgba(200,16,46,0.12); color: var(--red-bright); }

/* === Inputs numéricos === */
.num-input {
  background: var(--bg-input);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 13px; font-weight: 500;
  padding: 6px 8px;
  text-align: center;
  width: 100%;
  min-width: 64px;
  font-family: inherit;
}
.num-input:focus {
  outline: none; border-color: var(--red-bright);
}
.num-input.fatur { min-width: 110px; text-align: right; font-weight: 600; }
.num-input.retencao { min-width: 72px; }
.mini-select {
  background: var(--bg-input);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 12px; font-weight: 600;
  padding: 4px 8px;
  cursor: pointer; text-align: center;
  width: 56px;
  font-family: inherit;
}
.mini-select:focus { outline: none; border-color: var(--red-bright); }

/* === Status de salvamento === */
.save-status {
  font-size: 12px;
  color: var(--ink-muted);
  padding: 8px 0;
  text-align: right;
  letter-spacing: 0.04em;
  min-height: 24px;
}
.save-status.pending { color: var(--warning); }
.save-status.ok { color: var(--success); }
.save-status.error { color: var(--danger); }

/* === Page header com ações === */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.page-actions {
  display: flex;
  gap: 10px;
}

/* === PAINEL === */
.painel-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 32px;
  margin-top: 20px;
}
.podium-wrap {
  background: linear-gradient(180deg, rgba(200,16,46,0.06) 0%, transparent 100%);
  border: 1px solid var(--line);
  padding: 36px 40px;
  position: relative; overflow: hidden;
}
.podium-wrap::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  opacity: 0.6;
}
.section-label {
  display: flex; align-items: center; gap: 14px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.28em;
  color: var(--ink-muted); text-transform: uppercase; margin-bottom: 24px;
}
.section-label::before {
  content: ''; width: 20px; height: 1px; background: var(--red);
}
.podium {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  align-items: end; gap: 18px; margin-bottom: 12px;
}
.pod { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.medal {
  width: 84px; height: 84px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 900; font-size: 56px;
  border: 2px solid; position: relative;
}
.medal::after {
  content: ''; position: absolute; inset: -8px;
  border-radius: 50%; border: 1px dashed; opacity: 0.3;
}
.pod--1 .medal {
  background: radial-gradient(circle at 30% 30%, #FF6478, var(--red) 50%, var(--red-deep) 100%);
  color: #FFF; border-color: #FF6478;
  width: 110px; height: 110px; font-size: 72px;
  box-shadow: 0 0 60px rgba(230,57,70,0.55);
  animation: pulseRed 3s ease-in-out infinite;
}
@keyframes pulseRed {
  0%, 100% { filter: drop-shadow(0 0 24px rgba(230,57,70,0.45)); }
  50% { filter: drop-shadow(0 0 48px rgba(230,57,70,0.7)); }
}
.pod--2 .medal {
  background: radial-gradient(circle at 30% 30%, #E8E4DC, #BFBFBF 50%, #7F7A70 100%);
  color: #2A2620; border-color: #E8E4DC;
}
.pod--3 .medal {
  background: radial-gradient(circle at 30% 30%, #DCA070, #B87333 50%, #7A4E1F 100%);
  color: #1A1008; border-color: #DCA070;
}
.pod-name {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700; font-size: 26px; text-align: center;
  max-width: 240px; line-height: 1;
}
.pod--1 .pod-name {
  font-size: 34px;
  background: linear-gradient(180deg, #FF8896, var(--red-bright));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.pod-points {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 900; font-size: 44px;
}
.pod--1 .pod-points { font-size: 62px; color: var(--red-bright); }
.pod-points-label {
  font-size: 10px; letter-spacing: 0.28em;
  color: var(--ink-dim); text-transform: uppercase; margin-top: -6px;
}
.pod-tier {
  font-size: 10px; font-weight: 700; letter-spacing: 0.3em;
  padding: 4px 10px; border: 1px solid; text-transform: uppercase;
}
.tier-diamante { color: var(--diamante); border-color: var(--diamante); }
.tier-ouro { color: var(--ouro); border-color: var(--ouro); }
.tier-prata { color: var(--prata); border-color: var(--prata); }
.tier-bronze { color: var(--bronze); border-color: var(--bronze); }
.tier-inelegivel { color: var(--inelegivel); border-color: var(--inelegivel); font-style: italic; }
.pod-bar { width: 100%; border-top: 2px solid var(--red); }
.pod--1 .pod-bar { height: 36px; background: linear-gradient(180deg, rgba(230,57,70,0.28), transparent); }
.pod--2 .pod-bar { height: 22px; border-top-color: var(--prata); background: linear-gradient(180deg, rgba(191,191,191,0.15), transparent); }
.pod--3 .pod-bar { height: 14px; border-top-color: var(--bronze); background: linear-gradient(180deg, rgba(184,115,51,0.15), transparent); }

/* === Linha do top 4-10 === */
.ranking-rest { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 20px; }
.rank-row {
  display: grid; grid-template-columns: 60px 1fr auto auto auto;
  gap: 20px; align-items: center;
  padding: 10px 8px; border-bottom: 1px solid var(--line);
}
.rank-row:hover { background: rgba(200,16,46,0.05); }
.rank-row.inelegivel { opacity: 0.55; }
.rank-pos {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700; font-size: 22px;
  color: var(--ink-muted); text-align: center;
}
.rank-name { font-weight: 600; font-size: 16px; }
.rank-metrics { display: flex; gap: 10px; font-size: 11px; color: var(--ink-muted); }
.rank-metric-badge { padding: 2px 8px; border: 1px solid var(--line-strong); }
.rank-tier {
  font-size: 9px; font-weight: 700; letter-spacing: 0.28em;
  padding: 3px 8px; border: 1px solid;
  min-width: 82px; text-align: center;
}
.rank-points {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 900; font-size: 28px;
  min-width: 70px; text-align: right;
}

/* === Sidebar com cards === */
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.card { background: var(--bg-card); border: 1px solid var(--line); padding: 24px; }
.card-title {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700; font-size: 24px; margin-bottom: 18px;
}
.progress-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, #231817 100%);
  border-color: rgba(200,16,46,0.30);
  position: relative; overflow: hidden;
}
.progress-card::before {
  content: ''; position: absolute;
  top: -50%; right: -30%;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(230,57,70,0.18) 0%, transparent 60%);
  pointer-events: none;
}
.progress-stat {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 0; border-bottom: 1px dashed var(--line);
}
.progress-stat:last-child { border-bottom: none; }
.progress-stat-label { font-size: 12px; color: var(--ink-muted); }
.progress-stat-value {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700; font-size: 22px;
}
.progress-stat-value .unit { font-size: 11px; color: var(--ink-muted); margin-left: 4px; }

/* === Distribuição de Tiers (sidebar) === */
.tier-dist { display: flex; flex-direction: column; gap: 12px; }
.tier-row {
  display: grid; grid-template-columns: 100px 1fr auto;
  align-items: center; gap: 16px;
}
.tier-badge {
  font-size: 9px; font-weight: 700; letter-spacing: 0.3em;
  padding: 5px 0; text-transform: uppercase;
  text-align: center; color: #000;
}
.tier-badge.diamante { background: var(--diamante); }
.tier-badge.ouro { background: var(--ouro); }
.tier-badge.prata { background: var(--prata); }
.tier-badge.bronze { background: var(--bronze); color: var(--ink); }
.tier-badge.inelegivel { background: #555; color: var(--ink); font-style: italic; }
.tier-bar-track { height: 16px; background: var(--bg-elev); overflow: hidden; }
.tier-bar-fill { height: 100%; transition: width 0.5s ease; }
.tier-bar-fill.diamante { background: var(--diamante); }
.tier-bar-fill.ouro { background: var(--ouro); }
.tier-bar-fill.prata { background: var(--prata); }
.tier-bar-fill.bronze { background: var(--bronze); }
.tier-bar-fill.inelegivel { background: #555; }
.tier-count {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 900; font-size: 22px;
  min-width: 40px; text-align: right;
}
.tier-count small { font-size: 12px; color: var(--ink-muted); }

/* === Destaques de qualidade (sidebar) === */
.highlights { display: flex; flex-direction: column; gap: 16px; }
.highlight {
  display: grid; grid-template-columns: 1fr auto;
  gap: 12px; padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.highlight:last-child { border-bottom: none; padding-bottom: 0; }
.highlight-cat {
  font-size: 10px; font-weight: 600; letter-spacing: 0.26em;
  color: var(--red-bright); text-transform: uppercase;
}
.highlight-name {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700; font-size: 20px; margin-top: 2px;
}
.highlight-value {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 900; font-size: 32px;
  color: var(--red-bright); align-self: center;
}

/* === Responsivo === */
@media (max-width: 1200px) {
  .painel-grid { grid-template-columns: 1fr; }
  .summary-bar { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .summary-bar { grid-template-columns: 1fr; }
  .podium { grid-template-columns: 1fr; }
  .pod-bar { display: none; }
  .rank-row { grid-template-columns: 40px 1fr auto; }
  .rank-metrics, .rank-tier { display: none; }
}

/* === Status de elegibilidade do vendedor (no Pulso do Mês) === */
.progress-stat-value.eleg-sim {
  color: var(--success);
  letter-spacing: 0.08em;
}
.progress-stat-value.eleg-nao {
  color: var(--danger);
  letter-spacing: 0.08em;
}
.progress-stat-value.eleg-pendente {
  color: var(--ink-muted);
  font-style: italic;
}

/* ============================================================
   MINHA EQUIPE — cards de vendedores da equipe (supervisor)
   ============================================================ */
.equipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.vendor-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.18s, transform 0.18s;
}
.vendor-card:hover {
  border-color: rgba(200,16,46,0.40);
  transform: translateY(-1px);
}
.vendor-card--inelegivel { opacity: 0.78; }
.vendor-card--pendente {
  border-style: dashed;
  border-color: var(--line-strong);
}

/* Header: nome + posição + tier */
.vc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.vc-name-block { min-width: 0; }
.vc-name {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.05;
  color: var(--ink);
}
.vc-rank {
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  text-transform: uppercase;
}
.vc-tier-block { flex-shrink: 0; }

/* Faixa de elegibilidade */
.vc-elegibilidade {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: var(--bg-elev);
}
.vc-elegibilidade.sim { border-left: 3px solid var(--success); }
.vc-elegibilidade.nao { border-left: 3px solid var(--danger); }
.vc-eleg-label { color: var(--ink-muted); }
.vc-eleg-value {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.08em;
}
.vc-elegibilidade.sim .vc-eleg-value { color: var(--success); }
.vc-elegibilidade.nao .vc-eleg-value { color: var(--danger); }

/* Grid de indicadores */
.vc-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 16px;
}
.vc-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.vc-metric:nth-last-child(-n+2) { border-bottom: none; }
.vc-metric-label {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  text-transform: uppercase;
}
.vc-metric-value {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
}
.vc-metric--points .vc-metric-value {
  color: var(--red-bright);
  font-size: 22px;
}

/* Mensagem de pendente */
.vc-pendente-msg {
  font-size: 13px;
  font-style: italic;
  color: var(--ink-muted);
  padding: 12px 0;
}

@media (max-width: 720px) {
  .equipe-grid { grid-template-columns: 1fr; }
  .vc-metrics { grid-template-columns: 1fr; }
}

/* ============================================================
   EQUIPES (gestor) — cards de cada equipe (supervisor + vendedores)
   ============================================================ */
.team-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.2s, transform 0.2s;
}
.team-card:hover {
  border-color: rgba(200,16,46,0.4);
  transform: translateY(-1px);
}
.team-card--orphan {
  border-style: dashed;
  opacity: 0.85;
}

.tc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.tc-name-block { min-width: 0; flex: 1; }
.tc-name {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 24px;
  line-height: 1.05;
  color: var(--ink);
}
.tc-vendedores {
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  text-transform: uppercase;
}
.tc-fat { text-align: right; flex-shrink: 0; }
.tc-fat-label {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}
.tc-fat-value {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 900;
  font-size: 26px;
  color: var(--red-bright);
}

.tc-tiers-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tc-tier-pill {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  padding: 4px 8px;
  text-transform: uppercase;
  color: #000;
}
.tc-tier-pill.diamante { background: var(--diamante); }
.tc-tier-pill.ouro { background: var(--ouro); }
.tc-tier-pill.prata { background: var(--prata); }
.tc-tier-pill.bronze { background: var(--bronze); color: var(--ink); }
.tc-tier-pill.inelegivel { background: #555; color: var(--ink); font-style: italic; }

.tc-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 16px;
}
.tc-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}
.tc-metric:nth-last-child(-n+2) { border-bottom: none; }
.tc-metric-label {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  text-transform: uppercase;
}
.tc-metric-value {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
}
.tc-metric-value .small {
  font-size: 13px;
  color: var(--ink-muted);
  font-weight: 500;
}
.tc-metric--points .tc-metric-value {
  color: var(--red-bright);
  font-size: 22px;
}

/* ============================================================
   PARÂMETROS (gestor)
   ============================================================ */
.params-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 8px;
}
.params-section {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 24px;
}
.params-section--accent {
  grid-column: 1 / -1;
  border-left: 4px solid var(--red);
}
.params-section-title {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
  margin-bottom: 6px;
}
.params-section--accent .params-section-title {
  color: var(--red-bright);
  font-size: 22px;
}
.params-section-intro {
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}
.params-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.param-field {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.param-field:last-child { border-bottom: none; }
.param-label {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.3;
}
.param-input-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  background: var(--bg-input);
  border: 1px solid var(--line-strong);
}
.param-input-wrap:focus-within { border-color: var(--red-bright); }
.param-prefix, .param-suffix {
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 12px;
  color: var(--ink-muted);
  background: rgba(0,0,0,0.2);
  font-weight: 600;
}
.param-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--ink);
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  font-family: inherit;
  min-width: 0;
}
.param-input:focus { outline: none; }
.params-tip {
  margin-top: 24px;
  padding: 14px 18px;
  background: rgba(200,16,46,0.08);
  border-left: 3px solid var(--red);
  font-size: 13px;
  color: var(--ink);
  line-height: 1.5;
}

/* ============================================================
   PREMIAÇÃO — Saúde do Orçamento (compartilhado)
   ============================================================ */
.health-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  padding: 24px;
  margin-bottom: 24px;
  transition: border-left-color 0.3s;
}
.health-card.health-ok { border-left-color: var(--success); }
.health-card.health-warn { border-left-color: var(--warning); }
.health-card.health-danger { border-left-color: var(--danger); }
.health-top {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.health-titles { flex: 1; min-width: 240px; }
.health-title {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 22px;
  margin-bottom: 4px;
}
.health-msg {
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.5;
}
.health-stats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.health-stat { text-align: right; }
.hs-label {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--ink-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.hs-value {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 24px;
}
.hs-variacao { font-weight: 900; }
.health-card.health-warn .hs-variacao { color: var(--warning); }
.health-card.health-danger .hs-variacao { color: var(--danger); }
.health-card.health-ok .hs-variacao { color: var(--success); }
.health-bar-info {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  gap: 16px;
  flex-wrap: wrap;
}

/* ============================================================
   PREMIAÇÃO — Cards de premiação (gestor / supervisor)
   ============================================================ */
.prem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.card-title-bar {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--ink);
  padding: 12px 16px;
  background: var(--bg-elev);
  border-left: 3px solid var(--red);
  margin-bottom: 12px;
}
.prem-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.prem-empty {
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-muted);
  font-style: italic;
  background: var(--bg-card);
  border: 1px dashed var(--line-strong);
}
.prem-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 14px 16px;
}
.prem-card--reserva {
  border-style: dashed;
  opacity: 0.9;
}
.pc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.pc-name-block { min-width: 0; }
.pc-name {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
}
.pc-total {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 900;
  font-size: 22px;
  color: var(--red-bright);
}
.pc-note {
  font-size: 12px;
  color: var(--ink-muted);
  font-style: italic;
  margin-top: 4px;
}
.pc-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pc-item {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 3px 0;
}
.pc-item-label { color: var(--ink-muted); }
.pc-item-value {
  font-weight: 700;
  font-family: 'Big Shoulders Display', sans-serif;
  font-size: 14px;
  color: var(--ink);
}
.pc-item--brinde .pc-item-value { color: var(--diamante); }

/* Slot de Brinde (top 3 Diamante) */
.prem-brinde-slot {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
}
.prem-brinde-slot--ativo { border-left-color: var(--diamante); }
.prem-brinde-slot--vago { opacity: 0.7; border-style: dashed; }
.pbs-pos {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 900;
  font-size: 28px;
  color: var(--red-bright);
  text-align: center;
}
.pbs-vendor {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
}
.pbs-vendor--vago { color: var(--ink-muted); font-style: italic; }
.pbs-status {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 4px;
}
.pbs-status--ok { color: var(--success); }
.pbs-status--bloqueado { color: var(--ink-muted); font-style: italic; }
.pbs-valor {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
}

/* ============================================================
   PREMIAÇÃO — Supervisor (resumo da equipe)
   ============================================================ */
.prem-team-summary {
  background: linear-gradient(135deg, var(--bg-card) 0%, #2A1A1A 100%);
  border: 1px solid rgba(200,16,46,0.40);
  padding: 24px;
  margin-bottom: 24px;
}
.prem-team-title {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--red-bright);
  margin-bottom: 16px;
}
.prem-team-stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}
.prem-team-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.prem-team-stat-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  text-transform: uppercase;
}
.prem-team-stat-value {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 28px;
  color: var(--ink);
}
.prem-team-stat--total .prem-team-stat-value {
  color: var(--red-bright);
  font-size: 36px;
  font-weight: 900;
}
.prem-section { margin-bottom: 24px; }

/* ============================================================
   PREMIAÇÃO — Vendedor (banner do prêmio individual)
   ============================================================ */
.meu-premio-banner {
  background: linear-gradient(135deg, var(--bg-card) 0%, #2A1A1A 100%);
  border: 1px solid var(--line);
  padding: 36px 32px;
  text-align: center;
  margin-bottom: 28px;
}
.meu-premio-banner--positive {
  border: 2px solid var(--red);
  background: linear-gradient(135deg, rgba(200,16,46,0.10) 0%, rgba(200,16,46,0.02) 100%);
  box-shadow: 0 0 80px rgba(230,57,70,0.20);
}
.mpb-label {
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--ink-muted);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.mpb-value {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 900;
  font-size: 86px;
  line-height: 1;
  color: var(--red-bright);
  margin-bottom: 12px;
}
.meu-premio-banner--neutral .mpb-value { color: var(--ink-muted); }
.mpb-sub {
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.6;
  max-width: 580px;
  margin: 0 auto;
}
.prem-detail-section {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 20px 24px;
  margin-bottom: 18px;
}
.prem-detail-title {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.prem-detail-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.prem-detail-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}
.pdi-label { color: var(--ink); font-size: 13px; }
.pdi-value {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--red-bright);
}
.prem-rules {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.prem-rule {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.6;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.prem-rule:last-child { border-bottom: none; }

@media (max-width: 1100px) {
  .params-grid { grid-template-columns: 1fr; }
  .prem-grid { grid-template-columns: 1fr; }
  .param-field { grid-template-columns: 1fr; }
  .mpb-value { font-size: 64px; }
}

/* ============================================================
   ESTIMATIVA BANNER — aviso "valor não é final"
   Aparece no topo das visões de premiação (gestor/supervisor/vendedor)
   ============================================================ */
.estimativa-banner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 24px;
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-left: 4px solid var(--warning, #F59E0B);
}
.eb-icon {
  font-size: 22px;
  line-height: 1;
  color: var(--warning, #F59E0B);
  flex-shrink: 0;
  margin-top: 2px;
}
.eb-content { flex: 1; min-width: 0; }
.eb-title {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--warning, #F59E0B);
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}
.eb-msg {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.55;
}

@media (max-width: 720px) {
  .estimativa-banner { padding: 14px 16px; gap: 12px; }
  .eb-title { font-size: 14px; }
  .eb-msg { font-size: 12px; }
}

/* ============================================================
   TRIGGER de CICLO na TOPBAR (pílula compacta)
   ============================================================ */
.cycle-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.12s;
  margin-right: 14px;
}
.cycle-trigger:hover {
  border-color: rgba(200,16,46,0.50);
  background: rgba(200,16,46,0.06);
}
.cycle-trigger:active { transform: scale(0.98); }
.ct-icon { color: var(--ink-muted); flex-shrink: 0; }
.ct-month {
  font-weight: 700;
  font-family: 'Big Shoulders Display', sans-serif;
  font-size: 14px;
  letter-spacing: 0.03em;
}
.ct-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}
.ct-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ct-dot--open {
  background: var(--success, #10B981);
  box-shadow: 0 0 8px rgba(16,185,129,0.6);
}
.ct-dot--closed { background: var(--warning, #F59E0B); }
.ct-status-text {
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
}

/* ============================================================
   DRAWER LATERAL DE CICLOS
   ============================================================ */
.cycle-drawer-root {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}
.cycle-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.28s ease-out;
  pointer-events: none;
}
.cycle-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: var(--bg-card);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
}
.cycle-drawer-root.is-open { pointer-events: auto; }
.cycle-drawer-root.is-open .cycle-overlay {
  opacity: 1;
  pointer-events: auto;
}
.cycle-drawer-root.is-open .cycle-drawer {
  transform: translateX(0);
  pointer-events: auto;
}

/* Header do drawer */
.cd-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(200,16,46,0.06) 0%, transparent 100%);
}
.cd-header-titles { flex: 1; min-width: 0; }
.cd-title {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.cd-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-muted);
}
.cd-close {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-muted);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s;
  flex-shrink: 0;
  margin-left: 12px;
}
.cd-close:hover {
  border-color: var(--red-bright);
  color: var(--red-bright);
}

/* Body do drawer */
.cd-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 32px;
}
.cd-section { margin-bottom: 24px; }
.cd-section-label {
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 10px;
  font-weight: 700;
}
.cd-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Botão de criar ciclo */
.btn-create-cycle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: center;
  background: transparent;
  border: 1px dashed var(--line-strong);
  color: var(--ink);
  padding: 12px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  margin-bottom: 24px;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.btn-create-cycle:hover {
  border-color: var(--red-bright);
  color: var(--red-bright);
  background: rgba(200,16,46,0.04);
  border-style: solid;
}

/* Card de ciclo */
.cycle-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  padding: 16px 18px;
  transition: border-color 0.18s, transform 0.12s, background 0.18s;
}
.cycle-card[role="button"] { cursor: pointer; }
.cycle-card[role="button"]:hover {
  border-color: var(--red-bright);
  transform: translateX(-2px);
}
.cycle-card[role="button"]:focus {
  outline: none;
  border-color: var(--red-bright);
  box-shadow: 0 0 0 3px rgba(200,16,46,0.20);
}
.cycle-card--current {
  background: linear-gradient(135deg, rgba(200,16,46,0.10) 0%, rgba(200,16,46,0.02) 100%);
  border: 2px solid var(--red);
  border-left-width: 4px;
  padding: 18px 20px;
}
.cycle-card--closed.cycle-card--current {
  background: linear-gradient(135deg, rgba(245,158,11,0.10) 0%, rgba(245,158,11,0.02) 100%);
  border-color: var(--warning, #F59E0B);
}
.cc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.cc-mes {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
}
.cycle-card--current .cc-mes { font-size: 24px; }
.cc-status {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 4px 8px;
  flex-shrink: 0;
}
.cc-status--open {
  color: var(--success, #10B981);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.cc-status--closed {
  color: var(--warning, #F59E0B);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.45);
}
.cc-dates {
  font-size: 12px;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}
.cc-actions {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
}

/* Botões pequenos (compartilhados) */
.btn-sm {
  font-size: 12px;
  padding: 7px 14px;
  letter-spacing: 0.04em;
}
.btn-danger {
  background: var(--danger, #DC2626);
  color: #fff;
  border: 1px solid var(--danger, #DC2626);
}
.btn-danger:hover {
  background: #B91C1C;
  border-color: #B91C1C;
}
.btn-warning {
  background: transparent;
  color: var(--warning, #F59E0B);
  border: 1px solid var(--warning, #F59E0B);
}
.btn-warning:hover {
  background: rgba(245, 158, 11, 0.10);
}

/* Banner "estimativa" vira "oficial" quando ciclo fechado */
.estimativa-banner--oficial {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.40);
  border-left-color: var(--success, #10B981);
}
.estimativa-banner--oficial .eb-icon { color: var(--success, #10B981); }
.estimativa-banner--oficial .eb-title { color: var(--success, #10B981); }

@media (max-width: 720px) {
  .cycle-trigger { padding: 6px 10px; gap: 8px; margin-right: 8px; }
  .ct-status { display: none; } /* esconde status no mobile, só mês */
  .cycle-drawer { width: 100vw; border-left: none; }
  .cd-header { padding: 18px 20px; }
  .cd-body { padding: 16px 20px 28px; }
}

/* ============================================================
   MEU PAINEL (vendedor)
   ============================================================ */
.mp-row {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}
.mp-row--2col { grid-template-columns: 1fr 1fr; }

/* HERO */
.mp-hero {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  padding: 28px 32px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  overflow: hidden;
}
.mp-hero.diamante { border-left-color: var(--diamante); background: linear-gradient(135deg, rgba(160,231,229,0.06) 0%, transparent 60%), var(--bg-card); }
.mp-hero.ouro { border-left-color: var(--ouro); background: linear-gradient(135deg, rgba(255,215,0,0.06) 0%, transparent 60%), var(--bg-card); }
.mp-hero.prata { border-left-color: var(--prata); background: linear-gradient(135deg, rgba(192,192,192,0.06) 0%, transparent 60%), var(--bg-card); }
.mp-hero.bronze { border-left-color: var(--bronze); background: linear-gradient(135deg, rgba(205,127,50,0.06) 0%, transparent 60%), var(--bg-card); }
.mp-hero.inelegivel { border-left-color: #555; opacity: 0.95; }

.mp-hero-greeting {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.mp-hero-cycle {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 900;
  font-size: 36px;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 14px;
}
.mp-hero-tier-block {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.tier-badge-lg {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.18em;
  padding: 7px 14px;
  text-transform: uppercase;
}
.tier-badge-lg.diamante { background: var(--diamante); color: #000; }
.tier-badge-lg.ouro { background: var(--ouro); color: #000; }
.tier-badge-lg.prata { background: var(--prata); color: #000; }
.tier-badge-lg.bronze { background: var(--bronze); color: var(--ink); }
.tier-badge-lg.inelegivel { background: #555; color: var(--ink); font-style: italic; }

.mp-hero-rank {
  font-size: 13px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}
.mp-hero-rank--ineleg { font-style: italic; }

.mp-hero-right {
  display: flex;
  gap: 32px;
  flex-shrink: 0;
}
.mp-hero-stat { text-align: right; }
.mp-hero-stat-label {
  font-size: 10px;
  letter-spacing: 0.20em;
  color: var(--ink-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.mp-hero-stat-value {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 900;
  font-size: 38px;
  color: var(--ink);
  line-height: 1;
}
.mp-hero-stat--premio .mp-hero-stat-value { color: var(--red-bright); }

/* CARDS GENÉRICOS */
.mp-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 20px 22px;
}
.mp-card--full { margin-bottom: 18px; }
.mp-card-title {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 4px;
}
.mp-card-subtitle {
  font-size: 12px;
  color: var(--ink-muted);
  margin-bottom: 14px;
}
.mp-card-empty {
  font-size: 13px;
  color: var(--ink-muted);
  font-style: italic;
  padding: 16px 0;
}

/* COACHING */
.mp-card--coaching .mp-coaching-desc {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.55;
  margin-top: 12px;
}
.mp-coaching-pts {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 900;
  font-size: 56px;
  color: var(--red-bright);
  line-height: 1;
  margin-top: 14px;
}
.mp-coaching-pts .small {
  font-size: 18px;
  color: var(--ink-muted);
  font-weight: 600;
  margin-left: 4px;
}
.mp-coaching-warn {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(220, 38, 38, 0.10);
  border-left: 3px solid var(--danger, #DC2626);
  font-size: 12px;
  color: var(--ink);
  line-height: 1.5;
}

/* COMPARAÇÃO */
.mp-cmp-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.mp-cmp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.mp-cmp-row:last-child { border-bottom: none; }
.mp-cmp-label {
  font-size: 13px;
  color: var(--ink);
}
.mp-cmp-vals {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mp-cmp-mine {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
}
.mp-cmp-arrow {
  font-size: 16px;
  font-weight: 700;
}
.mp-cmp-row.cmp-up .mp-cmp-arrow,
.mp-cmp-row.cmp-up .mp-cmp-mine { color: var(--success, #10B981); }
.mp-cmp-row.cmp-down .mp-cmp-arrow,
.mp-cmp-row.cmp-down .mp-cmp-mine { color: var(--warning, #F59E0B); }
.mp-cmp-row.cmp-eq .mp-cmp-arrow { color: var(--ink-muted); }
.mp-cmp-avg {
  font-size: 11px;
  color: var(--ink-muted);
  font-style: italic;
}

/* INDICADORES MINI */
.mp-indicadores {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.mp-ind {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 14px 16px;
  text-align: center;
}
.mp-ind-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.mp-ind-value {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
}

/* GRÁFICO */
.mp-chart-wrap {
  position: relative;
  height: 280px;
  margin-top: 8px;
}

/* CARREIRA */
.mp-carreira {
  background: linear-gradient(135deg, rgba(200,16,46,0.06) 0%, transparent 70%), var(--bg-card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  padding: 24px 28px;
  margin-bottom: 18px;
}
.mp-carreira-title {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--red-bright);
  margin-bottom: 16px;
}
.mp-carreira-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 18px;
}
.mp-carreira-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mp-carreira-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
  text-transform: uppercase;
}
.mp-carreira-value {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 24px;
  color: var(--ink);
}
.mp-carreira-item--big .mp-carreira-value {
  font-size: 36px;
  font-weight: 900;
  color: var(--red-bright);
}
.mp-tier-distribution {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.mp-tier-dist-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  text-transform: uppercase;
  margin-right: 8px;
}

/* HISTÓRICO TABELA */
.mp-historico {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 20px 22px;
}
.mp-historico-title {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 14px;
}
.mp-tabela {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.mp-tabela th {
  text-align: left;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-strong);
}
.mp-tabela td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.mp-tabela tr:hover td { background: rgba(255,255,255,0.02); }
.mp-tabela td.num {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 15px;
}

@media (max-width: 980px) {
  .mp-row--2col { grid-template-columns: 1fr; }
  .mp-hero { grid-template-columns: 1fr; gap: 20px; }
  .mp-hero-right { gap: 20px; }
  .mp-hero-stat { text-align: left; }
  .mp-indicadores { grid-template-columns: repeat(3, 1fr); }
  .mp-carreira-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .mp-hero-cycle { font-size: 28px; }
  .mp-hero-stat-value { font-size: 30px; }
  .mp-indicadores { grid-template-columns: repeat(2, 1fr); }
  .mp-carreira-grid { grid-template-columns: 1fr; }
  .mp-tabela { font-size: 12px; }
  .mp-tabela th, .mp-tabela td { padding: 8px; }
}

/* ============================================================
   D3 — VENDEDORES (tabela + status)
   ============================================================ */
.page-actions { display: flex; gap: 8px; align-items: center; }
.btn-primary {
  background: var(--red);
  color: #fff;
  border: 1px solid var(--red);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.btn-primary:hover { background: var(--red-bright); border-color: var(--red-bright); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-muted);
  padding: 8px 12px;
}
.btn-ghost:hover { border-color: var(--red-bright); color: var(--red-bright); }

.vendors-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--line);
  overflow-x: auto;
}
.vendors-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.vendors-table th {
  text-align: left;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--bg-elev);
}
.vendors-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.vendors-table tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}
.vendors-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.vendors-table td.no-sup { color: var(--ink-muted); font-style: italic; }
.row-action { color: var(--red-bright); font-size: 12px; text-align: right; letter-spacing: 0.05em; }

.vendor-status {
  font-size: 11px;
  letter-spacing: 0.10em;
  font-weight: 600;
  padding: 3px 8px;
  text-transform: uppercase;
}
.vendor-status.status-ativo { color: var(--success, #10B981); background: rgba(16,185,129,0.10); border: 1px solid rgba(16,185,129,0.30); }
.vendor-status.status-inativo { color: var(--ink-muted); background: rgba(255,255,255,0.04); border: 1px solid var(--line); }

/* ============================================================
   D3 — MODAL (Novo Vendedor/Supervisor, Trocar Senha)
   ============================================================ */
.modal-root {
  position: fixed; inset: 0; z-index: 10000;
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.65);
  opacity: 0;
  transition: opacity 0.22s ease-out;
  pointer-events: none;
}
.modal {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.96) translateY(8px);
  opacity: 0;
  transition: transform 0.22s ease-out, opacity 0.22s ease-out;
  pointer-events: none;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.modal-root.is-open { pointer-events: auto; }
.modal-root.is-open .modal-overlay { opacity: 1; pointer-events: auto; }
.modal-root.is-open .modal {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.modal-header--success {
  background: linear-gradient(135deg, rgba(16,185,129,0.15) 0%, transparent 70%);
  border-bottom-color: rgba(16,185,129,0.30);
}
.modal-title {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
}
.modal-header--success .modal-title { color: var(--success, #10B981); }
.modal-close {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  width: 28px;
  height: 28px;
  padding: 0;
  transition: color 0.18s;
}
.modal-close:hover { color: var(--red-bright); }
.modal-body { padding: 22px 24px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
}

/* Form elements (compartilhado) */
.form-group { margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }
.form-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 700;
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.18s;
  box-sizing: border-box;
}
.form-input:focus { outline: none; border-color: var(--red-bright); }
.form-input[readonly] { background: rgba(255,255,255,0.02); color: var(--ink-muted); }
.form-help {
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 6px;
  line-height: 1.5;
}
.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
}
.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--red-bright);
}

/* Card de credenciais geradas */
.cred-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.cred-label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 700;
  margin-bottom: 4px;
}
.cred-value {
  font-size: 15px;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 10px;
}
.cred-value--code {
  font-family: 'Courier New', monospace;
  background: rgba(200,16,46,0.10);
  padding: 6px 10px;
  display: inline-block;
  border: 1px solid rgba(200,16,46,0.30);
  color: var(--red-bright);
  letter-spacing: 0.04em;
}
.cred-card .cred-label:not(:first-child) { margin-top: 6px; }
.cred-value:last-child { margin-bottom: 0; }

/* Ações dentro do drawer */
.cd-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
}

/* ============================================================
   D3 — EQUIPES (Drag & Drop)
   ============================================================ */
.teams-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.team-column {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 14px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.18s, background 0.18s;
}
.team-column.drop-target {
  border-color: var(--red-bright);
  background: rgba(200,16,46,0.06);
  border-style: dashed;
}
.team-header {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.team-header--unassigned {
  border-bottom-color: rgba(245,158,11,0.30);
}
.team-name {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.team-header--unassigned .team-name { color: var(--warning, #F59E0B); }
.team-count {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
  margin-top: 2px;
}
.team-pills {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.team-empty {
  font-size: 12px;
  color: var(--ink-muted);
  font-style: italic;
  text-align: center;
  padding: 20px 8px;
  border: 1px dashed var(--line);
  opacity: 0.6;
}
.vendor-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--ink);
  cursor: grab;
  transition: border-color 0.15s, transform 0.10s, opacity 0.15s;
  user-select: none;
}
.vendor-pill:hover { border-color: var(--red-bright); }
.vendor-pill:active { cursor: grabbing; }
.vendor-pill.dragging { opacity: 0.4; transform: scale(0.96); }
.vp-name { flex: 1; }
.vp-drag {
  color: var(--ink-muted);
  font-size: 14px;
  letter-spacing: -2px;
  cursor: grab;
}

@media (max-width: 720px) {
  .modal { max-width: 100%; }
  .modal-header, .modal-body, .modal-footer { padding-left: 18px; padding-right: 18px; }
  .teams-board { grid-template-columns: 1fr; }
  .vendors-table th, .vendors-table td { padding: 10px 12px; font-size: 12px; }
}

/* ============================================================
   INÍCIO (alinhado ao padrão visual do app — cards limpos)
   ============================================================ */

/* HERO: linha tipográfica simples, sem caixa, com separador embaixo */
.home-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  padding: 4px 0 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  text-align: left;
}
.hh-top {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.hh-greeting {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 30px;
  color: var(--ink);
  line-height: 1.05;
  letter-spacing: 0.005em;
}
.hh-cycle {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  text-transform: uppercase;
}

/* Bloco do tier (vendedor) ou equipe (supervisor) — fica no MEIO */
.hh-main {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  flex: 1;
  justify-content: flex-end;
}
.hh-tier-block {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.hh-rank {
  font-size: 13px;
  color: var(--ink-muted);
  letter-spacing: 0.03em;
}
.hh-rank--ineleg { font-style: italic; }

/* Tier badge no hero: tamanho contido */
.home-hero .tier-badge-lg {
  font-size: 11px;
  padding: 5px 11px;
  letter-spacing: 0.18em;
}

/* Team info do supervisor */
.hh-team-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hh-team-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
  text-transform: uppercase;
}
.hh-team-count {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
}

/* Stats inline */
.hh-stats {
  display: flex;
  gap: 32px;
  flex-shrink: 0;
}
.hh-stats--wide { gap: 40px; }
.hh-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 72px;
}
.hh-stat-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
  text-transform: uppercase;
}
.hh-stat-value {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 26px;
  color: var(--ink);
  line-height: 1;
}
.hh-stat-value .small {
  font-size: 14px;
  color: var(--ink-muted);
  font-weight: 600;
}
.hh-stat-sub {
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 2px;
}
.hh-stat--premio .hh-stat-value { color: var(--red-bright); }

.hh-empty-inline {
  font-size: 13px;
  color: var(--ink-muted);
  font-style: italic;
  max-width: 600px;
}

/* Estado vazio (sem ciclo) */
.home-hero-empty {
  padding: 40px 24px;
  text-align: center;
  border: 1px solid var(--line);
  background: var(--bg-card);
  margin-bottom: 24px;
}
.home-hero-empty .hh-greeting {
  display: block;
  margin-bottom: 14px;
  font-size: 26px;
}
.hh-empty-title {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--warning, #F59E0B);
  margin-bottom: 8px;
}
.hh-empty-text {
  font-size: 13px;
  color: var(--ink-muted);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Grid de cards */
.home-row {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}
.home-row--2col { grid-template-columns: 1fr 1fr; }

/* Cards uniformes — bordas neutras como nas outras telas do app */
.home-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
}
.home-card-title {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 700;
  margin-bottom: 12px;
}
.home-card-desc {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.55;
}
.home-card-desc-strong {
  font-size: 13px;
  color: var(--success, #10B981);
  font-weight: 600;
  margin-top: 10px;
}
.home-card-empty {
  font-size: 12px;
  color: var(--ink-muted);
  font-style: italic;
  padding: 4px 0;
}

/* Número de destaque no card (faltam X pts, vendedores sem dados, etc.) */
.home-card-big {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 36px;
  color: var(--red-bright);
  line-height: 1;
  margin-top: 12px;
}
.home-card-big .small {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 600;
  margin-left: 6px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Aviso dentro de card */
.home-card-warn {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(245, 158, 11, 0.08);
  border-left: 2px solid var(--warning, #F59E0B);
  font-size: 12px;
  color: var(--ink);
  line-height: 1.45;
}

/* Mini grid (resumo cotas do vendedor) */
.home-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 2px;
}
.home-mini {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.home-mini-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  text-transform: uppercase;
}
.home-mini-value {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
}

/* Comparações (supervisor: equipe vs empresa) */
.home-cmp-list {
  display: flex;
  flex-direction: column;
}
.home-cmp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.home-cmp-row:last-child { border-bottom: none; padding-bottom: 0; }
.home-cmp-row:first-child { padding-top: 0; }
.home-cmp-label {
  font-size: 13px;
  color: var(--ink);
}
.home-cmp-vals {
  display: flex;
  align-items: center;
  gap: 10px;
}
.home-cmp-mine {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}
.home-cmp-arrow { font-size: 12px; color: var(--ink-muted); font-weight: 700; }
.home-cmp-row.cmp-up .home-cmp-arrow { color: var(--success, #10B981); }
.home-cmp-row.cmp-down .home-cmp-arrow { color: var(--warning, #F59E0B); }
.home-cmp-avg {
  font-size: 11px;
  color: var(--ink-muted);
  font-style: italic;
}

/* Destaque da equipe */
.home-destaque-nome {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
  margin-top: 2px;
  margin-bottom: 8px;
}
.home-destaque-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-muted);
}

/* Lista (atenções equipe) */
.home-list {
  display: flex;
  flex-direction: column;
}
.home-list-row {
  display: grid;
  grid-template-columns: 1fr auto 2fr;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.home-list-row:last-child { border-bottom: none; padding-bottom: 0; }
.home-list-row:first-child { padding-top: 0; }
.home-list-nome {
  font-weight: 600;
  color: var(--ink);
}
.home-list-motivo {
  font-size: 11px;
  color: var(--ink-muted);
  text-align: right;
}
.home-list-more {
  font-size: 11px;
  color: var(--ink-muted);
  font-style: italic;
  padding-top: 8px;
}

/* Top 3 (gestor) */
.home-top3 {
  display: flex;
  flex-direction: column;
}
.home-top3-row {
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.home-top3-row:last-child { border-bottom: none; padding-bottom: 0; }
.home-top3-row:first-child { padding-top: 0; }
.home-top3-pos { font-size: 18px; text-align: center; }
.home-top3-nome {
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
}
.home-top3-pts {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

/* Atenções (gestor) — grid de mini stats */
.home-atencao-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 2px;
}
.home-atencao-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.home-atencao-label {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  text-transform: uppercase;
  font-weight: 700;
}
.home-atencao-value {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 32px;
  color: var(--warning, #F59E0B);
  line-height: 1;
}
.home-atencao-desc {
  font-size: 11px;
  color: var(--ink-muted);
  font-style: italic;
}

/* Atalhos: linha de botões secundários no rodapé */
.home-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.home-shortcut {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 18px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
  position: relative;
  padding-right: 36px;
}
.home-shortcut:hover {
  border-color: var(--red-bright);
  background: rgba(200,16,46,0.04);
}
.hs-label {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hs-desc {
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}
.hs-arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  font-size: 16px;
  transition: color 0.18s, transform 0.18s;
}
.home-shortcut:hover .hs-arrow {
  color: var(--red-bright);
  transform: translateY(-50%) translateX(3px);
}

/* Botão link discreto */
.btn-link {
  background: transparent;
  border: none;
  color: var(--red-bright);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 12px 0 0;
  margin-top: auto;
  text-align: left;
  align-self: flex-start;
}
.btn-link:hover { opacity: 0.8; }

/* Responsivo */
@media (max-width: 980px) {
  .home-row--2col { grid-template-columns: 1fr; }
  .home-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }
  .hh-main {
    width: 100%;
    justify-content: flex-start;
    gap: 20px;
  }
  .hh-stats { width: 100%; justify-content: space-between; gap: 16px; }
  .home-mini-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}
@media (max-width: 600px) {
  .hh-greeting { font-size: 24px; }
  .hh-stat-value { font-size: 22px; }
  .home-card-big { font-size: 30px; }
  .home-atencao-value { font-size: 26px; }
}

/* ============================================================
   INÍCIO — Enriquecimentos (pódio, tiers, composição prêmio)
   ============================================================ */

/* Card full-width (ocupa 100% sem grid 2col) */
.home-card--full {
  margin-bottom: 16px;
}

/* Pódio (vendedor) e Top equipe/Top 5 (supervisor/gestor) */
.home-podio {
  display: flex;
  flex-direction: column;
}
.home-podio-row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.home-podio-row:first-child { padding-top: 0; }
.home-podio-row:last-child { border-bottom: none; padding-bottom: 0; }
.home-podio-row.is-me {
  background: rgba(200, 16, 46, 0.06);
  border-left: 3px solid var(--red);
  padding-left: 12px;
  padding-right: 12px;
}
.home-podio-pos {
  font-size: 20px;
  text-align: center;
  line-height: 1;
}
.home-podio-pos--num {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink-muted);
}
.home-podio-nome {
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
}
.home-podio-pts {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

/* Distribuição de tiers */
.home-tier-dist {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 2px;
}
.home-tier-dist-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.home-tier-dist-count {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  line-height: 1;
}

/* Composição do prêmio (vendedor) */
.home-prem-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.home-prem-section:first-of-type {
  margin-top: 4px;
  padding-top: 0;
  border-top: none;
}
.home-prem-section-title {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 10px;
}
.home-prem-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 13px;
}
.home-prem-label { color: var(--ink-muted); }
.home-prem-value {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  color: var(--ink);
}

/* Info extra no card (linha pequena, ex: distância pro próximo) */
.home-card-extra {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.45;
}

/* ============================================================
   D5: Exclusões + Gestores + Auditoria
   ============================================================ */

/* Zona perigosa no drawer de edição */
.cd-danger-zone {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cd-danger-title {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--danger, #DC2626);
  font-weight: 700;
  margin-bottom: 4px;
}
.cd-danger-help {
  font-size: 11px;
  color: var(--ink-muted);
  line-height: 1.5;
  margin-top: 6px;
}

/* Botão de excluir supervisor (X no header da coluna) */
.team-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.team-header-info {
  flex: 1;
  min-width: 0;
}
.team-delete {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-muted);
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  font-family: inherit;
}
.team-delete:hover {
  border-color: var(--danger, #DC2626);
  color: var(--danger, #DC2626);
  background: rgba(220, 38, 38, 0.08);
}

/* Badge gestor raiz */
.badge-raiz {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: rgba(200, 16, 46, 0.12);
  border: 1px solid rgba(200, 16, 46, 0.40);
  color: var(--red-bright);
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 700;
}

/* Modal warn (aviso destacado dentro de modais) */
.form-warn {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.40);
  border-left: 3px solid var(--warning, #F59E0B);
  padding: 12px 14px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--ink);
  line-height: 1.5;
}

/* Link de ação destrutiva */
.btn-link--danger {
  color: var(--danger, #DC2626);
}
.muted { color: var(--ink-muted); font-size: 13px; }

/* ============================================================
   AUDITORIA — timeline
   ============================================================ */
.audit-timeline {
  position: relative;
  padding-left: 24px;
  border-left: 1px solid var(--line);
  margin-top: 8px;
}
.audit-entry {
  position: relative;
  padding: 14px 0 14px 18px;
  border-bottom: 1px dashed var(--line);
}
.audit-entry:last-child { border-bottom: none; }
.audit-marker {
  position: absolute;
  left: -29px;
  top: 18px;
  width: 10px;
  height: 10px;
  background: var(--ink-muted);
  border: 2px solid var(--bg-card);
}
.audit-entry--create .audit-marker { background: var(--success, #10B981); }
.audit-entry--warn .audit-marker { background: var(--warning, #F59E0B); }
.audit-entry--delete .audit-marker { background: var(--danger, #DC2626); }

.audit-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.audit-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.audit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.audit-entry--create .audit-icon { color: var(--success, #10B981); }
.audit-entry--warn .audit-icon { color: var(--warning, #F59E0B); }
.audit-entry--delete .audit-icon { color: var(--danger, #DC2626); }

.audit-acao {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.audit-alvo {
  font-size: 14px;
  color: var(--ink);
}
.audit-tipo {
  font-size: 11px;
  color: var(--ink-muted);
  font-style: italic;
  margin-left: 4px;
}
.audit-meta {
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}
.audit-detalhes {
  font-style: italic;
}

/* ============================================================
   D6: Aba Usuários unificada + Dropdown do usuário na topbar
   ============================================================ */

/* --- Dropdown do usuário na topbar --- */
.user-menu-wrapper {
  position: relative;
}
.user-info {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 6px 10px;
  border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.user-info:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.user-menu-caret {
  position: absolute;
  right: 6px;
  bottom: 4px;
  font-size: 10px;
  color: var(--ink-muted);
  opacity: 0.7;
}
.user-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  padding: 6px 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}
.user-menu-dropdown[hidden] { display: none; }
.user-menu-dropdown button {
  background: transparent;
  border: none;
  color: var(--ink);
  text-align: left;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.12s;
}
.user-menu-dropdown button:hover {
  background: rgba(200,16,46,0.10);
}

/* --- Header actions (botão +Adicionar com dropdown) --- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.add-user-wrapper {
  position: relative;
}
.add-user-wrapper .caret {
  margin-left: 6px;
  font-size: 11px;
  opacity: 0.7;
}
.add-user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  padding: 6px 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}
.add-user-dropdown[hidden] { display: none; }
.add-user-dropdown button {
  background: transparent;
  border: none;
  color: var(--ink);
  text-align: left;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: background 0.12s;
}
.add-user-dropdown button:hover {
  background: rgba(200,16,46,0.10);
}

/* --- Toolbar (toggle modo + filtros + busca) --- */
.users-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.mode-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  overflow: hidden;
}
.mode-btn {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  padding: 8px 16px;
  cursor: pointer;
  font-family: 'Big Shoulders Display', sans-serif;
  font-size: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 700;
  transition: background 0.15s, color 0.15s;
}
.mode-btn:hover { color: var(--ink); }
.mode-btn.active {
  background: var(--red);
  color: #fff;
}

.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pill {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-muted);
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s, color 0.15s;
}
.pill:hover { color: var(--ink); border-color: var(--ink-muted); }
.pill.active {
  border-color: var(--red);
  color: var(--ink);
}
.pill-count {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 700;
  font-size: 11px;
  background: rgba(255,255,255,0.06);
  padding: 1px 7px;
  letter-spacing: 0.02em;
}
.pill.active .pill-count {
  background: rgba(200,16,46,0.20);
  color: var(--red-bright);
}

.users-search {
  flex: 1;
  min-width: 220px;
  max-width: 320px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13px;
}
.users-search:focus {
  outline: none;
  border-color: var(--red);
}

/* --- Tabela unificada de usuários --- */
.users-table {
  width: 100%;
  border-collapse: collapse;
}
.users-table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.users-table tbody td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 13px;
  color: var(--ink);
}
.users-row { transition: background 0.12s; }
.users-row:hover { background: rgba(255,255,255,0.02); }
.users-row--inativo { opacity: 0.55; }
.users-email {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--ink-muted);
  letter-spacing: 0.01em;
}
.users-actions { text-align: right; }
.users-empty {
  text-align: center;
  color: var(--ink-muted);
  font-style: italic;
  padding: 32px 12px;
}

/* Badges de tipo */
.user-tipo {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 700;
  border: 1px solid;
}
.user-tipo--raiz {
  background: rgba(200, 16, 46, 0.12);
  border-color: rgba(200, 16, 46, 0.40);
  color: var(--red-bright);
}
.user-tipo--gestor {
  background: rgba(200, 16, 46, 0.05);
  border-color: rgba(200, 16, 46, 0.25);
  color: var(--red-bright);
}
.user-tipo--supervisor {
  background: rgba(160, 231, 229, 0.05);
  border-color: rgba(160, 231, 229, 0.30);
  color: var(--diamante, #A0E7E5);
}
.user-tipo--vendedor {
  background: rgba(255,255,255,0.02);
  border-color: var(--line);
  color: var(--ink-muted);
}

/* Status dot */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.status-dot--ativo { background: var(--success, #10B981); }
.status-dot--inativo { background: var(--ink-muted); }

/* --- Botão danger pequeno --- */
.btn-danger {
  background: rgba(220, 38, 38, 0.10);
  border: 1px solid rgba(220, 38, 38, 0.40);
  color: #FCA5A5;
}
.btn-danger:hover {
  background: rgba(220, 38, 38, 0.20);
  border-color: rgba(220, 38, 38, 0.60);
}
.btn-warning {
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.40);
  color: #FCD34D;
}
.btn-warning:hover {
  background: rgba(245, 158, 11, 0.20);
  border-color: rgba(245, 158, 11, 0.60);
}
.btn-sm {
  padding: 6px 12px;
  font-size: 11px;
}


/* ============================================================
   DRAWER (lateral direito) — usado pela aba Usuários
   ============================================================ */
.drawer-root {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
}
.drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  opacity: 0;
  transition: opacity 0.22s ease-out;
  pointer-events: none;
}
.drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 520px;
  max-width: 92vw;
  background: var(--bg-card);
  border-left: 1px solid var(--line);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}
.drawer-right {
  /* alias semântico - mesmo posicionamento de .drawer */
}
.drawer-root.is-open {
  pointer-events: auto;
}
.drawer-root.is-open .drawer-overlay {
  opacity: 1;
  pointer-events: auto;
}
.drawer-root.is-open .drawer {
  transform: translateX(0);
  pointer-events: auto;
}
.drawer-content {
  padding: 28px 32px;
}
.cd-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.cd-header h2 {
  font-family: 'Big Shoulders Display', sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0;
  color: var(--ink);
}
.cd-actions {
  margin-top: 24px;
  display: flex;
  gap: 10px;
}

/* Responsive: em telas estreitas o drawer ocupa quase toda a tela */
@media (max-width: 640px) {
  .drawer {
    width: 100vw;
    max-width: 100vw;
  }
  .drawer-content { padding: 20px; }
}
