/* ============================================================
   DESIGN SYSTEM UNIFICADO
   Paleta e fonte baseadas no Style 1 - LOGIN
   Todas as telas (Login, Dashboard, Admin) compartilham as
   mesmas variáveis, fontes e componentes base.
   ============================================================ */

:root {
  /* ---- Paleta oficial (origem: Login) ---- */
  --primary: #0056b3;
  --primary-dark: #003d80;
  --primary-light: #e8f0fb;
  --accent: #00b386;
  --accent-light: #e6f7f2;
  --danger: #dc3545;
  --danger-light: #fdecea;
  --warning: #f0a500;
  --warning-light: #fff8e6;
  --text: #1a1a2e;
  --text-muted: #6c757d;
  --border: #dee2e6;
  --bg: #f5f7fa;
  --white: #ffffff;

  /* ---- Tokens estruturais ---- */
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.3);
  --sidebar-w: 240px;
  --font: 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

/* ============================================================
   ESTRUTURA DE TELAS (toggle entre Login / Dashboard / Admin)
   ============================================================ */
.screen { display: none; }
.screen.active { display: block; }

/* ============================================================
   1. LOGIN (e telas de autenticação: Login, 2FA, Admin Login)
   ============================================================ */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: #0a1628; position: relative; overflow: hidden;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.auth-wrap::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 20% 50%, #0d2d5a 0%, #0a1628 50%, #001a0f 100%);
}
.auth-wrap::after {
  content: '';
  position: absolute; inset: 0; z-index: 1;
  background-image:
    radial-gradient(circle, rgba(0,179,134,0.15) 1px, transparent 1px),
    radial-gradient(circle, rgba(77,184,255,0.1) 1px, transparent 1px);
  background-size: 80px 80px, 120px 120px;
  background-position: 0 0, 40px 40px;
  animation: bg-drift 20s linear infinite;
}
@keyframes bg-drift { from { transform: translateY(0); } to { transform: translateY(-80px); } }

.auth-card {
  position: relative; z-index: 10;
  background: rgba(255,255,255,0.97);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  width: 100%; max-width: 420px; margin: 20px;
}

.auth-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--gradient-end) 100%);
  padding: 28px 32px 24px; text-align: center; position: relative; overflow: hidden;
}
.auth-header::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at top right, rgba(0,179,134,0.2), transparent 60%);
}
.auth-logo {
  font-size: 2rem; font-weight: 900; color: #fff;
  letter-spacing: -0.02em; position: relative; z-index: 1;
}
.auth-logo span { color: #4db8ff; }
.auth-sub {
  font-size: 0.72rem; color: rgba(255,255,255,0.6);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-top: 4px; position: relative; z-index: 1;
}
.auth-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px; padding: 4px 12px; font-size: 0.72rem;
  color: rgba(255,255,255,0.8); margin-top: 12px; position: relative; z-index: 1;
}

.auth-body { padding: 28px 32px 32px; }
.auth-screen { display: none; }
.auth-screen.active { display: block; }

/* ============================================================
   2. FORMULÁRIOS (compartilhado entre todas as telas)
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-label {
  font-size: 0.78rem; font-weight: 600; color: var(--text-muted);
  display: block; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em;
}
.form-input,
input[type=text], input[type=email], input[type=password], input[type=tel], select {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 0.95rem; color: var(--text); background: #f9fafc;
  outline: none; transition: all 0.2s;
}
.form-input:focus,
input:focus, select:focus {
  border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(0,86,179,0.1);
}
.form-input.error { border-color: var(--danger); background: #fff8f8; }

.input-group { position: relative; }
.input-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 1rem; color: var(--text-muted);
  padding: 4px;
}
.input-error { font-size: 0.75rem; color: var(--danger); margin-top: 4px; display: none; }
.input-error.show { display: block; }

/* CHECKBOX */
.check-row, .checkbox-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 20px;
}
.checkbox-row { align-items: flex-start; margin-bottom: 10px; }
.check-row input[type=checkbox], .checkbox-row input[type=checkbox] {
  width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary);
}
.checkbox-row input[type=checkbox] { margin-top: 2px; }
.check-row label, .checkbox-row label {
  font-size: 0.82rem; color: var(--text-muted); cursor: pointer; font-weight: 400;
}

label {
  font-size: 0.8rem; font-weight: 600; color: var(--text);
  display: block; margin-bottom: 6px;
}

/* PASSWORD STRENGTH */
.strength-bar { height: 4px; border-radius: 2px; background: var(--border); margin-top: 8px; overflow: hidden; }
.strength-fill { height: 100%; border-radius: 2px; transition: all 0.3s; width: 0%; }
.strength-label { font-size: 0.72rem; margin-top: 4px; font-weight: 600; }
.s-weak { width: 25%; background: var(--danger); }
.s-fair { width: 50%; background: var(--warning); }
.s-good { width: 75%; background: #4db8ff; }
.s-strong { width: 100%; background: var(--accent); }

/* TOGGLE SWITCH (on/off) */
.switch { position: relative; display: inline-block; width: 48px; height: 27px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; cursor: pointer; inset: 0; background: var(--border, #ccd2dc);
  border-radius: 27px; transition: background 0.25s;
}
.switch-slider::before {
  content: ''; position: absolute; height: 21px; width: 21px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: transform 0.25s; box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.switch input:checked + .switch-slider { background: var(--accent, #00b386); }
.switch input:checked + .switch-slider::before { transform: translateX(21px); }
.switch input:focus-visible + .switch-slider { box-shadow: 0 0 0 3px rgba(0,86,179,0.25); }

/* ÍCONES MONOCROMÁTICOS via CSS mask — herdam a COR (currentColor) e o tamanho.
   Usados em glifos de UI e ícones que trocam de estado por classe. */
.ico {
  display: inline-block;
  width: 1.15em; height: 1.15em;
  vertical-align: -0.16em;
  background-color: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat;
          mask: var(--ico) center / contain no-repeat;
  flex-shrink: 0;
}
.ico-lg { width: 3.2rem; height: 3.2rem; }

/* Glifos de UI */
.ico-seta-esquerda { --ico: url("../img/icon/seta-esquerda.svg"); }
.ico-seta-direita  { --ico: url("../img/icon/seta-direita.svg"); }
.ico-check         { --ico: url("../img/icon/check.svg"); }
.ico-chevron-baixo { --ico: url("../img/icon/chevron-baixo.svg"); }
.ico-trocar        { --ico: url("../img/icon/trocar.svg"); }
.ico-menu          { --ico: url("../img/icon/menu.svg"); }
.ico-olho          { --ico: url("../img/icon/olho.svg"); }
.ico-olho-off      { --ico: url("../img/icon/olho-off.svg"); }
.ico-adicionar     { --ico: url("../img/icon/adicionar.svg"); }
.ico-remover       { --ico: url("../img/icon/remover.svg"); }
.ico-ponto         { --ico: url("../img/icon/ponto.svg"); width: 0.7em; height: 0.7em; vertical-align: 0; }

/* Ícones dinâmicos / status (cor definida aqui) */
.ico-biometria     { --ico: url("../img/icon/biometria.svg"); color: var(--primary); }
.ico-notificacoes  { --ico: url("../img/icon/notificacoes.svg"); }
.ico-sino-off      { --ico: url("../img/icon/sino-off.svg"); }
.ico-sucesso       { --ico: url("../img/icon/sucesso.svg"); color: var(--accent, #00b386); }
.ico-erro          { --ico: url("../img/icon/erro.svg");    color: var(--danger, #e03131); }
.ico-aviso         { --ico: url("../img/icon/aviso.svg");   color: var(--warning, #f0a500); }

/* ÍCONES SVG (assets/img/icon) — herdam o tamanho do contexto via em */
.svg-ico {
  display: inline-block;
  width: 1.15em; height: 1.15em;
  vertical-align: -0.16em;
  object-fit: contain;
  flex-shrink: 0;
}
/* Nos wrappers de navegação/canal o ícone ocupa o tamanho já reservado */
.nav-icon .svg-ico, .cp-icon .svg-ico, .contract-btn-icon .svg-ico,
.channel-icon .svg-ico { width: 1.1em; height: 1.1em; vertical-align: -0.15em; }

/* EMAIL MASCARADO */
.masked-email {
  background: var(--primary-light); border-radius: 8px; padding: 10px 14px;
  font-size: 0.85rem; color: var(--primary); font-weight: 600;
  text-align: center; margin: 10px 0;
}

/* ============================================================
   3. BOTÕES (compartilhado)
   ============================================================ */
.btn {
  padding: 13px; border-radius: 10px; font-size: 0.95rem;
  font-weight: 700; border: none; cursor: pointer; transition: all 0.2s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-block, .auth-body .btn, .btn-admin { width: 100%; }

.btn-primary, .btn-admin { background: var(--primary); color: #fff; }
.btn-primary:hover, .btn-admin:hover {
  background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,86,179,0.3);
}
.btn-primary:active, .btn-admin:active { transform: translateY(0); }
.btn-admin:disabled { opacity: 0.5; transform: none; cursor: not-allowed; }

.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }

.btn-success { background: var(--accent); color: #fff; }
.btn-success:hover { opacity: 0.92; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-soft { background: var(--danger-light); color: var(--danger); border: 1.5px solid #f5c2c7; }
.btn-danger-soft:hover { background: var(--danger); color: #fff; }

.btn-bio {
  background: linear-gradient(135deg, #1a1a2e, var(--primary-dark));
  color: #fff; margin-top: 10px; width: 100%;
}
.btn-bio:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.3); }

.btn-sm { padding: 9px 18px; font-size: 0.85rem; width: auto; border-radius: 8px; }
.btn-link {
  background: none; border: none; color: var(--primary); cursor: pointer;
  font-size: 0.85rem; font-weight: 600; text-decoration: none; padding: 0;
}
.btn-link:hover { text-decoration: underline; }

/* botões "abtn-*" do admin -> alias para os botões padrão */
.abtn { padding: 8px 18px; border-radius: 8px; font-size: 0.83rem; font-weight: 700; border: none; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; gap: 6px; }
.abtn-primary { background: var(--primary); color: #fff; }
.abtn-primary:hover { background: var(--primary-dark); }
.abtn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.abtn-outline:hover { background: var(--primary-light); }
.abtn-danger { background: var(--danger-light); color: var(--danger); border: 1.5px solid #f5c2c7; }
.abtn-danger:hover { background: var(--danger); color: #fff; }
.abtn-success { background: var(--accent); color: #fff; }

/* DIVISOR */
.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.divider span { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }

/* BACK BTN */
.back-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  font-size: 0.82rem; color: var(--text-muted); margin-bottom: 16px; padding: 0;
}
.back-btn:hover { color: var(--primary); }

/* ============================================================
   4. ALERTAS (unifica .alert / .auth-alert)
   ============================================================ */
.alert, .auth-alert {
  border-radius: 10px; padding: 12px 14px; margin-bottom: 18px;
  font-size: 0.83rem; display: none; align-items: flex-start; gap: 10px;
}
.alert.show, .auth-alert.show { display: flex; }
.alert-success { background: var(--accent-light); border: 1px solid #b7e8d9; color: #005c3e; }
.alert-danger { background: var(--danger-light); border: 1px solid #f5c2c7; color: #7d1d2a; }
.alert-warn { background: var(--warning-light); border: 1px solid #f0d070; color: #7a5000; }
.alert-info { background: var(--primary-light); border: 1px solid #b3d0f5; color: var(--primary-dark); }
.alert-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

.alert-banner {
  background: var(--danger-light); border: 1px solid #f5c2c7; border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 20px; display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: all 0.2s;
}
.alert-banner:hover { box-shadow: 0 4px 16px rgba(220,53,69,0.15); }
.alert-banner .alert-icon { font-size: 1.3rem; }
.alert-banner .alert-text { flex: 1; }
.alert-banner .alert-title { font-weight: 600; color: var(--danger); font-size: 0.9rem; }
.alert-banner .alert-desc { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.alert-banner .alert-action { font-size: 0.8rem; font-weight: 600; color: var(--danger); white-space: nowrap; }

.security-note, .lgpd-note {
  background: #f9fafc; border-radius: 8px; padding: 10px 12px;
  font-size: 0.72rem; color: var(--text-muted); margin-top: 14px;
  border: 1px solid var(--border); line-height: 1.5;
}
.security-badge {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 0.72rem; color: var(--text-muted); margin-top: 16px;
}

/* ============================================================
   5. BIOMETRIA
   ============================================================ */
.bio-icon {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-dark), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; margin: 0 auto 16px; cursor: pointer;
  transition: all 0.3s; box-shadow: 0 4px 20px rgba(0,86,179,0.3);
}
.bio-icon:hover { transform: scale(1.05); box-shadow: 0 6px 28px rgba(0,179,134,0.4); }
.bio-icon.scanning { animation: pulse-bio 1.5s ease-in-out infinite; }
@keyframes pulse-bio {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,179,134,0.4); }
  50% { box-shadow: 0 0 0 20px rgba(0,179,134,0); }
}
.bio-text { text-align: center; font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }
.bio-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 6px; text-align: center; }

/* ============================================================
   6. OTP / TOTP / 2FA (unificado em um único padrão: 44x52)
   ============================================================ */
.otp-wrap { display: flex; gap: 10px; justify-content: center; margin: 14px 0; }
.otp-input {
  width: 44px; height: 52px; text-align: center; font-size: 1.3rem; font-weight: 700;
  border: 2px solid var(--border); border-radius: 10px; outline: none; transition: all 0.2s;
  color: var(--text);
}
.otp-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,86,179,0.1); }
.otp-input.filled { border-color: var(--accent); background: var(--accent-light); }

.totp-hint {
  background: var(--primary-light); border-radius: 8px; padding: 12px 14px;
  font-size: 0.82rem; color: var(--primary-dark); line-height: 1.5; margin-bottom: 16px; text-align: center;
}
.totp-timer-row {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 14px; font-size: 0.78rem; color: var(--text-muted);
}
.totp-timer-circle {
  width: 36px; height: 36px; border-radius: 50%; background: var(--primary-light); color: var(--primary);
  font-weight: 700; font-size: 0.82rem; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--primary);
}
.totp-timer { text-align: center; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 14px; }
.totp-timer span { font-weight: 700; color: var(--primary); }
.totp-error {
  background: var(--danger-light); border: 1px solid #f5c2c7; border-radius: 8px;
  padding: 10px; font-size: 0.82rem; color: var(--danger); text-align: center; margin-bottom: 12px; display: none;
}
.totp-error.show { display: block; }
.attempts-bar { display: flex; gap: 6px; justify-content: center; margin-bottom: 12px; }
.attempt-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.attempt-dot.used { background: var(--danger); }

/* TOTP modal overlay (escuro, fora do auth-wrap) */
.totp-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 400;
  display: none; align-items: center; justify-content: center;
}
.totp-overlay.open { display: flex; }
.totp-card {
  background: #fff; border-radius: var(--radius-lg); width: 380px; max-width: 95vw;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5); overflow: hidden;
}
.totp-header {
  background: linear-gradient(135deg, #1a1a2e, var(--primary-dark)); padding: 24px;
  text-align: center; color: #fff;
}
.totp-icon { font-size: 2.5rem; margin-bottom: 8px; }
.totp-title { font-size: 1rem; font-weight: 700; }
.totp-sub { font-size: 0.78rem; opacity: 0.7; margin-top: 4px; }
.totp-body { padding: 24px; }

/* ============================================================
   7. SPINNER / LOADING / PROGRESS
   ============================================================ */
.spinner {
  width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite; display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 20px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.dot.active { background: var(--primary); }
.dot.done { background: var(--accent); }

.timer-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--warning-light); border: 1px solid #f0d070;
  color: #7a5000; border-radius: 20px; padding: 4px 12px;
  font-size: 0.78rem; font-weight: 600; margin-bottom: 14px;
}

/* ============================================================
   8. LAYOUT (Sidebar + Topbar + Main) - Dashboard e Admin
   ============================================================ */
body.has-sidebar { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); background: var(--primary-dark); color: #fff;
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0;
  height: 100vh; z-index: 100; transition: transform 0.3s;
  padding-top: env(safe-area-inset-top, 0px);
}
.sidebar-logo { padding: 24px 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-logo .brand { display: flex; align-items: center; justify-content: center; width: 100%; }
.sidebar-logo .brand img { max-width: 160px; max-height: 60px; width: auto; height: auto; object-fit: contain; }
.sidebar-logo .brand span { color: #4db8ff; }
.sidebar-logo .sub {
  font-size: 0.7rem; color: rgba(255,255,255,0.5); margin-top: 2px;
  text-transform: uppercase; letter-spacing: 0.06em;   display: flex;
  justify-content: center;
}
.sidebar-logo .admin-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(220,53,69,0.2); border: 1px solid rgba(220,53,69,0.4);
  border-radius: 20px; padding: 2px 10px; font-size: 0.65rem; color: #ff8a8a;
  margin-top: 8px; font-weight: 700;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.nav-section, .nav-section-title {
  padding: 14px 20px 4px; font-size: 0.62rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: rgba(255,255,255,0.3);
}
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 20px; cursor: pointer;
  font-size: 0.875rem; color: rgba(255,255,255,0.75); transition: all 0.2s;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.12); color: #fff; border-left-color: #4db8ff; }
.nav-item .nav-icon, .nav-item .icon { font-size: 1.1rem; width: 20px; text-align: center; }
.nav-badge {
  background: var(--danger); color: #fff; font-size: 0.65rem; border-radius: 10px;
  padding: 1px 6px; margin-left: auto;
}
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1); }
.user-info { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.avatar-sm {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.875rem;
}
.user-name { font-size: 0.8rem; font-weight: 600; color: #fff; }
.user-plan { font-size: 0.7rem; color: rgba(255,255,255,0.5); }
.session-info { font-size: 0.72rem; color: rgba(255,255,255,0.5); }
.session-timer { font-size: 0.88rem; font-weight: 700; color: #4db8ff; margin-top: 2px; }
.logout-btn {
  margin-top: 12px; width: 100%; padding: 8px; background: rgba(220,53,69,0.15);
  border: 1px solid rgba(220,53,69,0.3); color: #ff8a8a; border-radius: 8px;
  cursor: pointer; font-size: 0.82rem; font-weight: 600; transition: all 0.2s;
}
.logout-btn:hover { background: rgba(220,53,69,0.3); }

/* CONTRATO SELECTOR */
.contract-selector { background: var(--primary); border-bottom: 2px solid rgba(255,255,255,0.15); padding: 10px 20px; position: relative; }
.contract-btn {
  display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25); border-radius: 8px; padding: 8px 12px;
  cursor: pointer; width: 100%; color: #fff; transition: all 0.2s;
}
.contract-btn:hover { background: rgba(255,255,255,0.2); }
.contract-btn-icon { font-size: 1rem; }
.contract-btn-info { flex: 1; text-align: left; }
.contract-btn-label { font-size: 0.62rem; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 0.06em; }
.contract-btn-name { font-size: 0.82rem; font-weight: 700; color: #fff; line-height: 1.2; }
.contract-btn-arrow { font-size: 0.7rem; color: rgba(255,255,255,0.6); transition: transform 0.2s; }
.contract-btn.open .contract-btn-arrow { transform: rotate(180deg); }
.contract-dropdown {
  position: absolute; top: calc(100% + 4px); left: 12px; right: 12px; background: #fff;
  border-radius: 10px; box-shadow: 0 8px 32px rgba(0,0,0,0.25); z-index: 200; display: none; overflow: hidden;
}
.contract-dropdown.open { display: block; }
.contract-dropdown-header {
  padding: 10px 14px; font-size: 0.72rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--border); background: var(--bg);
}
.contract-option { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background 0.15s; }
.contract-option:last-child { border-bottom: none; }
.contract-option:hover { background: var(--primary-light); }
.contract-option.selected { background: var(--accent-light); }
.contract-opt-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.contract-opt-info { flex: 1; }
.contract-opt-name { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.contract-opt-addr { font-size: 0.75rem; color: var(--text-muted); margin-top: 1px; }
.contract-opt-status { font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; margin-top: 4px; display: inline-block; }
.cs-active { background: var(--accent-light); color: var(--accent); }
.cs-pending { background: var(--warning-light); color: var(--warning); }
.cs-suspended { background: var(--danger-light); color: var(--danger); }
.contract-check { color: var(--accent); font-size: 1rem; }

.active-contract-bar {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff;
  padding: 10px 28px; display: flex; align-items: center; gap: 12px; font-size: 0.82rem;
}
.active-contract-bar strong { font-size: 0.88rem; }
.active-contract-bar .switch-btn {
  margin-left: auto; background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3);
  color: #fff; padding: 4px 12px; border-radius: 20px; cursor: pointer; font-size: 0.75rem; font-weight: 600; transition: all 0.2s;
}
.active-contract-bar .switch-btn:hover { background: rgba(255,255,255,0.25); }

/* MAIN / TOPBAR */
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: env(safe-area-inset-top, 0px) 28px 0;
  height: calc(60px + env(safe-area-inset-top, 0px));
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 1.05rem; font-weight: 600; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-icon-btn {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border);
  background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: var(--text-muted); transition: all 0.2s;
}
.topbar-icon-btn:hover { background: var(--bg); }
.topbar-admin-btn {
  background: linear-gradient(135deg, #1a1a2e, var(--primary-dark)); color: #fff; border: none;
  padding: 6px 14px; border-radius: 8px; font-size: 0.78rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; gap: 6px; transition: all 0.2s;
}
.topbar-admin-btn:hover { opacity: 0.9; }
.topbar-admin-info { font-size: 0.78rem; color: var(--text-muted); }
.topbar-admin-info strong { color: var(--primary); font-weight: 700; }
.notif-dot { position: relative; }
.notif-dot::after {
  content: ''; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px;
  background: var(--danger); border-radius: 50%; border: 2px solid #fff;
}
.content { padding: 28px; flex: 1; }

/* ============================================================
   9. CARDS
   ============================================================ */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.card-subtitle { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.section-label, .admin-section-title {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--border);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }

/* ============================================================
   10. MÉTRICAS / STATS
   ============================================================ */
.metric-card, .stat-card {
  background: var(--white); border-radius: var(--radius); padding: 16px 18px;
  border: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--shadow);
}
.metric-label, .stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.metric-value, .stat-value { font-size: 1.6rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat-value { font-size: 1.8rem; font-weight: 800; margin: 6px 0 4px; }
.metric-value span { font-size: 0.85rem; font-weight: 400; color: var(--text-muted); }

.metric-badge, .stat-badge {
  font-size: 0.72rem; padding: 2px 8px; border-radius: 20px; font-weight: 600; width: fit-content;
}
.badge-green { background: var(--accent-light); color: var(--accent); }
.badge-red { background: var(--danger-light); color: var(--danger); }
.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-yellow { background: var(--warning-light); color: var(--warning); }
.badge-gray { background: #eceef1; color: #6b7280; }

.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }

/* STATUS PILLS (unifica .status-pill / .spill / .contract-opt-status) */
.status-pill, .spill {
  padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 700;
}
.status-paid, .spill-green { background: var(--accent-light); color: var(--accent); }
.status-pending, .spill-yellow { background: var(--warning-light); color: var(--warning); }
.status-overdue { background: var(--danger-light); color: var(--danger); }
.spill-blue { background: var(--primary-light); color: var(--primary); }

/* ============================================================
   11. VELOCIDADE / GAUGE
   ============================================================ */
.speed-section { display: flex; gap: 20px; align-items: stretch; }
.speed-gauge-card {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  border-radius: var(--radius); padding: 20px; color: #fff; flex: 1; text-align: center;
}
.speed-label { font-size: 0.75rem; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.06em; }
.speed-value { font-size: 2.8rem; font-weight: 800; line-height: 1; margin: 6px 0 2px; }
.speed-unit { font-size: 0.85rem; opacity: 0.7; }
.speed-bar { height: 6px; background: rgba(255,255,255,0.2); border-radius: 3px; margin: 10px 0; }
.speed-bar-fill { height: 100%; border-radius: 3px; background: #4db8ff; transition: width 1s ease; }
.speed-meta { font-size: 0.72rem; opacity: 0.6; }

/* ============================================================
   12. TABELAS / LOGS
   ============================================================ */
table, .log-table { width: 100%; border-collapse: collapse; }
th, .log-table th {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted);
  padding: 10px 12px; text-align: left; border-bottom: 2px solid var(--border);
}
td, .log-table td { padding: 12px; font-size: 0.875rem; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* Contêiner com rolagem horizontal — impede que a tabela estoure a tela */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Tabela responsiva: no mobile cada linha vira um cartão empilhado (data-label) */
@media (max-width: 600px) {
  .rtable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tr {
    border: 1px solid var(--border); border-radius: 12px;
    padding: 4px 14px; margin-bottom: 12px; background: var(--white);
  }
  .rtable tr:last-child { margin-bottom: 0; }
  .rtable td {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 9px 0; border-bottom: 1px solid var(--border); text-align: right;
  }
  .rtable tr td:last-child { border-bottom: none; }
  .rtable td::before {
    content: attr(data-label);
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--text-muted); text-align: left; flex-shrink: 0;
  }
  .rtable td:empty { display: none; }
}

.log-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.8rem; }
.log-row:last-child { border-bottom: none; }
.log-time { color: var(--text-muted); white-space: nowrap; font-size: 0.75rem; }
.log-action { flex: 1; color: var(--text); }
.log-who { font-size: 0.72rem; color: var(--primary); font-weight: 600; }

/* ============================================================
   13. TABS
   ============================================================ */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  padding: 10px 16px; font-size: 0.85rem; font-weight: 600; border: none; background: transparent;
  cursor: pointer; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ============================================================
   14. SIGN FLOW
   ============================================================ */
.flow-steps { display: flex; gap: 0; margin-bottom: 24px; }
.flow-step { flex: 1; text-align: center; position: relative; }
.flow-step::after { content: ''; position: absolute; top: 15px; left: 50%; width: 100%; height: 2px; background: var(--border); z-index: 0; }
.flow-step:last-child::after { display: none; }
.step-num {
  width: 32px; height: 32px; border-radius: 50%; background: var(--border); color: var(--text-muted);
  font-size: 0.8rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  position: relative; z-index: 1; margin-bottom: 6px;
}
.flow-step.done .step-num { background: var(--accent); color: #fff; }
.flow-step.current .step-num { background: var(--primary); color: #fff; }
.step-label { font-size: 0.72rem; color: var(--text-muted); }
.flow-step.current .step-label { color: var(--primary); font-weight: 600; }
.sign-pane { display: none; }
.sign-pane.active { display: block; }
#signatureCanvas { border: 2px dashed var(--border); border-radius: 8px; cursor: crosshair; display: block; width: 100%; touch-action: none; }
#signatureCanvas.signed { border-color: var(--accent); border-style: solid; }

/* ============================================================
   15. PLANOS
   ============================================================ */
.plan-card { border: 2px solid var(--border); border-radius: var(--radius); padding: 20px; transition: all 0.2s; cursor: pointer; }
.plan-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(0,86,179,0.1); }
.plan-card.current-plan { border-color: var(--accent); background: var(--accent-light); }
.plan-card.recommended { border-color: var(--primary); }
.plan-name { font-size: 1.05rem; font-weight: 700; }
.plan-speed { font-size: 2rem; font-weight: 800; color: var(--primary); line-height: 1.1; }
.plan-price { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-top: 8px; }
.plan-price span { font-size: 0.75rem; font-weight: 400; color: var(--text-muted); }

/* PLAN RULES (admin) */
.plan-rule-row {
  display: flex; align-items: center; gap: 14px; padding: 14px; border: 1.5px solid var(--border);
  border-radius: 10px; margin-bottom: 10px; background: #fff; transition: all 0.2s;
}
.plan-rule-row:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,86,179,0.08); }
.plan-rule-icon {
  width: 40px; height: 40px; border-radius: 8px; background: var(--primary-light);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0;
}
.plan-rule-info { flex: 1; }
.plan-rule-name { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.plan-rule-speed, .plan-rule-detail { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.plan-rule-arrow { font-size: 1.2rem; color: var(--text-muted); flex-shrink: 0; }
.plan-rule-select {
  padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 0.85rem;
  color: var(--text); outline: none; min-width: 180px; transition: border 0.2s; cursor: pointer;
}
.plan-rule-select:focus { border-color: var(--primary); }

/* ============================================================
   16. CANAIS
   ============================================================ */
.channel-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.channel-card {
  border: 1.5px solid var(--border); border-radius: var(--radius); padding: 16px;
  display: flex; align-items: center; gap: 14px; cursor: pointer; transition: all 0.2s;
}
.channel-card:hover { border-color: var(--primary); background: var(--primary-light); }
.channel-icon { font-size: 1.8rem; }
.channel-name { font-size: 0.85rem; font-weight: 600; }
.channel-desc { font-size: 0.75rem; color: var(--text-muted); }

/* ============================================================
   17. NOTIFICAÇÕES / TOGGLES
   ============================================================ */
.nf-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.nf-row:last-child { border-bottom: none; }
.nf-icon {
  width: 38px; height: 38px; border-radius: 8px; background: var(--primary-light);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.nf-info { flex: 1; }
.nf-type { font-size: 0.85rem; font-weight: 600; }
.nf-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 0.875rem; font-weight: 500; }
.toggle-desc { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.toggle-switch { position: relative; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: var(--border); border-radius: 24px; transition: 0.3s; }
.toggle-slider::before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 0.3s; }
input:checked + .toggle-slider { background: var(--accent); }
input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ============================================================
   18. APPS
   ============================================================ */
.apps-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--gradient-end) 100%); border-radius: var(--radius);
  padding: 28px; color: #fff; margin-bottom: 20px; display: flex; align-items: center; gap: 20px;
}
.apps-hero-icon { font-size: 3.5rem; }
.apps-hero-title { font-size: 1.4rem; font-weight: 700; }
.apps-hero-desc { font-size: 0.875rem; opacity: 0.8; margin-top: 4px; }
.apps-hero-btn {
  margin-top: 14px; background: #fff; color: var(--primary); padding: 10px 22px; border-radius: 8px;
  font-weight: 700; font-size: 0.9rem; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; transition: all 0.2s;
}
.apps-hero-btn:hover { background: var(--primary-light); }
.apps-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 20px; }
.app-card {
  background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 20px; text-align: center; cursor: pointer; transition: all 0.2s;
}
.app-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(0,86,179,0.12); transform: translateY(-2px); }
.app-card-icon { font-size: 2.5rem; margin-bottom: 10px; }
.app-card-name { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.app-card-desc { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.app-card-badge { font-size: 0.68rem; padding: 2px 8px; border-radius: 20px; margin-top: 8px; display: inline-block; }

/* ============================================================
   19. GUIA DE LOGIN (como acessar)
   ============================================================ */
.login-guide-hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); border-radius: var(--radius);
  padding: 28px; color: #fff; margin-bottom: 20px; display: flex; align-items: center; gap: 20px;
}
.login-guide-hero-icon { font-size: 3rem; }
.login-guide-hero-title { font-size: 1.3rem; font-weight: 700; }
.login-guide-hero-desc { font-size: 0.875rem; opacity: 0.75; margin-top: 4px; line-height: 1.5; }
.login-guide-btn {
  margin-top: 14px; background: #4db8ff; color: #1a1a2e; padding: 10px 22px; border-radius: 8px;
  font-weight: 700; font-size: 0.9rem; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
}
.login-steps { display: flex; flex-direction: column; gap: 12px; }
.login-step-card {
  background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 18px; display: flex; align-items: flex-start; gap: 14px;
}
.login-step-num {
  width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff;
  font-weight: 700; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.login-step-title { font-size: 0.9rem; font-weight: 600; }
.login-step-desc { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }
.platform-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { padding: 4px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 600; background: var(--primary-light); color: var(--primary); }
.chip.android { background: #e6f4ea; color: #2d7a3a; }
.chip.ios { background: #f0f0f0; color: #444; }
.chip.tv { background: #fff3e0; color: #e65100; }

/* ============================================================
   20. MODAIS / OVERLAYS / TOAST
   ============================================================ */
.modal-backdrop, .confirm-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200;
  display: none; align-items: center; justify-content: center;
}
.modal-backdrop.open, .confirm-backdrop.open { display: flex; }
.modal {
  background: var(--white); border-radius: var(--radius); width: 520px; max-width: 95vw;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; background: #fff;
}
.modal-title { font-size: 1rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--text-muted); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }
.pix-display { background: var(--bg); border-radius: 8px; padding: 14px; font-family: monospace; font-size: 0.8rem; word-break: break-all; color: var(--text-muted); margin: 12px 0; }

.confirm-box { background: #fff; border-radius: var(--radius); width: 380px; max-width: 95vw; padding: 28px; box-shadow: var(--shadow-lg); }
.confirm-icon { font-size: 2.5rem; text-align: center; margin-bottom: 12px; }
.confirm-title { font-size: 1rem; font-weight: 700; text-align: center; margin-bottom: 6px; }
.confirm-desc { font-size: 0.83rem; color: var(--text-muted); text-align: center; line-height: 1.5; margin-bottom: 20px; }
.confirm-actions { display: flex; gap: 10px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1a1a2e; color: #fff;
  padding: 10px 22px; border-radius: 20px; font-size: 0.82rem; z-index: 999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3); transition: opacity 0.4s; white-space: nowrap; pointer-events: none;
}

/* ============================================================
   21. ADMIN PANEL (overlay + painel completo)
   ============================================================ */
.admin-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 300;
  display: none; align-items: flex-start; justify-content: center; padding: 20px; overflow-y: auto;
}
.admin-overlay.open { display: flex; }
.admin-panel { background: #fff; border-radius: var(--radius); width: 100%; max-width: 900px; box-shadow: 0 24px 80px rgba(0,0,0,0.4); overflow: hidden; }
.admin-header {
  background: linear-gradient(135deg, #1a1a2e, var(--primary-dark)); color: #fff; padding: 20px 28px;
  display: flex; align-items: center; gap: 14px;
}
.admin-header-icon { font-size: 1.8rem; }
.admin-header-title { font-size: 1.1rem; font-weight: 700; }
.admin-header-sub { font-size: 0.75rem; opacity: 0.7; margin-top: 2px; }
.admin-header-close { margin-left: auto; background: rgba(255,255,255,0.15); border: none; color: #fff; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 1rem; }
.admin-body { padding: 28px; }
.admin-save-bar, .save-bar {
  background: var(--bg); border-top: 1px solid var(--border); padding: 16px 28px;
  display: flex; align-items: center; justify-content: space-between; position: sticky; bottom: 0;
}
.save-status { font-size: 0.82rem; font-weight: 600; }
.admin-log { background: #f9fafc; border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-top: 20px; }
.admin-log-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 10px; }
.admin-badge {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; font-size: 0.65rem;
  padding: 2px 8px; border-radius: 20px; font-weight: 700; letter-spacing: 0.04em;
}
.panel-wrap { display: none; min-height: 100vh; }
.panel-wrap.active { display: flex; }

/* ===== ADMIN USER MENU (dropdown no topo) ===== */
.admin-user-menu { position: relative; }
.admin-user-btn {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); transition: all 0.2s;
}
.admin-user-btn:hover { background: var(--bg); }
.admin-user-name { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.admin-user-arrow { font-size: 0.65rem; color: var(--text-muted); transition: transform 0.2s; }
.admin-user-btn.open .admin-user-arrow { transform: rotate(180deg); }

.admin-user-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; width: 220px;
  background: #fff; border-radius: 10px; box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  z-index: 250; display: none; overflow: hidden; border: 1px solid var(--border);
}
.admin-user-dropdown.open { display: block; }
.admin-user-dropdown-header {
  padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--bg);
}
.admin-user-dropdown-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px;
  font-size: 0.82rem; font-weight: 600; color: var(--text); background: none; border: none;
  cursor: pointer; text-align: left; text-decoration: none; transition: background 0.15s;
}
.admin-user-dropdown-item:hover { background: var(--primary-light); }
.admin-user-dropdown-danger { color: var(--danger); border-top: 1px solid var(--border); }
.admin-user-dropdown-danger:hover { background: var(--danger-light); }

/* ============================================================
   22. RESPONSIVO
   ============================================================ */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .grid-4, .grid-3, .stats-grid { grid-template-columns: 1fr 1fr; }
  .apps-grid { grid-template-columns: repeat(2,1fr); }
  .channel-grid { grid-template-columns: 1fr; }
  .speed-section { flex-direction: column; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .apps-grid { grid-template-columns: repeat(2,1fr); }
  .content { padding: 16px; }
}
@media (max-width: 480px) {
  .auth-body { padding: 20px; }
  .auth-header { padding: 22px 20px 18px; }
}
/* Isso afeta só o login, não quebra a central */
.page-login .card { width: 400px; margin: auto; }

/* Isso afeta só a central — cards são blocos verticais normais.
   (o antigo display:flex quebrava o empilhamento do conteúdo interno) */
.page-central .card { width: 100%; }

/* Overlay do menu lateral no mobile (central) */
.sidebar-overlay { display: none; }

/* Botão ☰ da central só aparece no mobile (no desktop a sidebar é fixa) */
.page-central #menuBtn { display: none; }

/* ===== BOTTOM NAV MOBILE (ADMIN) ===== */
.bottom-nav {
  display: none;
}

@media (max-width: 900px) {
  /* ADMIN: esconde sidebar e usa bottom-nav. NÃO afeta a central,
     que mantém o menu lateral em drawer (aberto pelo botão ☰). */
  .page-admin #sidebar { display: none !important; }
  .page-admin #adminMenuBtn { display: none !important; }
  .main { margin-left: 0; }

  /* Espaço para o bottom nav não sobrepor o conteúdo (+ safe area da home indicator) */
  .page-admin .content { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }

  /* CENTRAL: no mobile/APP a sidebar dá lugar ao menu inferior (bottom nav),
     no mesmo padrão do painel admin. */
  .page-central #sidebar { display: none !important; }
  .page-central #menuBtn { display: none !important; }
  .page-central .sidebar-overlay { display: none !important; }
  .page-central .main { margin-left: 0; }
  .page-central .content { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    /* altura fixa + espaço da home indicator (iPhone/Android gesture nav) */
    padding-bottom: env(safe-area-inset-bottom, 0px);
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    background: var(--white);
    border-top: 1px solid var(--border);
    z-index: 200;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  }

  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 8px 4px;
    transition: color 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .bottom-nav-item .bnav-icon {
    font-size: 1.35rem;
    line-height: 1;
    display: flex; align-items: center; justify-content: center;
    width: 52px; height: 30px; border-radius: 16px;
    transition: background 0.2s;
  }

  .bottom-nav-item.active {
    color: var(--primary);
  }

  /* Realce arredondado atrás do ícone ativo (estilo apps de banco) */
  .bottom-nav-item.active .bnav-icon {
    background: var(--primary-light);
  }
}

/* ============================================================
   23. BOTTOM SHEET (trocar contrato / mais opções) — central
   ============================================================ */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }

.sheet {
  width: 100%; max-width: 520px;
  background: var(--white);
  border-radius: 18px 18px 0 0;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  max-height: 80vh; overflow-y: auto;
  transform: translateY(100%); transition: transform 0.28s cubic-bezier(.22,1,.36,1);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.18);
}
.sheet-backdrop.open .sheet { transform: translateY(0); }

/* No desktop a folha vira um card centralizado (não colado embaixo) */
@media (min-width: 901px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 16px; max-width: 420px; transform: translateY(16px) scale(0.98); }
  .sheet-backdrop.open .sheet { transform: translateY(0) scale(1); }
  .sheet-handle { display: none; }
}

.sheet-handle {
  width: 40px; height: 4px; border-radius: 4px; background: var(--border);
  margin: 6px auto 10px;
}
.sheet-title {
  font-size: 0.95rem; font-weight: 700; color: var(--text);
  padding: 4px 4px 12px; text-align: center;
}
.sheet-list { display: flex; flex-direction: column; }

/* Itens de menu da folha "Mais" */
.sheet-menu { display: flex; flex-direction: column; gap: 2px; }
.sheet-menu-item {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 14px 12px; border: none; background: none;
  font-size: 0.92rem; font-weight: 600; color: var(--text); cursor: pointer;
  text-align: left; text-decoration: none; border-radius: 10px; transition: background 0.15s;
}
.sheet-menu-item:hover, .sheet-menu-item:active { background: var(--bg); }
.sheet-menu-item span:first-child { font-size: 1.25rem; width: 26px; text-align: center; }
.sheet-menu-item em {
  margin-left: auto; font-style: normal; background: var(--primary-light); color: var(--primary);
  font-size: 0.72rem; font-weight: 700; padding: 1px 9px; border-radius: 20px;
}
.sheet-menu-item.danger { color: var(--danger); }

/* Opção de contrato dentro da folha (reaproveita .contract-option) */
.sheet .contract-option {
  border-radius: 12px; border: 1px solid var(--border); margin-bottom: 8px;
}
.sheet .contract-option:last-child { margin-bottom: 0; }
.contract-opt-plan { font-size: 0.78rem; color: var(--text); font-weight: 600; margin-top: 1px; }

/* Barra de contrato ativo: empilha nº + plano + endereço */
.active-contract-bar .acb-info { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.active-contract-bar .acb-plan { font-size: 0.76rem; opacity: 0.9; }
.active-contract-bar .acb-addr {
  font-size: 0.72rem; opacity: 0.8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw;
}
body.sheet-open { overflow: hidden; }

/* ============================================================
   24. HOME MODERNA (pill de contrato + atalhos horizontais)
   ============================================================ */
/* Pill de contrato ativo (abre a folha de troca ao tocar) */
.contract-pill-row { padding: 12px 16px 0; }
.contract-pill {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--white); border: 1px solid var(--border);
  border-radius: 14px; padding: 10px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.contract-pill.tappable { cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.contract-pill.tappable:hover { background: var(--bg); border-color: var(--primary-light); }
.contract-pill.tappable:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.cp-icon {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.15rem;
  background: var(--primary-light);
}
.cp-info { flex: 1; min-width: 0; }
.cp-primary {
  font-size: 0.9rem; font-weight: 700; color: var(--text); line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cp-plan { font-weight: 500; color: var(--text-muted); }
.cp-addr {
  font-size: 0.76rem; color: var(--text-muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cp-arrow { font-size: 1.15rem; color: var(--text-muted); flex-shrink: 0; }

/* Título de seção (cinza discreto, estilo app) */
.section-title {
  font-size: 0.82rem; font-weight: 700; color: var(--text-muted); margin-bottom: 12px;
}

/* Linha horizontal rolável de atalhos */
.hscroll {
  display: flex; gap: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 2px 4px 8px; margin: 0 -4px; scroll-snap-type: x proximity;
}
.hscroll::-webkit-scrollbar { height: 0; }
.quick-card {
  flex: 0 0 auto; width: 108px; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 16px 10px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--white); cursor: pointer; transition: all 0.15s; text-align: center;
}
.quick-card:hover { border-color: var(--primary-light); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.qc-icon {
  width: 46px; height: 46px; border-radius: 12px; background: var(--bg);
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.qc-label { font-size: 0.76rem; font-weight: 600; color: var(--text); line-height: 1.2; }
/* Primeiro card em destaque (usa a cor da empresa) */
.quick-card.accent { background: var(--primary); border-color: var(--primary); }
.quick-card.accent .qc-icon { background: rgba(255,255,255,0.22); }
.quick-card.accent .qc-label { color: #fff; }

/* ============================================================
   25. LOGIN/RECUPERAÇÃO — skin moderna "app de banco"
   (escopo em .login-modern; NÃO afeta o login do admin)
   ============================================================ */
.login-modern { max-width: 440px; border-radius: 22px; box-shadow: 0 26px 70px rgba(10,22,40,0.30); }
.login-modern .auth-header { padding: 30px 30px 26px; }
.login-modern .auth-body { padding: 26px 26px 30px; }
.login-modern .form-input,
.login-modern input[type=text],
.login-modern input[type=email],
.login-modern input[type=password] { border-radius: 12px; padding: 13px 14px; }
.login-modern .btn { border-radius: 12px; padding: 14px; }
.login-modern .btn-admin { box-shadow: 0 6px 18px rgba(0,86,179,0.22); }

/* Stepper de progresso */
.rec-steps { display: flex; align-items: flex-start; margin-bottom: 22px; }
.rec-step {
  flex: 1; position: relative; z-index: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted);
}
.rec-step i {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--border); color: #fff; font-style: normal; font-size: 0.78rem; font-weight: 700;
  position: relative; z-index: 1; transition: all 0.2s;
}
/* Conector à esquerda de cada passo */
.rec-step::before {
  content: ''; position: absolute; top: 13px; right: 50%; width: 100%; height: 2px;
  background: var(--border); z-index: 0;
}
.rec-step:first-child::before { display: none; }
.rec-step.active { color: var(--primary); }
.rec-step.active i { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.rec-step.done i { background: var(--accent); }
.rec-step.done::before, .rec-step.active::before { background: var(--accent); }

/* Cabeçalho com badge circular */
.rec-head { text-align: center; margin-bottom: 20px; }
.rec-badge {
  width: 62px; height: 62px; border-radius: 20px; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center; font-size: 1.8rem;
  background: var(--primary-light);
}
.rec-badge.ok   { background: var(--accent-light); }
.rec-badge.warn { background: var(--danger-light); }
.rec-title { font-size: 1.05rem; font-weight: 800; color: var(--text); }
.rec-sub   { font-size: 0.82rem; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }

/* Código OTP em caixas separadas */
.otp-boxes { display: flex; gap: 8px; justify-content: center; margin-bottom: 4px; }
.otp-boxes input {
  width: 44px; height: 54px; padding: 0; text-align: center;
  font-size: 1.4rem; font-weight: 700; color: var(--text);
  border: 1.5px solid var(--border); border-radius: 12px; background: #f9fafc;
  outline: none; transition: all 0.15s;
}
.otp-boxes input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(0,86,179,0.12); }
.otp-boxes input.filled { border-color: var(--primary); background: #fff; }
@media (max-width: 360px) {
  .otp-boxes { gap: 6px; }
  .otp-boxes input { width: 40px; height: 50px; font-size: 1.25rem; }
}