/* Reset e Configurações Globais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 50%, #1B5E20 100%);
    min-height: 100vh;
    color: #333;
}

/* Tela de Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 25px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15), 
                0 10px 20px rgba(46, 139, 87, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid rgba(244, 67, 54, 0.1);
}

.logo {
    margin-bottom: 30px;
}

.logo i {
    font-size: 60px;
    color: #F44336;
    margin-bottom: 10px;
}

.logo h1 {
    color: #333;
    font-size: 32px;
    margin-bottom: 5px;
    font-weight: 700;
}

.logo p {
    color: #666;
    font-size: 16px;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #F44336;
    font-size: 18px;
}

.input-group input {
    width: 100%;
    padding: 15px 15px 15px 50px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.input-group input:focus {
    outline: none;
    border-color: #F44336;
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.1);
}

.btn-login {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #F44336 0%, #C62828 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(244, 67, 54, 0.3);
}

.btn-login i {
    margin-right: 8px;
}

.error-message {
    background: #ff4757;
    color: white;
    padding: 10px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 14px;
}



/* Tela Principal */
.header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 
                0 2px 8px rgba(46, 139, 87, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid rgba(244, 67, 54, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 30px;
    /* max-width: 1200px; */
    margin: 0 auto;
}

.logo-header {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.logo-header i {
    color: #F44336;
    margin-right: 10px;
    font-size: 28px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.badge {
    background: #4CAF50;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.btn-logout {
    background: #ff4757;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: #ff3742;
    transform: translateY(-1px);
}

/* Navegação */
.nav-tabs {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 0 30px;
    display: flex;
    border-bottom: 3px solid rgba(244, 67, 54, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.nav-tab {
    background: none;
    border: none;
    padding: 15px 25px;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-tab:hover {
    color: #F44336;
    background: #f8f9fa;
}

.nav-tab.active {
    color: #F44336;
    border-bottom-color: #F44336;
    font-weight: 600;
}

/* Conteúdo Principal */
.main-content {
    margin: 0 auto;
    padding: 30px;
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    min-height: calc(100vh - 140px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.content-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

@media (min-width: 769px) {
    .content-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 20px;
    }
    
    .relatorio-buttons {
        flex-direction: row !important;
    }
}

.header-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

@media (min-width: 769px) {
    .header-actions {
        flex-direction: row;
        gap: 15px;
    }
}

/* Para todas as telas - botões sempre lado a lado */
.relatorio-buttons {
    flex-direction: row !important;
}

#relatorioButtonsContainer {
    display: flex !important;
    flex-direction: row !important;
    gap: 15px;
}

#relatorioButtonsContainer button {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* Forçar layout horizontal para os botões em todas as situações */
#imprimirRelatorioBtn,
#exportPdfBtn,
#exportRelatorioBtn {
    display: inline-block !important;
    float: none !important;
    clear: none !important;
}

#relatorioButtonsContainer {
    white-space: nowrap;
}

#relatorioButtonsContainer::after {
    content: "";
    display: table;
    clear: both;
}

.content-header h2 {
    color: #333;
    font-size: 28px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #24bd0d 0%, #2d9b12 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: linear-gradient(135deg, #F44336 0%, #C62828 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(244, 67, 54, 0.2);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #C62828 0%, #B71C1C 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(244, 67, 54, 0.3);
}

#exportPdfBtn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    color: white !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

#exportPdfBtn:hover {
    background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%) !important;
}

.btn-edit {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    margin-right: 5px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.2);
}

.btn-edit:hover {
    background: linear-gradient(135deg, #2E7D32 0%, #1B5E20 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.btn-disabled {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: not-allowed;
    opacity: 0.6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    margin-right: 5px;
}

/* Tabelas */
.table-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1), 
                0 4px 10px rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.05);
}

/* Mobile cards - escondidos no desktop */
.mobile-cards {
    display: none;
}

/* Estilos para Relatórios */
.relatorio-buttons {
    display: flex !important;
    flex-direction: row !important;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.relatorio-buttons button {
    display: inline-block !important;
    margin: 0 !important;
}

.filtros-container {
    margin-bottom: 25px;
}

.filtros-card {
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.1);
}

.filtros-card h3 {
    color: #2E7D32;
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filtros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.filtro-group {
    display: flex;
    flex-direction: column;
}

.filtro-group label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
}

.filtro-input {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.filtro-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.filtro-group-checkbox {
    justify-content: flex-end;
    gap: 6px;
}

.filtro-checkbox {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.filtro-checkbox input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    accent-color: #2E7D32;
    cursor: pointer;
}

.filtro-hint {
    color: #6c757d;
    font-size: 12px;
    line-height: 1.35;
}

.filtros-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.resumo-container {
    margin-bottom: 25px;
}

.resumo-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.resumo-card {
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(76, 175, 80, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.resumo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.15);
}

.resumo-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.resumo-info h4 {
    margin: 0 0 5px 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
}

.resumo-info span {
    font-size: 20px;
    font-weight: 700;
    color: #2E7D32;
}

.comparacao-anterior-container {
    margin-bottom: 25px;
    padding: 18px;
    background: #ffffff;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.comparacao-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.comparacao-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 6px 0;
    color: #253858;
    font-size: 17px;
    font-weight: 700;
}

.comparacao-header p {
    margin: 0;
    color: #5f6c7b;
    font-size: 13px;
}

.comparacao-header p span {
    margin: 0 8px;
    color: #9aa5b1;
}

.comparacao-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
}

.comparacao-card {
    min-width: 0;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #e5edf5;
    border-radius: 8px;
}

.comparacao-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.comparacao-card-header h4 {
    margin: 0;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.comparacao-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: #2454a6;
    background: #e8f1ff;
    border-radius: 8px;
}

.comparacao-valores {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.comparacao-valores div {
    min-width: 0;
}

.comparacao-valores span {
    display: block;
    margin-bottom: 4px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.comparacao-valores strong {
    display: block;
    color: #1f2937;
    font-size: 16px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.comparacao-variacao {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    padding: 6px 9px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.comparacao-variacao span {
    overflow-wrap: anywhere;
}

.comparacao-variacao--up {
    color: #166534;
    background: #dcfce7;
}

.comparacao-variacao--down {
    color: #991b1b;
    background: #fee2e2;
}

.comparacao-variacao--same {
    color: #475569;
    background: #e2e8f0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

tbody td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

tbody tr:hover {
    background: #f8f9fa;
}

tbody tr:last-child td {
    border-bottom: none;
}

#relatorioTable .metas-grupo-header td {
    background: #f5f7fb;
    font-weight: 700;
    border-top: 2px solid #dce5ff;
    color: #1f2937;
}

#relatorioTable .metas-grupo-total td {
    background: #eef3ff;
    font-weight: 700;
}

#relatorioTable .metas-grupo-separador td {
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    height: 14px;
}

#relatorioTable .metas-grupo-separador:hover {
    background: transparent !important;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    margin: 2% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25), 
                0 10px 20px rgba(76, 175, 80, 0.1);
    animation: modalSlideIn 0.3s ease;
    border: 1px solid rgba(244, 67, 54, 0.1);
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex-grow: 1;
}

/* Scanner modal */
.scanner-modal {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.scanner-info-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 16px;
    background: linear-gradient(135deg, #1f6feb 0%, #38bdf8 100%);
    color: #ffffff;
    box-shadow: 0 18px 38px -20px rgba(31, 111, 235, 0.6);
}

.scanner-info-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.scanner-info-details h4 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: #ffffff;
}

.scanner-info-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
    font-size: 0.85rem;
    opacity: 0.9;
}

.scanner-info-meta i {
    margin-right: 6px;
}

.scanner-info-badge {
    background: rgba(255, 255, 255, 0.25);
    padding: 2px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.scanner-form .form-group label {
    font-size: 0.95rem;
}

.scanner-input {
    border-radius: 12px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.scanner-input:focus {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.scanner-modal .form-hint {
    display: block;
    margin-top: 6px;
    color: #6b7280;
    font-size: 0.8rem;
}

.scanner-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
}

.scanner-modal-footer .btn-secondary,
.scanner-modal-footer .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.scanner-modal-footer .btn-primary i,
.scanner-modal-footer .btn-secondary i {
    font-size: 0.9rem;
}

@media (max-width: 480px) {
    .scanner-info-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .scanner-info-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .scanner-modal-footer {
        flex-direction: column-reverse;
        align-items: stretch;
    }
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Checkbox personalizado */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.checkbox-label input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: #4CAF50;
    border-color: #4CAF50;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-label:hover .checkbox-custom {
    border-color: #4CAF50;
}

/* Badges para status */
.badge-success {
    background: #4CAF50;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-danger {
    background: #F44336;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: #4CAF50;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.btn-warning {
    background: #FF9800;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    margin: 0 2px;
}

.btn-warning:hover {
    background: #F57C00;
    transform: translateY(-1px);
}

.btn-success {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    margin: 0 2px;
}

.btn-success:hover {
    background: #388E3C;
    transform: translateY(-1px);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #F44336;
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.1);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
}

/* Loading */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #F44336;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 4000;
    transform: translateX(400px);
    transition: all 0.3s ease;
    background: #666; /* Background padrão para evitar texto sem fundo */
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: #2ed573;
}

.toast.error {
    background: #ff4757;
}

.toast.info {
    background: #3742fa;
}

.toast.warning {
    background: #FF9800;
}

/* Modal de Confirmação */
.confirm-modal {
    display: none;
    position: fixed;
    z-index: 5000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.confirm-modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    margin: 10% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3), 
                0 10px 20px rgba(244, 67, 54, 0.15);
    animation: slideIn 0.3s ease;
    border: 1px solid rgba(244, 67, 54, 0.1);
    overflow: hidden;
    position: relative;
}

@keyframes slideIn {
    from {
        transform: translateY(-100px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.confirm-modal-header {
    background: linear-gradient(135deg, #F44336 0%, #C62828 100%);
    color: white;
    padding: 25px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.confirm-modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 3s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

.confirm-modal-header i {
    font-size: 36px;
    margin-bottom: 10px;
    display: block;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

.confirm-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 1;
    position: relative;
}

.confirm-modal-body {
    padding: 30px 25px;
    text-align: center;
}

.confirm-modal-body p {
    font-size: 16px;
    color: #495057;
    margin: 0;
    line-height: 1.6;
    font-weight: 500;
}

.confirm-modal-buttons {
    display: flex;
    gap: 15px;
    padding: 0 25px 25px;
    justify-content: space-between;
}

.btn-cancel,
.btn-confirm {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-cancel {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-cancel:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.btn-confirm {
    background: linear-gradient(135deg, #F44336 0%, #C62828 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-confirm:hover {
    background: linear-gradient(135deg, #E53935 0%, #B71C1C 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.5);
}

.btn-cancel i,
.btn-confirm i {
    font-size: 12px;
}

/* Responsivo para modal de confirmação */
@media (max-width: 768px) {
    .confirm-modal-content {
        margin: 20% auto;
        width: 95%;
        max-width: 400px;
    }

    .confirm-modal-header {
        padding: 20px;
    }

    .confirm-modal-header i {
        font-size: 32px;
    }

    .confirm-modal-header h3 {
        font-size: 18px;
    }

    .confirm-modal-body {
        padding: 25px 20px;
    }

    .confirm-modal-body p {
        font-size: 15px;
    }

    .confirm-modal-buttons {
        flex-direction: column;
        gap: 12px;
        padding: 0 20px 20px;
    }

    .btn-cancel,
    .btn-confirm {
        padding: 12px 15px;
        font-size: 13px;
    }

    /* Relatórios responsivos */
    .filtros-card {
        padding: 20px 15px;
    }

    .filtros-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .filtros-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .filtros-buttons button {
        width: 100%;
        justify-content: center;
    }

    .relatorio-buttons {
        flex-direction: column !important;
        gap: 10px;
        justify-content: center;
        flex-wrap: nowrap;
        align-items: stretch;
    }

    .relatorio-buttons button {
        flex: 1 1 auto;
        width: 100%;
        min-width: auto;
        margin-bottom: 0;
        padding: 12px 20px;
        font-size: 14px;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .resumo-cards {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .resumo-card {
        padding: 15px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .comparacao-anterior-container {
        padding: 15px;
    }

    .comparacao-header {
        display: block;
    }

    .comparacao-header p {
        display: grid;
        gap: 3px;
    }

    .comparacao-header p span {
        display: none;
    }

    .comparacao-grid {
        grid-template-columns: 1fr;
    }

    .resumo-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .resumo-info span {
        font-size: 18px;
    }
}

.screen {
    min-height: 100vh;
}

/* Tablets - versão híbrida */
@media (max-width: 1024px) and (min-width: 769px) {
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 13px;
        min-width: 800px;
    }

    thead th,
    tbody td {
        padding: 10px 8px;
    }

    .btn-edit,
    .btn-danger {
        padding: 6px 10px;
        font-size: 11px;
    }
}

/* Responsividade Mobile */
@media (max-width: 768px) {
    .header {
        background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
        color: white;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }

    .header-content {
        padding: 15px;
        /* flex-direction: column; */
        gap: 15px;
        position: relative;
    }

    .logo-header {
        font-size: 18px;
        color: white;
        justify-content: center;
        align-items: center;
        text-align: center;
        padding: 10px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 15px;
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }

    .logo-header img {
        filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
    }

    .logo-header span {
        color: white;
        font-weight: 700;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        display: none !important;
    }

    .user-info {
        background: rgba(255, 255, 255, 0.15);
        border-radius: 20px;
        padding: 5px 20px;
        backdrop-filter: blur(15px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 15px;
        position: relative;
        overflow: hidden;
    }

    .user-info::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
        animation: shimmer 3s infinite;
    }

    @keyframes shimmer {
        0% { transform: translateX(-100%); }
        50% { transform: translateX(100%); }
        100% { transform: translateX(100%); }
    }

    .user-info-left {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        z-index: 1;
    }

    .user-info #userName {
        color: white;
        font-weight: 600;
        font-size: 16px;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
        margin: 0;
    }

    .user-info .badge {
        background: linear-gradient(135deg, #F44336 0%, #C62828 100%);
        color: white;
        padding: 4px 12px;
        border-radius: 15px;
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

    .btn-logout {
        background: linear-gradient(135deg, #F44336 0%, #C62828 100%);
        color: white;
        border: none;
        padding: 10px 15px;
        border-radius: 15px;
        cursor: pointer;
        font-size: 13px;
        font-weight: 600;
        transition: all 0.3s ease;
        box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.2);
        z-index: 1;
        backdrop-filter: blur(5px);
    }

    .btn-logout:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(244, 67, 54, 0.4);
    }

    .btn-logout i {
        margin-right: 6px;
        font-size: 12px;
    }

    .nav-tabs {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.95) 100%);
        backdrop-filter: blur(10px);
        padding: 8px 15px;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        border-bottom: none;
        box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .nav-tabs::-webkit-scrollbar {
        display: none;
    }

    .nav-tab {
        padding: 12px 18px;
        font-size: 13px;
        min-width: 110px;
        flex-shrink: 0;
        background: rgba(255, 255, 255, 0.7);
        margin: 4px 6px;
        border-radius: 12px;
        border: 1px solid rgba(76, 175, 80, 0.1);
        transition: all 0.3s ease;
        color: #495057;
        font-weight: 500;
        backdrop-filter: blur(5px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }

    .nav-tab:hover {
        background: rgba(76, 175, 80, 0.1);
        color: #2E7D32;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(76, 175, 80, 0.15);
    }

    .nav-tab.active {
        background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
        color: white;
        border-color: #2E7D32;
        transform: translateY(-1px);
        box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
        font-weight: 600;
    }

    .nav-tab i {
        margin-right: 6px;
        font-size: 12px;
    }

    .main-content {
        padding: 20px 15px;
        margin-top: -10px;
        border-radius: 25px 25px 0 0;
        background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
        box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.1);
        position: relative;
        z-index: 10;
    }

    .main-content::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: #e9ecef;
        border-radius: 2px;
    }

    .content-header {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        background: linear-gradient(135deg, rgba(76, 175, 80, 0.05) 0%, rgba(46, 125, 50, 0.05) 100%);
        padding: 20px;
        border-radius: 20px;
        border: 1px solid rgba(76, 175, 80, 0.1);
        margin-bottom: 25px;
    }

    .content-header h2 {
        font-size: 20px;
        text-align: center;
        color: #2E7D32;
        margin: 0;
        font-weight: 700;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .content-header h2 i {
        background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        margin-right: 8px;
        font-size: 18px;
    }

    /* Tabelas responsivas - Layout de Cards */
    .table-container {
        overflow: visible;
        border-radius: 8px;
        box-shadow: none;
    }

    .main-content > .tab-content > .table-container table {
        display: none; /* Esconde tabela tradicional no mobile apenas para as abas principais */
    }
    
    /* Manter tabelas do dashboard visíveis no mobile */
    .dashboard-table-card table {
        display: table !important;
    }

    /* Container de cards para mobile */
    .mobile-cards {
        display: block;
    }

    .mobile-card {
        background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
        border-radius: 18px;
        margin-bottom: 16px;
        padding: 20px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
        border: 1px solid rgba(76, 175, 80, 0.1);
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }

    .mobile-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    }

    .mobile-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(76, 175, 80, 0.15);
        border-color: rgba(76, 175, 80, 0.2);
    }

    .mobile-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 15px;
        padding-bottom: 10px;
        border-bottom: 2px solid #f8f9fa;
    }

    /* Versão compacta para lançamentos no mobile: título à esquerda, ações (somente ícones) à direita */
    .mobile-card--compact .mobile-card-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: 0;
        flex-wrap: nowrap;
        width: 100%;
    }

    .mobile-card--compact .mobile-card-title {
        flex: 1 1 auto;
        min-width: 0;
        padding-right: 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-card--compact .mobile-card-actions {
        flex: 0 0 auto;
        display: flex;
        gap: 8px;
        align-items: center;
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-top: 0 !important;
        justify-content: flex-end !important;
    }

    .mobile-card--compact .mobile-card-actions .btn-edit,
    .mobile-card--compact .mobile-card-actions .btn-danger,
    .mobile-card--compact .mobile-card-actions .btn-disabled {
        padding: 8px;
        min-width: 36px;
        height: 36px;
        border-radius: 8px;
        margin: 0;
    }

    .mobile-card--compact .mobile-card-actions .btn-edit i,
    .mobile-card--compact .mobile-card-actions .btn-danger i,
    .mobile-card--compact .mobile-card-actions .btn-disabled i {
        margin: 0;
        font-size: 14px;
    }

    .mobile-card-id {
        background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
        color: white;
        padding: 6px 12px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: bold;
    }

    .mobile-card-body {
        display: grid;
        gap: 12px;
    }

    .mobile-card-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
    }

    .mobile-card-label {
        font-weight: 600;
        color: #495057;
        font-size: 14px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .mobile-card-value {
        color: #333;
        font-size: 14px;
        text-align: right;
        flex: 1;
        margin-left: 10px;
    }

    .mobile-card-actions {
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid #f8f9fa;
        display: flex;
        gap: 8px;
        justify-content: flex-end;
    }



    .btn-edit,
    .btn-danger {
        padding: 8px 12px;
        font-size: 12px;
        margin-right: 0;
        border-radius: 8px;
        display: flex;
        align-items: center;
        gap: 5px;
    }

    .btn-edit i,
    .btn-danger i {
        font-size: 12px;
    }

    /* Modal responsivo */
    .modal-content {
        margin: 5% auto;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-body {
        padding: 20px 15px;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .modal-buttons button {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }

    /* Login responsivo */
    .login-box {
        padding: 30px 20px;
        margin: 20px;
        max-width: 350px;
    }

    .logo i {
        font-size: 50px;
    }

    .logo h1 {
        font-size: 28px;
    }

    .input-group input {
        padding: 12px 12px 12px 45px;
        font-size: 16px; /* Evita zoom no iOS */
    }

    .input-group i {
        left: 12px;
        font-size: 16px;
    }

    /* Botões responsivos */
    .btn-primary {
        padding: 12px 15px;
        font-size: 14px;
        justify-content: center;
    }

    /* Toast responsivo */
    .toast {
        right: 10px;
        left: auto;
        width: calc(100% - 20px);
        max-width: 350px;
        transform: translateX(400px);
        margin: 0;
    }

    .toast.show {
        transform: translateX(0);
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 12px;
        gap: 12px;
    }

    .logo-header {
        padding: 8px 0px 8px 8px;
        font-size: 16px;
    }

    .logo-header img {
        width: 80px;
    }

    .user-info {
        padding: 12px 16px;
        border-radius: 16px;
    }

    .user-info #userName {
        font-size: 14px;
    }

    .btn-logout {
        padding: 8px 12px;
        font-size: 12px;
        border-radius: 12px;
    }

    .nav-tabs {
        padding: 6px 10px;
    }

    .nav-tab {
        padding: 10px 14px;
        font-size: 12px;
        min-width: 90px;
        margin: 3px 4px;
        border-radius: 10px;
    }

    .main-content {
        padding: 15px 10px;
        border-radius: 20px 20px 0 0;
    }

    .content-header {
        padding: 15px;
        gap: 15px;
        border-radius: 16px;
        margin-bottom: 20px;
    }

    .content-header h2 {
        font-size: 18px;
    }

    .content-header h2 i {
        font-size: 16px;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
        padding: 14px;
        border-radius: 12px;
        font-size: 23px;
        font-weight: 600;
    }

    /* Cards ainda menores em telas muito pequenas */
    .mobile-card {
        padding: 15px;
        margin-bottom: 12px;
    }

    .mobile-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* Manter layout horizontal para cards compactos (lançamentos) */
    .mobile-card--compact .mobile-card-header {
        flex-direction: row !important;
        align-items: start !important;
        justify-content: space-between !important;
        gap: 10px !important;
    }

    .mobile-card-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        padding: 6px 0;
    }

    .mobile-card-label {
        font-size: 12px;
        margin-bottom: 3px;
    }

    .mobile-card-value {
        font-size: 14px;
        text-align: left;
        margin-left: 0;
        font-weight: 500;
    }

    .mobile-card-actions {
        flex-direction: column;
        gap: 8px;
    }

    /* Manter layout horizontal para actions dos cards compactos (lançamentos) */
    .mobile-card--compact .mobile-card-actions {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .btn-edit,
    .btn-danger {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }

    .modal-content {
        width: 98%;
        margin: 2% auto;
    }

    .modal-body {
        padding: 15px 10px;
    }

    .login-box {
        padding: 25px 15px;
        margin: 15px;
    }

    .nav-tab {
        padding: 10px 15px;
        font-size: 12px;
        min-width: 100px;
    }

    .btn-logout {
        padding: 6px 12px;
        font-size: 12px;
    }

    .badge {
        padding: 3px 8px;
        font-size: 10px;
    }

    /* Botões de relatório em telas pequenas */
    .relatorio-buttons {
        flex-direction: column !important;
        gap: 12px;
        align-items: stretch;
    }
    
    #relatorioButtonsContainer {
        flex-direction: column !important;
        gap: 12px !important;
        align-items: stretch !important;
    }
    
    .relatorio-buttons button,
    #imprimirRelatorioBtn,
    #exportPdfBtn,
    #exportRelatorioBtn {
        width: 100% !important;
        padding: 14px 20px !important;
        font-size: 14px !important;
        text-align: center !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 10px !important;
        flex: 1 1 auto !important;
        min-width: auto !important;
        float: none !important;
        clear: none !important;
        white-space: nowrap !important;
    }
}

/* Melhorias de toque para mobile */
@media (hover: none) and (pointer: coarse) {
    .btn-primary:hover,
    .btn-secondary:hover,
    .btn-danger:hover,
    .btn-edit:hover,
    .btn-logout:hover {
        transform: none;
        box-shadow: none;
    }

    .btn-login:hover {
        transform: none;
        box-shadow: none;
    }

    .nav-tab:hover {
        background: none;
    }
}

/* Acessibilidade */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Estilos do Controle de Caixa */
.caixa-container {
    margin-bottom: 20px;
}

.caixa-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.caixa-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.caixa-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.caixa-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
}

.status-indicator {
    font-size: 20px;
    line-height: 1;
}

.status-indicator.aberto {
    color: #28a745;
}

.status-indicator.fechado {
    color: #dc3545;
}

.caixa-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-label {
    font-weight: 600;
    color: #495057;
}

.info-row span:last-child {
    color: #212529;
    font-weight: 500;
}

.caixa-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
}

.caixa-actions .form-group {
    margin-bottom: 10px;
    flex: 1 0 100%;
}

.caixa-actions label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
}

.caixa-actions select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    font-size: 14px;
}

.caixa-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    min-height: 38px;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Mobile responsivo para controle de caixa */
@media (max-width: 768px) {
    .caixa-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .caixa-status {
        align-self: flex-end;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .caixa-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Estilos de Impressão */
@media print {
    /* Esconder elementos desnecessários na impressão */
    .header,
    .nav-tabs,
    .filtros-container,
    .relatorio-buttons,
    #relatorioButtonsContainer,
    #imprimirRelatorioBtn,
    #exportPdfBtn,
    #exportRelatorioBtn,
    .btn-primary,
    .btn-secondary,
    .btn-danger,
    .btn-edit,
    .toast,
    .modal,
    .loading,
    .mobile-cards {
        display: none !important;
    }

    /* Esconder todas as outras abas exceto relatórios */
    #lancamentos,
    #empresas,
    #maquinas,
    #usuarios {
        display: none !important;
    }

    /* Configurações gerais de impressão */
    * {
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    html, body {
        background: white !important;
        color: black !important;
        font-family: Arial, sans-serif !important;
        font-size: 12px !important;
        line-height: 1.2 !important;
        margin: 0 !important;
        padding: 5px !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .main-content {
        background: white !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        page-break-after: avoid !important;
        overflow: visible !important;
    }

    .main-content::before {
        content: none !important;
        display: none !important;
    }

    /* Container de relatórios específico */
    #relatorios {
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* Cabeçalho do relatório para impressão */
    .tab-content {
        page-break-inside: auto;
    }

    .tab-content h2 {
        color: black !important;
        text-align: center !important;
        font-size: 18px !important;
        font-weight: bold !important;
        line-height: 1.35 !important;
        display: block !important;
        margin: 0 0 14px 0 !important;
        padding: 0 !important;
        border: none !important;
        text-decoration: none !important;
        page-break-after: avoid;
    }

    #relatorios .content-header h2,
    #relatorios .content-header h2 * {
        text-decoration: none !important;
    }

    /* Resumo na impressão */
    .resumo-container {
        background: white !important;
        border: 1px solid black !important;
        margin-bottom: 20px;
        page-break-inside: avoid;
        page-break-after: avoid;
        padding: 15px;
    }

    .resumo-cards {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 15px !important;
    }

    .resumo-card {
        background: white !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        margin-bottom: 0;
        padding: 10px;
        display: flex !important;
        flex-direction: column !important;
        align-items: center;
        text-align: center;
        border-radius: 0 !important;
    }

    .resumo-icon {
        background: #f0f0f0 !important;
        color: #333 !important;
        width: 30px !important;
        height: 30px !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        margin-bottom: 8px;
        font-size: 14px !important;
    }

    .resumo-info h4 {
        color: black !important;
        font-size: 12px;
        margin: 0;
    }

    .resumo-info span {
        color: black !important;
        font-weight: bold;
        font-size: 12px;
    }

    /* Tabela para impressão */
    .mobile-cards {
        display: none !important;
    }

    table {
        display: table !important;
        width: 100% !important;
        border-collapse: collapse;
        margin: 10px 0 0 0 !important;
        page-break-inside: auto;
    }

    table thead {
        display: table-header-group;
        page-break-after: avoid;
    }

    table tbody {
        display: table-row-group;
    }
    
    /* Repetir cabeçalho da tabela em cada página */
    @page {
        margin: 1cm;
    }
    
    thead {
        display: table-header-group;
    }

    table th,
    table td {
        border: 1px solid black !important;
        padding: 4px 3px !important;
        text-align: left;
        background: white !important;
        color: black !important;
        font-size: 9px !important;
        vertical-align: top;
        line-height: 1.1 !important;
    }

    #relatorioTable .metas-grupo-header td {
        background: #f5f7fb !important;
        font-weight: 700 !important;
    }

    #relatorioTable .metas-grupo-total td {
        background: #eef3ff !important;
        font-weight: 700 !important;
    }

    #relatorioTable .metas-grupo-separador td {
        border: 0 !important;
        background: white !important;
        padding: 0 !important;
        height: 8px !important;
    }

    table th {
        background: #f0f0f0 !important;
        font-weight: bold;
        text-align: center;
        padding: 3px 2px !important;
    }

    table tr {
        page-break-inside: avoid;
    }

    /* Forçar quebra de página quando necessário */
    .page-break {
        page-break-before: always;
    }

    /* Configuração da página */
    @page {
        margin: 1cm;
        size: A4;
        padding: 0;
        @bottom-right {
            content: "Página " counter(page);
            font-size: 10px;
        }
        @bottom-left {
            content: "Manhattan";
            font-size: 10px;
        }
    }

    /* Evitar quebras de página desnecessárias */
    @page :last {
        margin-bottom: 0;
    }

    /* Ajustes para economizar papel */
    .table-container {
        background: white !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        overflow: visible !important;
    }

    /* Forçar fim do conteúdo da página */
    body::after {
        content: "";
        display: block;
        height: 0 !important;
        page-break-after: auto !important;
    }

    /* Controle rigoroso de elementos */
    .tab-content {
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        page-break-after: avoid !important;
    }

    .content-header {
        background: white !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 0 10px 0 !important;
        page-break-after: avoid !important;
    }

    #relatorios .content-header {
        display: none !important;
    }

    #printHeaderTemp {
        display: block !important;
        text-align: center !important;
        margin: 0 0 14px 0 !important;
        padding: 0 !important;
        background: white !important;
        border: 0 !important;
        page-break-after: avoid !important;
    }

    #printHeaderTemp .print-title-main {
        display: block !important;
        font-size: 28px !important;
        font-weight: 700 !important;
        line-height: 1.3 !important;
        margin: 0 !important;
        padding: 0 !important;
        text-decoration: none !important;
        text-shadow: none !important;
        border: 0 !important;
    }

    #printHeaderTemp .print-title-sub {
        display: block !important;
        font-size: 20px !important;
        font-weight: 700 !important;
        line-height: 1.25 !important;
        margin: 2px 0 0 0 !important;
        padding: 0 !important;
        text-decoration: none !important;
        text-shadow: none !important;
        border: 0 !important;
    }

    /* Reset forte do título para evitar sobreposição/traços na impressão */
    #relatorios .content-header,
    #relatorios .content-header h2 {
        position: static !important;
        overflow: visible !important;
        transform: none !important;
        text-shadow: none !important;
        background: white !important;
        z-index: auto !important;
    }

    #relatorios .content-header::before,
    #relatorios .content-header::after,
    #relatorios .content-header h2::before,
    #relatorios .content-header h2::after {
        content: none !important;
        display: none !important;
        border: 0 !important;
    }

    #relatorios .content-header h2 .print-title-main,
    #relatorios .content-header h2 .print-title-sub {
        display: block !important;
        text-decoration: none !important;
        line-height: 1.35 !important;
    }

    /* Garantir que nenhum elemento force nova página */
    .resumo-container {
        background: white !important;
        border: 1px solid black !important;
        margin: 0 0 15px 0 !important;
        padding: 15px !important;
        page-break-inside: avoid !important;
        page-break-after: avoid !important;
    }

    .table-container {
        background: white !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        page-break-after: avoid !important;
    }

    /* Último elemento sem margem para evitar página extra */
    .table-container:last-child,
    table:last-child,
    .tab-content:last-child {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
        page-break-after: avoid !important;
    }
}

#printHeaderTemp {
    display: none;
}

/* Estilos para o aviso de usuário limitado */
.aviso-container {
    margin: 15px 0;
    padding: 0;
}

.aviso-card {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
    border-left: 4px solid #1abc9c;
    animation: slideInInfo 0.3s ease-out;
}

.aviso-card i {
    font-size: 18px;
    color: #ecf0f1;
    opacity: 0.9;
}

.aviso-card span {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

@keyframes slideInInfo {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsivo para mobile */
@media (max-width: 768px) {
    .aviso-card {
        padding: 10px 14px;
        border-radius: 6px;
        gap: 10px;
    }
    
    .aviso-card i {
        font-size: 16px;
    }
    
    .aviso-card span {
        font-size: 13px;
    }
}

/* SOBRESCREVER PARA MOBILE - BOTÕES EM COLUNA */
@media (max-width: 768px) {
    .relatorio-buttons {
        flex-direction: column !important;
        gap: 10px !important;
        align-items: stretch !important;
    }

    #relatorioButtonsContainer {
        flex-direction: column !important;
        gap: 10px !important;
        align-items: stretch !important;
    }

    #imprimirRelatorioBtn,
    #exportPdfBtn,
    #exportRelatorioBtn {
        display: flex !important;
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 8px !important;
        float: none !important;
        clear: none !important;
        white-space: nowrap !important;
    }
}

/* =========================
   DASHBOARD ADMINISTRATIVO
   ========================= */

/* Dashboard Stats Cards */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.stat-info h3 {
    color: #333;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 5px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-info span {
    color: #2E7D32;
    font-size: 28px;
    font-weight: 700;
    display: block;
    margin-bottom: 5px;
}

.stat-info small {
    color: #666;
    font-size: 12px;
}

/* Dashboard Charts */
.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.chart-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.1);
}

.chart-card {
    padding: 25px;
}

.chart-card h3 {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-card h3 i {
    color: #4CAF50;
}

.chart-content {
    position: relative;
    height: 300px;
}

.chart-content canvas {
    max-height: 100%;
}

/* Dashboard Tables */
.dashboard-tables {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.table-dashboard-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.1);
}

.dashboard-table-card {
    padding: 25px;
}

.dashboard-table-card h3 {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-table-card h3 i {
    color: #4CAF50;
}

.dashboard-table-card .table-container {
    margin: 0;
    box-shadow: none;
    border: 1px solid #e0e0e0;
    min-height: 200px; /* Altura mínima para garantir visibilidade */
    max-height: 400px;
    overflow-y: auto;
}

/* Estilos específicos para as tabelas do dashboard */
.dashboard-table-card table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: white;
}

.dashboard-table-card table thead th {
    background-color: #f8f9fa;
    color: #333;
    font-weight: 600;
    padding: 12px 8px;
    border-bottom: 2px solid #4CAF50;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 10;
}

.dashboard-table-card table tbody td {
    padding: 10px 8px;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
}

.dashboard-table-card table tbody tr:nth-child(even) {
    background-color: rgba(248, 249, 250, 0.5);
}

.dashboard-table-card table tbody tr:hover {
    background-color: rgba(76, 175, 80, 0.1);
    transition: background-color 0.2s ease;
}

/* Mensagem quando não há dados */
.dashboard-table-card .no-data {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.dashboard-table-card .loading-table {
    text-align: center;
    padding: 40px 20px;
    color: #4CAF50;
}

/* Responsividade para Dashboard */
@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .stat-card {
        padding: 20px;
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .stat-info span {
        font-size: 24px;
    }

    .dashboard-charts {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .chart-container {
        margin-bottom: 20px;
    }

    .chart-card {
        padding: 20px;
    }

    .chart-content {
        height: 250px;
    }

    .dashboard-tables {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .dashboard-table-card {
        padding: 20px;
    }

    /* Tabelas do Dashboard - Manter como tabela no mobile */
    .dashboard-table-card .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .dashboard-table-card table {
        min-width: 100%;
        width: auto;
        font-size: 12px;
    }

    .dashboard-table-card table th,
    .dashboard-table-card table td {
        padding: 8px 4px;
        white-space: nowrap;
        font-size: 11px;
    }

    .dashboard-table-card table th {
        background-color: #f8f9fa;
        font-weight: 600;
        color: #333;
        border-bottom: 2px solid #4CAF50;
    }

    .dashboard-table-card table tbody tr:nth-child(even) {
        background-color: #f8f9fa;
    }

    .dashboard-table-card table tbody tr:hover {
        background-color: #e8f5e8;
    }

    /* Ajustar larguras específicas das colunas */
    #ultimosLancamentosTable th:nth-child(1),
    #ultimosLancamentosTable td:nth-child(1) {
        min-width: 80px;
    }

    #ultimosLancamentosTable th:nth-child(2),
    #ultimosLancamentosTable td:nth-child(2) {
        min-width: 80px;
        text-align: right;
    }

    #ultimosLancamentosTable th:nth-child(3),
    #ultimosLancamentosTable td:nth-child(3) {
        min-width: 70px;
        font-weight: bold;
    }

    #ultimosLancamentosTable th:nth-child(4),
    #ultimosLancamentosTable td:nth-child(4) {
        min-width: 100px;
    }

    #ultimosLancamentosTable th:nth-child(5),
    #ultimosLancamentosTable td:nth-child(5) {
        min-width: 80px;
    }

    #topEmpresasTable th:nth-child(1),
    #topEmpresasTable td:nth-child(1) {
        min-width: 30px;
        text-align: center;
    }

    #topEmpresasTable th:nth-child(2),
    #topEmpresasTable td:nth-child(2) {
        min-width: 120px;
    }

    #topEmpresasTable th:nth-child(3),
    #topEmpresasTable td:nth-child(3) {
        min-width: 80px;
        text-align: center;
    }

    #topEmpresasTable th:nth-child(4),
    #topEmpresasTable td:nth-child(4) {
        min-width: 100px;
        text-align: right;
    }
}

@media (max-width: 480px) {
    .dashboard-stats {
        gap: 10px;
    }

    .stat-card {
        padding: 15px;
        gap: 10px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .stat-info h3 {
        font-size: 12px;
    }

    .stat-info span {
        font-size: 20px;
    }

    .chart-card {
        padding: 15px;
    }

    .chart-card h3 {
        font-size: 16px;
    }

    .chart-content {
        height: 200px;
    }

    .dashboard-table-card {
        padding: 15px;
    }

    .dashboard-table-card h3 {
        font-size: 16px;
    }

    /* Tabelas ainda menores no mobile pequeno */
    .dashboard-table-card table {
        font-size: 10px;
    }

    .dashboard-table-card table th,
    .dashboard-table-card table td {
        padding: 6px 2px;
        font-size: 10px;
    }

    /* Ajustar larguras para telas pequenas */
    #ultimosLancamentosTable th:nth-child(1),
    #ultimosLancamentosTable td:nth-child(1) {
        min-width: 70px;
    }

    #ultimosLancamentosTable th:nth-child(2),
    #ultimosLancamentosTable td:nth-child(2) {
        min-width: 70px;
    }

    #ultimosLancamentosTable th:nth-child(3),
    #ultimosLancamentosTable td:nth-child(3) {
        min-width: 60px;
    }

    #ultimosLancamentosTable th:nth-child(4),
    #ultimosLancamentosTable td:nth-child(4) {
        min-width: 80px;
    }

    #ultimosLancamentosTable th:nth-child(5),
    #ultimosLancamentosTable td:nth-child(5) {
        min-width: 70px;
    }

    #topEmpresasTable th:nth-child(2),
    #topEmpresasTable td:nth-child(2) {
        min-width: 100px;
    }

    #topEmpresasTable th:nth-child(4),
    #topEmpresasTable td:nth-child(4) {
        min-width: 80px;
    }
}

/* Estilos para status dos serviços */
.status-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-ativo {
    background-color: #4CAF50;
    color: white;
}

.status-inativo {
    background-color: #f44336;
    color: white;
}

.status-editavel {
    background-color: #2196F3;
    color: white;
}

.status-fixo {
    background-color: #9E9E9E;
    color: white;
}

/* Estilos para serviços adicionais */
.servico-adicional-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 8px;
    background: #f9f9f9;
    transition: background-color 0.2s;
}

.servico-adicional-item:hover {
    background: #f0f0f0;
}

#servicosAdicionaisContainer {
    margin-top: 15px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}

#servicosAdicionaisContainer label {
    color: #333;
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
}

#addServicoBtn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

#addServicoBtn:hover {
    background: #45a049;
}

/* Ajustar botões de remover serviço */
.servico-adicional-item .btn-danger {
    background: #f44336;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
}

.servico-adicional-item .btn-danger:hover {
    background: #d32f2f;
}

/* Melhorar visualização do campo preço editável */
#precoGroup {
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 10px;
    transition: all 0.3s ease;
}

#precoGroup.editavel {
    border-color: #2196F3;
    background: #e3f2fd;
}

.editavel-hint {
    animation: pulse-hint 2s infinite;
}

@keyframes pulse-hint {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Estilos para a tela de Contadores */
.contador-form-container {
    margin-bottom: 30px;
}

.contador-form-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.1);
    transition: all 0.3s ease;
}

.contador-form-card:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.contador-form-card h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.contador-form-card h3 i {
    color: #F44336;
    font-size: 20px;
}

.contador-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    align-items: end;
}

.contador-form-group {
    display: flex;
    flex-direction: column;
}

.contador-form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.contador-input {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.contador-input:focus {
    outline: none;
    border-color: #F44336;
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.1);
}

.contador-input:readonly {
    background: #f5f5f5;
    cursor: not-allowed;
    font-weight: 600;
    color: #4CAF50;
    font-size: 18px;
    text-align: center;
}

.contador-input:not(:readonly) {
    background: white;
    color: #333;
    font-weight: normal;
    border: 2px solid #4CAF50;
}

.contador-input:not(:readonly):focus {
    border-color: #2E7D32;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.btn-increment {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
}

.btn-increment:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.3);
}

.btn-increment:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-increment i {
    font-size: 16px;
}

.contador-info {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border-left: 4px solid #4CAF50;
}

.contador-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.contador-info-item:last-child {
    border-bottom: none;
}

.contador-info-label {
    font-weight: 600;
    color: #333;
}

.contador-info-item span:last-child {
    color: #4CAF50;
    font-weight: 600;
}

/* Estilos para dispositivos móveis */
@media (max-width: 768px) {
    .contador-form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .contador-form-card {
        padding: 20px 15px;
        margin: 0 15px;
    }
    
    .contador-form-card h3 {
        font-size: 16px;
    }
    
    .contador-input {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .btn-increment {
        padding: 10px 15px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .contador-info {
        margin: 15px;
        padding: 15px;
    }
    
    .contador-info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .contador-form-container {
        margin-bottom: 20px;
    }
    
    .contador-form-card {
        border-radius: 10px;
        padding: 15px 10px;
    }
    
    .contador-form-card h3 {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .contador-form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .contador-input {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .btn-increment {
        padding: 8px 12px;
        font-size: 13px;
        min-height: 40px;
    }
}

/* Tela de Metas */
.metas-form-container {
    margin-bottom: 30px;
}

.metas-form-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.1);
}

.metas-form-card h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.metas-form-card h3 i {
    color: #F44336;
    font-size: 20px;
}

.metas-user-row {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    gap: 15px;
    align-items: end;
}

.metas-actions {
    display: flex;
    align-items: flex-end;
    padding-bottom: 15px;
}

.metas-servicos-wrapper {
    margin-top: 10px;
}

.metas-placeholder {
    padding: 14px;
    border-radius: 8px;
    border: 1px dashed #cfd8dc;
    background: #f8fafb;
    color: #607d8b;
}

.metas-servicos-table .meta-valor-input {
    max-width: 170px;
}

.metas-servicos-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.metas-bonus-geral-card {
    margin-top: 16px;
    border-color: rgba(33, 150, 243, 0.2);
}

.metas-bonus-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 8px;
}

.metas-servicos-hint {
    margin-top: 10px;
    color: #666;
    font-size: 12px;
}

.metas-bonus-resumo {
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid #bbdefb;
    background: #f7fbff;
    border-radius: 8px;
    color: #1a237e;
    font-size: 13px;
}

.metas-bonus-resumo-separador {
    margin: 0 8px;
    color: #90a4ae;
}

@media (max-width: 768px) {
    .metas-form-card {
        padding: 20px 15px;
    }

    .metas-user-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .metas-actions {
        padding-bottom: 0;
    }

    .metas-actions .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .metas-bonus-grid {
        grid-template-columns: 1fr;
    }

    .metas-bonus-resumo {
        font-size: 12px;
        line-height: 1.5;
    }

    .metas-bonus-resumo-separador {
        display: block;
        margin: 4px 0;
    }
}

/* Estilos de Paginacao */
.pagination-container {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-btn {
    background: white;
    border: 2px solid #e0e0e0;
    color: #333;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.pagination-btn:hover {
    background: #f5f5f5;
    border-color: #4CAF50;
    color: #4CAF50;
    transform: translateY(-1px);
}

.pagination-btn.active {
    background: #4CAF50;
    border-color: #4CAF50;
    color: white;
    font-weight: 700;
}

.pagination-btn:disabled {
    background: #f5f5f5;
    border-color: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    transform: none;
}

.pagination-ellipsis {
    color: #999;
    font-weight: bold;
    padding: 8px 4px;
    user-select: none;
}

.pagination-info {
    text-align: center;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    background: #f8f9fa;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* Responsividade da Paginação */
@media (max-width: 768px) {
    .pagination-container {
        margin: 15px 0;
        gap: 10px;
    }
    
    .pagination {
        gap: 5px;
        padding: 0 10px;
    }
    
    .pagination-btn {
        padding: 6px 8px;
        font-size: 12px;
        min-width: 32px;
    }
    
    .pagination-btn i {
        font-size: 10px;
    }
    
    .pagination-info {
        font-size: 12px;
        padding: 8px 15px;
    }
}

@media (max-width: 480px) {
    .pagination {
        gap: 3px;
        padding: 0 5px;
    }
    
    .pagination-btn {
        padding: 5px 6px;
        font-size: 11px;
        min-width: 28px;
    }
    
    .pagination-btn span {
        display: none;
    }
    
    .pagination-info {
        font-size: 11px;
        padding: 6px 12px;
        text-align: center;
        line-height: 1.3;
    }
}

/* Modal de Edição de Contador */
#editContadorModal {
    display: none;
    position: fixed;
    z-index: 5000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

#editContadorModal .modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3), 
                0 10px 20px rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.1);
    overflow: hidden;
    animation: slideIn 0.3s ease;
    width: 90%;
    max-width: 400px;
}

#editContadorModal .modal-header {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    padding: 25px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

#editContadorModal .modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 3s infinite;
}

#editContadorModal .modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 1;
    position: relative;
}

#editContadorModal .modal-header i {
    margin-right: 10px;
    font-size: 18px;
}

#editContadorModal .modal-body {
    padding: 30px 25px;
}

#editContadorModal .form-group {
    margin-bottom: 20px;
}

#editContadorModal .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

#editContadorModal .form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    box-sizing: border-box;
}

#editContadorModal .form-control:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

#editContadorModal .form-control:readonly {
    background: #f5f5f5;
    color: #666;
    cursor: not-allowed;
}

#editContadorModal .modal-buttons {
    display: flex;
    gap: 15px;
    padding: 0 25px 25px;
    justify-content: space-between;
}

#editContadorModal .modal-buttons button {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#editContadorModal .btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#editContadorModal .btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

#editContadorModal .btn-primary {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#editContadorModal .btn-primary:hover {
    background: linear-gradient(135deg, #45A049 0%, #1B5E20 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
}

/* Responsivo para modal de edição */
@media (max-width: 768px) {
    #editContadorModal .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
        max-width: none;
    }

    #editContadorModal .modal-header {
        padding: 20px;
    }

    #editContadorModal .modal-header h3 {
        font-size: 18px;
    }

    #editContadorModal .modal-body {
        padding: 25px 20px;
    }

    #editContadorModal .modal-buttons {
        padding: 0 20px 20px;
    }

    #editContadorModal .modal-buttons button {
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* Estilos para Modal de Pagamento Misto */
.pagamento-info {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f9f0 100%);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #d4edda;
}

.valor-total {
    text-align: center;
    margin-top: 8px;
}

.valor-total span {
    font-size: 24px;
    font-weight: bold;
    color: #2E7D32;
    background: white;
    padding: 10px 20px;
    border-radius: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: inline-block;
    min-width: 120px;
}

.pagamentos-section {
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.section-header h4 {
    color: #333;
    margin: 0;
    font-size: 16px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.lista-pagamentos {
    max-height: 300px;
    overflow-y: auto;
}

.pagamento-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.pagamento-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.pagamento-item.pagamento-error {
    border-color: #dc3545;
    background: #fff5f5;
}

.pagamento-row {
    display: grid;
    grid-template-columns: 2fr 1fr 40px;
    gap: 15px;
    align-items: end;
}

.pagamento-row .form-group {
    margin: 0;
}

.remove-pagamento {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 12px;
}

.remove-pagamento:hover {
    background: #c82333;
    transform: scale(1.1);
}

.pagamento-resumo {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.resumo-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 500;
}

.resumo-row:last-child {
    margin-bottom: 0;
    font-size: 16px;
    font-weight: bold;
    padding-top: 8px;
    border-top: 1px solid #f39c12;
}

.valor-pago {
    color: #2E7D32;
    font-weight: bold;
}

.valor-restante {
    color: #d32f2f;
    font-weight: bold;
}

.valor-restante.zero {
    color: #2E7D32;
}

.validacao-pagamento {
    background: #fff3cd;
    color: #856404;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #ffeaa7;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.validacao-pagamento i {
    color: #f39c12;
}

.pagamento-misto-success {
    background: #d4edda !important;
    border-color: #c3e6cb !important;
    color: #155724 !important;
}

.pagamento-misto-success i {
    color: #28a745 !important;
}

/* Indicador de pagamento misto no relatório */
.pagamento-misto-indicator {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    vertical-align: middle;
}

.pagamento-misto-indicator i {
    font-size: 8px;
}

/* Hover effect para o indicador */
.pagamento-misto-indicator:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

/* Botão de pagamento combinado no formulário */
.pagamento-options {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: end;
}

.btn-pagamento-misto {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    min-height: 40px;
}

.btn-pagamento-misto:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
    background: linear-gradient(135deg, #138496 0%, #0f6674 100%);
}

.btn-pagamento-misto:active {
    transform: translateY(0);
}

/* Indicador visual de pagamento misto */
.pagamento-misto-indicator {
    background: linear-gradient(45deg, #17a2b8, #28a745);
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 5px;
}

/* Responsividade */
@media (max-width: 768px) {
    .pagamento-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .remove-pagamento {
        position: absolute;
        top: 10px;
        right: 10px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
}

/* === Sticky do botão "Novo Lançamento" na aba Lançamentos === */
#lancamentos .header-actions #addLancamentoBtn {
    position: sticky;
    top: 90px; /* abaixo do header fixo no desktop */
    z-index: 900; /* acima do conteúdo, abaixo do header (1000) */
}

@media (max-width: 768px) {
    #lancamentos .header-actions #addLancamentoBtn {
        top: 120px; /* compensa header + abas fixas no mobile */
    }
}

/* === Sticky do cabeçalho da aba Lançamentos para persistir o botão === */
#lancamentos .content-header {
    position: sticky;
    top: 90px; /* abaixo do header + abas no desktop */
    z-index: 90; /* abaixo da nav (100) e do header (1000), acima do conteúdo */
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

@media (max-width: 768px) {
    #lancamentos .content-header {
        top: 90px; /* compensa alturas no mobile */
    }
}

/* Navigation refresh */
.header {
    border-bottom: 1px solid rgba(34, 92, 52, 0.08);
    box-shadow: 0 14px 30px -24px rgba(21, 61, 35, 0.45);
}

.header-content {
    padding: 10px 22px;
    gap: 18px;
}

.logo-header {
    gap: 12px;
    font-size: 20px;
}

.logo-header img {
    width: 42px !important;
    margin-right: 0 !important;
}

.user-info-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#userName {
    font-size: 14px;
    font-weight: 700;
}

.badge {
    padding: 4px 10px;
    font-size: 10px;
    letter-spacing: 0.04em;
}

.btn-logout {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 10px;
}

.nav-tabs {
    align-items: center;
    padding: 10px 22px 14px;
    gap: 10px;
    overflow: visible;
    flex-wrap: wrap;
    scrollbar-width: thin;
    scrollbar-color: rgba(76, 175, 80, 0.35) transparent;
    border-bottom: 1px solid rgba(34, 92, 52, 0.08);
    box-shadow: 0 14px 28px -26px rgba(21, 61, 35, 0.45);
}

.nav-tabs::-webkit-scrollbar {
    height: 6px;
}

.nav-tabs::-webkit-scrollbar-thumb {
    background: rgba(76, 175, 80, 0.3);
    border-radius: 999px;
}

.nav-tabs > .nav-tab,
.nav-tabs > .nav-group {
    flex: 0 0 auto;
}

.nav-tab,
.nav-group-toggle {
    min-width: auto;
    margin: 0;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-bottom: 1px solid transparent;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: #44525d;
    background: transparent;
    white-space: nowrap;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.nav-tab i,
.nav-group-toggle i {
    margin-right: 8px;
}

.nav-tab-label {
    display: inline-block;
    line-height: 1.1;
}

.nav-tab:hover,
.nav-group-toggle:hover {
    background: #f1f6f2;
    color: #225c34;
    border-color: rgba(76, 175, 80, 0.16);
}

.nav-tab.active {
    background: linear-gradient(135deg, #ebf7ee 0%, #dff1e4 100%);
    color: #225c34;
    border-color: rgba(76, 175, 80, 0.25);
    box-shadow: 0 14px 24px -22px rgba(46, 125, 50, 0.55);
}

.nav-group {
    position: relative;
}

.nav-group[hidden] {
    display: none !important;
}

.nav-group-toggle {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 132px;
    cursor: pointer;
    background: #ffffff;
    border-color: rgba(76, 175, 80, 0.12);
}

.nav-group-toggle::-webkit-details-marker {
    display: none;
}

.nav-group-toggle-main {
    display: inline-flex;
    align-items: center;
}

.nav-group-toggle-main i {
    margin-right: 8px;
}

.nav-group-toggle-icon {
    margin-right: 0 !important;
    font-size: 11px;
    transition: transform 0.2s ease;
}

.nav-group[open] .nav-group-toggle-icon {
    transform: rotate(180deg);
}

.nav-group.has-active .nav-group-toggle {
    color: #225c34;
    border-color: rgba(76, 175, 80, 0.25);
    background: linear-gradient(135deg, #f3fbf5 0%, #e9f6ed 100%);
}

.nav-group-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    max-width: calc(100vw - 32px);
    padding: 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(76, 175, 80, 0.12);
    box-shadow: 0 22px 40px -28px rgba(16, 24, 40, 0.45);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 1100;
}

.nav-group-menu .nav-tab {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    text-align: left;
}

.main-content {
    padding: 24px;
    min-height: calc(100vh - 124px);
}

.content-header {
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .header-content {
        padding: 10px 12px;
        gap: 12px;
    }

    .logo-header {
        font-size: 16px;
        padding: 8px 10px;
        border-radius: 12px;
    }

    .logo-header img {
        width: 36px !important;
    }

    .user-info {
        padding: 8px 12px;
        gap: 10px;
        border-radius: 16px;
    }

    .user-info #userName {
        font-size: 13px;
    }

    .btn-logout {
        padding: 8px 10px;
        font-size: 11px;
    }

    .nav-tabs {
        padding: 8px 12px;
        gap: 8px;
    }

    .nav-tab,
    .nav-group-toggle {
        padding: 9px 12px;
        font-size: 12px;
    }

    .nav-group-toggle {
        min-width: 118px;
    }

    .nav-group-menu {
        min-width: 200px;
        right: 0;
    }

    .main-content {
        padding: 16px 12px;
    }

    .btn-primary {
        font-size: 15px;
    }

    #lancamentos .header-actions #addLancamentoBtn,
    #lancamentos .content-header {
        position: static;
        top: auto;
    }

    #lancamentos .content-header {
        background: transparent;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 8px 10px;
    }

    .nav-tabs {
        padding: 7px 10px;
        gap: 6px;
    }

    .nav-tab,
    .nav-group-toggle {
        padding: 8px 10px;
        font-size: 11px;
    }

    .nav-group-toggle {
        min-width: 108px;
    }

    .nav-group-menu {
        min-width: 180px;
        max-width: calc(100vw - 20px);
    }

    .btn-primary {
        font-size: 14px;
    }
}

/* Lancamentos workspace refresh */
#lancamentos .content-header {
    position: static;
    top: auto;
    z-index: auto;
    background: transparent;
    margin-bottom: 18px;
}

#lancamentos .header-actions #addLancamentoBtn {
    position: static;
    top: auto;
}

.lancamentos-header {
    padding: 24px 26px;
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(76, 175, 80, 0.16), transparent 34%),
        linear-gradient(135deg, #ffffff 0%, #f5faf6 100%);
    border: 1px solid rgba(76, 175, 80, 0.14);
    box-shadow: 0 24px 42px -34px rgba(21, 61, 35, 0.55);
    align-items: stretch;
}

.lancamentos-header-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 620px;
}

.section-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(34, 92, 52, 0.08);
    color: #225c34;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-subtitle {
    color: #60717d;
    font-size: 15px;
    line-height: 1.55;
    margin: 0;
}

.lancamentos-header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 14px;
    align-items: stretch;
    width: 100%;
}

.action-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(76, 175, 80, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.action-panel-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5c6f63;
}

.header-filter-group {
    align-items: stretch !important;
    flex-wrap: wrap;
}

.header-filter-group .action-panel-label {
    flex: 1 0 100%;
}

.header-filter-group .filtro-input {
    flex: 1 1 150px;
    min-height: 44px;
    border-radius: 12px;
}

.header-filter-group .btn-secondary {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.header-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.header-quick-actions .btn-secondary,
.header-quick-actions .btn-primary {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.lancamentos-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.overview-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 128px;
    padding: 18px 20px;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid rgba(76, 175, 80, 0.1);
    box-shadow: 0 18px 35px -32px rgba(16, 24, 40, 0.6);
}

.overview-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #73848e;
}

.overview-value {
    color: #20313c;
    font-size: 22px;
    line-height: 1.15;
}

.overview-hint {
    color: #6d7d87;
    font-size: 13px;
    line-height: 1.45;
}

.overview-card--status[data-state="open"] {
    background: linear-gradient(135deg, #effaf1 0%, #e3f5e7 100%);
    border-color: rgba(46, 125, 50, 0.18);
}

.overview-card--status[data-state="closed"] {
    background: linear-gradient(135deg, #fff5f3 0%, #ffe9e4 100%);
    border-color: rgba(198, 40, 40, 0.16);
}

.overview-card--status[data-state="alert"] {
    background: linear-gradient(135deg, #fff8e8 0%, #fff1cc 100%);
    border-color: rgba(245, 124, 0, 0.2);
}

.overview-card--status[data-state="idle"] {
    background: linear-gradient(135deg, #f7faf8 0%, #eef4f0 100%);
}

#lancamentos .aviso-card {
    border-radius: 18px;
    padding: 14px 18px;
    box-shadow: 0 18px 34px -30px rgba(41, 128, 185, 0.6);
    border-left: 0;
}

.caixa-card {
    padding: 24px;
    border-radius: 24px;
    border: 1px solid rgba(76, 175, 80, 0.12);
    background:
        radial-gradient(circle at top right, rgba(76, 175, 80, 0.12), transparent 30%),
        linear-gradient(135deg, #ffffff 0%, #f8fcf9 100%);
    box-shadow: 0 22px 40px -34px rgba(21, 61, 35, 0.5);
}

.caixa-header {
    margin-bottom: 18px;
    padding-bottom: 0;
    border-bottom: 0;
    gap: 14px;
}

.caixa-header-copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.caixa-header-copy p {
    margin: 0;
    color: #61737f;
    font-size: 14px;
    line-height: 1.5;
}

.caixa-status {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(244, 247, 244, 0.92);
    border: 1px solid rgba(76, 175, 80, 0.12);
    color: #2f4a38;
}

.caixa-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
    gap: 16px;
    align-items: start;
}

.caixa-info {
    margin-bottom: 0;
    padding: 18px 20px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid rgba(76, 175, 80, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.info-row {
    margin-bottom: 0;
    padding: 12px 0;
    border-bottom: 1px solid rgba(96, 113, 125, 0.12);
}

.info-row:last-child {
    border-bottom: 0;
}

.caixa-actions {
    justify-content: flex-start;
    gap: 12px;
    padding: 18px 20px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid rgba(76, 175, 80, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.caixa-machine-field {
    flex: 1 0 100%;
    margin-bottom: 0 !important;
}

.caixa-actions select {
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid #d7e2da;
}

.caixa-actions button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.lancamentos-table-container {
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.lancamentos-table-shell {
    background: #ffffff;
    border: 1px solid rgba(76, 175, 80, 0.1);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 24px 42px -36px rgba(16, 24, 40, 0.58);
}

.lancamentos-table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 22px;
    border-bottom: 1px solid rgba(96, 113, 125, 0.12);
    background: linear-gradient(135deg, #f9fcfa 0%, #f2f8f3 100%);
}

.lancamentos-table-intro {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lancamentos-table-intro h3 {
    margin: 0;
    color: #20313c;
    font-size: 20px;
}

.lancamentos-table-intro p {
    margin: 0;
    color: #6c7c87;
    font-size: 14px;
}

.table-eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    color: #5d7064;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.table-toolbar-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.table-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid rgba(76, 175, 80, 0.12);
    color: #465762;
    font-size: 12px;
    font-weight: 600;
}

.table-scroll {
    overflow-x: auto;
}

#lancamentosTable thead th {
    background: #f5faf6;
    color: #4a5c55;
    border-bottom: 1px solid rgba(96, 113, 125, 0.12);
}

#lancamentosTable tbody td {
    padding: 16px 18px;
    vertical-align: middle;
}

.lancamento-row--cancelado {
    background: #fff4f1;
}

.lancamento-code,
.lancamento-primary,
.lancamento-price,
.lancamento-payment {
    display: inline-flex;
    align-items: center;
}

.lancamento-code {
    font-weight: 700;
    color: #225c34;
}

.lancamento-primary {
    font-weight: 700;
    color: #2a3d49;
}

.lancamento-price {
    font-weight: 700;
    color: #225c34;
    white-space: nowrap;
}

.lancamento-payment {
    font-weight: 600;
}

.lancamento-actions-cell {
    white-space: nowrap;
}

.is-cancelado-text {
    color: #c62828 !important;
    text-decoration: line-through;
}

.lancamentos-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 260px;
    padding: 48px 24px;
    border-radius: 24px;
    background: #ffffff;
    border: 1px dashed rgba(76, 175, 80, 0.24);
    text-align: center;
}

.lancamentos-empty-icon {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #edf6ef 0%, #dff1e4 100%);
    color: #2e7d32;
    font-size: 28px;
}

.lancamentos-empty-state h3 {
    margin: 0;
    color: #22333f;
    font-size: 22px;
}

.lancamentos-empty-state p {
    margin: 0;
    max-width: 480px;
    color: #667681;
    font-size: 15px;
    line-height: 1.6;
}

.mobile-card--cancelado::before {
    background: linear-gradient(135deg, #ef5350 0%, #c62828 100%);
}

.mobile-card-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.mobile-card-subtitle {
    color: #6b7280;
    font-size: 13px;
    line-height: 1.35;
}

.lancamentos-mobile-actions {
    align-items: flex-end !important;
    flex-direction: column;
    gap: 10px;
}

.mobile-card-price {
    color: #225c34;
    font-size: 15px;
    font-weight: 700;
}

.mobile-card-action-buttons {
    display: flex;
    gap: 6px;
}

.lancamentos-mobile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.lancamentos-mobile-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f2f6f4;
    color: #4e5f69;
    font-size: 12px;
    font-weight: 600;
}

@media (max-width: 1080px) {
    .lancamentos-header-actions,
    .lancamentos-overview,
    .caixa-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .table-toolbar-meta {
        justify-content: flex-start;
    }

    .caixa-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .lancamentos-header {
        padding: 18px;
        border-radius: 22px;
    }

    .lancamentos-header-actions,
    .lancamentos-overview {
        grid-template-columns: 1fr;
    }

    .action-panel,
    .overview-card,
    .caixa-card,
    .caixa-info,
    .caixa-actions,
    .lancamentos-table-shell {
        border-radius: 18px;
    }

    .header-quick-actions {
        flex-direction: column;
    }

    .header-quick-actions .btn-secondary,
    .header-quick-actions .btn-primary,
    .header-filter-group .btn-secondary {
        width: 100%;
    }

    .lancamentos-table-toolbar {
        flex-direction: column;
        padding: 18px;
    }

    .table-toolbar-meta {
        width: 100%;
    }

    .table-meta-pill {
        width: 100%;
        justify-content: center;
    }

    .lancamentos-empty-state {
        min-height: 220px;
        padding: 36px 18px;
    }
}

@media (max-width: 480px) {
    .lancamentos-header {
        padding: 16px;
    }

    .overview-value {
        font-size: 20px;
    }

    .caixa-card,
    .caixa-info,
    .caixa-actions {
        padding: 16px;
    }

    .mobile-card-price {
        font-size: 14px;
    }

    .lancamentos-mobile-meta {
        gap: 6px;
    }
}

/* Lancamentos simplify pass */
.section-kicker,
.section-subtitle,
.action-panel-label,
.lancamentos-overview,
.caixa-header-copy p,
.table-eyebrow,
.lancamentos-table-intro p,
.table-toolbar-meta {
    display: none !important;
}

.lancamentos-header {
    padding: 16px 18px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(76, 175, 80, 0.08);
    box-shadow: 0 16px 28px -30px rgba(16, 24, 40, 0.55);
}

.lancamentos-header-main {
    justify-content: center;
    gap: 0;
}

.lancamentos-header-main h2 {
    margin: 0;
    font-size: 24px;
}

.lancamentos-header-actions {
    display: flex;
    flex-wrap: wrap;
    grid-template-columns: none;
    gap: 10px;
    width: auto;
    align-items: center;
    justify-content: flex-end;
}

.action-panel {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.header-filter-group {
    gap: 10px !important;
}

.header-filter-group .filtro-input {
    min-width: 160px;
    max-width: 170px;
}

.header-quick-actions {
    flex-direction: row;
}

.lancamentos-table-shell {
    border-radius: 18px;
}

.lancamentos-table-toolbar {
    display: none;
}

.caixa-card {
    padding: 18px;
    border-radius: 18px;
}

.caixa-header {
    margin-bottom: 14px;
}

.caixa-header-copy h3 {
    font-size: 17px;
}

.caixa-status {
    padding: 8px 12px;
    font-size: 13px;
}

.caixa-grid {
    gap: 12px;
}

.caixa-info,
.caixa-actions {
    padding: 16px;
    border-radius: 16px;
}

.info-row {
    padding: 10px 0;
}

#lancamentosTable thead th {
    padding: 13px 14px;
    font-size: 11px;
}

#lancamentosTable tbody td {
    padding: 14px;
}

@media (max-width: 768px) {
    .lancamentos-header {
        padding: 14px;
    }

    .lancamentos-header-main h2 {
        font-size: 20px;
    }

    .lancamentos-header-actions {
        width: 100%;
        justify-content: stretch;
    }

    .header-filter-group,
    .header-quick-actions {
        width: 100%;
        flex-direction: column;
    }

    .header-filter-group .filtro-input,
    .header-filter-group .btn-secondary,
    .header-quick-actions .btn-secondary,
    .header-quick-actions .btn-primary {
        width: 100%;
        max-width: none;
    }

    .caixa-card,
    .caixa-info,
    .caixa-actions,
    .lancamentos-table-shell {
        border-radius: 16px;
    }
}

/* Lancamentos header alignment */
.lancamentos-header-actions {
    display: grid;
    grid-template-columns: minmax(260px, 350px) minmax(280px, 1fr);
    gap: 12px;
    width: min(100%, 760px);
    align-items: stretch;
}

.lancamentos-toolbar-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 12px 14px;
    border-radius: 14px;
    background: #f7faf7;
    border: 1px solid rgba(76, 175, 80, 0.12);
}

.lancamentos-toolbar-label {
    display: block;
    margin: 0;
    color: #53655b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lancamentos-toolbar-row {
    display: grid;
    gap: 10px;
    align-items: center;
}

.lancamentos-toolbar-row--date {
    grid-template-columns: minmax(0, 1fr) auto;
}

.lancamentos-toolbar-row--actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lancamentos-date-input {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    font-weight: 600;
    color: #21332b;
}

.lancamentos-toolbar-row--date .btn-secondary,
.lancamentos-toolbar-row--actions .btn-secondary,
.lancamentos-toolbar-row--actions .btn-primary {
    width: 100%;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

@media (max-width: 980px) {
    .lancamentos-header-actions {
        grid-template-columns: 1fr;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .lancamentos-header-actions {
        gap: 10px;
    }

    .lancamentos-toolbar-group {
        padding: 10px 12px;
    }

    .lancamentos-toolbar-row--date {
        grid-template-columns: minmax(0, 1fr) 48px;
    }

    .lancamentos-toolbar-row--actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #imprimirFechamentoBtn {
        min-width: 48px;
        padding-left: 0;
        padding-right: 0;
        font-size: 0;
    }

    #imprimirFechamentoBtn i {
        margin: 0;
        font-size: 16px;
    }

    #scanCodigoBtn,
    #addLancamentoBtn {
        padding-left: 10px;
        padding-right: 10px;
        font-size: 13px;
    }
}

/* Mobile nav dropdown fix */
@media (max-width: 768px) {
    .nav-tabs {
        position: relative;
    }

    .nav-group {
        position: static;
    }

    .nav-group-menu {
        top: calc(100% + 8px);
        left: 12px;
        right: 12px;
        min-width: 0;
        width: auto;
        max-width: none;
        padding: 8px;
        border-radius: 16px;
    }

    .nav-group-menu .nav-tab {
        justify-content: flex-start;
        white-space: normal;
        line-height: 1.3;
    }

    .nav-group-menu .nav-tab .nav-tab-label {
        white-space: normal;
    }
}

@media (max-width: 480px) {
    .nav-group-menu {
        left: 10px;
        right: 10px;
    }
}



/* Gestao de caixas */
.caixas-resumo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 16px;
    margin: 18px 0;
}

.caixa-list-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.caixa-list-status--aberto {
    background: #e8f5e9;
    color: #1b5e20;
}

.caixa-list-status--fechado {
    background: #f1f3f5;
    color: #495057;
}

#caixasTable .btn-sm {
    min-height: 34px;
    padding: 7px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#caixasTable .btn-sm:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .caixas-resumo-grid {
        grid-template-columns: 1fr;
    }
}
