* {
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    margin: 0;
    background: #f4f6fa;
    color: #101828;
}

a {
    text-decoration: none;
}

.pagina-login {
    min-height: 100vh;
    background: #eef2f7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    width: 420px;
    background: #ffffff;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 10px 35px rgba(0,0,0,0.12);
}

.login-box h1 {
    margin: 0 0 8px;
    font-size: 30px;
}

.login-box p {
    margin: 0 0 24px;
    color: #667085;
}

.campo {
    margin-bottom: 16px;
}

.campo label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
    color: #344054;
}

.campo input,
.campo select {
    width: 100%;
    height: 44px;
    border: 1px solid #d4d8e3;
    border-radius: 10px;
    padding: 0 12px;
    outline: none;
}

.btn {
    min-height: 44px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
}

.btn-full {
    width: 100%;
}

.btn-primario {
    background: #2f6ef7;
    color: #ffffff;
}

.alerta {
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.alerta-erro {
    background: #ffe5e5;
    color: #a20000;
}

.alerta-sucesso {
    background: #dcfce7;
    color: #166534;
}

.alerta-info {
    background: #dbeafe;
    color: #1e40af;
}

.pagina-selecionar-perfil {
    min-height: 100vh;
    background: #303030;
}

.perfil-overlay {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.perfil-card {
    width: 440px;
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
}

.perfil-card-topo {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.perfil-card-topo h2 {
    margin: 0 0 8px;
    font-size: 22px;
}

.perfil-card-topo p {
    margin: 0;
    color: #667085;
    line-height: 1.45;
}

.perfil-fechar {
    width: 28px;
    height: 28px;
    border: 1px solid #9ca3af;
    border-radius: 50%;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.perfil-botoes form {
    margin-bottom: 12px;
}

.btn-perfil {
    width: 100%;
    height: 56px;
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
}

.btn-perfil-executivo {
    background: #4481eb;
}

.btn-perfil-vendedor {
    background: #ff8d3a;
}

.btn-perfil-gestor {
    background: #34d399;
}

.btn-perfil-operador {
    background: #9ca3af;
}

.btn-perfil-consulta {
    background: #8b5cf6;
}

.topo-sistema {
    min-height: 72px;
    background: #ffffff;
    border-bottom: 1px solid #e5eaf2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
}

.topo-marca {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-sistema {
    width: 42px;
    height: 42px;
    background: #4c7cf2;
    color: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    letter-spacing: -0.5px;
}

.empresa-nome {
    font-weight: bold;
    font-size: 16px;
    text-transform: uppercase;
}

.empresa-subtitulo {
    font-size: 13px;
    color: #667085;
    margin-top: 2px;
}

.topo-usuario {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-usuario {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #7d57f5;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 13px;
}

.usuario-nome {
    font-weight: bold;
    font-size: 14px;
}

.usuario-email {
    color: #667085;
    font-size: 13px;
}

.menu-usuario-links {
    display: flex;
    gap: 8px;
    margin-left: 8px;
}

.menu-usuario-links a {
    color: #2f6ef7;
    font-size: 13px;
}

.menu-principal {
    min-height: 54px;
    background: #ffffff;
    border-bottom: 1px solid #e5eaf2;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 18px;
    position: relative;
}

.menu-item {
    color: #52627a;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
}

.menu-item:hover {
    background: #eef3ff;
    color: #2f6ef7;
}

.menu-item-botao {
    background: none;
    border: none;
    cursor: pointer;
}

.menu-dropdown {
    position: relative;
}

.menu-dropdown-conteudo {
    display: none;
    position: absolute;
    top: 42px;
    left: 0;
    min-width: 270px;
    background: #ffffff;
    border: 1px solid #e5eaf2;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    z-index: 10;
    overflow: hidden;
}

.menu-dropdown-conteudo a {
    display: block;
    padding: 13px 16px;
    color: #202939;
    border-bottom: 1px solid #f0f2f7;
    font-size: 14px;
}

.menu-dropdown-conteudo a:hover {
    background: #f5f8ff;
}

.menu-dropdown:hover .menu-dropdown-conteudo {
    display: block;
}

.conteudo-principal {
    padding: 22px;
}

.pagina-card {
    background: #ffffff;
    border: 1px solid #e5eaf2;
    border-radius: 16px;
    padding: 22px;
}

.topo-pagina {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.topo-pagina h1 {
    margin: 0;
    font-size: 28px;
}

.topo-pagina p {
    margin: 6px 0 0;
    color: #667085;
}

.filtros-linha {
    display: flex;
    gap: 12px;
    margin-bottom: 22px;
    align-items: center;
}

.filtros-linha input,
.filtros-linha select {
    height: 42px;
    border: 1px solid #d4d8e3;
    border-radius: 10px;
    padding: 0 12px;
    outline: none;
}

.tabela-lista {
    width: 100%;
    border-collapse: collapse;
}

.tabela-lista th {
    background: #eef1f6;
    text-align: left;
    padding: 10px 9px;
    font-size: 13px;
}

.tabela-lista td {
    padding: 10px 9px;
    border-bottom: 1px solid #edf0f5;
    font-size: 14px;
}

.badge-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
}

.badge-ativo {
    background: #dff5e7;
    color: #178a4f;
}

.badge-inativo {
    background: #ffe2e2;
    color: #bf1d1d;
}

.rodape-lista {
    margin-top: 18px;
    color: #667085;
    font-size: 14px;
}

.lista-perfis-check {
    display: grid;
    gap: 10px;
}

.lista-perfis-check label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
}
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.switch-line {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: bold;
}

.switch-line input {
    width: 42px;
    height: 22px;
    accent-color: #111827;
}

.perfis-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.perfil-check {
    min-height: 44px;
    border: 1px solid #d9e1ec;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    cursor: pointer;
    background: #ffffff;
}

.perfil-check:hover {
    background: #f8fbff;
    border-color: #9db8ff;
}

.perfil-check input {
    width: 18px;
    height: 18px;
    accent-color: #111827;
}

.form-actions {
    border-top: 1px solid #e5eaf2;
    margin-top: 24px;
    padding-top: 22px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-secundario {
    background: #ffffff;
    color: #111827;
    border: 1px solid #d9e1ec;
    padding: 0 18px;
}

.btn-primario {
    padding: 0 18px;
}

@media (max-width: 900px) {
    .form-grid-2,
    .perfis-grid {
        grid-template-columns: 1fr;
    }
}
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.switch-line {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: bold;
}

.switch-line input {
    width: 42px;
    height: 22px;
    accent-color: #111827;
}

.perfis-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.perfil-check {
    min-height: 44px;
    border: 1px solid #d9e1ec;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    cursor: pointer;
    background: #ffffff;
}

.perfil-check:hover {
    background: #f8fbff;
    border-color: #9db8ff;
}

.perfil-check input {
    width: 18px;
    height: 18px;
    accent-color: #111827;
}

.form-actions {
    border-top: 1px solid #e5eaf2;
    margin-top: 24px;
    padding-top: 22px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-secundario {
    background: #ffffff;
    color: #111827;
    border: 1px solid #d9e1ec;
    padding: 0 18px;
}

.btn-primario {
    padding: 0 18px;
}

@media (max-width: 900px) {
    .form-grid-2,
    .perfis-grid {
        grid-template-columns: 1fr;
    }
}
.login-minimal-body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #eaf2ff 0%, #eef2ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-minimal-wrapper {
    width: 100%;
    max-width: 440px;
    text-align: center;
}

.login-minimal-logo {
    width: 52px;
    height: 52px;
    margin: 0 auto 18px;
    background: linear-gradient(135deg, #2563eb, #9333ea);
    color: #ffffff;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 19px;
}

.login-minimal-title {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    color: #111827;
}

.login-minimal-subtitle {
    margin-top: 10px;
    margin-bottom: 26px;
    color: #475569;
    font-size: 15px;
}

.login-minimal-card {
    background: #ffffff;
    border: 1px solid #dfe7f3;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    padding: 28px;
    text-align: left;
}

.login-minimal-card h2 {
    margin: 0 0 8px;
    font-size: 24px;
    color: #111827;
}

.login-minimal-card p {
    margin: 0 0 24px;
    color: #64748b;
    font-size: 14px;
}

.login-minimal-card .campo {
    margin-bottom: 14px;
}

.login-minimal-card .campo label {
    display: block;
    margin-bottom: 8px;
    color: #111827;
    font-size: 13px;
    font-weight: 600;
}

.login-minimal-card .campo input {
    width: 100%;
    height: 46px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0 14px;
    font-size: 14px;
    outline: none;
    background: #ffffff;
}

.login-minimal-card .campo input:focus {
    border-color: #111827;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.12);
}

.btn-login-dark {
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 7px;
    background: #111827;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    margin-top: 2px;
}

.btn-login-dark:hover {
    background: #020617;
}

.login-minimal-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 18px 0;
}

.btn-login-outline {
    width: 100%;
    height: 42px;
    border: 1px solid #d9e1ec;
    border-radius: 7px;
    background: #ffffff;
    color: #111827;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-login-outline:hover {
    background: #f8fafc;
}

.login-small-link {
    display: block;
    text-align: center;
    margin-top: 14px;
    color: #2563eb;
    font-size: 13px;
}

.login-minimal-card .alerta {
    margin-bottom: 16px;
}
/* ============================================================
   CORREÇÃO PONTUAL LOGIN - SISTEMA DE GESTÃO DE CEMITÉRIO
   Colar no FINAL do arquivo sistema.css
   ============================================================ */

html,
body {
    min-height: 100%;
}

body.cemi-login-body {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh !important;
    width: 100% !important;
    background: linear-gradient(135deg, #eaf2ff 0%, #eef2ff 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: Arial, Helvetica, sans-serif !important;
}

.cemi-login-page {
    width: 100% !important;
    max-width: 440px !important;
    text-align: center !important;
    padding: 24px !important;
}

.cemi-login-logo {
    width: 52px !important;
    height: 52px !important;
    margin: 0 auto 18px auto !important;
    background: linear-gradient(135deg, #2563eb, #9333ea) !important;
    color: #ffffff !important;
    border-radius: 9px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 800 !important;
    font-size: 18px !important;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.22) !important;
}

.cemi-login-title {
    margin: 0 !important;
    font-size: 28px !important;
    line-height: 1.2 !important;
    font-weight: 800 !important;
    color: #111827 !important;
    text-align: center !important;
}

.cemi-login-subtitle {
    margin-top: 10px !important;
    margin-bottom: 26px !important;
    color: #475569 !important;
    font-size: 15px !important;
    line-height: 1.4 !important;
    text-align: center !important;
}

.cemi-login-card {
    width: 100% !important;
    background: #ffffff !important;
    border: 1px solid #d7dfec !important;
    border-radius: 9px !important;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08) !important;
    padding: 28px !important;
    text-align: left !important;
}

.cemi-login-card h2 {
    margin: 0 0 8px 0 !important;
    font-size: 24px !important;
    color: #111827 !important;
    font-weight: 800 !important;
}

.cemi-login-card p {
    margin: 0 0 24px 0 !important;
    color: #64748b !important;
    font-size: 14px !important;
}

.cemi-login-field {
    margin-bottom: 14px !important;
}

.cemi-login-field label {
    display: block !important;
    margin-bottom: 8px !important;
    color: #111827 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}

.cemi-login-field input {
    width: 100% !important;
    height: 46px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 0 14px !important;
    font-size: 14px !important;
    outline: none !important;
    background: #ffffff !important;
    color: #111827 !important;
    box-sizing: border-box !important;
}

.cemi-login-field input:focus {
    border-color: #111827 !important;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.12) !important;
}

.cemi-login-field input:disabled {
    background: #f8fafc !important;
    color: #64748b !important;
}

.cemi-login-button {
    width: 100% !important;
    height: 44px !important;
    border: none !important;
    border-radius: 7px !important;
    background: #111827 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    margin-top: 2px !important;
}

.cemi-login-button:hover {
    background: #020617 !important;
}

.cemi-login-link {
    display: block !important;
    text-align: center !important;
    margin-top: 14px !important;
    color: #2563eb !important;
    font-size: 13px !important;
    text-decoration: none !important;
}

.cemi-login-link:hover {
    text-decoration: underline !important;
}

.cemi-alert-error {
    padding: 12px 14px !important;
    border-radius: 8px !important;
    margin-bottom: 16px !important;
    background: #fee2e2 !important;
    border: 1px solid #fecaca !important;
    color: #991b1b !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
}

@media (max-width: 520px) {
    .cemi-login-page {
        max-width: 100% !important;
        padding: 18px !important;
    }

    .cemi-login-card {
        padding: 22px !important;
    }

    .cemi-login-title {
        font-size: 24px !important;
    }
}
/* ============================================================
   MENU DO USUÁRIO NO TOPO
   ============================================================ */

.usuario-menu-container {
    position: relative;
}

.usuario-menu-botao {
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 10px;
}

.usuario-menu-botao:hover {
    background: #f3f6fb;
}

.usuario-menu-botao .usuario-dados {
    text-align: left;
}

.usuario-seta {
    color: #64748b;
    font-size: 16px;
    margin-left: 2px;
}

.usuario-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 52px;
    width: 270px;
    background: #ffffff;
    border: 1px solid #dfe7f3;
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
    z-index: 200;
    overflow: hidden;
}

.usuario-dropdown-aberto {
    display: block;
}

.usuario-dropdown-cabecalho {
    padding: 14px 14px 10px;
    border-bottom: 1px solid #edf1f7;
}

.usuario-dropdown-cabecalho strong {
    display: block;
    font-size: 14px;
    color: #111827;
}

.usuario-dropdown-cabecalho span {
    display: block;
    margin-top: 3px;
    font-size: 13px;
    color: #64748b;
}

.usuario-dropdown-secao {
    border-bottom: 1px solid #edf1f7;
    padding: 4px 0;
}

.usuario-dropdown-secao:last-child {
    border-bottom: none;
}

.usuario-dropdown-item {
    width: 100%;
    min-height: 34px;
    border: none;
    background: #ffffff;
    color: #111827;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}

.usuario-dropdown-item:hover {
    background: #f5f8ff;
}

.usuario-dropdown form {
    margin: 0;
}

.perfil-menu-item {
    justify-content: space-between;
}

.perfil-menu-executivo:hover,
.perfil-menu-executivo.perfil-menu-ativo {
    box-shadow: inset 0 -2px 0 #4481eb;
    background: #f3f7ff;
}

.perfil-menu-vendedor:hover,
.perfil-menu-vendedor.perfil-menu-ativo {
    box-shadow: inset 0 -2px 0 #ff8d3a;
    background: #fff7ed;
}

.perfil-menu-gestor:hover,
.perfil-menu-gestor.perfil-menu-ativo {
    box-shadow: inset 0 -2px 0 #34d399;
    background: #ecfdf5;
}

.perfil-menu-operador:hover,
.perfil-menu-operador.perfil-menu-ativo {
    box-shadow: inset 0 -2px 0 #9ca3af;
    background: #f8fafc;
}

.perfil-menu-consulta:hover,
.perfil-menu-consulta.perfil-menu-ativo {
    box-shadow: inset 0 -2px 0 #8b5cf6;
    background: #f5f3ff;
}

.usuario-check {
    color: #111827;
    font-weight: bold;
}

.usuario-dropdown-titulo {
    padding: 8px 14px 4px;
    font-size: 12px;
    color: #64748b;
    font-weight: bold;
}

.tema-bolinha {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    display: inline-block;
}

.tema-padrao {
    background: #3b82f6;
}

.tema-esmeralda {
    background: #10b981;
}

.tema-violeta {
    background: #8b5cf6;
}

.tema-midnight {
    background: #1e3a8a;
}

.tema-solarized {
    background: #b7791f;
}

.tema-opcao {
    justify-content: flex-start;
    gap: 8px;
}

.tema-opcao .tema-check {
    margin-left: auto;
}

.usuario-sair {
    color: #ef4444;
}

.usuario-sair:hover {
    background: #fff1f2;
}

/* ============================================================
   TEMAS SIMPLES
   ============================================================ */

body.tema-padrao-body {
    --cor-principal: #2f6ef7;
}

body.tema-esmeralda-body {
    --cor-principal: #10b981;
}

body.tema-violeta-body {
    --cor-principal: #8b5cf6;
}

body.tema-midnight-body {
    --cor-principal: #1e3a8a;
}

body.tema-solarized-body {
    --cor-principal: #b7791f;
}

body.tema-padrao-body .logo-sistema,
body.tema-padrao-body .avatar-usuario {
    background: #4c7cf2;
}

body.tema-esmeralda-body .logo-sistema,
body.tema-esmeralda-body .avatar-usuario {
    background: #10b981;
}

body.tema-violeta-body .logo-sistema,
body.tema-violeta-body .avatar-usuario {
    background: #8b5cf6;
}

body.tema-midnight-body .logo-sistema,
body.tema-midnight-body .avatar-usuario {
    background: #1e3a8a;
}

body.tema-solarized-body .logo-sistema,
body.tema-solarized-body .avatar-usuario {
    background: #b7791f;
}

/* ============================================================
   MODO ESCURO SIMPLES
   ============================================================ */

body.modo-escuro {
    background: #111827;
    color: #e5e7eb;
}

body.modo-escuro .topo-sistema,
body.modo-escuro .menu-principal,
body.modo-escuro .pagina-card,
body.modo-escuro .usuario-dropdown,
body.modo-escuro .menu-dropdown-conteudo {
    background: #1f2937;
    color: #e5e7eb;
    border-color: #374151;
}

body.modo-escuro .empresa-nome,
body.modo-escuro .usuario-nome,
body.modo-escuro .usuario-dropdown-cabecalho strong,
body.modo-escuro .usuario-dropdown-item,
body.modo-escuro .tabela-lista td,
body.modo-escuro .tabela-lista th {
    color: #e5e7eb;
}

body.modo-escuro .empresa-subtitulo,
body.modo-escuro .usuario-email,
body.modo-escuro .usuario-dropdown-cabecalho span,
body.modo-escuro .usuario-dropdown-titulo {
    color: #9ca3af;
}

body.modo-escuro .conteudo-principal {
    background: #111827;
}

body.modo-escuro .usuario-dropdown-item,
body.modo-escuro .menu-item-botao {
    background: transparent;
}

body.modo-escuro .usuario-dropdown-item:hover,
body.modo-escuro .menu-item:hover {
    background: #374151;
}
/* ============================================================
   DADOS DA EMPRESA
   ============================================================ */

.input-readonly {
    background: #f8fafc !important;
    color: #64748b !important;
    cursor: not-allowed !important;
}

.pagina-card h2 {
    font-size: 22px;
    margin-bottom: 24px;
}

.pagina-card form .campo label {
    font-size: 13px;
    color: #111827;
}

.pagina-card form .campo input {
    font-size: 14px;
}
/* ============================================================
   CADASTRO COMPLETO CESSIONÁRIO / NOVO CESSIONÁRIO
   ============================================================ */

.cc-window {
    background: #f3f4f6;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 14px;
}

.cc-title {
    font-weight: 800;
    color: #111827;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.cc-box {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 6px;
}

.cc-box-title {
    font-weight: 800;
    color: #0066cc;
    margin-bottom: 10px;
    font-size: 14px;
}

.cc-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 8px;
    align-items: end;
}

.cc-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cc-field label {
    font-size: 12px;
    font-weight: 700;
    color: #111827;
}

.cc-field input,
.cc-field select,
.cc-field textarea {
    height: 32px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 0 8px;
    font-size: 13px;
    background: #ffffff;
}

.cc-field textarea {
    height: 90px;
    padding: 8px;
}

.cc-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid #cbd5e1;
    padding-top: 12px;
    margin-top: 12px;
}

.cc-btn {
    border: 1px solid #94a3b8;
    background: #ffffff;
    border-radius: 6px;
    padding: 8px 14px;
    cursor: pointer;
    font-weight: 700;
    color: #111827;
    text-decoration: none;
}

.cc-btn-primary {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
}

.cc-col-1 { grid-column: span 1; }
.cc-col-2 { grid-column: span 2; }
.cc-col-3 { grid-column: span 3; }
.cc-col-4 { grid-column: span 4; }
.cc-col-5 { grid-column: span 5; }
.cc-col-6 { grid-column: span 6; }
.cc-col-7 { grid-column: span 7; }
.cc-col-8 { grid-column: span 8; }
.cc-col-9 { grid-column: span 9; }
.cc-col-10 { grid-column: span 10; }
.cc-col-12 { grid-column: span 12; }

@media (max-width: 1000px) {
    .cc-grid {
        grid-template-columns: 1fr;
    }

    .cc-col-1,
    .cc-col-2,
    .cc-col-3,
    .cc-col-4,
    .cc-col-5,
    .cc-col-6,
    .cc-col-7,
    .cc-col-8,
    .cc-col-9,
    .cc-col-10,
    .cc-col-12 {
        grid-column: span 1;
    }
}
/* ============================================================
   V45 - RESPONSIVIDADE GLOBAL / TAMANHO CONSISTENTE
   Objetivo:
   - manter fonte, campos, botões e dados em tamanho estável;
   - adaptar a largura das telas ao monitor sem cortar informações;
   - usar quebra/rolagem controlada em menus, cards e tabelas grandes;
   - evitar que monitores grandes estiquem os dados e telas menores cortem colunas.
   ============================================================ */
:root {
    --cemi-page-max-width: 1540px;
    --cemi-page-padding: 22px;
    --cemi-card-radius: 16px;
    --cemi-font-base: 14px;
    --cemi-font-small: 13px;
    --cemi-font-title: 28px;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: auto;
}

body {
    min-width: 0;
    overflow-x: hidden;
    font-size: var(--cemi-font-base);
    line-height: 1.4;
}

img,
svg,
canvas,
video,
iframe {
    max-width: 100%;
}

input,
select,
textarea,
button {
    font-size: var(--cemi-font-base);
    max-width: 100%;
}

.topo-sistema {
    width: 100%;
    min-width: 0;
    gap: 14px;
    flex-wrap: wrap;
    padding: 10px var(--cemi-page-padding);
}

.topo-marca,
.usuario-menu-botao,
.usuario-dados,
.marca-textos {
    min-width: 0;
}

.empresa-nome,
.usuario-nome,
.usuario-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-principal {
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    padding: 8px var(--cemi-page-padding);
}

.menu-item {
    white-space: nowrap;
}

.menu-dropdown-conteudo,
.usuario-dropdown {
    max-width: calc(100vw - 24px);
}

.conteudo-principal {
    width: 100%;
    max-width: var(--cemi-page-max-width);
    min-width: 0;
    margin: 0 auto;
    padding: var(--cemi-page-padding);
}

.pagina-card,
.card,
.rn-card,
.rec-card,
.rr-card,
.cc-window,
.cc-box,
.dash-panel,
.dash-kpi,
.dash-modelo-hero,
.dash-modelo-filtros {
    max-width: 100%;
    min-width: 0;
}

.topo-pagina,
.filtros-linha,
.form-actions,
.cc-footer,
.rn-actions,
.rec-actions {
    flex-wrap: wrap;
    min-width: 0;
}

.filtros-linha > *,
.form-actions > *,
.cc-footer > *,
.rn-actions > *,
.rec-actions > * {
    max-width: 100%;
}

.form-grid-2,
.perfis-grid,
.cc-grid,
.rn-grid,
.rec-grid,
.grid {
    min-width: 0;
}

.cc-field,
.rn-field,
.rec-field,
.field {
    min-width: 0;
}

.cc-field input,
.cc-field select,
.cc-field textarea,
.rn-input,
.rn-select,
.rn-textarea,
.rec-input,
.rec-select,
.rec-textarea,
.field input,
.field select,
.field textarea {
    max-width: 100%;
}

.cemi-table-scroll,
.table-wrap,
.rec-table-wrap,
.rr-table-wrap,
.cc-table-wrap,
.dash-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
}

.cemi-table-scroll > table,
.table-wrap > table,
.rec-table-wrap > table,
.rr-table-wrap > table,
.cc-table-wrap > table,
.dash-table-scroll > table {
    width: 100%;
    min-width: 760px;
}

.tabela-lista,
.data-table,
.tbl,
.dash-table,
.rn-table,
.rec-table,
.rr-table,
.cc-table {
    max-width: none;
}

.tabela-lista th,
.tabela-lista td,
.data-table th,
.data-table td,
.tbl th,
.tbl td,
.dash-table th,
.dash-table td,
.rn-table th,
.rn-table td,
.rec-table th,
.rec-table td,
.rr-table th,
.rr-table td,
.cc-table th,
.cc-table td {
    vertical-align: middle;
}

.dash-modelo-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
}

.dash-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
}

.dash-section-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)) !important;
}

.dash-kpi-value,
.dash-kpi-label,
.dash-kpi-sub,
.dash-panel h2 {
    overflow-wrap: anywhere;
}

.dash-bars,
.dash-line-scroll {
    max-width: 100%;
    overflow-x: auto;
}

.dash-line-svg {
    min-width: 620px;
}

.cemi-frame-fluid {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

@media (min-width: 1700px) {
    .conteudo-principal {
        max-width: var(--cemi-page-max-width);
    }
}

@media (max-width: 1180px) {
    :root {
        --cemi-page-padding: 18px;
    }

    .topo-pagina {
        align-items: flex-start;
        gap: 12px;
    }

    .filtros-linha {
        align-items: stretch;
    }
}

@media (max-width: 900px) {
    :root {
        --cemi-page-padding: 14px;
    }

    .topo-sistema {
        align-items: flex-start;
    }

    .usuario-menu-container {
        margin-left: auto;
    }

    .menu-principal {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 10px;
    }

    .menu-dropdown {
        flex: 0 0 auto;
    }

    .conteudo-principal {
        padding: var(--cemi-page-padding);
    }

    .pagina-card {
        padding: 16px;
    }

    .topo-pagina h1,
    .dash-modelo-hero h1 {
        font-size: var(--cemi-font-title) !important;
    }
}

@media (max-width: 640px) {
    :root {
        --cemi-page-padding: 10px;
    }

    .usuario-menu-botao .usuario-dados {
        display: none;
    }

    .topo-marca {
        max-width: calc(100% - 72px);
    }

    .pagina-card,
    .rn-card,
    .rec-card,
    .rr-card,
    .dash-panel,
    .dash-kpi,
    .dash-modelo-hero,
    .dash-modelo-filtros {
        padding: 14px;
        border-radius: 14px;
    }

    .form-actions,
    .cc-footer,
    .rn-actions,
    .rec-actions {
        justify-content: flex-start;
    }

    .form-actions .btn,
    .cc-footer .cc-btn,
    .rn-actions .rn-btn,
    .rec-actions .rec-btn {
        width: 100%;
    }
}


/* ============================================================
   V48 - ESCALA HORIZONTAL COM ALTURA REAL DO CONTEÚDO
   Objetivo:
   - manter o acerto horizontal da V47;
   - não reduzir a tela por causa da altura do monitor;
   - recalcular a altura conforme o conteúdo real para evitar grades encavaladas;
   - manter rolagem vertical normal quando a página for alta;
   - não usar rolagem horizontal como solução principal.

   Observação técnica:
   - a escala é aplicada apenas no layout interno do sistema autenticado;
   - telas de login e impressão continuam fora dessa regra.
   ============================================================ */
:root {
    --cemi-design-width-v46: 1540px;
    --cemi-design-min-height-v46: 860px;
    --cemi-current-scale: 1;
}

body.cemi-app-body {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 100vh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background: #f4f6fa !important;
}

body.cemi-app-body.modo-escuro {
    background: #111827 !important;
}

.cemi-viewport-fit {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: visible;
    background: #f4f6fa;
}

body.modo-escuro .cemi-viewport-fit {
    background: #111827;
}

.cemi-app-canvas {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--cemi-design-width-v46);
    min-height: var(--cemi-design-min-height-v46);
    transform-origin: top left;
    will-change: transform;
    background: #f4f6fa;
    padding-bottom: 24px;
}

body.modo-escuro .cemi-app-canvas {
    background: #111827;
}

body.cemi-app-body .topo-sistema,
body.cemi-app-body .menu-principal,
body.cemi-app-body .conteudo-principal {
    width: 100% !important;
    max-width: none !important;
}

body.cemi-app-body .conteudo-principal {
    margin: 0 !important;
    padding: 18px !important;
}

body.cemi-app-body .topo-sistema,
body.cemi-app-body .menu-principal {
    flex-wrap: wrap !important;
    overflow: visible !important;
}

body.cemi-app-body .menu-principal {
    min-height: 54px;
    align-content: center;
}

body.cemi-app-body .menu-dropdown-conteudo,
body.cemi-app-body .usuario-dropdown {
    max-width: none !important;
}

body.cemi-app-body .cemi-table-scroll,
body.cemi-app-body .table-wrap,
body.cemi-app-body .rec-table-wrap,
body.cemi-app-body .rr-table-wrap,
body.cemi-app-body .cc-table-wrap,
body.cemi-app-body .dash-table-scroll {
    overflow-x: visible !important;
    overflow-y: visible !important;
    max-width: 100% !important;
}

body.cemi-app-body .cemi-table-scroll > table,
body.cemi-app-body .table-wrap > table,
body.cemi-app-body .rec-table-wrap > table,
body.cemi-app-body .rr-table-wrap > table,
body.cemi-app-body .cc-table-wrap > table,
body.cemi-app-body .dash-table-scroll > table {
    width: 100% !important;
    min-width: 0 !important;
}

body.cemi-app-body table {
    max-width: 100% !important;
}

body.cemi-app-body th,
body.cemi-app-body td {
    word-break: normal;
    overflow-wrap: anywhere;
}

body.cemi-app-body .dash-line-scroll,
body.cemi-app-body .dash-bars {
    overflow-x: visible !important;
    max-width: 100% !important;
}

body.cemi-app-body .dash-line-svg {
    min-width: 0 !important;
    max-width: 100% !important;
}

body.cemi-app-body .dash-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)) !important;
}

body.cemi-app-body .dash-section-grid {
    grid-template-columns: repeat(auto-fit, minmax(470px, 1fr)) !important;
}

body.cemi-app-body .form-grid-2,
body.cemi-app-body .perfis-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

body.cemi-app-body .cc-grid,
body.cemi-app-body .rn-grid,
body.cemi-app-body .rec-grid {
    min-width: 0 !important;
}

body.cemi-app-body .form-actions .btn,
body.cemi-app-body .cc-footer .cc-btn,
body.cemi-app-body .rn-actions .rn-btn,
body.cemi-app-body .rec-actions .rec-btn {
    width: auto !important;
}

.cemi-scale-indicator {
    position: fixed;
    right: 10px;
    bottom: 8px;
    z-index: 99998;
    background: rgba(15, 23, 42, 0.72);
    color: #ffffff;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 11px;
    line-height: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s ease;
}

.cemi-scale-indicator.cemi-scale-visible {
    opacity: .78;
}

@media print {
    body.cemi-app-body {
        width: auto !important;
        height: auto !important;
        overflow: visible !important;
    }

    .cemi-viewport-fit {
        position: static !important;
        width: auto !important;
        height: auto !important;
        overflow: visible !important;
    }

    .cemi-app-canvas {
        position: static !important;
        width: auto !important;
        height: auto !important;
        transform: none !important;
    }
}


/* ============================================================
   V49 - CORREÇÃO DE ALTURA DAS GRADES DO CESSIONÁRIO
   Problema corrigido:
   - na V48, as grades do cadastro completo podiam ficar com max-height
     antigo e overflow visível ao mesmo tempo; isso fazia a tabela continuar
     por trás da próxima caixa, encavalando "Títulos dessa venda" e
     "Renegociações de Vendas".

   Regra:
   - manter a escala horizontal do sistema;
   - não reduzir a tela pela altura;
   - deixar as grades do cadastro completo ocuparem sua altura real no fluxo
     da página, sem sobrepor o bloco seguinte.
   ============================================================ */
body.cemi-app-body .cc-window .cc-tab-content .cc-table-wrap,
body.cemi-app-body .cc-window .cc-tab-content .cc-reneg-wrap,
body.cemi-app-body .cc-window .cc-tab-content .cc-sepultados-wrap {
    max-height: none !important;
    height: auto !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    display: block !important;
    position: relative !important;
    clear: both !important;
}

body.cemi-app-body .cc-window .cc-tab-content .cc-box {
    display: block !important;
    position: relative !important;
    clear: both !important;
    overflow: visible !important;
}

body.cemi-app-body .cc-window .cc-tab-content .cc-table {
    margin-bottom: 0 !important;
}

body.cemi-app-body .cc-window .cc-tab-content .cc-box + .cc-box {
    margin-top: 16px !important;
}

/* ============================================================
   V53 - TOPO E MENUS FIXOS COM ESCALA HORIZONTAL
   Regras:
   - nome da empresa e menu superior não rolam junto com as telas;
   - no cadastro do cessionário, o menu de abas fica fixo abaixo do menu superior;
   - somente o conteúdo abaixo dos menus rola verticalmente;
   - mantém a escala horizontal das V47/V49/V52.
   ============================================================ */
:root {
    --cemi-sticky-topo-height: 64px;
    --cemi-sticky-menu-height: 54px;
    --cemi-sticky-offset: 118px;
}

body.cemi-app-body .topo-sistema {
    position: sticky !important;
    top: 0 !important;
    z-index: 9000 !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .08) !important;
}

body.cemi-app-body .menu-principal {
    position: sticky !important;
    top: var(--cemi-sticky-topo-height) !important;
    z-index: 8900 !important;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .06) !important;
}

body.cemi-app-body .conteudo-principal {
    position: relative !important;
    z-index: 1 !important;
}

body.cemi-app-body .menu-dropdown-conteudo,
body.cemi-app-body .usuario-dropdown {
    z-index: 9500 !important;
}

body.cemi-app-body .cc-window .cc-tabs {
    position: sticky !important;
    top: calc(var(--cemi-sticky-offset) + 6px) !important;
    z-index: 7800 !important;
    background: #f3f4f6 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    padding: 8px 8px 0 !important;
    margin: 0 0 12px !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08) !important;
}

body.modo-escuro.cemi-app-body .cc-window .cc-tabs {
    background: #111827 !important;
}

/* ============================================================
   V54 - LAYOUT FIXO CORRETO COM ESCALA APENAS HORIZONTAL
   Correções:
   - substitui o efeito prático do transform:scale por zoom via JS;
   - o canvas volta ao fluxo normal da página;
   - topo e menu superior ficam sticky de verdade;
   - abas do cessionário ficam sticky abaixo do menu;
   - a altura não é forçada por JS, evitando encavalamento/rolagem errada.
   ============================================================ */
body.cemi-app-body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

body.cemi-app-body .cemi-viewport-fit {
    position: relative !important;
    width: 100vw !important;
    min-height: 100vh !important;
    height: auto !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
}

body.cemi-app-body .cemi-app-canvas {
    position: relative !important;
    left: 0 !important;
    top: 0 !important;
    width: var(--cemi-design-width-v46) !important;
    min-height: var(--cemi-design-min-height-v46) !important;
    height: auto !important;
    transform: none !important;
    transform-origin: top left !important;
    will-change: auto !important;
    margin: 0 auto !important;
}

body.cemi-app-body .topo-sistema {
    position: sticky !important;
    top: 0 !important;
    z-index: 30000 !important;
}

body.cemi-app-body .menu-principal {
    position: sticky !important;
    top: var(--cemi-sticky-topo-height, 64px) !important;
    z-index: 29900 !important;
}

body.cemi-app-body .conteudo-principal {
    position: relative !important;
    z-index: 1 !important;
}

body.cemi-app-body .menu-dropdown-conteudo,
body.cemi-app-body .usuario-dropdown {
    z-index: 31000 !important;
}

body.cemi-app-body .cc-window .cc-tabs {
    position: sticky !important;
    top: calc(var(--cemi-sticky-offset, 118px) + 8px) !important;
    z-index: 25000 !important;
    background: #f3f4f6 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    padding: 8px 8px 0 !important;
    margin: 0 0 12px !important;
    box-shadow: 0 12px 24px rgba(15, 23, 42, .10) !important;
}

body.modo-escuro.cemi-app-body .cc-window .cc-tabs {
    background: #111827 !important;
}

body.cemi-app-body .cc-operacional-frame {
    width: 100% !important;
    min-height: 0 !important;
    height: calc(100vh - var(--cemi-sticky-offset, 118px) - 96px) !important;
    max-height: 900px !important;
    border: 0 !important;
    overflow: auto !important;
}

body.cemi-app-body .cc-window .cc-tab-content .cc-table-wrap,
body.cemi-app-body .cc-window .cc-tab-content .cc-reneg-wrap,
body.cemi-app-body .cc-window .cc-tab-content .cc-sepultados-wrap {
    overflow: auto !important;
    max-height: calc(100vh - var(--cemi-sticky-offset, 118px) - 210px) !important;
}

body.cemi-app-body .cc-window .cc-tab-content .cc-table-wrap table,
body.cemi-app-body .cc-window .cc-tab-content .cc-reneg-wrap table,
body.cemi-app-body .cc-window .cc-tab-content .cc-sepultados-wrap table {
    margin-bottom: 0 !important;
}

body.cemi-app-body .cc-window .cc-tab-content .cc-table-wrap thead th,
body.cemi-app-body .cc-window .cc-tab-content .cc-reneg-wrap thead th,
body.cemi-app-body .cc-window .cc-tab-content .cc-sepultados-wrap thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}


/* V69 - menu superior mais baixo para liberar área útil das telas operacionais */
.topo-sistema{min-height:54px!important;padding:6px var(--cemi-page-padding)!important;}
.logo-sistema{width:34px!important;height:34px!important;border-radius:7px!important;font-size:12px!important;}
.empresa-nome{font-size:14px!important;line-height:1.05!important;}
.empresa-subtitulo{font-size:11px!important;margin-top:0!important;line-height:1.05!important;}
.usuario-menu-botao{min-height:34px!important;padding:4px 8px!important;}
.usuario-nome{font-size:12px!important;line-height:1.05!important;}
.usuario-email{font-size:11px!important;line-height:1.05!important;}
.menu-principal{min-height:38px!important;padding:4px var(--cemi-page-padding)!important;gap:5px 7px!important;}
.menu-item{padding:6px 9px!important;border-radius:7px!important;font-size:12px!important;line-height:1.1!important;}
.menu-dropdown-conteudo{top:32px!important;}


/* V70 - menu superior mais compacto e compatível com telas operacionais em página cheia */
body.cemi-app-body {
    --cemi-sticky-topo-height: 54px;
    --cemi-sticky-menu-height: 38px;
    --cemi-sticky-offset: 92px;
}
body.cemi-app-body .topo-sistema {
    min-height:54px!important;
    padding:0 14px!important;
}
body.cemi-app-body .logo-sistema,
body.cemi-app-body .avatar-usuario {
    width:36px!important;
    height:36px!important;
}
body.cemi-app-body .empresa-nome {font-size:14px!important;}
body.cemi-app-body .empresa-subtitulo,
body.cemi-app-body .usuario-email {font-size:12px!important;}
body.cemi-app-body .usuario-nome {font-size:13px!important;}
body.cemi-app-body .menu-principal {
    min-height:38px!important;
    padding:0 12px!important;
    gap:8px!important;
}
body.cemi-app-body .menu-item,
body.cemi-app-body .menu-item-botao {
    padding:6px 10px!important;
    font-size:13px!important;
    border-radius:8px!important;
}
body.cemi-app-body .cc-window .cc-tabs {
    top:calc(var(--cemi-sticky-offset) + 4px)!important;
    padding:5px 6px 0!important;
    margin-bottom:8px!important;
}
body.cemi-app-body .cc-tab-btn {
    padding:3px 7px!important;
    min-height:22px!important;
    font-size:11.5px!important;
}
/* Modal antigo V66 fica desativado por padrão nos links V70; se algum link antigo ainda acionar, fica acima do menu. */
.cc-reneg-modal-overlay { z-index:2147483000!important; padding:4px!important; }
.cc-reneg-modal { height:calc(100vh - 8px)!important; width:calc(100vw - 8px)!important; max-width:none!important; }
