*{box-sizing:border-box}
html,body{margin:0;width:100%;max-width:100%;overflow-x:hidden}
body{font-family:Arial,Helvetica,sans-serif;background:#f3f4f6;color:#111827}
.container{width:100%;max-width:1100px;margin:0 auto;padding:22px}
.card{background:#fff;border-radius:14px;padding:20px;box-shadow:0 8px 24px rgba(0,0,0,.08);margin-bottom:18px;max-width:100%;overflow-x:auto}
.login{max-width:420px;margin:70px auto}
.topbar{background:#111827;color:#fff;padding:14px 22px;width:100%;max-width:100%;display:flex;align-items:center;gap:14px;flex-wrap:wrap;overflow-x:hidden}
.topbar b{white-space:nowrap}
.topbar a{color:#fff;text-decoration:none;margin-right:0;white-space:nowrap}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:14px;width:100%}
input,select,textarea{width:100%;padding:12px;border:1px solid #d1d5db;border-radius:10px;margin:7px 0 13px;font-size:15px;max-width:100%}
textarea{min-height:150px}
button,.btn{display:inline-block;border:0;background:#2563eb;color:#fff;padding:11px 15px;border-radius:10px;text-decoration:none;cursor:pointer;font-weight:bold;max-width:100%}
.btn.red,button.red{background:#dc2626}.btn.gray,button.gray{background:#4b5563}.btn.green,button.green{background:#16a34a}
.alert{padding:12px;border-radius:10px;margin-bottom:15px}.ok{background:#dcfce7;color:#166534}.erro{background:#fee2e2;color:#991b1b}
table{width:100%;border-collapse:collapse;background:#fff;max-width:100%}
th,td{text-align:left;border-bottom:1px solid #e5e7eb;padding:10px;font-size:14px;word-break:break-word}
.badge{padding:4px 8px;border-radius:20px;font-size:12px}.ativo,.disponivel{background:#dcfce7;color:#166534}.bloqueado{background:#fee2e2;color:#991b1b}.usado{background:#fef3c7;color:#92400e}
.copy{background:#111827;padding:7px 10px;border-radius:8px;font-size:13px}
h1,h2,h3{margin-top:0;word-break:break-word}.muted{color:#6b7280;font-size:14px}.actions{display:flex;gap:8px;flex-wrap:wrap}.code{font-family:monospace;font-size:18px;font-weight:bold}.footer{font-size:12px;color:#6b7280;text-align:center;margin-top:30px}

@media (max-width:600px){
  .container{padding:16px 14px}
  .topbar{padding:12px 14px;gap:10px;font-size:15px}
  .grid{grid-template-columns:1fr}
  .card{padding:18px}
  h1{font-size:34px;line-height:1.1}
  h2{font-size:24px}
  .code{font-size:16px}
  table{display:block;overflow-x:auto;white-space:nowrap}
}

.logo-img{height:38px;max-width:150px;object-fit:contain;display:inline-block;background:transparent}
.logo-text{font-weight:bold;color:#fff;font-size:18px;white-space:nowrap}
.login-logo{margin-bottom:15px;text-align:center}
.login-logo .logo-img{height:70px;max-width:260px}
.login-logo .logo-text{color:#111827;font-size:24px}
.preview-logo{background:#f3f4f6;border:1px solid #e5e7eb;border-radius:12px;padding:15px;margin:12px 0;display:flex;align-items:center;justify-content:center;min-height:90px}
.preview-logo img{max-width:260px;max-height:120px;object-fit:contain}
@media (max-width:600px){.logo-img{height:30px;max-width:105px}.login-logo .logo-img{height:58px;max-width:220px}}

/* CORRECAO FORCADA DA LOGO NO TOPO */
.topbar{min-height:58px!important;align-items:center!important;overflow:hidden!important}
.topbar .logo-img{height:42px!important;width:auto!important;max-width:180px!important;object-fit:contain!important;display:block!important;flex:0 0 auto!important}
.topbar .logo-text{font-size:18px!important}
@media (max-width:600px){
  .topbar{min-height:54px!important;padding:10px 12px!important;gap:8px!important;overflow:hidden!important}
  .topbar .logo-img{height:36px!important;max-width:135px!important;width:auto!important}
  .topbar a,.topbar b{font-size:14px!important}
  .container{max-width:100%!important;overflow-x:hidden!important}
}
.copy.disabled,.copy:disabled{opacity:.55;cursor:not-allowed;background:#6b7280}.table-wrap{width:100%;overflow-x:auto}table{min-width:620px}
.warning-card{border-left:5px solid #f59e0b;background:#fffbeb;color:#78350f}
.warning-card h2{color:#92400e;margin-bottom:10px}
.warning-card p{font-size:15px;line-height:1.45;margin:8px 0}
.warning-card .muted{color:#92400e}
@media (max-width:600px){.warning-card p{font-size:14px}}

form.inline-form{display:flex;gap:10px;align-items:center;flex-wrap:wrap}form.inline-form select{flex:1;min-width:180px;margin:0}form.inline-form button{margin:0}
@media (max-width:600px){form.inline-form{display:block}form.inline-form select{margin:7px 0 13px}}

/* TEMA DARK / CLARO */
body.theme-light{background:#f3f4f6;color:#111827}
body.theme-dark{background:#0b1220;color:#e5e7eb}
body.theme-dark .card{background:#111827;color:#e5e7eb;box-shadow:0 8px 24px rgba(0,0,0,.35)}
body.theme-dark .topbar{background:#020617;color:#fff;border-bottom:1px solid #1f2937}
body.theme-dark input,body.theme-dark select,body.theme-dark textarea{background:#020617;color:#e5e7eb;border-color:#374151}
body.theme-dark table{background:#111827;color:#e5e7eb}
body.theme-dark th,body.theme-dark td{border-bottom-color:#374151}
body.theme-dark .muted{color:#9ca3af}
body.theme-dark .preview-logo{background:#020617;border-color:#374151}
body.theme-dark .login-logo .logo-text{color:#e5e7eb}
body.theme-dark .warning-card{background:#451a03;color:#ffedd5;border-left-color:#f59e0b}
body.theme-dark .warning-card h2{color:#fed7aa}
body.theme-dark .warning-card .muted{color:#fed7aa}
body.theme-dark .footer{color:#9ca3af}
.aviso-texto{font-size:15px;line-height:1.5;white-space:normal}
.full{display:block;width:100%;text-align:center;margin-top:10px}
hr{border:0;border-top:1px solid #e5e7eb;margin:20px 0}
body.theme-dark hr{border-top-color:#374151}
small{color:#6b7280}
body.theme-dark small{color:#9ca3af}
.sucesso{background:#dcfce7;color:#166534}.senha_invalida{background:#fee2e2;color:#991b1b}.usuario_bloqueado{background:#fee2e2;color:#991b1b}.navegador_bloqueado{background:#fef3c7;color:#92400e}

/* MENU LATERAL */
.menu-toggle{display:none;position:fixed;top:14px;left:14px;z-index:1200;background:#111827;color:#fff;border:0;border-radius:12px;padding:10px 14px;font-weight:bold;box-shadow:0 10px 24px rgba(0,0,0,.18)}
.sidebar-overlay{display:none}
.sidebar{position:fixed;top:0;left:0;bottom:0;width:260px;background:#0f172a;color:#fff;padding:22px 16px;overflow-y:auto;z-index:1100;box-shadow:4px 0 20px rgba(0,0,0,.18)}
.sidebar-brand{display:flex;flex-direction:column;align-items:flex-start;gap:10px;padding-bottom:18px;border-bottom:1px solid rgba(255,255,255,.12);margin-bottom:18px}
.sidebar-brand .logo-img{height:44px!important;max-width:190px!important}
.sidebar-brand .logo-text{font-size:20px!important;color:#fff!important}
.sidebar-title{font-size:24px;font-weight:800;line-height:1.1}
.sidebar-nav{display:flex;flex-direction:column;gap:8px}
.sidebar-nav a{display:block;color:#e5e7eb;text-decoration:none;padding:12px 14px;border-radius:12px;font-weight:600;transition:.2s;background:transparent}
.sidebar-nav a:hover,.sidebar-nav a:focus{background:rgba(255,255,255,.08);color:#fff}
.sidebar-nav a.logout-link{margin-top:14px;background:#7f1d1d;color:#fff}
.sidebar-nav a.logout-link:hover{background:#991b1b}
.main-content{margin-left:260px;min-height:100vh}
.main-content .container{max-width:1200px;padding:28px}
body.theme-dark .sidebar{background:#020617;border-right:1px solid #1f2937}
body.theme-light .sidebar{background:#0f172a}
body.theme-dark .menu-toggle{background:#020617}
@media (max-width:900px){
  .menu-toggle{display:inline-block}
  .sidebar{transform:translateX(-100%);transition:transform .25s ease}
  body.sidebar-open .sidebar{transform:translateX(0)}
  .sidebar-overlay{position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:1050}
  body.sidebar-open .sidebar-overlay{display:block}
  .main-content{margin-left:0;padding-top:56px}
  .main-content .container{padding:18px 14px}
}

/* DASHBOARD ESTILO CARDS */
.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:20px;flex-wrap:wrap}
.eyebrow{margin:0 0 6px;color:#64748b;font-weight:800;text-transform:uppercase;letter-spacing:.08em;font-size:12px}body.theme-dark .eyebrow{color:#94a3b8}
.stats-grid{display:grid;grid-template-columns:repeat(2,minmax(240px,1fr));gap:22px;margin:20px 0 26px}.stat-card{min-height:150px;border:1px solid #dbe3ef;border-radius:26px;padding:26px 28px;background:#fff;box-shadow:0 12px 30px rgba(15,23,42,.08);display:flex;align-items:center;gap:26px;overflow:hidden}.stat-card span{display:block;color:#475569;font-size:24px;line-height:1.18;font-weight:700}.stat-card span small{font-size:20px;color:inherit}.stat-card strong{display:block;font-size:54px;line-height:1.02;margin-top:10px;color:#0f172a;font-weight:900}.stat-card small{display:block;margin-top:5px;font-size:16px;color:#64748b}.stat-icon{width:94px;height:94px;min-width:94px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:42px;color:#fff}.stat-blue .stat-icon{background:#1d4ed8}.stat-green .stat-icon{background:#15803d}.stat-teal .stat-icon{background:#0f766e}.stat-orange .stat-icon{background:#9a3412}.stat-purple .stat-icon{background:#4338ca}.stat-green{border-color:#16a34a}.stat-green strong{color:#22c55e}.stat-teal strong{color:#14b8a6}.stat-orange strong{color:#f97316}.stat-purple strong{color:#8b5cf6}
.distribution-card{border-radius:26px;padding:28px 30px!important}.dist-head{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:18px;flex-wrap:wrap}.dist-head h2{margin:0;font-size:30px}.dist-head span{font-size:24px;color:#64748b}.dist-head b{color:#0f172a}.progress-bar{width:100%;height:30px;border-radius:999px;background:#e5e7eb;overflow:hidden;display:flex;margin:14px 0 24px}.progress-bar span{height:100%;min-width:0}.progress-ativos{background:#22c55e}.progress-usados{background:#14b8a6}.progress-ind{background:#f97316;flex:1}.legend{display:flex;gap:24px;flex-wrap:wrap;font-size:22px;color:#475569;line-height:1.4}.legend b{font-weight:900}.dot{width:22px;height:22px;display:inline-block;border-radius:50%;vertical-align:-3px;margin-right:8px}.ativos-dot{background:#22c55e}.usados-dot{background:#14b8a6}.ind-dot{background:#f97316}.check-line{font-size:22px;color:#475569;margin:20px 0 0}.ok-text{color:#22c55e;font-weight:700}.erro-text{color:#ef4444;font-weight:700}
body.theme-dark .stat-card{background:#1e293b;border-color:#334155;box-shadow:none}body.theme-dark .stat-card span,body.theme-dark .legend,body.theme-dark .check-line{color:#cbd5e1}body.theme-dark .stat-card strong,body.theme-dark .dist-head b{color:#f8fafc}body.theme-dark .stat-card small,body.theme-dark .dist-head span{color:#cbd5e1}body.theme-dark .distribution-card{background:#1e293b;border:1px solid #334155}body.theme-dark .progress-bar{background:#0f172a}
@media (max-width:900px){.stats-grid{grid-template-columns:1fr;gap:16px}.stat-card{min-height:132px;padding:22px;gap:20px}.stat-icon{width:76px;height:76px;min-width:76px;font-size:34px}.stat-card span{font-size:21px}.stat-card strong{font-size:44px}.dist-head h2{font-size:24px}.dist-head span,.legend,.check-line{font-size:18px}}
@media (max-width:480px){.stat-card{border-radius:20px;padding:18px;gap:16px}.stat-icon{width:64px;height:64px;min-width:64px;font-size:28px}.stat-card span{font-size:18px}.stat-card span small{font-size:16px}.stat-card strong{font-size:38px}.distribution-card{padding:20px!important}.progress-bar{height:24px}.legend{display:block}.legend span{display:block;margin:9px 0}.check-line{font-size:16px}.dist-head span{font-size:17px}}
.bulk-actions{display:flex;gap:10px;flex-wrap:wrap;margin:0 0 15px 0}
.bulk-actions button{width:auto;min-width:150px}
.table-wrap input[type=checkbox]{width:22px;height:22px}

/* Ajustes completos da revenda: topo, conta e regras */
.revenda-topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:10px 0 18px;padding:14px 16px;border-radius:18px;background:linear-gradient(135deg,#ef4444,#f97316);box-shadow:0 10px 30px rgba(0,0,0,.25)}
.revenda-welcome strong{display:block;font-size:22px;color:#fff}.revenda-welcome span{display:block;color:#ffe7e7;font-size:14px;margin-top:2px}.account-dropdown{position:relative}.account-trigger{border:1px solid rgba(255,255,255,.35);background:rgba(0,0,0,.25);color:#fff;border-radius:999px;padding:8px 12px;display:flex;align-items:center;gap:8px;white-space:nowrap}.account-avatar{width:34px;height:34px;border-radius:50%;display:inline-grid;place-items:center;background:#111827;color:#fff;font-weight:800}.account-menu-pop{display:none;position:absolute;right:0;top:52px;min-width:260px;background:#1f2937;border:1px solid #64748b;border-radius:12px;overflow:hidden;z-index:9999;box-shadow:0 18px 45px rgba(0,0,0,.45)}.account-menu-pop.open{display:block}.account-menu-head{padding:14px 16px;border-bottom:1px solid #374151;color:#fff}.account-menu-head small{display:block;color:#cbd5e1;margin-top:4px}.account-menu-pop a,.account-menu-pop button{display:block;width:100%;padding:15px 16px;text-align:left;color:#f8fafc;background:transparent;border:0;border-bottom:1px solid #374151;text-decoration:none;font-size:16px}.account-menu-pop .danger{color:#f87171}.warning-card-top{margin-top:10px;margin-bottom:18px!important;border-left:7px solid #f97316!important;background:#4b1b05!important}.warning-card-top h2{margin-top:0;color:#fff}.warning-card-top .aviso-texto{color:#fff7ed;line-height:1.55}@media(max-width:640px){.revenda-topbar{margin-top:58px}.account-label{display:none}.account-menu-pop{right:-6px;min-width:245px}.revenda-welcome strong{font-size:20px}}

/* Ajustes completos da revenda: topo, conta e regras */
.revenda-topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:10px 0 18px;padding:14px 16px;border-radius:18px;background:linear-gradient(135deg,#ef4444,#f97316);box-shadow:0 10px 30px rgba(0,0,0,.25)}
.revenda-welcome strong{display:block;font-size:22px;color:#fff}.revenda-welcome span{display:block;color:#ffe7e7;font-size:14px;margin-top:2px}.account-dropdown{position:relative}.account-trigger{border:1px solid rgba(255,255,255,.35);background:rgba(0,0,0,.25);color:#fff;border-radius:999px;padding:8px 12px;display:flex;align-items:center;gap:8px;white-space:nowrap}.account-avatar{width:34px;height:34px;border-radius:50%;display:inline-grid;place-items:center;background:#111827;color:#fff;font-weight:800}.account-menu-pop{display:none;position:absolute;right:0;top:52px;min-width:260px;background:#1f2937;border:1px solid #64748b;border-radius:12px;overflow:hidden;z-index:9999;box-shadow:0 18px 45px rgba(0,0,0,.45)}.account-menu-pop.open{display:block}.account-menu-head{padding:14px 16px;border-bottom:1px solid #374151;color:#fff}.account-menu-head small{display:block;color:#cbd5e1;margin-top:4px}.account-menu-pop a,.account-menu-pop button{display:block;width:100%;padding:15px 16px;text-align:left;color:#f8fafc;background:transparent;border:0;border-bottom:1px solid #374151;text-decoration:none;font-size:16px}.account-menu-pop .danger{color:#f87171}.warning-card-top{margin-top:10px;margin-bottom:18px!important;border-left:7px solid #f97316!important;background:#4b1b05!important}.warning-card-top h2{margin-top:0;color:#fff}.warning-card-top .aviso-texto{color:#fff7ed;line-height:1.55}@media(max-width:640px){.revenda-topbar{margin-top:58px}.account-label{display:none}.account-menu-pop{right:-6px;min-width:245px}.revenda-welcome strong{font-size:20px}}

/* Revenda - topo fixo, conta e páginas separadas */
.revenda-topbar-fixed{position:sticky;top:12px;z-index:900;margin-bottom:24px!important}
.account-avatar-img{width:34px;height:34px;border-radius:50%;object-fit:cover;border:2px solid rgba(255,255,255,.45)}
.profile-row{display:flex;gap:18px;align-items:center;flex-wrap:wrap;margin:10px 0 18px}
.profile-photo{width:92px;height:92px;border-radius:50%;object-fit:cover;border:3px solid #334155;background:#0f172a;color:#fff;display:grid;place-items:center;font-size:42px;font-weight:900}.profile-letter{display:grid!important}.account-card p{font-size:17px;margin:8px 0}.sidebar-nav a.active{background:rgba(255,255,255,.12);color:#fff}
@media(max-width:900px){.revenda-topbar-fixed{position:sticky;top:60px}.main-content .container{padding-top:10px}.revenda-topbar{border-radius:18px}}

/* ===== CORREÇÃO FINAL: TOPO FIXO UNIFICADO DA REVENDA ===== */
/* Menu padrão continua ativo no admin; o menu antigo só é ocultado na revenda com topo unificado */
.revenda-fixed-topbar{position:fixed;top:0;left:260px;right:0;height:74px;z-index:1400;display:flex;align-items:center;gap:14px;padding:10px 22px;background:linear-gradient(135deg,#ef4444,#f97316);border-bottom:1px solid rgba(255,255,255,.12);box-shadow:0 10px 30px rgba(0,0,0,.35)}
.revenda-menu-top-btn{border:0;background:#020617;color:#fff;border-radius:14px;padding:13px 16px;font-size:16px;font-weight:800;box-shadow:0 10px 22px rgba(0,0,0,.25)}
.revenda-fixed-title{display:flex;flex-direction:column;line-height:1.1;color:#fff;min-width:0;flex:1}.revenda-fixed-title strong{font-size:20px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.revenda-fixed-title span{font-size:13px;color:#ffedd5;margin-top:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.revenda-fixed-account{margin-left:auto}.revenda-fixed-account .account-trigger{background:rgba(2,6,23,.35);border-color:rgba(255,255,255,.25)}.account-avatar-img{width:34px;height:34px;border-radius:50%;object-fit:cover;border:2px solid rgba(255,255,255,.28)}
.main-content{padding-top:86px!important}.main-content .container{padding-top:22px!important}.revenda-topbar,.revenda-topbar-fixed{display:none!important}
@media(max-width:900px){.revenda-fixed-topbar{left:0;height:72px;padding:9px 12px;gap:9px}.revenda-menu-top-btn{padding:12px 13px;border-radius:13px;font-size:15px}.revenda-fixed-title strong{font-size:17px}.revenda-fixed-title span{font-size:12px}.account-label{display:none!important}.main-content{padding-top:88px!important}.main-content .container{padding-top:16px!important}.account-menu-pop{position:fixed!important;top:76px!important;right:10px!important;left:auto!important;min-width:270px!important;max-width:calc(100vw - 20px)!important}}

/* AJUSTE FINAL - TOPO UNIFICADO DA REVENDA */
body .revenda-fixed-topbar{
  position:fixed!important;
  top:0!important;
  left:260px!important;
  right:0!important;
  height:72px!important;
  z-index:99999!important;
  display:flex!important;
  align-items:center!important;
  gap:12px!important;
  padding:9px 18px!important;
  background:linear-gradient(135deg,#ef4444,#f97316)!important;
  box-shadow:0 10px 30px rgba(0,0,0,.35)!important;
  border-radius:0!important;
  margin:0!important;
}
body .revenda-menu-top-btn{display:inline-flex!important;align-items:center!important;justify-content:center!important;background:#020617!important;color:#fff!important;border:0!important;border-radius:14px!important;padding:12px 14px!important;font-weight:800!important;white-space:nowrap!important;box-shadow:0 8px 20px rgba(0,0,0,.25)!important}
body .revenda-fixed-title{display:flex!important;flex-direction:column!important;flex:1!important;color:#fff!important;min-width:0!important}
body .revenda-fixed-title strong{font-size:19px!important;line-height:1.1!important;color:#fff!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
body .revenda-fixed-title span{font-size:12px!important;color:#ffedd5!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;margin-top:3px!important}
body .revenda-fixed-account{margin-left:auto!important;position:relative!important}
body .revenda-fixed-account .account-trigger{height:48px!important;background:rgba(2,6,23,.35)!important;border:1px solid rgba(255,255,255,.25)!important;color:#fff!important;border-radius:999px!important;display:flex!important;align-items:center!important;gap:8px!important;padding:6px 10px!important;white-space:nowrap!important}
body .revenda-topbar,body .revenda-topbar-fixed,body .revenda-hero{display:none!important}
body .main-content{padding-top:86px!important}
@media(max-width:900px){
  body .revenda-fixed-topbar{left:0!important;height:70px!important;padding:8px 10px!important;gap:8px!important}
  body .revenda-menu-top-btn{font-size:14px!important;padding:11px 12px!important}
  body .revenda-fixed-title strong{font-size:16px!important}
  body .revenda-fixed-title span{font-size:11px!important}
  body .account-label{display:none!important}
  body .main-content{padding-top:84px!important}
}


/* Correção: botão Menu/Voltar visível no painel admin */
@supports selector(body:has(.revenda-fixed-topbar)) {
  body:has(.revenda-fixed-topbar) .menu-toggle { display:none!important; }
  body:not(:has(.revenda-fixed-topbar)) .menu-toggle { display:inline-block!important; }
}
@media(max-width:900px){
  body:not(:has(.revenda-fixed-topbar)) .menu-toggle{display:inline-block!important;}
}


/* AJUSTE FINAL ADMIN */
body.theme-dark, body.theme-dark .main-content{background:#0b1220;color:#e5e7eb}
.sidebar-nav a.active{background:rgba(37,99,235,.95);color:#fff}
.btn.green,.green{background:#16a34a;color:#fff}.btn.gray,.gray{background:#475569;color:#fff}.btn.red,.red{background:#dc2626;color:#fff}.alert.ok,.ok{background:#dcfce7;color:#166534}.alert.erro,.erro{background:#fee2e2;color:#991b1b}.dashboard-grid{align-items:stretch}.bulk-actions{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}
@media (max-width:900px){.sidebar{z-index:1100}.menu-toggle{z-index:1200}}


/* MENU ADMIN LIMPO - CONFIGURAÇÕES AGRUPADAS */
.sidebar-nav .menu-config{border-radius:12px;overflow:hidden;background:rgba(255,255,255,.04);margin:4px 0}
.sidebar-nav .menu-config summary{list-style:none;cursor:pointer;color:#e5e7eb;padding:12px 14px;border-radius:12px;font-weight:800;user-select:none}
.sidebar-nav .menu-config summary::-webkit-details-marker{display:none}
.sidebar-nav .menu-config summary:after{content:'▾';float:right;opacity:.8}
.sidebar-nav .menu-config[open] summary{background:rgba(37,99,235,.95);color:#fff}
.sidebar-nav .menu-config[open] summary:after{content:'▴'}
.sidebar-nav .menu-config a{margin:4px 8px;padding:10px 12px 10px 22px;font-size:14px;background:rgba(15,23,42,.45)}
.sidebar-nav .menu-config a:hover{background:rgba(255,255,255,.10)}
@media(max-width:900px){.sidebar{width:66vw;max-width:460px}.sidebar-title{font-size:22px}.sidebar-nav a,.sidebar-nav .menu-config summary{font-size:16px;padding:13px 14px}.sidebar-nav .menu-config a{font-size:15px;padding:12px 12px 12px 22px}}



/* CORREÇÃO FINAL: menu da revenda com 14 categorias e largura correta no celular */
@media (max-width: 900px) {
  body .revenda-sidebar,
  body.sidebar-open .revenda-sidebar,
  body aside.revenda-sidebar,
  body.sidebar-open aside.revenda-sidebar {
    top: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    width: 74vw !important;
    max-width: 310px !important;
    min-width: 270px !important;
    padding-top: 86px !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    padding-bottom: 18px !important;
    background: #020617 !important;
    box-shadow: 10px 0 30px rgba(0,0,0,.45) !important;
    z-index: 100001 !important;
    overflow-y: auto !important;
  }

  body .sidebar-overlay {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    background: rgba(0,0,0,.55) !important;
    z-index: 100000 !important;
  }

  body .revenda-sidebar .sidebar-brand {
    padding-top: 0 !important;
    margin-top: 0 !important;
    padding-bottom: 14px !important;
    margin-bottom: 12px !important;
  }

  body .revenda-sidebar .sidebar-title {
    font-size: 19px !important;
    line-height: 1.15 !important;
  }

  body .revenda-sidebar .sidebar-nav {
    gap: 3px !important;
  }

  body .revenda-sidebar .sidebar-nav a {
    padding: 10px 11px !important;
    margin: 0 !important;
    border-radius: 10px !important;
    font-size: 14.5px !important;
    line-height: 1.18 !important;
  }

  body .revenda-sidebar .sidebar-brand .logo-img {
    max-width: 180px !important;
    height: auto !important;
  }
}

@media (max-width: 380px) {
  body .revenda-sidebar,
  body.sidebar-open .revenda-sidebar {
    width: 78vw !important;
    max-width: 295px !important;
    min-width: 250px !important;
  }
}




/* CORREÇÃO DEFINITIVA - MENU REVENDA COMPACTO + LINK VISÍVEL NO MODO CLARO */
@media (max-width: 900px) {
  html body .revenda-sidebar,
  html body.sidebar-open .revenda-sidebar,
  html body aside.revenda-sidebar,
  html body.sidebar-open aside.revenda-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    width: 58vw !important;
    max-width: 245px !important;
    min-width: 220px !important;
    margin: 0 !important;
    padding-top: 78px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    padding-bottom: 14px !important;
    overflow-y: auto !important;
    background: #020617 !important;
    z-index: 100001 !important;
    box-shadow: 10px 0 28px rgba(0,0,0,.42) !important;
  }

  html body .sidebar-overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0,0,0,.55) !important;
    z-index: 100000 !important;
  }

  html body .revenda-sidebar .sidebar-brand {
    margin: 0 0 8px 0 !important;
    padding: 0 0 10px 0 !important;
  }

  html body .revenda-sidebar .sidebar-brand .logo-img {
    max-width: 150px !important;
    max-height: 42px !important;
    height: auto !important;
  }

  html body .revenda-sidebar .sidebar-title {
    font-size: 16px !important;
    line-height: 1.12 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  html body .revenda-sidebar .sidebar-nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 1px !important;
  }

  html body .revenda-sidebar .sidebar-nav a {
    display: block !important;
    padding: 7px 8px !important;
    margin: 0 !important;
    border-radius: 8px !important;
    font-size: 12.7px !important;
    line-height: 1.13 !important;
    font-weight: 700 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  html body .revenda-sidebar .logout-link {
    margin-top: 8px !important;
    padding: 8px !important;
  }
}

@media (max-width: 380px) {
  html body .revenda-sidebar,
  html body.sidebar-open .revenda-sidebar {
    width: 60vw !important;
    max-width: 235px !important;
    min-width: 210px !important;
  }

  html body .revenda-sidebar .sidebar-nav a {
    font-size: 12.2px !important;
    padding: 6px 7px !important;
  }
}

/* Link da revenda legível no modo claro e escuro */
body input[readonly],
body .link-revenda-input,
body input[name="link_revenda"],
body input[value*="cadastrar_revenda.php"] {
  background: #ffffff !important;
  color: #111827 !important;
  border: 1px solid #cbd5e1 !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #111827 !important;
}

body.theme-dark input[readonly],
body.theme-dark .link-revenda-input,
body.theme-dark input[name="link_revenda"],
body.theme-dark input[value*="cadastrar_revenda.php"] {
  background: #020617 !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
  -webkit-text-fill-color: #f8fafc !important;
}

body input[readonly]::selection {
  background: #2563eb !important;
  color: #ffffff !important;
}



/* CORREÇÃO FINAL: remove espaço em cima/embaixo do menu da revenda */
@media (max-width: 900px) {
  html body .revenda-sidebar,
  html body.sidebar-open .revenda-sidebar,
  html body aside.revenda-sidebar,
  html body.sidebar-open aside.revenda-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    width: 58vw !important;
    max-width: 245px !important;
    min-width: 220px !important;
    margin: 0 !important;
    padding-top: 52px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    padding-bottom: 4px !important;
    overflow-y: auto !important;
    background: #020617 !important;
    z-index: 100001 !important;
    box-shadow: 10px 0 28px rgba(0,0,0,.42) !important;
  }

  html body .sidebar-overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0,0,0,.55) !important;
    z-index: 100000 !important;
  }

  html body .revenda-sidebar .sidebar-brand {
    margin: 0 0 6px 0 !important;
    padding: 0 0 8px 0 !important;
  }

  html body .revenda-sidebar .sidebar-brand .logo-img {
    max-width: 145px !important;
    max-height: 36px !important;
    height: auto !important;
  }

  html body .revenda-sidebar .sidebar-title {
    font-size: 15.5px !important;
    line-height: 1.1 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  html body .revenda-sidebar .sidebar-nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  html body .revenda-sidebar .sidebar-nav a {
    display: block !important;
    padding: 6px 8px !important;
    margin: 0 !important;
    border-radius: 8px !important;
    font-size: 12.4px !important;
    line-height: 1.1 !important;
    font-weight: 700 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  html body .revenda-sidebar .logout-link {
    margin-top: 5px !important;
    margin-bottom: 0 !important;
    padding: 7px 8px !important;
  }
}

@media (max-width: 380px) {
  html body .revenda-sidebar,
  html body.sidebar-open .revenda-sidebar {
    width: 60vw !important;
    max-width: 235px !important;
    min-width: 210px !important;
    padding-top: 48px !important;
  }

  html body .revenda-sidebar .sidebar-nav a {
    font-size: 12px !important;
    padding: 5.5px 7px !important;
  }
}


/* DubaiDigital fix final: bloquear itens antigos de crédito no menu */
.sidebar-nav a[href*="credito"], #admSidebar a[href*="credito"], .sidebar-nav a[href*="creditos"], #admSidebar a[href*="creditos"]{display:none!important}

/* FIX FINAL REVENDA: menu clicável acima do overlay */
@media(max-width:900px){
  html body aside#revendaSidebar.revenda-sidebar{position:fixed!important;top:0!important;left:0!important;bottom:0!important;width:min(410px,88vw)!important;max-width:min(410px,88vw)!important;min-width:280px!important;height:100dvh!important;padding:22px 17px 28px!important;background:#061022!important;color:#fff!important;z-index:899999!important;transform:translate3d(-105%,0,0)!important;opacity:1!important;visibility:visible!important;pointer-events:auto!important;overflow-y:auto!important;}
  html body aside#revendaSidebar.revenda-sidebar.dd-open,html body.dd-revenda-menu-open aside#revendaSidebar.revenda-sidebar{transform:translate3d(0,0,0)!important;}
  html body aside#revendaSidebar.revenda-sidebar,html body aside#revendaSidebar.revenda-sidebar *{opacity:1!important;visibility:visible!important;pointer-events:auto!important;}
  html body div#revendaSidebarOverlay.dd-revenda-backdrop{position:fixed!important;top:0!important;right:0!important;bottom:0!important;left:min(410px,88vw)!important;background:rgba(2,6,23,.62)!important;z-index:899998!important;display:none!important;}
  html body div#revendaSidebarOverlay.dd-revenda-backdrop.dd-open{display:block!important;}
}
