/* ============================================================
   ERP Batele - Clean com Efeitos
   ============================================================ */

:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #EFF6FF;
    --success: #16A34A;
    --warning: #D97706;
    --danger: #DC2626;
    --dark: #111827;
    --text: #1F2937;
    --text-light: #6B7280;
    --border: #E5E7EB;
    --bg: #F9FAFB;
    --bg-white: #FFFFFF;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --transition: 0.2s ease;
}

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

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

/* Sidebar */
.sidebar {
    background: var(--dark) !important;
    box-shadow: 2px 0 12px rgba(0,0,0,0.15);
}

    .sidebar .top-row {
        background: rgba(255,255,255,0.02) !important;
        border-bottom: 1px solid rgba(255,255,255,0.06) !important;
        height: 48px;
    }

    .sidebar .navbar-brand {
        color: #fff !important;
        font-weight: 600;
        font-size: 1rem;
        letter-spacing: 0.3px;
    }

    .sidebar .nav-item .nav-link {
        color: #9CA3AF !important;
        padding: 8px 20px;
        font-size: 13px;
        font-weight: 400;
        border-radius: 0;
        margin: 1px 0;
        border-left: 2px solid transparent;
        transition: all var(--transition);
    }

        .sidebar .nav-item .nav-link:hover {
            color: #FFFFFF !important;
            background: rgba(255,255,255,0.08) !important;
            border-left-color: rgba(255,255,255,0.5);
            padding-left: 24px;
        }

        .sidebar .nav-item .nav-link.active {
            color: #FFFFFF !important;
            background: rgba(255,255,255,0.12) !important;
            border-left-color: #FFFFFF;
            font-weight: 500;
            box-shadow: inset 0 0 20px rgba(255,255,255,0.05);
        }

    .sidebar .nav-icon {
        display: none;
    }

    .sidebar .nav-section-label {
        color: #6B7280;
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 1px;
        padding: 16px 20px 6px;
    }

/* Top Row */
.top-row {
    background: var(--bg-white) !important;
    border-bottom: 1px solid var(--border) !important;
    height: 48px;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* Content */
.content {
    padding: 24px 32px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards */
.card {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow);
    background: var(--bg-white);
    transition: all var(--transition);
}

    .card:hover {
        box-shadow: var(--shadow-md);
        transform: translateY(-1px);
    }

.card-header {
    font-weight: 500;
    border-bottom: 1px solid var(--border) !important;
    border-radius: var(--radius) var(--radius) 0 0 !important;
    padding: 12px 20px;
    font-size: 14px;
    background: var(--bg-white);
}

    .card-header.bg-dark {
        background: var(--dark) !important;
        color: #fff !important;
        border-bottom: none !important;
    }

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg);
    border-radius: 0 0 var(--radius) var(--radius) !important;
}

/* Botões */
.btn {
    border-radius: 6px !important;
    font-weight: 500;
    padding: 7px 18px;
    font-size: 13px;
    transition: all var(--transition);
}

.btn-primary {
    background: var(--primary) !important;
    border: 1px solid var(--primary) !important;
    box-shadow: 0 1px 3px rgba(37,99,235,0.3);
}

    .btn-primary:hover {
        background: var(--primary-dark) !important;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(37,99,235,0.35);
    }

.btn-success {
    background: var(--success) !important;
    border: 1px solid var(--success) !important;
    box-shadow: 0 1px 3px rgba(22,163,74,0.3);
}

    .btn-success:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(22,163,74,0.35);
    }

.btn-outline-primary {
    color: var(--primary) !important;
    border: 1px solid var(--primary) !important;
    background: transparent !important;
}

    .btn-outline-primary:hover {
        background: var(--primary) !important;
        color: #fff !important;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(37,99,235,0.25);
    }

.btn-outline-secondary {
    color: var(--text-light) !important;
    border: 1px solid var(--border) !important;
}

    .btn-outline-secondary:hover {
        background: var(--bg) !important;
        border-color: #D1D5DB !important;
    }

.btn-outline-danger {
    color: var(--danger) !important;
    border: 1px solid var(--danger) !important;
}

    .btn-outline-danger:hover {
        background: var(--danger) !important;
        color: #fff !important;
    }

.btn-light {
    border: 1px solid var(--border) !important;
    border-radius: 6px !important;
}

/* Badges */
.badge {
    padding: 3px 10px;
    font-weight: 500;
    border-radius: 4px;
    font-size: 11px;
}

    .badge.bg-success {
        background: #ECFDF5 !important;
        color: #065F46 !important;
    }

    .badge.bg-warning {
        background: #FFFBEB !important;
        color: #92400E !important;
    }

    .badge.bg-danger {
        background: #FEF2F2 !important;
        color: #991B1B !important;
    }

    .badge.bg-info {
        background: #EFF6FF !important;
        color: #1E40AF !important;
    }

/* Alertas */
.alert {
    border: 1px solid !important;
    border-radius: var(--radius) !important;
    padding: 12px 16px;
    font-size: 13px;
    box-shadow: var(--shadow);
}

.alert-danger {
    background: #FEF2F2 !important;
    color: #991B1B !important;
    border-color: #FECACA !important;
}

.alert-success {
    background: #ECFDF5 !important;
    color: #065F46 !important;
    border-color: #A7F3D0 !important;
}

.alert-warning {
    background: #FFFBEB !important;
    color: #92400E !important;
    border-color: #FDE68A !important;
}

.alert-info {
    background: #EFF6FF !important;
    color: #1E40AF !important;
    border-color: #BFDBFE !important;
}

/* Tabelas */
.table {
    margin-bottom: 0;
}

    .table thead th {
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--text-light);
        border-bottom: 2px solid var(--border);
        padding: 10px 16px;
        background: var(--bg);
    }

    .table tbody td {
        padding: 10px 16px;
        border-bottom: 1px solid #F3F4F6;
        font-size: 13px;
    }

.table-hover tbody tr {
    transition: background var(--transition);
}

    .table-hover tbody tr:hover {
        background: #F9FAFB;
    }

/* Formulários */
.form-control, .form-select {
    border: 1px solid var(--border) !important;
    border-radius: 6px !important;
    padding: 7px 12px;
    font-size: 13px;
    transition: all var(--transition);
}

    .form-control:focus, .form-select:focus {
        border-color: var(--primary) !important;
        box-shadow: 0 0 0 3px rgba(37,99,235,0.1) !important;
    }

.form-check-input:checked {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

/* Progress */
.progress {
    background: #F3F4F6;
    border-radius: 6px;
    height: 6px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary), #3B82F6);
    border-radius: 6px;
    transition: width 0.3s ease;
}

    .progress-bar.bg-success {
        background: linear-gradient(90deg, #16A34A, #22C55E) !important;
    }

/* Error UI */
#blazor-error-ui {
    background: var(--danger);
    color: #fff;
    padding: 10px 16px;
    display: none;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 9999;
    font-size: 13px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}

    #blazor-error-ui a {
        color: #fff;
        text-decoration: underline;
        font-weight: 500;
    }

/* Seções do Menu */
.nav-section {
    cursor: pointer;
    user-select: none;
}

.nav-section-label {
    color: #6B7280;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 20px 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color var(--transition);
}

    .nav-section-label:hover {
        color: #9CA3AF;
    }

.section-arrow {
    font-size: 8px;
    transition: transform var(--transition);
}

    .section-arrow.open {
        transform: rotate(180deg);
    }

.nav-submenu {
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }

    to {
        opacity: 1;
        max-height: 200px;
    }
}

.nav-link.sub {
    padding-left: 32px !important;
    font-size: 12px !important;
}

/* Fonte maior */
html, body {
    font-size: 15px;
}

.sidebar .nav-item .nav-link {
    font-size: 14px;
    padding: 10px 20px;
}

.sidebar .nav-section-label {
    font-size: 11px;
}

.nav-link.sub {
    font-size: 13px !important;
}

.sidebar .navbar-brand {
    font-size: 1.1rem;
}

h1 {
    font-size: 1.8rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.1rem;
}

h5 {
    font-size: 1rem;
}

h6 {
    font-size: 0.9rem;
}

.card-header {
    font-size: 15px;
}

.table thead th {
    font-size: 12px;
}

.table tbody td {
    font-size: 14px;
}

.btn {
    font-size: 14px;
}

.form-control, .form-select {
    font-size: 14px;
}

.badge {
    font-size: 12px;
}

.alert {
    font-size: 14px;
}

/* Componentes Padronizados */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

    .page-header h3 {
        margin: 0;
        font-weight: 600;
    }

.abas-modernas {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}

.aba-pilula {
    border: 1px solid var(--border);
    background: var(--bg-white);
    color: var(--text-light);
    border-radius: 999px;
    padding: 0.45rem 1.1rem;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition);
}

    .aba-pilula:hover {
        background: var(--bg);
        color: var(--text);
    }

    .aba-pilula.active {
        background: var(--primary);
        border-color: var(--primary);
        color: #fff;
    }

.form-painel {
    border-color: var(--primary) !important;
}

    .form-painel .card-header {
        background: var(--primary) !important;
        color: #fff !important;
    }

.table-sm td, .table-sm th {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

.nav-link.sub {
    padding-left: 32px !important;
    font-size: 13px !important;
    color: #9CA3AF !important;
    border-left: 2px solid transparent !important;
    transition: all var(--transition);
}

    .nav-link.sub:hover {
        color: #FFFFFF !important;
        background: rgba(255,255,255,0.06) !important;
        border-left-color: rgba(255,255,255,0.4) !important;
        padding-left: 36px !important;
    }

    .nav-link.sub.active {
        color: #FFFFFF !important;
        background: rgba(255,255,255,0.1) !important;
        border-left-color: #FFFFFF !important;
        font-weight: 500;
    }

/* PWA - Safe Area */
body {
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

::selection {
    background: #111;
    color: #fff;
}

input:focus, select:focus, textarea:focus, button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

/* ============================================================
   MOBILE — só abaixo de 768px
   Regras gerais (btn, badge, etc.) ficam dentro de .tabela-mobile
   para não vazar para o resto do layout
   ============================================================ */
@media (max-width: 768px) {

    html, body {
        font-size: 14px;
        overflow-x: hidden;
        width: 100%;
    }

    body {
        line-height: 1.6 !important;
    }

    .content {
        padding: 12px !important;
    }

    h1 {
        font-size: 1.4rem !important;
    }

    h2 {
        font-size: 1.2rem !important;
    }

    h3 {
        font-size: 1rem !important;
    }

    h4 {
        font-size: 0.9rem !important;
    }

    .card {
        margin-bottom: 10px;
    }

    .aba-pilula {
        font-size: 0.75rem;
        padding: 5px 12px;
    }

    /* Esconde colunas marcadas como secundárias no mobile */
    .hide-mobile {
        display: none !important;
    }

    /* ── Tudo abaixo só afeta tabelas marcadas com .tabela-mobile ── */

    .tabela-mobile thead th {
        font-size: 0.6rem;
        padding: 5px 3px;
        white-space: nowrap;
        letter-spacing: 0;
    }

    .tabela-mobile tbody td {
        font-size: 0.68rem;
        padding: 5px 3px;
    }

    .tabela-mobile .btn-sm {
        font-size: 0.65rem;
        padding: 3px 6px;
    }

    .tabela-mobile .badge {
        font-size: 0.6rem !important;
        padding: 2px 5px !important;
    }

    .tabela-mobile code {
        font-size: 0.62rem;
        padding: 1px 3px;
    }

    /* Trunca texto com ... (conteúdo completo fica no title) */
    .tabela-mobile .truncate {
        max-width: 70px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
        vertical-align: middle;
        cursor: default;
    }

    .tabela-mobile .truncate-sm {
        max-width: 50px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
        vertical-align: middle;
        cursor: default;
    }

    /* Oculta coluna específica dentro da tabela mobile */
    .tabela-mobile .col-mobile-hide {
        display: none !important;
    }
}
/* ============================================================
   BOTÕES DE ÍCONE MINIMALISTAS (MOBILE ONLY)
   ============================================================ */
.show-mobile {
    display: none !important;
}

.hide-mobile {
    display: block;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    background: white;
    color: #666;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.15s;
    padding: 0;
    text-decoration: none;
    vertical-align: middle;
}

.btn-icon-danger:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.btn-icon-primary:hover {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}

.btn-icon-success:hover {
    background: #ecfdf5;
    color: #16a34a;
    border-color: #a7f3d0;
}

@media (max-width: 768px) {
    .show-mobile {
        display: block !important;
    }

    .btn-icon.show-mobile {
        display: inline-flex !important;
    }

    .hide-mobile {
        display: none !important;
    }
}
/* =========================================================
   Layout principal ERPBatele - sidebar recolhível
   ========================================================= */
:root {
    --erp-sidebar-expanded: 260px;
    --erp-sidebar-collapsed: 76px;
    --erp-sidebar-bg: #FCFCFD;
    --erp-sidebar-bg-deep: #F3F4F6;
    --erp-page-bg: #f4f7fb;
    --erp-topbar-height: 58px;
    --erp-layout-transition: 250ms cubic-bezier(.4, 0, .2, 1);
}

html, body {
    background: var(--erp-page-bg);
}

    body.erp-menu-open {
        overflow: hidden;
    }

.offline-bar {
    display: none;
    text-align: center;
    padding: 3px;
    font-size: .7rem;
    font-weight: 600;
    background: #fff3cd;
    color: #664d03;
}

body.offline-mode .offline-bar {
    display: block;
}

.erp-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--erp-sidebar-expanded) minmax(0, 1fr);
    background: var(--erp-page-bg);
    transition: grid-template-columns var(--erp-layout-transition);
}

    .erp-layout.sidebar-collapsed {
        grid-template-columns: var(--erp-sidebar-collapsed) minmax(0, 1fr);
    }

.erp-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    min-width: 0;
    overflow: hidden;
    z-index: 1035;
    background: linear-gradient(180deg, var(--erp-sidebar-bg) 0%, var(--erp-sidebar-bg-deep) 100%);
    border-right: 1px solid #E5E7EB;
    box-shadow: 5px 0 18px rgba(15, 23, 42, .06);
}

.erp-workspace {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.erp-topbar {
    height: var(--erp-topbar-height);
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 22px;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(15,23,42,.04);
    backdrop-filter: blur(8px);
}

.topbar-left,
.user-info {
    display: flex;
    align-items: center;
}

.menu-toggle {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #0f2747;
    font-size: 1.45rem;
    transition: background-color .16s ease, transform .16s ease;
}

    .menu-toggle:hover {
        background: #edf4fb;
    }

    .menu-toggle:active {
        transform: scale(.96);
    }

.topbar-brand-mobile {
    display: none;
}

.user-info {
    gap: 10px;
    color: #334155;
    font-size: .86rem;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #e8f1fb;
    color: #0b4f8a;
}

.money-privacy-button {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border: 1px solid #d9e2ec;
    border-radius: 9px;
    background: #fff;
    color: #475569;
    font-size: .8rem;
    transition: background-color .16s ease, color .16s ease, border-color .16s ease;
}

    .money-privacy-button:hover {
        border-color: #bfdbfe;
        background: #eff6ff;
        color: #1d4ed8;
    }

    .money-privacy-button.is-hidden {
        border-color: #bfdbfe;
        background: #eff6ff;
        color: #1d4ed8;
    }

.valor-monetario {
    white-space: nowrap;
}

.logout-button,
.login-button {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border: 1px solid #d9e2ec;
    border-radius: 9px;
    background: #fff;
    color: #475569;
    text-decoration: none;
    font-size: .8rem;
}

    .logout-button:hover,
    .login-button:hover {
        background: #f8fafc;
        color: #0f2747;
    }

.erp-content {
    flex: 1;
    min-width: 0;
    padding: 20px 22px 28px;
    overflow-x: auto;
}

.menu-backdrop {
    display: none;
}

@media (max-width: 991.98px) {
    .erp-layout,
    .erp-layout.sidebar-collapsed {
        display: block;
        min-height: 100vh;
    }

    .erp-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(84vw, 310px);
        height: 100dvh;
        transform: translateX(-102%);
        transition: transform var(--erp-layout-transition);
        box-shadow: 18px 0 45px rgba(2, 15, 35, .28);
    }

    .erp-layout.mobile-menu-open .erp-sidebar {
        transform: translateX(0);
    }

    .menu-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1030;
        border: 0;
        background: rgba(2, 15, 35, .52);
        animation: erpBackdropIn .2s ease;
    }

    .erp-topbar {
        height: 56px;
        padding: 0 12px;
        position: sticky;
    }

    .topbar-left {
        width: 42px;
        min-width: 42px;
        gap: 0;
    }

    .topbar-brand-mobile {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        align-items: center;
        justify-content: center;
        width: 112px;
        height: 46px;
        pointer-events: none;
    }

        .topbar-brand-mobile img {
            display: block;
            width: 104px;
            height: 42px;
            object-fit: contain;
            object-position: center;
        }

    .user-info {
        min-width: 42px;
        justify-content: flex-end;
    }

    .user-name,
    .logout-button span,
    .money-privacy-label {
        display: none;
    }

    .money-privacy-button {
        width: 34px;
        height: 34px;
        justify-content: center;
        padding: 0;
    }

    .erp-content {
        padding: 14px 12px 22px;
    }
}

@keyframes erpBackdropIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .erp-layout,
    .erp-sidebar,
    .menu-backdrop {
        transition: none !important;
        animation: none !important;
    }
}

/* =========================================================
   Correção visual do menu lateral - ERPBatele
   Mantém os estilos dos módulos internos intactos.
   ========================================================= */
.erp-sidebar .erp-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .erp-sidebar .erp-nav a.erp-nav-link,
    .erp-sidebar .erp-nav button.section-button {
        width: 100%;
        min-height: 42px;
        display: flex !important;
        align-items: center !important;
        gap: 12px;
        padding: 10px 12px !important;
        margin: 0 !important;
        border: 0 !important;
        border-radius: 9px !important;
        background: transparent !important;
        color: #1F2937 !important;
        text-decoration: none !important;
        font-size: .88rem !important;
        font-weight: 500;
        line-height: 1.2;
        text-align: left;
        white-space: nowrap;
        box-shadow: none !important;
        transition: background-color .16s ease, color .16s ease, transform .16s ease;
    }

        .erp-sidebar .erp-nav a.erp-nav-link > i,
        .erp-sidebar .erp-nav button.section-button > i:first-child {
            width: 20px;
            min-width: 20px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: #4B5563 !important;
            font-size: 1rem;
        }

        .erp-sidebar .erp-nav a.erp-nav-link:hover,
        .erp-sidebar .erp-nav button.section-button:hover {
            color: #111827 !important;
            background: #F3F4F6 !important;
        }

        .erp-sidebar .erp-nav a.erp-nav-link.active {
            color: #ffffff !important;
            background: #E5E7EB !important;
            color: #111827 !important;
            box-shadow: none !important;
        }

            .erp-sidebar .erp-nav a.erp-nav-link.active > i,
            .erp-sidebar .erp-nav a.erp-nav-link:hover > i,
            .erp-sidebar .erp-nav button.section-button:hover > i:first-child {
                color: #111827 !important;
            }

.erp-sidebar .nav-section {
    margin-top: 3px;
    border-radius: 11px;
    overflow: hidden;
}

    .erp-sidebar .nav-section.open {
        background: #F8FAFC;
        box-shadow: inset 0 0 0 1px #E5E7EB;
    }

.erp-sidebar .section-button {
    color: #111827 !important;
    font-weight: 650 !important;
}

.erp-sidebar .section-arrow {
    margin-left: auto;
    color: #6B7280 !important;
    font-size: .7rem;
}

.erp-sidebar .nav-submenu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0 6px;
    transition: max-height .26s ease, opacity .18s ease, padding .2s ease;
}

.erp-sidebar .nav-section.open .nav-submenu {
    max-height: 420px;
    opacity: 1;
    padding: 2px 6px 8px;
}

.erp-sidebar .erp-nav a.sub-link {
    min-height: 37px;
    padding: 8px 10px 8px 16px !important;
    border-radius: 8px !important;
    color: #374151 !important;
    font-size: .82rem !important;
    font-weight: 450 !important;
}

    .erp-sidebar .erp-nav a.sub-link > i {
        width: 18px;
        min-width: 18px;
        font-size: .92rem;
        color: #6B7280 !important;
    }

    .erp-sidebar .erp-nav a.sub-link:hover {
        color: #111827 !important;
        background: #EEF2F7 !important;
    }

    .erp-sidebar .erp-nav a.sub-link.active {
        color: #111827 !important;
        background: #E5E7EB !important;
        box-shadow: inset 3px 0 0 #9CA3AF !important;
    }

.erp-sidebar .brand-area {
    padding-left: 16px;
    padding-right: 16px;
}

.erp-sidebar .brand-full {
    width: 154px;
    height: 98px;
    object-fit: contain;
    object-position: center;
    filter: none;
}

.erp-sidebar .brand-symbol {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: none;
}

.erp-layout.sidebar-collapsed .erp-sidebar .erp-nav a.erp-nav-link,
.erp-layout.sidebar-collapsed .erp-sidebar .erp-nav button.section-button {
    justify-content: center !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
}

.erp-layout.sidebar-collapsed .erp-sidebar .nav-text,
.erp-layout.sidebar-collapsed .erp-sidebar .section-arrow,
.erp-layout.sidebar-collapsed .erp-sidebar .nav-submenu {
    display: none !important;
}

@media (max-width: 991.98px) {
    .erp-sidebar .brand-area {
        height: 112px !important;
        display: flex;
        align-items: center;
        justify-content: center !important;
        padding: 12px 20px !important;
    }

    .erp-sidebar .brand-full {
        display: block !important;
        width: 145px !important;
        height: 92px !important;
        margin: 0 auto !important;
    }

    .erp-sidebar .brand-symbol {
        display: none !important;
    }

    .erp-layout.sidebar-collapsed .erp-sidebar .nav-text,
    .erp-layout.sidebar-collapsed .erp-sidebar .section-arrow {
        display: inline !important;
    }

    .erp-layout.sidebar-collapsed .erp-sidebar .nav-submenu {
        display: flex !important;
    }

    .erp-layout.sidebar-collapsed .erp-sidebar .erp-nav a.erp-nav-link,
    .erp-layout.sidebar-collapsed .erp-sidebar .erp-nav button.section-button {
        justify-content: flex-start !important;
    }

    .topbar-brand-mobile {
        left: 50% !important;
        right: auto !important;
        transform: translate(-50%, -50%) !important;
        width: 94px !important;
        height: 46px !important;
    }

        .topbar-brand-mobile img {
            width: 88px !important;
            height: 44px !important;
            object-fit: contain !important;
            object-position: center !important;
        }
}

/* Ajustes finais do menu: controle interno no desktop */
@media (min-width: 992px) {
    .erp-topbar .mobile-menu-toggle {
        display: none !important;
    }
}

@media (max-width: 991.98px) {
    .erp-topbar .mobile-menu-toggle {
        display: inline-flex !important;
    }
}

.erp-sidebar .brand-area {
    position: relative !important;
    height: 96px !important;
    min-height: 96px !important;
    padding: 8px 46px 8px 16px !important;
}

.erp-sidebar .brand-full {
    width: 156px !important;
    height: 82px !important;
    image-rendering: auto !important;
}

.erp-sidebar .erp-nav a.erp-nav-link,
.erp-sidebar .erp-nav button.section-button {
    color: #1F2937 !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
}

    .erp-sidebar .erp-nav a.erp-nav-link > i,
    .erp-sidebar .erp-nav button.section-button > i:first-child {
        color: #4B5563 !important;
        font-size: 1.06rem !important;
    }

.erp-sidebar .erp-nav a.sub-link {
    color: #374151 !important;
    font-size: .94rem !important;
    font-weight: 500 !important;
}

    .erp-sidebar .erp-nav a.sub-link > i {
        color: #6B7280 !important;
        font-size: .98rem !important;
    }

.erp-layout.sidebar-collapsed .erp-sidebar .brand-area {
    height: 104px !important;
    min-height: 104px !important;
    padding: 10px 8px 44px !important;
}

@media (max-width: 991.98px) {
    .erp-sidebar .brand-area,
    .erp-layout.sidebar-collapsed .erp-sidebar .brand-area {
        height: 112px !important;
        min-height: 112px !important;
        padding: 12px 20px !important;
    }

    .erp-sidebar .brand-full,
    .erp-layout.sidebar-collapsed .erp-sidebar .brand-full {
        width: 150px !important;
        height: 92px !important;
    }
}


/* =========================================================
   TEMA CLARO DEFINITIVO DA SIDEBAR
   Mantém recolhimento no desktop e menu deslizante no mobile.
   ========================================================= */
.erp-sidebar {
    background: linear-gradient(180deg, #FCFCFD 0%, #F3F4F6 100%) !important;
    border-right: 1px solid #E5E7EB !important;
    box-shadow: 5px 0 18px rgba(15, 23, 42, .06) !important;
}

    .erp-sidebar .erp-nav a.erp-nav-link,
    .erp-sidebar .erp-nav button.section-button {
        color: #1F2937 !important;
    }

        .erp-sidebar .erp-nav a.erp-nav-link > i,
        .erp-sidebar .erp-nav button.section-button > i:first-child {
            color: #4B5563 !important;
        }

        .erp-sidebar .erp-nav a.erp-nav-link:hover,
        .erp-sidebar .erp-nav button.section-button:hover {
            color: #111827 !important;
            background: #F3F4F6 !important;
        }

        .erp-sidebar .erp-nav a.erp-nav-link.active {
            color: #111827 !important;
            background: #E5E7EB !important;
            box-shadow: none !important;
        }

            .erp-sidebar .erp-nav a.erp-nav-link.active > i {
                color: #111827 !important;
            }

    .erp-sidebar .nav-section.open {
        background: #F8FAFC !important;
        box-shadow: inset 0 0 0 1px #E5E7EB !important;
    }

    .erp-sidebar .section-button {
        color: #111827 !important;
    }

    .erp-sidebar .section-arrow {
        color: #6B7280 !important;
    }

    .erp-sidebar .erp-nav a.sub-link {
        color: #374151 !important;
    }

        .erp-sidebar .erp-nav a.sub-link > i {
            color: #6B7280 !important;
        }

        .erp-sidebar .erp-nav a.sub-link:hover {
            color: #111827 !important;
            background: #EEF2F7 !important;
        }

        .erp-sidebar .erp-nav a.sub-link.active {
            color: #111827 !important;
            background: #E5E7EB !important;
            box-shadow: inset 3px 0 0 #9CA3AF !important;
        }


/* Correção da cor dos botões hambúrguer */
.menu-toggle,
.menu-toggle i,
.mobile-menu-toggle,
.mobile-menu-toggle i,
.sidebar-toggle,
.sidebar-toggle i {
    color: #1F2937 !important;
}

    .menu-toggle:hover,
    .mobile-menu-toggle:hover,
    .sidebar-toggle:hover {
        background: #F3F4F6 !important;
    }

/* ============================================================
   PADRÃO RESPONSIVO ERP — Catálogo como referência
   Normaliza páginas legadas e modernas sem alterar comportamento.
   ============================================================ */
.form-painel {
    border-color: var(--border) !important;
}

.form-painel .card-header {
    background: var(--bg-white) !important;
    color: var(--text) !important;
    border-bottom: 1px solid var(--border) !important;
}

.erp-responsive-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: .5rem;
}

.table-responsive,
.erp-table-scroll {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.modal-content {
    max-width: 100%;
}

@media (max-width: 1199.98px) {
    .content,
    .erp-content {
        min-width: 0;
    }

    .content {
        padding: 18px 20px;
    }

    .content > *,
    .content .row,
    .content [class*="col-"],
    .content .card,
    .content .card-body,
    .content .card-header,
    .content .input-group,
    .content .form-control,
    .content .form-select {
        min-width: 0;
    }

    .page-header,
    .content [class*="mobile-header"] {
        gap: .75rem;
        flex-wrap: wrap;
    }

    .page-header > .d-flex,
    .card-header > .d-flex,
    .card-header > div,
    .modal-header > .d-flex {
        min-width: 0;
        flex-wrap: wrap;
    }

    .content [class*="toolbar"],
    .content [class*="filter-bar"] {
        max-width: 100%;
        min-width: 0;
    }

    .content .btn-group,
    .content .btn-toolbar {
        flex-wrap: wrap;
    }

    .modal-dialog,
    .modal-dialog.modal-lg,
    .modal-dialog.modal-xl {
        width: auto;
        max-width: calc(100vw - 32px);
        margin-left: auto;
        margin-right: auto;
    }

    .modal-body {
        min-width: 0;
        overflow-x: hidden;
    }

    .modal-body .table-responsive {
        overflow-x: auto;
    }

    .modal-body .row > [class*="col-"] {
        min-width: 0;
    }
}

@media (max-width: 767.98px) {
    .content {
        padding: 12px !important;
    }

    .page-header,
    .content [class*="mobile-header"] {
        align-items: flex-start !important;
        margin-bottom: 1rem;
    }

    .page-header h1,
    .page-header h2,
    .page-header h3,
    .page-header h4,
    .content [class*="mobile-header"] h1,
    .content [class*="mobile-header"] h2,
    .content [class*="mobile-header"] h3,
    .content [class*="mobile-header"] h4 {
        overflow-wrap: anywhere;
    }

    .erp-responsive-actions,
    .page-header > .d-flex:last-child {
        width: 100%;
        justify-content: flex-start;
    }

    .erp-responsive-actions .btn,
    .page-header > .d-flex:last-child .btn {
        min-height: 38px;
    }

    .content [class*="toolbar"],
    .content [class*="filter-bar"] {
        width: 100%;
    }

    .content [class*="toolbar"] > *,
    .content [class*="filter-bar"] > * {
        min-width: 0 !important;
        max-width: 100%;
    }

    .card {
        max-width: 100%;
    }

    .card-header,
    .card-body,
    .card-footer {
        padding-left: .75rem;
        padding-right: .75rem;
    }

    .modal-dialog,
    .modal-dialog.modal-lg,
    .modal-dialog.modal-xl,
    .modal-dialog.modal-dialog-centered {
        width: auto;
        max-width: none;
        margin: .5rem;
        min-height: calc(100% - 1rem);
    }

    .modal-content {
        border-radius: 12px !important;
    }

    .modal-header {
        padding: .85rem 1rem !important;
        align-items: flex-start;
        gap: .75rem;
    }

    .modal-header .modal-title {
        font-size: 1rem;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }

    .modal-body {
        padding: .85rem 1rem !important;
    }

    .modal-footer {
        padding: .75rem 1rem !important;
        display: flex;
        flex-wrap: wrap;
        gap: .5rem;
    }

    .modal-footer .btn {
        min-height: 38px;
    }

    .pagination {
        flex-wrap: wrap;
        gap: .2rem;
    }

    .pagination .page-link {
        min-width: 34px;
        min-height: 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: .35rem .55rem;
    }

    .table-responsive {
        border-radius: 8px;
    }

    .table-responsive > .table {
        margin-bottom: 0;
    }
}

@media (max-width: 430px) {
    .modal-footer .btn:not(.btn-icon),
    .erp-responsive-actions .btn:not(.btn-icon) {
        flex: 1 1 auto;
    }
}
