/* ===================================================================
   Tema "Pro Clarity v2.1" - O Clássico, Refinado e Responsivo
   =================================================================== */

:root {
    --primary-blue: #3b82f6; --primary-blue-hover: #2563eb;
    --primary-green: #10b981; --primary-green-hover: #059669;
    --danger-red: #ef4444; --danger-red-hover: #dc2626;
    --bg-light: #f8fafc; --surface-light: #ffffff; --border-light: #e2e8f0;
    --text-dark: #1e293b; --text-muted-light: #64748b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* --- Estilos de Fracionamento de Produtos --- */
.fracionamento-card {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    margin-bottom: 1rem;
}

.fracionamento-card .card-body h5 {
    color: #0369a1;
    margin-bottom: 1rem;
}

.fracionamento-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- Estilos Gerais e Base --- */
*, *::before, *::after { box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--bg-light); color: var(--text-dark);
    line-height: 1.5; margin: 0; padding-top: 56px;
    font-size: 14px;
}
.container {
    background-color: var(--surface-light); padding: 1rem 1.5rem;
    border-radius: 10px; box-shadow: var(--shadow-md);
    width: 99%; max-width: none; margin: 0.75rem auto;
    border: 1px solid var(--border-light);
}
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.025em; margin: 0; }

/* --- Navegação — Reset completo contra Bootstrap 4 --- */
.main-header,
.main-header *,
.main-header *::before,
.main-header *::after {
    box-sizing: border-box;
}
/* Anular reset do Bootstrap nos elementos do header */
.main-header ul,
.main-header ol { margin: 0; padding: 0; list-style: none; }
.main-header li { margin: 0; padding: 0; }
.main-header a { text-decoration: none; }

.main-header {
    background-color: var(--surface-light);
    width: 100%;
    position: fixed;
    top: 0; left: 0;
    z-index: 1050;
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    height: 56px;
}
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    max-width: none;
    margin: 0 auto;
    padding: 0 1.5rem;
}
.nav-brand {
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--text-dark);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}
.menu-toggle span { display: block; width: 25px; height: 2px; background-color: var(--text-dark); transition: all 0.3s ease; }
.menu-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.is-active span:nth-child(2) { opacity: 0; }
.menu-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile: menu fullscreen overlay */
.main-nav {
    display: none;
    position: fixed;
    top: 56px; left: 0; right: 0; bottom: 0;
    background-color: var(--surface-light);
    box-shadow: var(--shadow-md);
    padding: 1rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1049;
}
.main-nav.is-open { display: block; }
body.menu-open { overflow: hidden; }
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav li { margin: 0; padding: 0; }
.main-nav a {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-muted-light);
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.4;
    background: none;
    border: none;
}
.main-nav a:hover,
.main-nav a:focus {
    background-color: var(--bg-light);
    color: var(--primary-blue);
    text-decoration: none;
}
.submenu { display: none; padding-left: 1rem; }
.has-submenu.is-open > a { background-color: var(--bg-light); color: var(--primary-blue); }
.has-submenu.is-open > .submenu { display: block; }

/* --- Componentes --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.4rem 0.875rem; font-size: 0.8rem; font-weight: 600;
    border-radius: 6px; border: 1px solid transparent; cursor: pointer;
    text-decoration: none; transition: all 0.2s ease;
}
.btn-primary { background-color: var(--primary-blue); color: white; border-color: var(--primary-blue); }
.btn-primary:hover { background-color: var(--primary-blue-hover); }
.btn-secondary { background-color: var(--surface-light); color: var(--text-dark); border-color: var(--border-light); }
.btn-secondary:hover { background-color: var(--bg-light); }

.form-control {
    width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border-light);
    border-radius: 6px; font-size: 0.875rem; color: var(--text-dark);
    background-color: var(--bg-light); transition: all 0.2s;
}
.form-control:focus { outline: none; border-color: var(--primary-blue); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }

.card-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; gap: 1rem; }
.search-form { margin-bottom: 1.5rem; }
.search-form form { display: flex; gap: 0.5rem; }
.search-form .form-group { flex-grow: 1; margin: 0; }

.table-wrapper { overflow-x: auto; border: 1px solid var(--border-light); border-radius: 8px; width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border-light); white-space: nowrap; }
th { background-color: var(--bg-light); font-weight: 600; color: var(--text-muted-light); }
tbody tr:hover { background-color: var(--bg-light); }
tbody tr:last-child td { border-bottom: none; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 0.25rem; margin-top: 0.75rem; flex-wrap: wrap; }
.pagination a, .pagination span, .pagination .page-link {
    padding: 0.3rem 0.5rem; border-radius: 4px; border: 1px solid var(--border-light);
    text-decoration: none; color: var(--text-dark); background-color: var(--surface-light);
    font-size: 0.75rem; min-width: 28px; text-align: center; display: inline-flex;
    align-items: center; justify-content: center;
}
.pagination a:hover, .pagination .page-link:hover { background-color: var(--primary-blue); color: white; border-color: var(--primary-blue); }
.pagination .active, .pagination .page-item.active .page-link { background-color: var(--primary-blue); color: white; border-color: var(--primary-blue); font-weight: 600; }
.pagination .disabled, .pagination .page-item.disabled .page-link { color: var(--text-muted-light); background-color: var(--bg-light); cursor: not-allowed; opacity: 0.6; }
.pagination .ellipsis { border: none; background: none; }
.pagination-info { text-align: center; color: var(--text-muted-light); font-size: 0.75rem; margin-top: 0.5rem; }

.flash-alert { padding: 1rem; margin-bottom: 1.5rem; border-radius: 8px; border: 1px solid transparent; }
.flash-alert.success { background-color: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.flash-alert.danger { background-color: #fef2f2; color: #991b1b; border-color: #fecaca; }

/* --- Responsividade --- */
@media (max-width: 768px) {
    .hide-mobile { display: none; }
    h1 { font-size: 1.5rem; }
    .card-header { flex-direction: column; align-items: flex-start; }
}

@media (min-width: 769px) {
    .menu-toggle { display: none !important; }

    .main-nav {
        display: flex !important;
        position: static;
        background: none;
        box-shadow: none;
        padding: 0;
        overflow: visible;
        bottom: auto;
        z-index: auto;
        height: 56px;
        align-items: stretch;
    }

    .main-nav > ul {
        display: flex !important;
        align-items: center;
        gap: 0;
        height: 56px;
        margin: 0;
        padding: 0;
        list-style: none;
        flex-wrap: nowrap;
    }

    .main-nav > ul > li {
        display: flex;
        align-items: center;
        height: 56px;
        margin: 0;
        padding: 0;
    }

    .main-nav > ul > li > a {
        display: flex;
        align-items: center;
        height: 56px;
        padding: 0 0.875rem;
        font-size: 0.875rem;
        font-weight: 500;
        color: var(--text-dark);
        white-space: nowrap;
        border-radius: 0;
        background: none;
        border: none;
        border-bottom: 2px solid transparent;
        transition: color 0.2s, border-color 0.2s;
    }

    .main-nav > ul > li > a:hover,
    .main-nav > ul > li > a:focus {
        color: var(--primary-blue);
        background: none;
        border-bottom-color: var(--primary-blue);
        text-decoration: none;
    }

    .has-submenu { position: relative; }

    .has-submenu:hover > .submenu,
    .has-submenu:focus-within > .submenu { display: block; }

    .submenu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: var(--surface-light);
        box-shadow: var(--shadow-lg);
        min-width: 230px;
        border-radius: 8px;
        padding: 0.5rem;
        border: 1px solid var(--border-light);
        z-index: 1051;
        margin: 0;
        list-style: none;
    }

    .submenu li {
        margin: 0;
        padding: 0;
    }

    .submenu li a {
        display: block;
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        color: var(--text-dark);
        border-radius: 6px;
        font-weight: 400;
        white-space: nowrap;
        height: auto;
        border-bottom: none;
        background: none;
    }

    .submenu li a:hover {
        background-color: var(--bg-light);
        color: var(--primary-blue);
        text-decoration: none;
        border-bottom: none;
    }
}

/* --- Tabela de Busca de Clientes no Modal --- */
#modalBuscaClientes #tabelaClientes.table-hover th:nth-child(1),
#modalBuscaClientes #tabelaClientes.table-hover td:nth-child(1) {
    width: 30% !important;
    max-width: none !important;
    min-width: 200px !important;
    padding: 0.5rem !important;
    text-align: left !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

#modalBuscaClientes #tabelaClientes.table-hover th,
#modalBuscaClientes #tabelaClientes.table-hover td {
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

#modalBuscaClientes #tabelaClientes.table-hover td:first-child strong {
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    color: #1a365d !important;
    display: block !important;
    line-height: 1.4 !important;
    white-space: normal !important;
}

#modalBuscaClientes #tabelaClientes {
    table-layout: auto !important;
}

/* --- Adições para a Página de Relatórios --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px; /* pill shape */
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success {
    background-color: #f0fdf4; /* green-50 */
    color: #166534; /* green-800 */
}

.progress-bar-container {
    width: 100%;
    min-width: 150px;
    background-color: var(--bg-light);
    border-radius: 8px;
    height: 1rem;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-green);
    transition: width 0.5s ease-in-out;
}

/* --- Adições para a Página de Vendas --- */
.venda-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #6366f1 100%);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.25);
    position: relative;
    overflow: hidden;
}

.venda-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
}

.venda-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.15rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.venda-header h1 i {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

.venda-header p {
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    font-size: 0.8rem;
}

.venda-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 992px) {
    .venda-grid {
        grid-template-columns: 1.6fr 1fr;
    }
}

@media (min-width: 1400px) {
    .venda-grid {
        grid-template-columns: 2fr 1fr;
    }
}

.venda-main {
    background: var(--surface-light);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-light);
    transition: box-shadow 0.3s ease;
}

.venda-main:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
}

.venda-main h2 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-blue);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.venda-sidebar {
    background: var(--surface-light);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-light);
    position: sticky;
    top: 65px;
    transition: all 0.3s ease;
}

.venda-sidebar:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
}

.venda-sidebar::-webkit-scrollbar {
    width: 6px;
}

.venda-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.venda-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

.venda-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted-light);
}

.venda-sidebar h2 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-green);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text-dark);
    font-size: 0.8rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.form-row .form-group {
    flex-grow: 1;
}

/* Tabela de Vendas */
#tabela-venda {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 1rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#tabela-venda thead {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

#tabela-venda thead th {
    padding: 0.875rem 1rem;
    font-weight: 700;
    text-align: left;
    border: none;
    color: white;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#tabela-venda thead th:first-child {
    border-radius: 12px 0 0 0;
}

#tabela-venda thead th:last-child {
    border-radius: 0 12px 0 0;
}

#tabela-venda tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

#tabela-venda tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
    transform: scale(1.005);
}

#tabela-venda tbody td {
    padding: 0.5rem 0.75rem;
    color: var(--text-dark);
    font-size: 0.8rem;
    vertical-align: middle;
}

#tabela-venda tbody tr:last-child td {
    border-bottom: none;
}

#tabela-venda tbody tr:last-child td:first-child {
    border-radius: 0 0 0 12px;
}

#tabela-venda tbody tr:last-child td:last-child {
    border-radius: 0 0 12px 0;
}

/* Estado vazio da tabela */
#tabela-venda tbody:empty::after {
    content: 'Nenhum item adicionado';
    display: block;
    text-align: center;
    padding: 3rem;
    color: var(--text-muted-light);
    font-style: italic;
}

.btn-remover {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    color: white;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-remover:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

/* Resumo da Venda */
.venda-summary {
    background: linear-gradient(145deg, #f8fafc 0%, #ffffff 100%);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.venda-summary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-blue) 0%, #6366f1 100%);
}

.venda-summary h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-muted-light);
}

.venda-summary h3 span:last-child {
    font-weight: 600;
    color: var(--text-dark);
}

.venda-summary h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-dark);
}

.venda-summary h2 span:last-child {
    color: var(--primary-green);
    font-size: 1.25rem;
}

.venda-summary .desconto-fidelidade {
    color: var(--danger-red);
}

.venda-summary .desconto-fidelidade span:last-child {
    color: var(--danger-red);
}

/* Seção de Pagamento */
.venda-pagamento {
    background: linear-gradient(145deg, #f1f5f9 0%, #f8fafc 100%);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.venda-pagamento:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.venda-pagamento h4 {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

.venda-pagamento h4 i {
    color: var(--primary-blue);
    font-size: 0.9rem;
}

.venda-pagamento .form-group {
    margin-bottom: 0.5rem;
}

.venda-pagamento .form-check {
    margin-bottom: 0.25rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.venda-pagamento .form-check:hover {
    background-color: rgba(102, 126, 234, 0.08);
}

.venda-pagamento .form-check-label {
    margin-left: 0.35rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* Botões */
.btn-finalizar {
    width: 100%;
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    margin-top: 1rem;
    background: linear-gradient(135deg, var(--primary-green) 0%, #059669 100%);
    border: none;
    border-radius: 10px;
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-finalizar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-finalizar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-finalizar:hover::before {
    left: 100%;
}

.btn-finalizar:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
}

.btn-adicionar {
    width: 100%;
    padding: 0.7rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 1rem;
    background: linear-gradient(135deg, var(--primary-blue) 0%, #6366f1 100%);
    border: none;
    border-radius: 10px;
    color: white;
    box-shadow: 0 3px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-adicionar:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(59, 130, 246, 0.4);
}

.btn-adicionar:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Melhorias para formulários */
.form-control {
    border: 2px solid var(--border-light);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.form-select {
    border: 2px solid var(--border-light);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: white;
    cursor: pointer;
}

.form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* Animações suaves */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.venda-main, .venda-sidebar {
    animation: fadeIn 0.5s ease;
}

.venda-sidebar {
    animation-delay: 0.1s;
}

/* Sugestões */
.venda-sugestoes {
    background: linear-gradient(145deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.venda-sugestoes h5 {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.sugestao-grupo {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(245, 158, 11, 0.3);
}

.sugestao-grupo:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sugestao-grupo h6 {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-dark);
}

.sugestao-lista {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.sugestao-lista button {
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: white;
    color: var(--text-dark);
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.sugestao-lista button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

/* Tipo de Venda */
.venda-tipo-opcao {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 0.5rem;
}

.venda-tipo-opcao > label {
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-dark);
    font-size: 0.8rem;
}

.venda-tipo-opcao > label i {
    color: var(--primary-blue);
}

.venda-tipo-opcao .form-check {
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    background: var(--surface-light);
}

.venda-tipo-opcao .form-check:hover {
    background-color: rgba(102, 126, 234, 0.08);
}

.venda-tipo-opcao .form-check-input:checked + .form-check-label {
    color: var(--primary-blue);
    font-weight: 600;
}

.venda-tipo-opcao .form-check-label {
    margin-left: 0.35rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* Input Group */
.input-group {
    display: flex;
    gap: 0.5rem;
}

.input-group .form-control {
    flex: 1;
}

.input-group-append {
    display: flex;
}

/* Responsividade */
@media (max-width: 991px) {
    .venda-sidebar {
        position: static;
        max-height: none;
    }
    
    .venda-main h2,
    .venda-sidebar h2 {
        font-size: 1.25rem;
    }
    
    /* ==================== REORDENAÇÃO MOBILE - VENDAS ==================== */
    /* Reordenar o grid para coluna única com flexbox */
    .venda-grid {
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* Usar display: contents para que os filhos do venda-main possam ser reordenados no grid */
    .venda-main {
        display: contents !important;
    }
    
    /* 1. Título "Itens da Venda" primeiro - precisa estar no grid */
    .venda-grid h2:first-of-type {
        order: 1 !important;
        background: var(--surface-light) !important;
        border-radius: 12px !important;
        padding: 1.5rem !important;
        margin-bottom: 1rem !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
        border: 1px solid var(--border-light) !important;
    }
    
    /* 2. Container de itens da venda */
    .venda-grid #itens-venda-container {
        order: 2 !important;
        background: var(--surface-light) !important;
        border-radius: 12px !important;
        padding: 1.5rem !important;
        margin-bottom: 1.5rem !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
        border: 1px solid var(--border-light) !important;
    }
    
    /* 3. Adicionar Produto (sidebar) - vem DEPOIS dos itens, ANTES da sumarização */
    .venda-grid .venda-sidebar {
        order: 3 !important;
        margin-top: 0 !important;
        margin-bottom: 1.5rem !important;
    }
    
    /* 4. Sumarização (subtotal, total) - vem DEPOIS do sidebar */
    .venda-grid .venda-summary {
        order: 4 !important;
        margin-top: 0 !important;
        margin-bottom: 1.5rem !important;
    }
    
    /* 5. Outros elementos (entrega, pagamento, etc) */
    .venda-grid .venda-entrega,
    .venda-grid .venda-pagamento {
        order: 5 !important;
        background: var(--surface-light) !important;
        border-radius: 12px !important;
        padding: 1.5rem !important;
        margin-top: 1.5rem !important;
        margin-bottom: 1.5rem !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
        border: 1px solid var(--border-light) !important;
    }
    
    .venda-grid .btn-finalizar {
        order: 6 !important;
        margin-top: 1.5rem !important;
    }
}

/* ==================== VENDAS DETALHADAS MOBILE ==================== */
@media (max-width: 768px) {
    /* Cards para tabela de vendas detalhadas */
    #tabelaHistorico tbody tr.venda-row,
    #tabelaVendas table tbody tr.venda-row,
    .table-responsive table tbody tr.venda-row {
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 12px !important;
        margin-bottom: 16px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
        overflow: hidden !important;
        display: block !important;
    }
    
    /* Header do card - ID da venda com gradiente */
    #tabelaHistorico tbody tr.venda-row td.col-venda-id,
    #tabelaVendas table tbody tr.venda-row td.col-venda-id,
    .table-responsive table tbody tr.venda-row td.col-venda-id {
        display: block !important;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        color: white !important;
        padding: 16px !important;
        border-bottom: none !important;
        text-align: left !important;
        font-size: 1.1rem !important;
        font-weight: 700 !important;
    }
    
    #tabelaHistorico tbody tr.venda-row td.col-venda-id::before,
    #tabelaVendas table tbody tr.venda-row td.col-venda-id::before,
    .table-responsive table tbody tr.venda-row td.col-venda-id::before {
        display: none !important;
    }
    
    /* Células normais */
    #tabelaHistorico tbody tr.venda-row td.col-data,
    #tabelaHistorico tbody tr.venda-row td.col-cliente,
    #tabelaHistorico tbody tr.venda-row td.col-tipo,
    #tabelaHistorico tbody tr.venda-row td.col-pagamento,
    #tabelaHistorico tbody tr.venda-row td.col-valor,
    #tabelaHistorico tbody tr.venda-row td.col-itens,
    #tabelaVendas table tbody tr.venda-row td.col-data,
    #tabelaVendas table tbody tr.venda-row td.col-cliente,
    #tabelaVendas table tbody tr.venda-row td.col-tipo,
    #tabelaVendas table tbody tr.venda-row td.col-pagamento,
    #tabelaVendas table tbody tr.venda-row td.col-valor,
    #tabelaVendas table tbody tr.venda-row td.col-itens,
    .table-responsive table tbody tr.venda-row td.col-data,
    .table-responsive table tbody tr.venda-row td.col-cliente,
    .table-responsive table tbody tr.venda-row td.col-tipo,
    .table-responsive table tbody tr.venda-row td.col-pagamento,
    .table-responsive table tbody tr.venda-row td.col-valor,
    .table-responsive table tbody tr.venda-row td.col-itens {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 12px 16px !important;
        border-bottom: 1px solid #e2e8f0 !important;
        background: transparent !important;
    }
    
    #tabelaHistorico tbody tr.venda-row td.col-data::before,
    #tabelaHistorico tbody tr.venda-row td.col-cliente::before,
    #tabelaHistorico tbody tr.venda-row td.col-tipo::before,
    #tabelaHistorico tbody tr.venda-row td.col-pagamento::before,
    #tabelaHistorico tbody tr.venda-row td.col-valor::before,
    #tabelaHistorico tbody tr.venda-row td.col-itens::before,
    #tabelaVendas table tbody tr.venda-row td.col-data::before,
    #tabelaVendas table tbody tr.venda-row td.col-cliente::before,
    #tabelaVendas table tbody tr.venda-row td.col-tipo::before,
    #tabelaVendas table tbody tr.venda-row td.col-pagamento::before,
    #tabelaVendas table tbody tr.venda-row td.col-valor::before,
    #tabelaVendas table tbody tr.venda-row td.col-itens::before,
    .table-responsive table tbody tr.venda-row td.col-data::before,
    .table-responsive table tbody tr.venda-row td.col-cliente::before,
    .table-responsive table tbody tr.venda-row td.col-tipo::before,
    .table-responsive table tbody tr.venda-row td.col-pagamento::before,
    .table-responsive table tbody tr.venda-row td.col-valor::before,
    .table-responsive table tbody tr.venda-row td.col-itens::before {
        content: attr(data-label) !important;
        font-weight: 600 !important;
        color: #64748b !important;
        text-transform: uppercase !important;
        font-size: 0.75rem !important;
        flex-shrink: 0 !important;
        margin-right: 12px !important;
    }
    
    /* Badges de tipo e pagamento */
    #tabelaHistorico tbody tr.venda-row td.col-tipo .badge,
    #tabelaHistorico tbody tr.venda-row td.col-pagamento .badge,
    #tabelaVendas table tbody tr.venda-row td.col-tipo .badge,
    #tabelaVendas table tbody tr.venda-row td.col-pagamento .badge,
    .table-responsive table tbody tr.venda-row td.col-tipo .badge,
    .table-responsive table tbody tr.venda-row td.col-pagamento .badge {
        font-size: 0.8rem !important;
        padding: 5px 12px !important;
        font-weight: 600 !important;
    }
    
    /* Valor destacado em verde */
    #tabelaHistorico tbody tr.venda-row td.col-valor strong,
    #tabelaVendas table tbody tr.venda-row td.col-valor strong,
    .table-responsive table tbody tr.venda-row td.col-valor strong {
        color: #10b981 !important;
        font-size: 1.1rem !important;
        font-weight: 700 !important;
    }
    
    /* Itens */
    #tabelaHistorico tbody tr.venda-row td.col-itens,
    #tabelaVendas table tbody tr.venda-row td.col-itens,
    .table-responsive table tbody tr.venda-row td.col-itens {
        text-align: right !important;
    }
    
    #tabelaHistorico tbody tr.venda-row td.col-itens small,
    #tabelaVendas table tbody tr.venda-row td.col-itens small,
    .table-responsive table tbody tr.venda-row td.col-itens small {
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
    }
    
    /* Ações */
    #tabelaHistorico tbody tr.venda-row td.col-acoes,
    #tabelaVendas table tbody tr.venda-row td.col-acoes,
    .table-responsive table tbody tr.venda-row td.col-acoes {
        display: block !important;
        padding: 14px 16px !important;
        background: #f8fafc !important;
        border-top: 1px dashed #e2e8f0 !important;
        border-bottom: none !important;
    }
    
    #tabelaHistorico tbody tr.venda-row td.col-acoes::before,
    #tabelaVendas table tbody tr.venda-row td.col-acoes::before,
    .table-responsive table tbody tr.venda-row td.col-acoes::before {
        display: none !important;
    }
    
    #tabelaHistorico tbody tr.venda-row td.col-acoes .acoes-cliente,
    #tabelaVendas table tbody tr.venda-row td.col-acoes .acoes-cliente,
    .table-responsive table tbody tr.venda-row td.col-acoes .acoes-cliente {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        justify-content: center !important;
    }
    
    #tabelaHistorico tbody tr.venda-row td.col-acoes .btn-acao,
    #tabelaVendas table tbody tr.venda-row td.col-acoes .btn-acao,
    .table-responsive table tbody tr.venda-row td.col-acoes .btn-acao {
        flex: 1 !important;
        min-width: 0 !important;
        padding: 10px 8px !important;
        font-size: 0.8rem !important;
    }
}
/* --- Estilos para Menu Flutuante (menu.html) --- */
.menu-flutuante {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--surface-light);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    border-bottom: 1px solid var(--border-light);
}

.container-nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.menu-flutuante ul {
    list-style: none;
    margin: 0;
    padding: 1rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.menu-flutuante li {
    margin: 0;
}

.menu-flutuante a {
    display: inline-block;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    color: var(--text-dark);
    background-color: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.menu-flutuante a:hover {
    background-color: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.conteudo {
    margin-top: 100px; /* Espaço para o menu fixo */
    padding: 1rem;
}

/* Responsividade para menu flutuante */
@media (max-width: 768px) {
    .menu-flutuante ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .menu-flutuante a {
        text-align: center;
        padding: 1rem;
        font-size: 1rem;
    }
    
    .conteudo {
        margin-top: 120px;
    }
}

@media (max-width: 480px) {
    .menu-flutuante {
        padding: 0 0.5rem;
    }
    
    .conteudo {
        margin-top: 140px;
    }
}

/* ==================== ESTILOS PARA RELATÓRIOS DE VENDAS ==================== */

/* Header Premium */
.relatorios-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.875rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.relatorios-header h2 {
    color: white;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.relatorios-header h2 i {
    font-size: 1rem;
}

.relatorios-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.75rem;
    margin: 0;
}

/* Cards de Estatísticas */
.stats-card {
    background: white;
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
    height: 100%;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.stats-card.bg-primary,
.stats-card.bg-success,
.stats-card.bg-info,
.stats-card.bg-warning {
    color: white;
}

.stats-card .card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.stats-card .card-text {
    font-size: 0.7rem;
    opacity: 0.9;
    margin: 0;
}

.stats-card .card-body {
    padding: 0.5rem;
}

.stats-card i.fa-2x {
    font-size: 1.25rem !important;
}

/* Tabs Melhoradas */
.nav-tabs {
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 1rem;
}

.nav-tabs .nav-item {
    margin-bottom: -2px;
}

.nav-tabs .nav-link {
    color: var(--text-muted-light);
    font-weight: 600;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    background: transparent;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-blue);
    background: rgba(59, 130, 246, 0.05);
    border-bottom-color: rgba(59, 130, 246, 0.3);
}

.nav-tabs .nav-link.active {
    color: var(--primary-blue);
    background: transparent;
    border-bottom-color: var(--primary-blue);
    font-weight: 700;
}

.nav-tabs .nav-link i {
    margin-right: 0.35rem;
}

/* Cards de Conteúdo */
.content-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.content-card .card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0;
}

.content-card .card-header h5 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.content-card .card-body {
    padding: 0.75rem;
}

/* Tabelas Melhoradas */
.content-card .table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.03em;
    padding: 0.4rem 0.5rem;
    border: none;
    white-space: nowrap;
}

.content-card .table tbody tr {
    transition: all 0.15s ease;
}

.content-card .table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.content-card .table tbody td {
    padding: 0.35rem 0.5rem;
    vertical-align: middle;
    font-size: 0.8rem;
}

.content-card .table tbody td small {
    font-size: 0.7rem;
    line-height: 1.3;
    display: block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Tabela de Histórico de Vendas - Compacta */
#tabelaHistorico th,
#tabelaHistorico td {
    padding: 0.4rem 0.5rem;
    font-size: 0.78rem;
}

#tabelaHistorico th {
    font-size: 0.68rem;
}

#tabelaHistorico .btn-sm {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
}

/* Larguras específicas das colunas da tabela de histórico */
#tabelaHistorico th:nth-child(4),
#tabelaHistorico td:nth-child(4) {
    /* Coluna Tipo */
    width: 70px;
    min-width: 70px;
    max-width: 70px;
}

#tabelaHistorico th:nth-child(5),
#tabelaHistorico td:nth-child(5) {
    /* Coluna Pagamento */
    width: 85px;
    min-width: 85px;
    max-width: 85px;
}

#tabelaHistorico th:nth-child(8),
#tabelaHistorico td:nth-child(8) {
    /* Coluna Ações */
    width: 180px;
    min-width: 180px;
    text-align: center;
}

/* Badges menores na tabela de histórico */
#tabelaHistorico .badge {
    padding: 0.15rem 0.4rem;
    font-size: 0.6rem;
    border-radius: 3px;
}

/* Badges Melhorados */
.badge {
    padding: 0.2rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: capitalize;
}

.badge-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.badge-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.badge-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

/* Paginação - Container */
.pagination-container {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}

/* Estado Vazio */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted-light);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h5 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.empty-state p {
    font-size: 0.95rem;
    margin: 0;
}

/* Formulários de Filtros */
.content-card .form-group label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.content-card .form-control {
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.content-card .form-control:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Botões de Ação */
.content-card .btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.2s ease;
}

.content-card .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
}

.content-card .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.content-card .btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: white;
}

.content-card .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.content-card .btn-outline-info {
    border: 1px solid var(--primary-blue);
    color: var(--primary-blue);
    background: transparent;
}

.content-card .btn-outline-info:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-2px);
}

/* Responsividade */
@media (max-width: 768px) {
    .relatorios-header {
        padding: 1.5rem;
    }
    
    .relatorios-header h2 {
        font-size: 1.5rem;
    }
    
    .stats-card .card-title {
        font-size: 1.5rem;
    }
    
    .nav-tabs .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .pagination .page-link {
        padding: 0.5rem 0.75rem;
        min-width: 36px;
        font-size: 0.85rem;
    }
}

/* ==================== ESTILOS PARA LISTA DE CLIENTES ==================== */

/* Tabela de Clientes Compacta */
.table-hover {
    table-layout: fixed;
    width: 100%;
}

.table-hover th,
.table-hover td {
    padding: 0.35rem 0.4rem;
    font-size: 0.75rem;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-hover input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
}

.table-hover thead th {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 0.4rem;
}

/* Larguras fixas das colunas - EXCETO table-historico */
.table-hover:not(.table-historico) th:nth-child(1),
.table-hover:not(.table-historico) td:nth-child(1) { 
    width: 3% !important; 
    max-width: 3% !important; 
    min-width: 3% !important;
    padding: 0.2rem 0.1rem !important; 
    text-align: center !important;
} /* Checkbox */
.table-hover:not(.table-historico) th:nth-child(2),
.table-hover:not(.table-historico) td:nth-child(2) { width: 24% !important; } /* Cliente */
.table-hover:not(.table-historico) th:nth-child(3),
.table-hover:not(.table-historico) td:nth-child(3) { width: 13%; } /* Contato */
.table-hover:not(.table-historico) th:nth-child(4),
.table-hover:not(.table-historico) td:nth-child(4) { width: 12%; } /* Empresa */
.table-hover:not(.table-historico) th:nth-child(5),
.table-hover:not(.table-historico) td:nth-child(5) { width: 18%; } /* Endereço */
.table-hover:not(.table-historico) th:nth-child(6),
.table-hover:not(.table-historico) td:nth-child(6) { width: 7%; } /* Status */
.table-hover:not(.table-historico) th:nth-child(7),
.table-hover:not(.table-historico) td:nth-child(7) { width: 10%; } /* Ações */

.table-hover .avatar-cliente {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.table-hover .avatar-cliente i {
    font-size: 0.7rem;
}

.table-hover .d-flex {
    flex-wrap: nowrap;
}

.table-hover .me-3 {
    margin-right: 0.4rem !important;
}

.table-hover h6 {
    font-size: 0.72rem;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-hover small {
    font-size: 0.6rem;
}

.table-hover .badge {
    font-size: 0.55rem;
    padding: 0.12rem 0.35rem;
}

.table-hover .btn-sm {
    padding: 0.15rem 0.25rem;
    font-size: 0.6rem;
}

.table-hover .btn-group .btn-sm {
    padding: 0.1rem 0.2rem;
}

/* Botões de ação compactos */
.acoes-cliente {
    display: flex;
    gap: 0.2rem;
    flex-wrap: nowrap;
}

.btn-acao {
    padding: 0.15rem 0.3rem;
    font-size: 0.6rem;
    border-radius: 3px;
    white-space: nowrap;
}

/* Endereço truncado */
.table-hover td .small {
    font-size: 0.65rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Cards de estatísticas na página de clientes */
.card.bg-primary .card-body,
.card.bg-success .card-body,
.card.bg-info .card-body,
.card.bg-warning .card-body {
    padding: 0.75rem;
}

.card.bg-primary .card-title,
.card.bg-success .card-title,
.card.bg-info .card-title,
.card.bg-warning .card-title {
    font-size: 1.1rem;
    margin-bottom: 0.1rem;
}

.card.bg-primary .card-text,
.card.bg-success .card-text,
.card.bg-info .card-text,
.card.bg-warning .card-text {
    font-size: 0.7rem;
}

.card.bg-primary i.fa-2x,
.card.bg-success i.fa-2x,
.card.bg-info i.fa-2x,
.card.bg-warning i.fa-2x {
    font-size: 1.25rem !important;
}

/* ==================== TABELA DE PRODUTOS ==================== */

/* Larguras específicas para tabela de produtos (sem checkbox) */
.container-fluid .table-hover:not(:has(input[type="checkbox"])) th:nth-child(1),
.container-fluid .table-hover:not(:has(input[type="checkbox"])) td:nth-child(1) {
    width: 35% !important;
    max-width: 35% !important;
}

.container-fluid .table-hover:not(:has(input[type="checkbox"])) th:nth-child(2),
.container-fluid .table-hover:not(:has(input[type="checkbox"])) td:nth-child(2) {
    width: 6%;
}

.container-fluid .table-hover:not(:has(input[type="checkbox"])) th:nth-child(3),
.container-fluid .table-hover:not(:has(input[type="checkbox"])) td:nth-child(3) {
    width: 10%;
    text-align: center;
}

.container-fluid .table-hover:not(:has(input[type="checkbox"])) th:nth-child(4),
.container-fluid .table-hover:not(:has(input[type="checkbox"])) td:nth-child(4),
.container-fluid .table-hover:not(:has(input[type="checkbox"])) th:nth-child(5),
.container-fluid .table-hover:not(:has(input[type="checkbox"])) td:nth-child(5) {
    width: 18%;
    text-align: right;
}

.container-fluid .table-hover:not(:has(input[type="checkbox"])) th:nth-child(6),
.container-fluid .table-hover:not(:has(input[type="checkbox"])) td:nth-child(6) {
    width: 10%;
    text-align: center;
}

.container-fluid .table-hover:not(:has(input[type="checkbox"])) th:nth-child(7),
.container-fluid .table-hover:not(:has(input[type="checkbox"])) td:nth-child(7) {
    width: 14%;
    text-align: center;
}

/* ==================== FILTROS MODERNOS ==================== */

/* Card de filtros */
.card.mb-4 .card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 0.6rem 1rem;
}

.card.mb-4 .card-header h5 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card.mb-4 .card-header h5 i {
    color: #667eea;
}

.card.mb-4 .card-body {
    padding: 0.75rem 1rem;
    background: #fafbfc;
}

/* Form inline compacto */
.card.mb-4 .row.g-3 {
    --bs-gutter-y: 0.5rem;
    --bs-gutter-x: 0.75rem;
    align-items: flex-end;
}

.form-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-control, .form-select {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.input-group {
    border-radius: 6px;
    overflow: hidden;
}

.input-group-text {
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #667eea;
}

/* Botões de filtro */
.card.mb-4 .btn-primary {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 6px;
}

.card.mb-4 .btn-outline-secondary {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    border-radius: 6px;
}

/* ==================== ESTILOS PARA CADASTRO DE CLIENTES ==================== */

/* Header Premium */
.cliente-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.875rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.cliente-header h1 {
    color: white;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cliente-header h1 i {
    font-size: 1.75rem;
}

.cliente-header p,
.cliente-header p.text-muted {
    color: #ffffff !important;
    font-size: 1rem;
    margin: 0;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    opacity: 1 !important;
}

/* Grid Layout */
.cliente-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (min-width: 992px) {
    .cliente-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Cards */
.cliente-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all 0.3s ease;
}

.cliente-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.cliente-card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 1.25rem 1.5rem;
    border-bottom: 2px solid var(--border-light);
}

.cliente-card-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cliente-card-header h2 i {
    color: var(--primary-blue);
    font-size: 1.1rem;
}

.cliente-card-body {
    padding: 1.5rem;
}

.cliente-card-actions {
    margin-top: 1rem;
}

/* Formulário */
.cliente-form .form-group {
    margin-bottom: 1.5rem;
}

.cliente-form .form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.cliente-form .form-group label i {
    color: var(--primary-blue);
    font-size: 0.9rem;
}

.cliente-form .form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-dark);
    background-color: var(--bg-light);
    transition: all 0.2s ease;
}

.cliente-form .form-control:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background-color: white;
}

.cliente-form .form-control::placeholder {
    color: var(--text-muted-light);
    opacity: 0.7;
}

.cliente-form textarea.form-control {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.cliente-form .form-text {
    font-size: 0.85rem;
    color: var(--text-muted-light);
    margin-top: 0.5rem;
    display: block;
}

/* Form Row */
.cliente-form .form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.cliente-form .form-row .form-group {
    flex: 1;
    margin-bottom: 1.5rem;
}

/* Classes específicas para controle de largura no desktop */
.cliente-form .form-group-number {
    flex-grow: 1;
}

.cliente-form .form-group-neighborhood {
    flex-grow: 2;
}

.cliente-form .form-group-city {
    flex-grow: 2;
}

.cliente-form .form-group-state {
    flex-grow: 1;
}

/* Ações do Formulário */
.cliente-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-light);
}

.cliente-form-actions .btn {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    min-width: 160px;
    justify-content: center;
}

.cliente-form-actions .btn-cancelar {
    background: var(--surface-light);
    color: var(--text-dark);
    border: 2px solid var(--border-light);
}

.cliente-form-actions .btn-cancelar:hover {
    background: var(--bg-light);
    border-color: var(--text-muted-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cliente-form-actions .btn-cadastrar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.cliente-form-actions .btn-cadastrar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.cliente-form-actions .btn i {
    font-size: 1rem;
}

/* ==================== COMPONENTE MAPA LOCALIZAÇÃO ==================== */
.mapa-localizacao-container {
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.mapa-localizacao-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.mapa-localizacao-header i {
    color: var(--primary-blue);
    margin-right: 0.3rem;
}

.mapa-localizacao-header small {
    color: var(--text-muted-light);
    font-weight: 400;
    font-size: 0.78rem;
}

.mapa-localizacao-body {
    position: relative;
}

.mapa-leaflet {
    height: 250px;
    width: 100%;
}

.mapa-localizacao-footer {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--bg-light);
    border-top: 1px solid var(--border-light);
}

.mapa-localizacao-footer .btn {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.4rem 1.2rem;
    border-radius: 6px;
}

.mapa-status-confirmado {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    color: #166534;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.mapa-status-confirmado .btn {
    margin-left: auto;
    font-size: 0.78rem;
    padding: 0.25rem 0.75rem;
}

.mapa-status-pendente {
    padding: 0.6rem 1rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    color: #92400e;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.mapa-status-pendente i {
    color: #d97706;
    margin-right: 0.3rem;
}

@media (max-width: 768px) {
    .mapa-leaflet {
        height: 200px;
    }
    
    .mapa-localizacao-header {
        flex-direction: column;
        gap: 0.2rem;
        text-align: center;
        padding: 0.5rem 0.75rem;
    }
    
    .mapa-localizacao-footer {
        flex-direction: column;
        padding: 0.5rem 0.75rem;
    }
    
    .mapa-localizacao-footer .btn {
        width: 100%;
    }
    
    .mapa-status-confirmado {
        flex-wrap: wrap;
        font-size: 0.8rem;
    }
    
    .mapa-status-confirmado .btn {
        margin-left: 0;
        width: 100%;
        margin-top: 0.4rem;
    }
}

/* Campos Obrigatórios */
.cliente-form .form-group label.required::after {
    content: " *";
    color: var(--danger-red);
    font-weight: 700;
}

/* Responsividade */
@media (max-width: 991px) {
    .cliente-header {
        padding: 1.5rem;
    }
    
    .cliente-header h1 {
        font-size: 1.5rem;
    }
    
    .cliente-card-header h2 {
        font-size: 1.1rem;
    }
    
    .cliente-form-actions {
        flex-direction: column;
    }
    
    .cliente-form-actions .btn {
        width: 100%;
    }
}

/* ==================== CADASTRO CLIENTE MOBILE ==================== */
@media (max-width: 768px) {
    /* Grid sempre em uma coluna no mobile */
    .cliente-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    /* Cards com melhor espaçamento */
    .cliente-card {
        margin-bottom: 1rem !important;
        border-radius: 12px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    }
    
    .cliente-card-header {
        padding: 1rem 1.25rem !important;
    }
    
    .cliente-card-header h2 {
        font-size: 1rem !important;
        font-weight: 700 !important;
    }
    
    .cliente-card-body {
        padding: 1.25rem !important;
    }
    
    /* Form rows sempre em coluna */
    .cliente-form .form-row,
    .form-row {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        width: 100% !important;
    }
    
    .cliente-form .form-row .form-group,
    .form-row .form-group,
    .cliente-form .form-group-number,
    .cliente-form .form-group-neighborhood,
    .cliente-form .form-group-city,
    .cliente-form .form-group-state {
        width: 100% !important;
        flex: 1 1 100% !important;
        flex-grow: 1 !important;
        margin-bottom: 1.25rem !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
    
    /* Campos de formulário ocupam 100% */
    .cliente-form .form-group {
        width: 100% !important;
        margin-bottom: 1.25rem !important;
    }
    
    .cliente-form .form-control,
    .form-control {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 0.75rem 1rem !important;
        font-size: 1rem !important;
    }
    
    /* Labels */
    .cliente-form label,
    .form-group label {
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        margin-bottom: 0.5rem !important;
        display: block !important;
    }
    
    /* Textarea */
    .cliente-form textarea.form-control {
        width: 100% !important;
        min-height: 120px !important;
        resize: vertical !important;
    }
    
    /* Botões de ação */
    .cliente-form-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
        width: 100% !important;
        margin-top: 1.5rem !important;
    }
    
    .cliente-form-actions .btn {
        width: 100% !important;
        padding: 0.875rem 1.5rem !important;
        font-size: 1rem !important;
        font-weight: 600 !important;
        border-radius: 8px !important;
    }
    
    /* Header do formulário */
    .cliente-header {
        padding: 1.25rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .cliente-header h1 {
        font-size: 1.5rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .cliente-header p,
    .cliente-header p.text-muted {
        font-size: 0.9rem !important;
        color: #ffffff !important;
        font-weight: 500 !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15) !important;
        opacity: 1 !important;
    }
    
    .cliente-header h1 {
        color: #ffffff !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15) !important;
    }
    
    /* Remover estilos inline que podem conflitar */
    .cliente-form .form-group[style*="flex-grow"] {
        flex-grow: 1 !important;
        width: 100% !important;
    }
}

/* ==================== ESTILOS PARA TELA CHEIA ==================== */

/* Container principal expandido */
.container-fluid,
.container-full {
    width: 100%;
    max-width: none;
    padding: 1.5rem 2rem;
    margin: 0 auto;
}

/* Grids responsivos para tela cheia */
.grid-full {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.grid-2-cols {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.grid-3-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.grid-4-cols {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .grid-4-cols { grid-template-columns: repeat(2, 1fr); }
    .grid-3-cols { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-4-cols,
    .grid-3-cols,
    .grid-2-cols { grid-template-columns: 1fr; }
    
    .container {
        width: 100%;
        padding: 1rem;
        margin: 0.5rem auto;
        border-radius: 8px;
    }
}

/* Cards expandidos */
.card-full {
    background: var(--surface-light);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    padding: 1.5rem;
    width: 100%;
}

/* Tabelas responsivas para tela cheia */
.table-full {
    width: 100%;
    min-width: 100%;
}

.table-full th,
.table-full td {
    padding: 1rem 1.5rem;
}

/* Dashboard cards em tela cheia */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.dashboard-card {
    background: var(--surface-light);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* Formulários em tela cheia */
.form-full {
    width: 100%;
    max-width: none;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Seções com largura total */
.section-full {
    width: 100%;
    padding: 2rem 0;
}

/* Header de página expandido */
.page-header-full {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
    width: 100%;
}

.page-header-full h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

/* Ações de página */
.page-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Filtros em linha */
.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.filters-row .form-group {
    flex: 1;
    min-width: 200px;
    margin: 0;
}

@media (max-width: 768px) {
    .filters-row {
        flex-direction: column;
    }
    
    .filters-row .form-group {
        width: 100%;
    }
}

/* ==================== ESTILOS PARA PÁGINA DE CLIENTES ==================== */

/* Container principal */
.container-fluid {
    padding: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* Header da página */
.container-fluid h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.container-fluid h2 i {
    color: var(--primary-blue);
}

/* Cards de estatísticas */
.container-fluid .card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.container-fluid .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.container-fluid .card.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.container-fluid .card.bg-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

.container-fluid .card.bg-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
}

.container-fluid .card.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

.container-fluid .card .card-body {
    padding: 1.25rem;
}

.container-fluid .card .card-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.container-fluid .card .card-text {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Card de filtros */
.container-fluid .card .card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 2px solid var(--border-light);
    padding: 1rem 1.25rem;
}

.container-fluid .card .card-header h5 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Tabela de clientes */
.container-fluid .table {
    margin-bottom: 0;
}

.container-fluid .table thead.table-dark {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.container-fluid .table thead.table-dark th {
    background: transparent;
    border: none;
    padding: 1rem 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: white;
}

.container-fluid .table tbody tr {
    transition: all 0.2s ease;
}

.container-fluid .table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

.container-fluid .table tbody td {
    padding: 0.875rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
}

/* Avatar do cliente */
.avatar-cliente {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted-light);
}

/* Ações em lote */
.acoes-lote-container {
    display: none !important;
}

.acoes-lote-container.show {
    display: flex !important;
}

/* Botões de ação */
.acoes-cliente {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-acao {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-acao-editar {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.btn-acao-editar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-acao-visualizar {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
}

.btn-acao-visualizar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
}

.btn-acao-info {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.btn-acao-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-acao-excluir {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-acao-excluir:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Paginação melhorada */
.paginacao-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.paginacao {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.paginacao-item {
    margin: 0;
}

.paginacao-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.6rem 1rem;
    min-width: 42px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark);
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.paginacao-link:hover {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.paginacao-item.active .paginacao-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.paginacao-item.disabled .paginacao-link {
    color: var(--text-muted-light);
    background: var(--bg-light);
    border-color: var(--border-light);
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}

.paginacao-item.disabled .paginacao-link:hover {
    transform: none;
    box-shadow: none;
}

.paginacao-info {
    text-align: center;
    color: var(--text-muted-light);
    font-size: 0.875rem;
    margin-top: 1rem;
    font-weight: 500;
}

/* Badges melhorados */
.container-fluid .badge {
    padding: 0.4rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.container-fluid .badge.bg-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

.container-fluid .badge.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: white !important;
}

.container-fluid .badge.bg-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

.container-fluid .badge.bg-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
}

/* Botões do header */
.container-fluid .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 0.6rem 1.25rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.container-fluid .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Grupo de botões */
.container-fluid .btn-group .btn {
    border-radius: 6px !important;
    margin-left: 0.25rem;
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
}

/* Form controls */
.container-fluid .form-control,
.container-fluid .form-select {
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    background-color: white;
}

.container-fluid .form-control:focus,
.container-fluid .form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.container-fluid .input-group-text {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 8px 0 0 8px;
    color: var(--text-muted-light);
}

.container-fluid .input-group .form-control {
    border-radius: 0 8px 8px 0;
}

/* ==================== RELATÓRIOS DE VENDAS AVANÇADOS ==================== */

/* Header do Relatório */
.relatorios-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 2rem;
    color: white;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.relatorios-header h2 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.relatorios-header p {
    opacity: 0.9;
    font-size: 0.95rem;
}

/* Abas de navegação */
.nav-tabs {
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 0;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: #6c757d;
    font-weight: 600;
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
    background: transparent;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.nav-tabs .nav-link.active {
    color: #667eea;
    border-bottom: 3px solid #667eea;
    background: transparent;
}

.nav-tabs .nav-link i {
    margin-right: 0.5rem;
}

/* Cards de conteúdo */
.content-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-top: 1.5rem;
}

.content-card .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    padding: 1.25rem 1.5rem;
}

.content-card .card-header h5 {
    margin: 0;
    font-weight: 600;
    color: #495057;
}

.content-card .card-body {
    padding: 1.5rem;
}

/* Stats Cards para relatórios */
.stats-card {
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

.stats-card .card-body {
    padding: 1.5rem;
}

.stats-card .card-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stats-card .card-text {
    font-size: 0.85rem;
    opacity: 0.9;
}

.stats-card i.fa-2x {
    opacity: 0.8;
}

/* Formulário de filtros */
#formFiltros .form-group {
    margin-bottom: 1rem;
}

#formFiltros label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

#formFiltros .form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

#formFiltros .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* Selects nos filtros do histórico */
.content-card .card-header .form-control {
    border-radius: 10px;
    border: 2px solid #dee2e6;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    background: white;
    transition: all 0.3s ease;
    width: 100%;
    height: auto;
}

.content-card .card-header .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.content-card .card-header .btn-primary {
    padding: 0.6rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    width: 100%;
}

.content-card .card-header .row {
    gap: 0.5rem;
}

#formFiltros .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

#formFiltros .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

#formFiltros .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

#formFiltros .btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
}

#formFiltros .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(17, 153, 142, 0.4);
}

/* Tabela de vendas melhorada */
.tab-content .table {
    margin-bottom: 0;
    width: 100%;
    table-layout: auto;
}

.tab-content .table thead.table-dark {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
}

.tab-content .table thead.table-dark th {
    border: none;
    padding: 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Coluna de ações sempre visível */
.tab-content .table thead.table-dark th:last-child,
.tab-content .table tbody td:last-child {
    min-width: 120px;
    text-align: center;
}

.tab-content .table tbody tr {
    transition: all 0.2s ease;
}

.tab-content .table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.tab-content .table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-color: #f1f3f4;
}

/* Botão de detalhes na tabela */
.tab-content .table tbody td .btn-outline-info {
    white-space: nowrap;
    padding: 0.4rem 0.75rem;
}

/* Badges melhorados */
.tab-content .badge {
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
}

.tab-content .badge-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.tab-content .badge-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.tab-content .badge-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.tab-content .badge-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Estado vazio */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.3;
    color: #667eea;
}

.empty-state h5 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #495057;
}

.empty-state p {
    font-size: 0.95rem;
    opacity: 0.8;
}

/* Paginação melhorada */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.pagination-container .pagination {
    margin: 0;
    gap: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-container .page-item .page-link {
    border-radius: 10px;
    border: 2px solid #dee2e6;
    background: white;
    color: #495057;
    padding: 0.6rem 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 45px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.pagination-container .page-item .page-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.pagination-container .page-item.active .page-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transform: scale(1.05);
}

.pagination-container .page-item.disabled .page-link {
    background: #e9ecef;
    color: #adb5bd;
    border-color: #dee2e6;
    cursor: not-allowed;
    box-shadow: none;
}

/* Botões de navegação primeira/última página */
.pagination-container .page-item:first-child .page-link,
.pagination-container .page-item:last-child .page-link {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border-color: transparent;
    color: white;
    font-weight: 700;
}

.pagination-container .page-item:first-child .page-link:hover,
.pagination-container .page-item:last-child .page-link:hover {
    background: linear-gradient(135deg, #0d7d74 0%, #2bc866 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(17, 153, 142, 0.4);
}

.pagination-container .page-item.disabled:first-child .page-link,
.pagination-container .page-item.disabled:last-child .page-link {
    background: #e9ecef;
    color: #adb5bd;
}

.pagination-container .pagination-info {
    width: 100%;
    text-align: center;
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 10px;
    color: #495057;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Botão de detalhes */
.btn-outline-info {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-info:hover {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

/* ===== TABELA DE CLIENTES - MELHORADA ===== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

/* Larguras fixas para cada coluna */
.table thead th:nth-child(1) { width: 40px; } /* Checkbox */
.table thead th:nth-child(2) { width: 20%; min-width: 150px; } /* Cliente */
.table thead th:nth-child(3) { width: 15%; min-width: 130px; } /* Contato */
.table thead th:nth-child(4) { width: 15%; min-width: 100px; } /* Empresa */
.table thead th:nth-child(5) { width: 20%; min-width: 150px; } /* Endereço */
.table thead th:nth-child(6) { width: 10%; min-width: 90px; } /* Status */
.table thead th:nth-child(7) { width: 15%; min-width: 140px; } /* Ações */

.table thead.table-dark th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.75rem 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border: none;
    vertical-align: middle;
}

.table tbody td {
    padding: 0.6rem 0.5rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

/* Avatar do cliente */
.avatar-cliente {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Nome do cliente */
.table tbody td h6 {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

/* Badges */
.badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Botões de ação */
.acoes-cliente {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
}

.btn-acao {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.3rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 75px;
}

.btn-acao i {
    font-size: 0.65rem;
}

.btn-acao-editar {
    background-color: #3b82f6;
    color: white;
}

.btn-acao-editar:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
}

.btn-acao-visualizar {
    background-color: #10b981;
    color: white;
}

.btn-acao-visualizar:hover {
    background-color: #059669;
    transform: translateY(-1px);
}

.btn-acao-excluir {
    background-color: #ef4444;
    color: white;
}

.btn-acao-excluir:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
}

/* Texto truncado para endereço */
.table tbody td .small {
    font-size: 0.75rem;
    line-height: 1.3;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== BOTÕES DE AÇÃO EM TABELAS ===== */
.btn-group-vertical.btn-group-sm {
    gap: 0.2rem;
}

.btn-group-vertical .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px !important;
    white-space: nowrap;
    min-width: 85px;
}

.btn-group-vertical .btn i {
    font-size: 0.7rem;
}

/* Cores dos botões de ação */
.btn-group-vertical .btn-info {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

.btn-group-vertical .btn-info:hover {
    background-color: #138496;
    border-color: #117a8b;
}

.btn-group-vertical .btn-primary {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.btn-group-vertical .btn-primary:hover {
    background-color: #2563eb;
    border-color: #1d4ed8;
}

.btn-group-vertical .btn-danger {
    background-color: #ef4444;
    border-color: #ef4444;
    color: white;
}

.btn-group-vertical .btn-danger:hover {
    background-color: #dc2626;
    border-color: #b91c1c;
}

.btn-group-vertical .btn-success {
    background-color: #10b981;
    border-color: #10b981;
    color: white;
}

.btn-group-vertical .btn-success:hover {
    background-color: #059669;
    border-color: #047857;
}

.btn-group-vertical .btn-warning {
    background-color: #f59e0b;
    border-color: #f59e0b;
    color: white;
}

.btn-group-vertical .btn-warning:hover {
    background-color: #d97706;
    border-color: #b45309;
}

/* Botão remover em carrinho de vendas */
.btn-remover {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

/* Ajuste para coluna de ações na tabela */
.table thead th:last-child,
.table tbody td:last-child {
    min-width: 100px;
    text-align: center;
}

/* Responsividade - NÃO aplicar na tabela de vendas */
@media (max-width: 1200px) {
    .table:not(#tabela-venda) thead th:nth-child(5) { display: none; } /* Esconder Endereço */
    .table:not(#tabela-venda) tbody td:nth-child(5) { display: none; }
}

@media (max-width: 992px) {
    .table:not(#tabela-venda) thead th:nth-child(4) { display: none; } /* Esconder Empresa */
    .table:not(#tabela-venda) tbody td:nth-child(4) { display: none; }
}

@media (max-width: 768px) {
    .container-fluid {
        padding: 0.75rem;
    }
    
    .container-fluid h2 {
        font-size: 1.25rem;
    }
    
    .table thead.table-dark th {
        font-size: 0.65rem;
        padding: 0.5rem 0.35rem;
    }
    
    .table tbody td {
        padding: 0.5rem 0.35rem;
        font-size: 0.75rem;
    }
    
    .avatar-cliente {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }
    
    .table tbody td h6 {
        font-size: 0.75rem;
        max-width: 80px;
    }
    
    .acoes-cliente {
        gap: 0.2rem;
    }
    
    .btn-acao {
        padding: 0.25rem 0.4rem;
        font-size: 0.65rem;
        min-width: 60px;
    }
    
    .btn-acao i {
        display: none;
    }
    
    /* Botões de ação em tabelas - mobile */
    .btn-group-vertical .btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.65rem;
        min-width: 70px;
    }
    
    .btn-group-vertical .btn i {
        display: none;
    }
    
    .btn-remover {
        padding: 0.2rem 0.4rem;
        font-size: 0.65rem;
    }
    
    .btn-remover i {
        display: none;
    }
    
    .badge {
        font-size: 0.6rem;
        padding: 0.2rem 0.4rem;
    }
    
    .paginacao {
        gap: 0.25rem;
    }
    
    .paginacao-link {
        padding: 0.5rem 0.75rem;
        min-width: 36px;
        font-size: 0.8rem;
    }
}

/* ========================================
   TABELA DE VENDAS - ESTILOS ESPECÍFICOS
   ======================================== */
#tabela-venda {
    width: 100%;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#tabela-venda thead {
    background: #2563eb !important;
}

#tabela-venda thead tr {
    background: #2563eb !important;
}

#tabela-venda thead th {
    background: #2563eb !important;
    color: #ffffff !important;
    padding: 14px 12px !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border: none !important;
    text-align: left !important;
}

#tabela-venda tbody tr {
    border-bottom: 1px solid #e5e7eb;
}

#tabela-venda tbody tr:hover {
    background-color: #f3f4f6;
}

#tabela-venda tbody td {
    padding: 12px;
    color: #374151;
    font-size: 0.9rem;
}

#tabela-venda tbody td:nth-child(2) {
    text-align: center;
}

#tabela-venda tbody td:nth-child(3),
#tabela-venda tbody td:nth-child(4) {
    text-align: right;
}

#tabela-venda tbody td:nth-child(5) {
    text-align: center;
}

/* ========================================
   ITENS DA VENDA - ESTILO CARDS (NOVO)
   ======================================== */
.itens-container {
    background: #f8fafc;
    border-radius: 12px;
    padding: 15px;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
}

.empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.empty-cart i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-cart p {
    font-size: 1rem;
    margin: 0;
}

.produto-item-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #4a7dff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.produto-item-card:hover {
    border-left-color: #2563eb;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.produto-item-card:last-child {
    margin-bottom: 0;
}

.produto-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.produto-nome {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
}

.produto-detalhe {
    font-size: 0.8rem;
    color: #64748b;
}

.produto-acoes {
    display: flex;
    align-items: center;
    gap: 12px;
}

.produto-total {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
}

.btn-remover-item {
    background: #fee2e2;
    border: none;
    color: #dc2626;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-remover-item:hover {
    background: #fecaca;
    color: #b91c1c;
}

/* ==================== TABELAS RESPONSIVAS PARA MOBILE ==================== */

/* Estilo base para tabelas responsivas */
.table-responsive-mobile {
    width: 100%;
}

/* Em telas grandes, comportamento normal */
@media (min-width: 769px) {
    .table-responsive-mobile table {
        width: 100%;
    }
}

/* Em mobile: transformar tabela em cards */
@media (max-width: 768px) {
    /* Container da tabela */
    .table-responsive,
    .table-responsive-mobile {
        overflow-x: visible;
        border: none;
    }
    
    /* Esconder cabeçalho da tabela */
    .table-responsive table thead,
    .table-responsive-mobile table thead,
    .tabela-produtos thead,
    #tabelaHistorico thead {
        display: none;
    }
    
    /* Cada linha vira um card */
    .table-responsive table tbody tr,
    .table-responsive-mobile table tbody tr,
    .tabela-produtos tbody tr,
    #tabelaHistorico tbody tr {
        display: block;
        background: var(--surface-light);
        border: 1px solid var(--border-light);
        border-radius: 10px;
        margin-bottom: 12px;
        padding: 12px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    }
    
    .table-responsive table tbody tr:hover,
    .table-responsive-mobile table tbody tr:hover,
    .tabela-produtos tbody tr:hover,
    #tabelaHistorico tbody tr:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    /* Cada célula vira uma linha do card */
    .table-responsive table tbody td,
    .table-responsive-mobile table tbody td,
    .tabela-produtos tbody td,
    #tabelaHistorico tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 4px;
        border-bottom: 1px solid var(--border-light);
        text-align: right;
        white-space: normal;
        word-wrap: break-word;
    }
    
    .table-responsive table tbody td:last-child,
    .table-responsive-mobile table tbody td:last-child,
    .tabela-produtos tbody td:last-child,
    #tabelaHistorico tbody td:last-child {
        border-bottom: none;
    }
    
    /* Label antes do conteúdo usando data-label */
    .table-responsive table tbody td::before,
    .table-responsive-mobile table tbody td::before,
    .tabela-produtos tbody td::before,
    #tabelaHistorico tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted-light);
        text-transform: uppercase;
        font-size: 0.7rem;
        letter-spacing: 0.03em;
        text-align: left;
        flex-shrink: 0;
        margin-right: 10px;
    }
    
    /* Ajustes para células de ações */
    .table-responsive table tbody td:last-child,
    .table-responsive-mobile table tbody td:last-child,
    .tabela-produtos tbody td.col-acoes,
    #tabelaHistorico tbody td:last-child {
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
        padding-top: 12px;
        margin-top: 8px;
        border-top: 1px dashed var(--border-light);
        border-bottom: none;
    }
    
    .table-responsive table tbody td:last-child::before,
    .table-responsive-mobile table tbody td:last-child::before,
    .tabela-produtos tbody td.col-acoes::before,
    #tabelaHistorico tbody td:last-child::before {
        display: none;
    }
    
    /* Botões de ação em mobile */
    .acoes-cliente {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: center;
        width: 100%;
    }
    
    .btn-acao {
        flex: 1 1 auto;
        min-width: 80px;
        max-width: 120px;
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    
    /* Filtros em mobile */
    .card-body .row.g-3 {
        gap: 10px;
    }
    
    .card-body .row.g-3 > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* Botões de filtro em mobile */
    .card-body .col-md-3:last-child {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .card-body .col-md-3:last-child .btn {
        flex: 1;
        min-width: 100px;
    }
    
    /* Cards de estatísticas em mobile */
    .row.mb-4 > [class*="col-md-3"] {
        flex: 0 0 50%;
        max-width: 50%;
        padding: 4px;
    }
    
    .row.mb-4 > [class*="col-md-3"] .card {
        margin-bottom: 0;
    }
    
    .row.mb-4 > [class*="col-md-3"] .card-body {
        padding: 10px;
    }
    
    .row.mb-4 > [class*="col-md-3"] .card-title {
        font-size: 1rem;
    }
    
    .row.mb-4 > [class*="col-md-3"] .card-text {
        font-size: 0.7rem;
    }
    
    .row.mb-4 > [class*="col-md-3"] .fa-2x {
        font-size: 1.25rem !important;
    }
    
    /* Paginação em mobile */
    .paginacao-container {
        padding: 10px 0;
    }
    
    .paginacao {
        flex-wrap: wrap;
        gap: 4px;
        justify-content: center;
    }
    
    .paginacao-item {
        margin: 2px;
    }
    
    .paginacao-link {
        padding: 6px 10px;
        font-size: 0.75rem;
        min-width: 32px;
    }
    
    /* Esconder texto em botões de paginação, manter só ícones */
    .paginacao-link i + span,
    .paginacao-link span + i {
        display: none;
    }
}

/* Telas muito pequenas (< 480px) */
@media (max-width: 480px) {
    /* Cards de estatísticas empilhados */
    .row.mb-4 > [class*="col-md-3"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* Container com menos padding */
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Título menor */
    h2 {
        font-size: 1.1rem;
    }
    
    /* Badges menores */
    .badge {
        font-size: 0.6rem;
        padding: 2px 6px;
    }
    
    /* Botões de ação ainda menores */
    .btn-acao {
        padding: 6px 8px;
        font-size: 0.7rem;
        min-width: 70px;
    }
    
    /* Filtros avançados */
    #filtrosAvancados .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 8px;
    }
}

/* ==================== TABELA DE PRODUTOS ESPECÍFICA ==================== */

/* Desktop - tabela normal compacta */
.tabela-produtos {
    font-size: 0.85rem;
}

.tabela-produtos th,
.tabela-produtos td {
    padding: 0.5rem 0.4rem;
    vertical-align: middle;
}

.tabela-produtos .col-produto {
    min-width: 200px;
}

.tabela-produtos .col-grupo {
    width: 80px;
    max-width: 80px;
}

.tabela-produtos .col-estoque {
    width: 70px;
}

.tabela-produtos .col-preco {
    width: 90px;
}

.tabela-produtos .col-margem {
    width: 60px;
}

.tabela-produtos .col-acoes {
    width: 220px;
}

.tabela-produtos .nome-produto {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
}

.tabela-produtos .codigo-produto {
    font-size: 0.75rem;
}

.tabela-produtos .badge {
    font-size: 0.7rem;
    padding: 3px 6px;
}

/* Grupo - desktop: truncar nomes longos */
.tabela-produtos .col-grupo .grupo-badge {
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

/* Mobile - tabela vira cards */
@media (max-width: 768px) {
    /* Header da página de produtos */
    .container-fluid .d-flex.justify-content-between.align-items-center.mb-4 {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }
    
    .container-fluid .d-flex.justify-content-between.align-items-center.mb-4 > div:last-child {
        width: 100%;
    }
    
    .container-fluid .d-flex.justify-content-between.align-items-center.mb-4 .btn {
        width: 100%;
    }
    
    /* Cards de estatísticas - 2 por linha */
    .container-fluid .row.mb-4 > [class*="col-md-3"] {
        flex: 0 0 50%;
        max-width: 50%;
        padding: 4px;
    }
    
    .container-fluid .row.mb-4 > [class*="col-md-3"] .card {
        margin-bottom: 0;
    }
    
    .container-fluid .row.mb-4 > [class*="col-md-3"] .card .card-body {
        padding: 10px;
    }
    
    .container-fluid .row.mb-4 > [class*="col-md-3"] .card .card-title {
        font-size: 0.95rem;
    }
    
    .container-fluid .row.mb-4 > [class*="col-md-3"] .card .card-text {
        font-size: 0.65rem;
    }
    
    /* Filtros em mobile */
    .card.mb-4 .card-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px;
    }
    
    .card.mb-4 .card-header h6,
    .card.mb-4 .card-header .btn {
        width: 100%;
        text-align: left;
    }
    
    .card.mb-4 .card-body .row.g-3 > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 4px 8px;
    }
    
    .card.mb-4 .card-body .col-md-3:last-child {
        display: flex;
        gap: 8px;
        margin-top: 8px;
    }
    
    .card.mb-4 .card-body .col-md-3:last-child .btn {
        flex: 1;
    }
    
    /* Esconder cabeçalho da tabela de produtos */
    .tabela-produtos thead {
        display: none !important;
    }
    
    /* Tabela de produtos vira cards */
    .tabela-produtos {
        display: block !important;
        width: 100% !important;
    }
    
    .tabela-produtos tbody {
        display: block !important;
    }
    
    .tabela-produtos tbody tr {
        display: block !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 12px !important;
        margin-bottom: 16px !important;
        padding: 0 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
        overflow: hidden !important;
        width: 100% !important;
    }
    
    .tabela-produtos tbody tr:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    }
    
    /* TODAS as células da tabela */
    .tabela-produtos tbody td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 12px 16px !important;
        border-bottom: 1px solid #e2e8f0 !important;
        text-align: right !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Label à esquerda de cada célula */
    .tabela-produtos tbody td::before {
        content: attr(data-label) !important;
        font-weight: 600 !important;
        color: #64748b !important;
        text-transform: uppercase !important;
        font-size: 0.75rem !important;
        letter-spacing: 0.03em !important;
        text-align: left !important;
        flex-shrink: 0 !important;
        margin-right: 12px !important;
    }
    
    /* Célula do produto - cabeçalho do card */
    .tabela-produtos tbody td.col-produto,
    .tabela-produtos tbody td:first-child {
        display: block !important;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        color: white !important;
        padding: 16px !important;
        border-bottom: none !important;
        text-align: left !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
    }
    
    .tabela-produtos tbody td.col-produto::before,
    .tabela-produtos tbody td:first-child::before {
        display: none !important;
        content: none !important;
    }
    
    .tabela-produtos tbody td.col-produto .nome-produto,
    .tabela-produtos tbody td:first-child .nome-produto {
        font-size: 1.1rem !important;
        font-weight: 700 !important;
        color: white !important;
        margin-bottom: 4px !important;
        display: block !important;
    }
    
    .tabela-produtos tbody td.col-produto .codigo-produto,
    .tabela-produtos tbody td:first-child .codigo-produto {
        font-size: 0.85rem !important;
        color: rgba(255, 255, 255, 0.9) !important;
        display: block !important;
    }
    
    /* Badges dentro das células */
    .tabela-produtos tbody td .badge {
        font-size: 0.8rem !important;
        padding: 5px 12px !important;
    }
    
    /* Grupo - mostrar nome completo em mobile */
    .tabela-produtos .col-grupo .grupo-badge {
        white-space: normal !important;
        max-width: none !important;
        overflow: visible !important;
        text-overflow: clip !important;
        display: inline !important;
    }
    
    /* Preços em destaque */
    .tabela-produtos tbody td strong {
        font-size: 1rem !important;
        color: #10b981 !important;
    }
    
    /* Small text (ex: estoque fracionado) */
    .tabela-produtos tbody td small {
        font-size: 0.8rem !important;
        margin-left: 8px !important;
    }
    
    /* Célula de ações - rodapé do card */
    .tabela-produtos tbody td.col-acoes,
    .tabela-produtos tbody td:last-child {
        display: block !important;
        padding: 14px 16px !important;
        border-bottom: none !important;
        background: #f8fafc !important;
        text-align: center !important;
        border-top: 1px dashed #e2e8f0 !important;
    }
    
    .tabela-produtos tbody td.col-acoes::before,
    .tabela-produtos tbody td:last-child::before {
        display: none !important;
    }
    
    .tabela-produtos tbody td.col-acoes .acoes-cliente,
    .tabela-produtos tbody td:last-child .acoes-cliente {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        justify-content: center !important;
        width: 100% !important;
    }
    
    .tabela-produtos tbody td .btn-acao {
        flex: 1 !important;
        min-width: 0 !important;
        max-width: none !important;
        padding: 10px 12px !important;
        font-size: 0.8rem !important;
        font-weight: 600 !important;
        border-radius: 8px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
    }
    
    .tabela-produtos tbody td .btn-acao i {
        font-size: 0.75rem !important;
    }
    
    /* Card de lista de produtos header */
    .card .card-header.d-flex h5 {
        font-size: 0.9rem;
    }
    
    .card .card-header .btn-group .btn {
        padding: 6px 10px;
        font-size: 0.7rem;
    }
    
    /* Paginação em mobile */
    .paginacao-container {
        margin-top: 1rem;
        padding: 12px;
    }
    
    .paginacao {
        gap: 4px;
    }
    
    .paginacao-link {
        padding: 8px 10px;
        font-size: 0.75rem;
        min-width: 36px;
    }
    
    /* Esconder texto nos botões de paginação, só ícones */
    .paginacao-link:has(i) {
        padding: 8px 12px;
    }
    
    .paginacao-info {
        font-size: 0.75rem;
        margin-top: 8px;
    }
}

/* Telas muito pequenas */
@media (max-width: 480px) {
    /* Cards de estatísticas empilhados */
    .container-fluid .row.mb-4 > [class*="col-md-3"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* Botões de ação menores */
    .tabela-produtos tbody td.col-acoes .btn-acao {
        min-width: 80px;
        padding: 8px 10px;
        font-size: 0.75rem;
    }
    
    /* Nome do produto menor */
    .tabela-produtos tbody td.col-produto .nome-produto {
        font-size: 0.95rem;
    }
}

/* ==================== TABELA DE RELATÓRIOS ESPECÍFICA ==================== */
@media (max-width: 768px) {
    #tabelaHistorico tbody tr {
        position: relative;
    }
    
    /* Status badge no canto superior */
    #tabelaHistorico tbody td .badge {
        font-size: 0.65rem;
    }
    
    /* Valor em destaque */
    #tabelaHistorico tbody td:nth-child(3) {
        font-weight: 700;
        font-size: 1rem;
        color: var(--primary-green);
    }
}

/* ==================== CONTAS A RECEBER/PAGAR MOBILE ==================== */
@media (max-width: 768px) {
    /* ===== CARDS COM STATUS COLORIDO ===== */
    
    /* Card de conta - status Recebida (verde) */
    tr.conta-row.status-recebida {
        background: linear-gradient(135deg, #d1fae5 0%, #ecfdf5 100%) !important;
        border-left: 5px solid #10b981 !important;
    }
    
    tr.conta-row.status-recebida td.col-descricao {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
        color: white !important;
    }
    
    tr.conta-row.status-recebida td.col-descricao strong,
    tr.conta-row.status-recebida td.col-descricao .descricao-conta {
        color: white !important;
    }
    
    tr.conta-row.status-recebida td.col-descricao .obs-conta {
        color: rgba(255, 255, 255, 0.85) !important;
    }
    
    /* Card de conta - status Vencida (vermelho) */
    tr.conta-row.status-vencida {
        background: linear-gradient(135deg, #fee2e2 0%, #fef2f2 100%) !important;
        border-left: 5px solid #ef4444 !important;
    }
    
    tr.conta-row.status-vencida td.col-descricao {
        background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
        color: white !important;
    }
    
    tr.conta-row.status-vencida td.col-descricao strong,
    tr.conta-row.status-vencida td.col-descricao .descricao-conta {
        color: white !important;
    }
    
    tr.conta-row.status-vencida td.col-descricao .obs-conta {
        color: rgba(255, 255, 255, 0.85) !important;
    }
    
    /* Card de conta - status Pendente (amarelo/laranja) */
    tr.conta-row.status-pendente {
        background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 100%) !important;
        border-left: 5px solid #f59e0b !important;
    }
    
    tr.conta-row.status-pendente td.col-descricao {
        background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
        color: white !important;
    }
    
    tr.conta-row.status-pendente td.col-descricao strong,
    tr.conta-row.status-pendente td.col-descricao .descricao-conta {
        color: white !important;
    }
    
    tr.conta-row.status-pendente td.col-descricao .obs-conta {
        color: rgba(255, 255, 255, 0.85) !important;
    }
    
    /* ===== ESCONDER CHECKBOX E PRIMEIRA COLUNA VAZIA EM MOBILE ===== */
    tr.conta-row td.col-checkbox,
    tr.conta-row td:first-child:not(.col-descricao) {
        display: none !important;
    }
    
    /* Garantir que a descrição seja o header mesmo sendo a segunda célula */
    tr.conta-row td.col-descricao {
        order: -1 !important;
    }
    
    /* ===== DESCRIÇÃO COMO HEADER DO CARD ===== */
    tr.conta-row td.col-descricao {
        display: block !important;
        padding: 16px !important;
        border-bottom: none !important;
        text-align: left !important;
        font-size: 1rem !important;
    }
    
    tr.conta-row td.col-descricao::before {
        display: none !important;
    }
    
    tr.conta-row td.col-descricao .descricao-conta {
        font-size: 1rem !important;
        line-height: 1.4 !important;
    }
    
    /* ===== CÉLULAS NORMAIS ===== */
    tr.conta-row td.col-cliente,
    tr.conta-row td.col-valor,
    tr.conta-row td.col-vencimento,
    tr.conta-row td.col-status {
        background: transparent !important;
    }
    
    tr.conta-row td.col-cliente .cliente-nome {
        font-weight: 600 !important;
        color: #1e293b !important;
    }
    
    tr.conta-row td.col-valor .valor-principal {
        font-size: 1.1rem !important;
        color: #10b981 !important;
    }
    
    tr.conta-row.status-vencida td.col-valor .valor-principal {
        color: #ef4444 !important;
    }
    
    tr.conta-row td.col-vencimento .data-venc {
        font-weight: 500 !important;
    }
    
    tr.conta-row td.col-status .badge-status {
        font-size: 0.85rem !important;
        padding: 6px 14px !important;
        font-weight: 700 !important;
    }
    
    /* ===== AÇÕES ===== */
    tr.conta-row td.col-acoes {
        background: rgba(0, 0, 0, 0.02) !important;
        border-top: 1px dashed #e2e8f0 !important;
        padding: 14px 16px !important;
    }
    
    tr.conta-row td.col-acoes::before {
        display: none !important;
    }
    
    tr.conta-row td.col-acoes .acoes-cliente {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        justify-content: center !important;
    }
    
    tr.conta-row td.col-acoes .btn-acao {
        flex: 1 1 calc(50% - 4px) !important;
        min-width: 0 !important;
        max-width: none !important;
    }
    
    /* Se há 3 botões (pendente), ajustar */
    tr.conta-row.status-pendente td.col-acoes .btn-acao {
        flex: 1 1 calc(50% - 4px) !important;
    }
    
    /* Se há 2 botões (recebida), lado a lado */
    tr.conta-row.status-recebida td.col-acoes .btn-acao {
        flex: 1 1 calc(50% - 4px) !important;
    }
}

/* ==================== CLIENTES MOBILE ==================== */
@media (max-width: 768px) {
    /* Esconder checkbox e primeira célula */
    tr.cliente-row td.col-checkbox,
    tr.cliente-row td:first-child:has(input[type="checkbox"]) {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
    }
    
    /* Card do cliente */
    tr.cliente-row {
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 12px !important;
        margin-bottom: 16px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
        overflow: hidden !important;
        display: block !important;
    }
    
    /* Header do card - informações do cliente */
    tr.cliente-row td.col-cliente {
        display: block !important;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        color: white !important;
        padding: 16px !important;
        border-bottom: none !important;
    }
    
    tr.cliente-row td.col-cliente::before {
        display: none !important;
    }
    
    tr.cliente-row td.col-cliente .cliente-info {
        justify-content: flex-start !important;
    }
    
    tr.cliente-row td.col-cliente .avatar-cliente {
        background: rgba(255, 255, 255, 0.2) !important;
        color: white !important;
        width: 45px !important;
        height: 45px !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 1.2rem !important;
    }
    
    tr.cliente-row td.col-cliente .cliente-nome {
        color: white !important;
        font-size: 1.1rem !important;
        font-weight: 700 !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
        word-break: break-word !important;
        max-width: none !important;
    }
    
    tr.cliente-row td.col-cliente .cliente-dados {
        overflow: visible !important;
        white-space: normal !important;
        text-overflow: unset !important;
        max-width: none !important;
        flex: 1 !important;
    }
    
    tr.cliente-row td.col-cliente h6,
    tr.cliente-row td.col-cliente h6.mb-0 {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
        max-width: none !important;
    }
    
    tr.cliente-row td.col-cliente .cliente-id {
        color: rgba(255, 255, 255, 0.85) !important;
    }
    
    /* Células normais */
    tr.cliente-row td.col-contato,
    tr.cliente-row td.col-empresa,
    tr.cliente-row td.col-endereco,
    tr.cliente-row td.col-status {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 12px 16px !important;
        border-bottom: 1px solid #e2e8f0 !important;
        background: transparent !important;
    }
    
    tr.cliente-row td.col-contato::before,
    tr.cliente-row td.col-empresa::before,
    tr.cliente-row td.col-endereco::before,
    tr.cliente-row td.col-status::before {
        content: attr(data-label) !important;
        font-weight: 600 !important;
        color: #64748b !important;
        text-transform: uppercase !important;
        font-size: 0.75rem !important;
        flex-shrink: 0 !important;
        margin-right: 12px !important;
    }
    
    tr.cliente-row td.col-contato .telefone-info {
        font-weight: 500 !important;
    }
    
    tr.cliente-row td.col-empresa .empresa-badge {
        font-size: 0.8rem !important;
        padding: 5px 12px !important;
    }
    
    tr.cliente-row td.col-endereco .endereco-info {
        text-align: right !important;
    }
    
    tr.cliente-row td.col-status .badge-status {
        font-size: 0.85rem !important;
        padding: 6px 14px !important;
        font-weight: 700 !important;
    }
    
    /* Ações */
    tr.cliente-row td.col-acoes {
        display: block !important;
        padding: 14px 16px !important;
        background: #f8fafc !important;
        border-top: 1px dashed #e2e8f0 !important;
        border-bottom: none !important;
    }
    
    tr.cliente-row td.col-acoes::before {
        display: none !important;
    }
    
    tr.cliente-row td.col-acoes .acoes-cliente {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        justify-content: center !important;
    }
    
    tr.cliente-row td.col-acoes .btn-acao {
        flex: 1 !important;
        min-width: 0 !important;
        padding: 10px 8px !important;
        font-size: 0.8rem !important;
    }
}

/* ==================== TABELA MOBILE GLOBAL - CARDS RESPONSIVOS ==================== */
/* Sistema de cards mobile reutilizável para todas as tabelas do sistema */

@media (max-width: 768px) {
    /* ===== RESET GLOBAL PARA TABELAS EM MOBILE ===== */
    .table-responsive,
    .table-responsive-mobile {
        overflow-x: visible !important;
        border: none !important;
    }
    
    /* Esconder cabeçalho de todas as tabelas */
    .table-responsive table thead,
    .table-responsive-mobile table thead,
    .table thead,
    #tabelaHistorico thead {
        display: none !important;
    }
    
    /* Cada linha vira um card */
    .table-responsive table tbody tr,
    .table-responsive-mobile table tbody tr,
    .table tbody tr,
    #tabelaHistorico tbody tr {
        display: block !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 12px !important;
        margin-bottom: 16px !important;
        padding: 0 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
        overflow: hidden !important;
    }
    
    .table-responsive table tbody tr:hover,
    .table-responsive-mobile table tbody tr:hover,
    .table tbody tr:hover,
    #tabelaHistorico tbody tr:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    }
    
    /* Cada célula vira uma linha do card */
    .table-responsive table tbody td,
    .table-responsive-mobile table tbody td,
    .table tbody td,
    #tabelaHistorico tbody td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 12px 16px !important;
        border-bottom: 1px solid #e2e8f0 !important;
        text-align: right !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
    }
    
    /* Última célula sem borda inferior */
    .table-responsive table tbody td:last-child,
    .table-responsive-mobile table tbody td:last-child,
    .table tbody td:last-child,
    #tabelaHistorico tbody td:last-child {
        border-bottom: none !important;
    }
    
    /* Label antes do conteúdo usando data-label */
    .table-responsive table tbody td::before,
    .table-responsive-mobile table tbody td::before,
    .table tbody td::before,
    #tabelaHistorico tbody td::before {
        content: attr(data-label) !important;
        font-weight: 600 !important;
        color: #64748b !important;
        text-transform: uppercase !important;
        font-size: 0.75rem !important;
        letter-spacing: 0.03em !important;
        text-align: left !important;
        flex-shrink: 0 !important;
        margin-right: 12px !important;
    }
    
    /* ===== PRIMEIRA CÉLULA - HEADER DO CARD ===== */
    .table-responsive table tbody td:first-child,
    .table-responsive-mobile table tbody td:first-child,
    .table tbody td:first-child,
    #tabelaHistorico tbody td:first-child {
        display: block !important;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        color: white !important;
        padding: 14px 16px !important;
        border-bottom: none !important;
        text-align: left !important;
        font-weight: 700 !important;
        font-size: 1rem !important;
    }
    
    .table-responsive table tbody td:first-child::before,
    .table-responsive-mobile table tbody td:first-child::before,
    .table tbody td:first-child::before,
    #tabelaHistorico tbody td:first-child::before {
        display: none !important;
    }
    
    .table-responsive table tbody td:first-child strong,
    .table-responsive-mobile table tbody td:first-child strong,
    .table tbody td:first-child strong,
    #tabelaHistorico tbody td:first-child strong {
        color: white !important;
        font-size: 1.1rem !important;
    }
    
    /* ===== ÚLTIMA CÉLULA - AÇÕES DO CARD ===== */
    .table-responsive table tbody td:last-child:has(.btn-acao),
    .table-responsive table tbody td:last-child:has(.acoes-cliente),
    .table-responsive-mobile table tbody td:last-child:has(.btn-acao),
    .table tbody td:last-child:has(.btn-acao),
    .table tbody td:last-child:has(.acoes-cliente),
    #tabelaHistorico tbody td:last-child:has(.btn-acao),
    #tabelaHistorico tbody td:last-child:has(.acoes-cliente) {
        display: block !important;
        padding: 14px 16px !important;
        background: #f8fafc !important;
        border-top: 1px dashed #e2e8f0 !important;
        text-align: center !important;
    }
    
    .table-responsive table tbody td:last-child:has(.btn-acao)::before,
    .table-responsive table tbody td:last-child:has(.acoes-cliente)::before,
    #tabelaHistorico tbody td:last-child:has(.btn-acao)::before,
    #tabelaHistorico tbody td:last-child:has(.acoes-cliente)::before {
        display: none !important;
    }
    
    /* Botões de ação - layout flexível */
    .acoes-cliente {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        justify-content: center !important;
        width: 100% !important;
    }
    
    .btn-acao {
        flex: 1 !important;
        min-width: 0 !important;
        max-width: none !important;
        padding: 10px 12px !important;
        font-size: 0.8rem !important;
        font-weight: 600 !important;
        border-radius: 8px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
    }
    
    .btn-acao i {
        font-size: 0.75rem !important;
    }
    
    /* ===== BADGES ===== */
    .table-responsive table tbody td .badge,
    .table-responsive-mobile table tbody td .badge,
    .table tbody td .badge,
    #tabelaHistorico tbody td .badge {
        font-size: 0.8rem !important;
        padding: 5px 12px !important;
        max-width: none !important;
        white-space: normal !important;
    }
    
    /* ===== VALORES MONETÁRIOS ===== */
    .table-responsive table tbody td strong,
    .table-responsive-mobile table tbody td strong,
    .table tbody td strong,
    #tabelaHistorico tbody td strong {
        font-size: 1rem !important;
        color: #10b981 !important;
    }
    
    /* Exceto na primeira célula (header) */
    .table-responsive table tbody td:first-child strong,
    .table-responsive-mobile table tbody td:first-child strong,
    .table tbody td:first-child strong,
    #tabelaHistorico tbody td:first-child strong {
        color: white !important;
    }
    
    /* ===== CARDS DE ESTATÍSTICAS ===== */
    .row.mb-4 > [class*="col-md-3"],
    .row.mb-3 > [class*="col-md-3"] {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        padding: 4px !important;
    }
    
    .row.mb-4 > [class*="col-md-3"] .card,
    .row.mb-4 > [class*="col-md-3"] .stats-card,
    .row.mb-3 > [class*="col-md-3"] .card {
        margin-bottom: 0 !important;
    }
    
    .row.mb-4 > [class*="col-md-3"] .card-body,
    .row.mb-3 > [class*="col-md-3"] .card-body {
        padding: 12px !important;
    }
    
    .row.mb-4 > [class*="col-md-3"] .card-title,
    .row.mb-3 > [class*="col-md-3"] .card-title {
        font-size: 1.1rem !important;
    }
    
    .row.mb-4 > [class*="col-md-3"] .card-text,
    .row.mb-3 > [class*="col-md-3"] .card-text {
        font-size: 0.7rem !important;
    }
    
    .row.mb-4 > [class*="col-md-3"] .fa-2x,
    .row.mb-3 > [class*="col-md-3"] .fa-2x {
        font-size: 1.25rem !important;
    }
    
    /* ===== HEADER DA PÁGINA ===== */
    .container-fluid > .d-flex.justify-content-between.align-items-center,
    .relatorios-header .d-flex.justify-content-between {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }
    
    .container-fluid > .d-flex.justify-content-between > div:last-child,
    .relatorios-header .d-flex.justify-content-between > div:last-child {
        width: 100% !important;
    }
    
    .container-fluid > .d-flex.justify-content-between .btn,
    .relatorios-header .btn {
        width: 100% !important;
    }
    
    /* ===== FILTROS ===== */
    .card-body .row.g-3 > [class*="col-"],
    .card-body .row > [class*="col-md-"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        padding: 4px 8px !important;
    }
    
    /* ===== PAGINAÇÃO ===== */
    .paginacao-container,
    .pagination-container {
        padding: 12px !important;
    }
    
    .paginacao,
    .pagination {
        flex-wrap: wrap !important;
        gap: 4px !important;
        justify-content: center !important;
    }
    
    .paginacao-link,
    .page-link {
        padding: 8px 10px !important;
        font-size: 0.75rem !important;
        min-width: 36px !important;
    }
    
    /* ===== ABAS/TABS EM MOBILE ===== */
    .nav-tabs {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .nav-tabs .nav-link {
        white-space: nowrap !important;
        padding: 8px 12px !important;
        font-size: 0.8rem !important;
    }
    
    /* ===== SELETOR "MOSTRAR POR PÁGINA" ===== */
    .d-flex.align-items-center.mb-3 {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    
    .d-flex.align-items-center.mb-3 select {
        width: auto !important;
        min-width: 80px !important;
    }
}

/* ===== TELAS MUITO PEQUENAS (< 480px) ===== */
@media (max-width: 480px) {
    /* Cards de estatísticas - 1 por linha */
    .row.mb-4 > [class*="col-md-3"],
    .row.mb-3 > [class*="col-md-3"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    /* Botões de ação empilhados */
    .acoes-cliente {
        flex-direction: column !important;
    }
    
    .btn-acao {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Header do card menor */
    .table-responsive table tbody td:first-child,
    .table-responsive-mobile table tbody td:first-child,
    .table tbody td:first-child,
    #tabelaHistorico tbody td:first-child {
        padding: 12px 14px !important;
        font-size: 0.95rem !important;
    }
    
    /* Células mais compactas */
    .table-responsive table tbody td,
    .table-responsive-mobile table tbody td,
    .table tbody td,
    #tabelaHistorico tbody td {
        padding: 10px 14px !important;
        font-size: 0.85rem !important;
    }
}

/* ==================== CORREÇÕES CADASTRO PRODUTO ==================== */
/* Corrigir sobreposição da Margem de Lucro com o menu */
.margem-lucro-card {
    z-index: 10 !important;
    max-width: 100% !important;
    overflow: visible !important;
}

/* Garantir que o container não sobreponha o menu */
.container-fluid {
    padding-left: 15px !important;
    padding-right: 15px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Garantir que as colunas não saiam dos limites */
.container-fluid .row {
    margin-left: -15px !important;
    margin-right: -15px !important;
    max-width: 100% !important;
}

.container-fluid .row > [class*="col-"] {
    padding-left: 15px !important;
    padding-right: 15px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Garantir que cards não ultrapassem os limites */
.container-fluid .card {
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* No desktop, garantir que não sobreponha menu lateral se existir */
@media (min-width: 992px) {
    .margem-lucro-card {
        position: sticky !important;
        top: 80px !important;
        z-index: 10 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Garantir que o card não ultrapasse os limites da coluna */
    .col-lg-4 .margem-lucro-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Se houver sidebar, ajustar margem */
    body:has(.sidebar) .margem-lucro-card,
    body:has(.menu-flutuante) .margem-lucro-card {
        margin-left: 0 !important;
    }
}

/* No mobile, garantir que a coluna lateral fique abaixo */
@media (max-width: 991px) {
    .col-lg-4 {
        margin-top: 1.5rem !important;
        order: 2 !important;
    }
    
    .col-lg-8 {
        order: 1 !important;
    }
    
    .margem-lucro-card {
        position: static !important;
        top: auto !important;
        margin-top: 0 !important;
    }
}

/* Ajustar tamanho do botão Cadastrar Produto - remover btn-lg */
#formCadastrarProduto .btn-primary,
#formCadastrarProduto button[type="submit"],
#formCadastrarProduto .card-body .btn-primary,
#formCadastrarProduto .card-body button[type="submit"],
.card-body .btn-primary.btn-lg,
.card-body button.btn-primary.btn-lg {
    padding: 0.5rem 1.25rem !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    height: auto !important;
    min-height: auto !important;
}

/* Garantir que botões de ação não fiquem gigantes */
.card-body .btn-primary:not(.btn-sm),
.card-body .btn-primary.btn-lg,
.card-body button.btn-primary,
.card-body button.btn-primary.btn-lg,
.row .card .card-body .btn-primary {
    padding: 0.5rem 1.25rem !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
}

/* Remover btn-lg se estiver aplicado em qualquer lugar */
.btn.btn-lg:not(.btn-sm),
button.btn.btn-lg {
    padding: 0.5rem 1.25rem !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    height: auto !important;
}

/* ==================== CORREÇÃO BOTÃO CADASTRAR PRODUTO ==================== */
/* Forçar tamanho normal para o botão Cadastrar Produto - máxima prioridade */
button.btn-cadastrar-produto,
button.btn-cadastrar-produto.btn-primary,
button.btn-cadastrar-produto.btn-primary.btn-lg,
button[type="submit"].btn-cadastrar-produto,
#formCadastrarProduto button.btn-cadastrar-produto,
#formCadastrarProduto button[type="submit"],
.row.mt-4 button.btn-cadastrar-produto,
.row.mt-4 .card .card-body button.btn-cadastrar-produto,
.row.mt-4 .card .card-body button[type="submit"].btn-primary {
    padding: 0.5rem 1.5rem !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    width: auto !important;
    display: inline-block !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

/* Garantir que o botão não fique gigante em qualquer contexto */
.btn-cadastrar-produto.btn-lg,
.btn-cadastrar-produto.btn-primary.btn-lg,
button.btn-cadastrar-produto.btn-lg {
    padding: 0.5rem 1.5rem !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    white-space: nowrap !important;
}

/* Forçar tamanho normal para todos os botões do formulário */
#formCadastrarProduto .btn:not(.btn-sm),
#formCadastrarProduto button:not(.btn-sm) {
    padding: 0.5rem 1.25rem !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    height: auto !important;
}

/* Específico para a área de botões de ação */
.row.mt-4 .card .card-body .btn-primary:not(.btn-sm),
.row.mt-4 .card .card-body button[type="submit"]:not(.btn-sm),
.row.mt-4 .card .card-body .d-flex .btn-primary {
    padding: 0.5rem 1.5rem !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    height: auto !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

/* Garantir que o container dos botões não corte o conteúdo */
.row.mt-4 .card .card-body.d-flex {
    flex-wrap: wrap !important;
    gap: 1rem !important;
}

.row.mt-4 .card .card-body.d-flex > div:last-child {
    display: flex !important;
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
}

/* ==================== MODAL DETALHES DE VENDA ==================== */
#modalDetalhesVenda .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

#modalDetalhesVenda .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    padding: 1.25rem 1.5rem;
    border-bottom: none;
}

#modalDetalhesVenda .modal-header .close {
    color: white;
    opacity: 0.9;
    text-shadow: none;
}

#modalDetalhesVenda .modal-header .close:hover {
    opacity: 1;
}

#modalDetalhesVenda .modal-title {
    font-weight: 600;
    font-size: 1.25rem;
}

#modalDetalhesVenda .modal-body {
    padding: 1.5rem;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.detalhes-venda-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.detalhes-venda-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    font-weight: 600;
    font-size: 1rem;
}

.detalhes-venda-body {
    padding: 20px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #475569;
    font-size: 0.9rem;
    flex: 0 0 40%;
}

.info-value {
    color: #1e293b;
    font-size: 0.95rem;
    text-align: right;
    flex: 1;
    word-break: break-word;
}

/* Estilos específicos para tabela de itens */
#modalDetalhesVenda .detalhes-venda-body .table-responsive {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
}

#modalDetalhesVenda .detalhes-venda-body table {
    width: 100% !important;
    border-collapse: collapse !important;
    display: table !important;
    table-layout: auto !important;
}

#modalDetalhesVenda .detalhes-venda-body table thead {
    display: table-header-group !important;
}

#modalDetalhesVenda .detalhes-venda-body table tbody {
    display: table-row-group !important;
}

#modalDetalhesVenda .detalhes-venda-body table tfoot {
    display: table-footer-group !important;
}

#modalDetalhesVenda .detalhes-venda-body table tr {
    display: table-row !important;
}

#modalDetalhesVenda .detalhes-venda-body table th,
#modalDetalhesVenda .detalhes-venda-body table td {
    display: table-cell !important;
    padding: 12px !important;
    border: 1px solid #e2e8f0 !important;
    vertical-align: middle !important;
}

#modalDetalhesVenda .detalhes-venda-body table th {
    background-color: #f8fafc !important;
    font-weight: 600 !important;
    color: #475569 !important;
}

#modalDetalhesVenda .detalhes-venda-body table tbody tr:hover {
    background-color: #f8fafc !important;
}

/* Responsivo para mobile */
@media (max-width: 768px) {
    #modalDetalhesVenda .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    #modalDetalhesVenda .modal-body {
        padding: 1rem;
    }
    
    .detalhes-venda-card {
        margin-bottom: 16px;
    }
    
    .detalhes-venda-body {
        padding: 16px;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 0;
    }
    
    .info-label {
        margin-bottom: 4px;
        flex: 1 1 100%;
    }
    
    .info-value {
        text-align: left;
        flex: 1 1 100%;
    }
    
    #modalDetalhesVenda .modal-body .table-responsive {
        font-size: 0.85rem;
    }
    
    #modalDetalhesVenda .detalhes-venda-body table {
        font-size: 0.85rem !important;
    }
    
    #modalDetalhesVenda .detalhes-venda-body table th,
    #modalDetalhesVenda .detalhes-venda-body table td {
        padding: 8px 4px !important;
    }
    
    #modalDetalhesVenda .modal-body .btn-lg {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* ==================== EDITAR VENDA - TABELA DE ITENS ==================== */
body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

main {
    overflow-x: hidden !important;
    max-width: 100% !important;
}

.editar-venda-container {
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

.editar-venda-container * {
    box-sizing: border-box !important;
}

#tabelaItens {
    table-layout: fixed !important;
    width: 100% !important;
    max-width: 100% !important;
    border-collapse: collapse !important;
    display: table !important;
    box-sizing: border-box !important;
}

#tabelaItens thead {
    display: table-header-group !important;
}

#tabelaItens tbody {
    display: table-row-group !important;
}

#tabelaItens tfoot {
    display: table-footer-group !important;
}

#tabelaItens tr {
    display: table-row !important;
}

#tabelaItens th,
#tabelaItens td {
    display: table-cell !important;
    padding: 12px 8px !important;
    vertical-align: middle !important;
    border: 1px solid #dee2e6 !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
}

#tabelaItens .form-control {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

@media (max-width: 991px) {
    .editar-venda-container .container-fluid {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        overflow-x: hidden !important;
    }
    
    .editar-venda-container .row {
        margin-left: -0.25rem !important;
        margin-right: -0.25rem !important;
    }
    
    .editar-venda-container .col-md-8,
    .editar-venda-container .col-md-4 {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
        max-width: 100% !important;
    }
    
    #tabelaItens {
        table-layout: fixed !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    #tabelaItens thead th:nth-child(1) { width: 38% !important; }
    #tabelaItens thead th:nth-child(2) { width: 14% !important; }
    #tabelaItens thead th:nth-child(3) { width: 16% !important; }
    #tabelaItens thead th:nth-child(4) { width: 16% !important; }
    #tabelaItens thead th:nth-child(5) { width: 16% !important; }
}

/* ==================== EDITAR VENDA - CARDS MOBILE ==================== */
@media (max-width: 768px) {
    .editar-venda-container .container-fluid {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }
    
    .editar-venda-container .row {
        margin-left: -0.15rem !important;
        margin-right: -0.15rem !important;
    }
    
    .editar-venda-container .col-md-8,
    .editar-venda-container .col-md-4 {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }
    
    .card-body {
        padding: 1rem !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
    }
    
    .table-responsive {
        overflow-x: visible !important;
        overflow-y: visible !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Transformar tabela em cards no mobile */
    #tabelaItens {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        border: none !important;
        table-layout: auto !important;
    }
    
    /* Forçar ocultação do thead mesmo com estilos inline */
    #tabelaItens thead,
    #tabelaItens thead[style],
    #tabelaItens thead.table-dark,
    #tabelaItens thead.table-dark[style] {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
    }
    
    #tabelaItens thead tr,
    #tabelaItens thead tr[style],
    #tabelaItens thead th,
    #tabelaItens thead th[style] {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        width: 0 !important;
        max-width: 0 !important;
    }
    
    #tabelaItens tbody {
        display: block !important;
    }
    
    /* Forçar transformação em cards mesmo com estilos inline */
    #tabelaItens tbody tr.item-row,
    #tabelaItens tbody tr.item-row[style],
    #tabelaItens tbody tr[data-item-id],
    #tabelaItens tbody tr[data-item-id][style] {
        display: block !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 12px !important;
        margin-bottom: 16px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
        overflow: hidden !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        table-layout: auto !important;
    }
    
    #tabelaItens tbody tr.item-row td,
    #tabelaItens tbody tr.item-row td[style],
    #tabelaItens tbody tr[data-item-id] td,
    #tabelaItens tbody tr[data-item-id] td[style] {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 12px 16px !important;
        border: none !important;
        border-bottom: 1px solid #f1f5f9 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        table-layout: auto !important;
    }
    
    #tabelaItens tbody tr.item-row td:last-child {
        border-bottom: none !important;
    }
    
    #tabelaItens tbody tr.item-row td.col-produto {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        color: white !important;
        font-weight: 600 !important;
        padding: 16px !important;
        border-bottom: none !important;
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    
    #tabelaItens tbody tr.item-row td.col-produto::before {
        content: attr(data-label) !important;
        font-weight: 600 !important;
        font-size: 0.85rem !important;
        margin-bottom: 8px !important;
        opacity: 0.9 !important;
    }
    
    #tabelaItens tbody tr.item-row td.col-produto .produto-select {
        background: white !important;
        color: #1e293b !important;
        border: none !important;
        border-radius: 6px !important;
        padding: 10px 12px !important;
        width: 100% !important;
        max-width: 100% !important;
        font-size: 0.9rem !important;
        box-sizing: border-box !important;
    }
    
    #tabelaItens tbody tr.item-row td.col-quantidade,
    #tabelaItens tbody tr.item-row td.col-preco {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    
    #tabelaItens tbody tr.item-row td.col-quantidade::before,
    #tabelaItens tbody tr.item-row td.col-preco::before {
        content: attr(data-label) !important;
        font-weight: 600 !important;
        color: #475569 !important;
        font-size: 0.85rem !important;
        margin-bottom: 6px !important;
    }
    
    #tabelaItens tbody tr.item-row td.col-quantidade .quantidade-input,
    #tabelaItens tbody tr.item-row td.col-preco .preco-input {
        width: 100% !important;
        max-width: 100% !important;
        text-align: right !important;
        font-size: 0.9rem !important;
        box-sizing: border-box !important;
    }
    
    #tabelaItens tbody tr.item-row td.col-subtotal {
        flex-direction: row !important;
        justify-content: space-between !important;
    }
    
    #tabelaItens tbody tr.item-row td.col-subtotal::before {
        content: attr(data-label) ": " !important;
        font-weight: 600 !important;
        color: #475569 !important;
        font-size: 0.9rem !important;
    }
    
    #tabelaItens tbody tr.item-row td.col-subtotal {
        background: #f8fafc !important;
        border-top: 2px solid #10b981 !important;
    }
    
    #tabelaItens tbody tr.item-row td.col-subtotal .subtotal {
        font-size: 1.1rem !important;
        color: #10b981 !important;
        font-weight: 700 !important;
    }
    
    #tabelaItens tbody tr.item-row td.col-acoes {
        justify-content: center !important;
        padding: 12px !important;
    }
    
    #tabelaItens tbody tr.item-row td.col-acoes::before {
        display: none !important;
    }
    
    #tabelaItens tbody tr.item-row td.col-acoes .btn {
        width: 100% !important;
        padding: 10px !important;
    }
    
    /* Footer da tabela (Total) */
    #tabelaItens tfoot {
        display: block !important;
        background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
        border-radius: 12px !important;
        padding: 16px !important;
        margin-top: 16px !important;
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2) !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    #tabelaItens tfoot tr {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
    }
    
    #tabelaItens tfoot td {
        display: block !important;
        border: none !important;
        padding: 0 !important;
        color: white !important;
        box-sizing: border-box !important;
    }
    
    #tabelaItens tfoot td.col-total-label {
        font-size: 1rem !important;
        font-weight: 600 !important;
        margin-bottom: 4px !important;
    }
    
    #tabelaItens tfoot td.col-total-value {
        font-size: 1.5rem !important;
        font-weight: 700 !important;
    }
    
    #tabelaItens tfoot td:last-child {
        display: none !important;
    }
    
    /* Ajustar form-controls dentro dos cards */
    #tabelaItens tbody tr.item-row td .form-control {
        font-size: 0.9rem !important;
        padding: 0.5rem 0.75rem !important;
        border: 1px solid #ced4da !important;
        border-radius: 6px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Garantir que não haja overflow */
    #tabelaItens tbody tr.item-row,
    #tabelaItens tbody tr.item-row td,
    #tabelaItens tbody tr.item-row td * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Forçar remoção de estilos inline de tabela no mobile */
    #tabelaItens tbody tr.item-row[style],
    #tabelaItens tbody tr[data-item-id][style] {
        display: block !important;
    }
    
    #tabelaItens tbody tr.item-row td[style],
    #tabelaItens tbody tr[data-item-id] td[style] {
        display: flex !important;
    }
    
    /* Sobrescrever todos os estilos inline que possam interferir */
    .editar-venda-container #tabelaItens thead,
    .editar-venda-container #tabelaItens thead * {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
    }
    
    /* Garantir que o container não corte */
    .editar-venda-container .card-body,
    .editar-venda-container .table-responsive {
        overflow-x: visible !important;
        overflow-y: visible !important;
    }
}
