/* ===== RESET E CONFIGURAÇÕES GERAIS ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #5e5e5e;
    --secondary-color: #5e5e5e;
    --success-color: #4cc9f0;
    --danger-color: #f72585;
    --warning-color: #f8961e;
    --info-color: #7209b7;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gray-color: #6c757d;
    --light-gray: #e9ecef;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f5f7fb;
    overflow-x: hidden;
}

/* ===== PÁGINAS DE LOGIN E CADASTRO ===== */
.login-page, .cadastro-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 20px;
}

.login-container, .container {
    background: black;
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    width: 100%;
    max-width: 500px;
    margin: 1rem;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.logo-container {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    max-width: 180px;
    height: auto;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
}

.logo-container h1 {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.indicacao-info {
    background: #e3f2fd;
    color: #1565c0;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* ===== FORMULÁRIOS ===== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: black;
    font-size: 0.95rem;
}

label i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: white;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

input:read-only {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* ===== ESTILOS ESPECÍFICOS PARA CAMPOS DE LOGIN ===== */
/* Aplica SOMENTE aos campos da página de login */
.login-page .login-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #ffffff !important; /* Cor branca para os labels */
    font-size: 0.95rem;
}

.login-page .login-label i {
    margin-right: 0.5rem;
    color: #4cc9f0 !important; /* Cor azul para os ícones */
}

.login-page .login-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
}

.login-page .login-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.login-page .login-input:focus {
    outline: none;
    border-color: #4cc9f0;
    box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

/* Garantir que outros formulários não sejam afetados */
/* Aplica estilos padrão para outros formulários */
.form-group label:not(.login-label) {
    color: var(--dark-color);
}

.form-group input:not(.login-input),
.form-group select:not(.login-input),
.form-group textarea:not(.login-input) {
    background: white;
    color: black;
    border: 2px solid var(--light-gray);
}

/* ===== CONTÊINERES ESPECIAIS ===== */
.cep-container {
    display: flex;
    gap: 0.75rem;
}

.cep-container input {
    flex: 1;
}

.password-container {
    position: relative;
}

.btn-password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-color);
    cursor: pointer;
    padding: 0.25rem;
    transition: var(--transition);
}

.btn-password-toggle:hover {
    color: var(--primary-color);
}

/* ===== BOTÕES ===== */
.btn {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn i {
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.3);
}

.btn-secondary {
    background: var(--light-gray);
    color: var(--dark-color);
}

.btn-secondary:hover {
    background: #dee2e6;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ===== ALERTAS ===== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert i {
    font-size: 1.25rem;
    margin-top: 0.125rem;
}

.alert-error {
    background: #fee;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-info {
    background: #e3f2fd;
    border: 1px solid #b3e5fc;
    color: #0c5460;
}

.alert-warning {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
}

/* ===== DASHBOARD CORRIGIDO ===== */
.dashboard {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

.dashboard-header {
    background: #5e5e5e;
    color: white;
    width: 260px;
    padding: 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.dashboard-header::-webkit-scrollbar {
    width: 6px;
}

.dashboard-header::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.dashboard-header::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.dashboard-header .logo-container {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.1);
}

.dashboard-header .logo {
    max-width: 160px;
    height: auto;
    margin-bottom: 0.5rem;
}

.dashboard-header .logo-container h1 {
    color: white;
    font-size: 1.2rem;
    margin: 0;
}

.dashboard-nav {
    padding: 1rem 0;
    flex: 1;
}

.dashboard-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dashboard-nav li {
    margin: 0;
}

.dashboard-nav a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 0.875rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition);
    border-left: 4px solid transparent;
    font-weight: 500;
    font-size: 0.95rem;
}

.dashboard-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: var(--primary-color);
}

.dashboard-nav a.active {
    background: rgba(195, 205, 247, 0.2);
    color: white;
    border-left-color: var(--primary-color);
}

.dashboard-nav .logout {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.dashboard-nav .logout:hover {
    background: rgba(255, 107, 107, 0.2);
    border-left-color: #ff6b6b;
}

.user-info {
    padding: 1.5rem;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.1);
}

.user-info span {
    font-size: 0.9rem;
    opacity: 0.9;
    display: block;
    text-align: center;
}

.dashboard-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    background: #f8fafc;
    min-height: 100vh;
    height: 100vh; /* Adicionado */
    overflow-y: auto; /* Isso já está */
    overflow-x: hidden;
    position: relative; /* Adicionado */
}

/* ===== HEADERS E TÍTULOS ===== */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-header p {
    color: var(--gray-color);
    font-size: 1.1rem;
}

/* ===== CARDS ===== */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
}

.card-header h2 {
    font-size: 1.4rem;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

/* ===== DADOS E INFORMAÇÕES ===== */
.dados-container {
    display: grid;
    gap: 2rem;
    margin-bottom: 2rem;
}

.dados-pessoais,
.dados-empresa,
.dados-endereco {
    background: var(--light-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--light-gray);
}

.dados-container h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-row {
    display: flex;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed #dee2e6;
}

.info-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.info-label {
    font-weight: 600;
    color: var(--dark-color);
    min-width: 180px;
    flex-shrink: 0;
}

.info-value {
    color: var(--gray-color);
    flex: 1;
}

/* ===== NOTIFICAÇÃO LGPD ===== */
.lgpd-notice {
    background: #e8f4fd;
    border: 1px solid #b3e5fc;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.lgpd-icon {
    font-size: 2rem;
    color: #0288d1;
}

.lgpd-content h4 {
    color: #0288d1;
    margin-bottom: 0.5rem;
}

.lgpd-content p {
    color: #0c5460;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ===== CONTADORES ===== */
.counters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.counter-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid var(--light-gray);
    transition: var(--transition);
}

.counter-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.counter-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.counter-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0.5rem 0;
    line-height: 1;
}

.counter-label {
    color: var(--gray-color);
    font-size: 1rem;
    font-weight: 500;
}

.counter-trend {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

.text-success { color: #28a745; }
.text-warning { color: #ffc107; }
.text-danger { color: #dc3545; }

/* ===== TABELAS ===== */
.table-container {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.table th {
    background: var(--light-color);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--dark-color);
    border-bottom: 2px solid var(--light-gray);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--light-gray);
    vertical-align: middle;
}

.table tr:hover {
    background: rgba(67, 97, 238, 0.02);
}

/* ===== STATUS ===== */
.status {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.status-pago {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-aberto {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.status-atraso {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-cancelado {
    background: #d6d8d9;
    color: #1b1e21;
    border: 1px solid #c6c8ca;
}

/* ===== BADGES ===== */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--light-gray);
    color: var(--dark-color);
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* ===== GRID DE CARDS ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.product-card {
    background: white;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.product-header h3 {
    font-size: 1.2rem;
    color: var(--dark-color);
    margin: 0;
}

.product-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.product-status.active {
    background: #d4edda;
    color: #155724;
}

.product-status.inactive {
    background: #f8d7da;
    color: #721c24;
}

.product-info {
    margin-bottom: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed #eee;
}

.info-item:last-child {
    border-bottom: none;
}

/* ===== CORREÇÃO PARA BOTÕES EM CARDS ===== */
.product-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.product-actions .btn {
    flex: 1;
    min-width: 80px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    white-space: nowrap;
    text-align: center;
}

/* Garantir que ícones fiquem centralizados */
.product-actions .btn i {
    margin-right: 0.25rem;
}

/* Para cards menores em telas pequenas */
@media (max-width: 768px) {
    .product-actions .btn {
        min-width: 70px;
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .product-actions .btn i {
        margin-right: 0;
    }
    
    .product-actions .btn span {
        display: none; /* Esconde texto, mostra apenas ícone em mobile */
    }
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    overflow-y: auto;
}

.modal-content {
    background: white;
    margin: 2rem auto;
    width: 90%;
    max-width: 800px;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--dark-color);
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-color);
    transition: var(--transition);
}

.close:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--light-gray);
    text-align: right;
}

/* ===== FORMULÁRIOS DE FILTRO ===== */
.filter-form {
    background: var(--light-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--light-gray);
}

/* ===== RESULTADOS FINANCEIROS ===== */
.financeiro-resumo {
    display: flex;
    justify-content: space-around;
    background: var(--light-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-top: 2rem;
    border: 1px solid var(--light-gray);
}

.resumo-item {
    text-align: center;
}

.resumo-label {
    display: block;
    font-size: 0.9rem;
    color: var(--gray-color);
    margin-bottom: 0.5rem;
}

.resumo-valor {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
}

/* ===== LOGIN PAGE STYLES ===== */
.login-page .logo-container {
    text-align: center;
    margin-bottom: 2rem;
}

.login-page .logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.login-page .logo-placeholder {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.login-page .logo-placeholder i {
    margin-bottom: 1rem;
}

.login-subtitle {
    color: var(--gray-color);
    font-size: 1rem;
    margin-top: 0.5rem;
}

.login-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.login-link-item {
    width: 100%;
}

.login-demo {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 0.9rem;
    color: var(--gray-color);
}

/* ===== FORM ACTIONS ===== */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--light-gray);
}

.form-notice {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--gray-color);
}

.form-notice p {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-notice p:last-child {
    margin-bottom: 0;
}

/* ===== LINK DE INDICAÇÃO ===== */
.link-indicacao-container {
    margin-top: 2rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.link-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.link-container input {
    flex: 1;
    background: white;
    border: 1px solid #c3e6cb;
    color: #155724;
    font-weight: 500;
}

/* ===== GRÁFICOS ===== */
.chart-container {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-top: 2rem;
    border: 1px solid var(--light-gray);
}

/* ===== LIST GROUP ===== */
.list-group {
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.list-group-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--light-gray);
    transition: var(--transition);
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item:hover {
    background: var(--light-color);
}

/* ===== UTILITÁRIOS ===== */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--gray-color) !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.d-flex {
    display: flex !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.align-items-center {
    align-items: center !important;
}

.small {
    font-size: 0.875rem;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 1200px) {
    .dashboard-header {
        width: 240px;
    }
    
    .dashboard-content {
        margin-left: 240px;
    }
}

@media (max-width: 992px) {
    .dashboard {
        flex-direction: column;
    }
    
    .dashboard-header {
        width: 100%;
        height: auto;
        position: static;
        max-height: 70vh;
    }
    
    .dashboard-content {
        margin-left: 0;
        padding: 1.5rem;
    }
    
    .dashboard-nav ul {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        padding: 0.5rem;
    }
    
    .dashboard-nav li {
        flex: 1;
        min-width: 120px;
    }
    
    .dashboard-nav a {
        padding: 0.75rem 0.5rem;
        justify-content: center;
        text-align: center;
        border-left: none;
        border-bottom: 3px solid transparent;
        border-radius: 5px;
    }
    
    .dashboard-nav a.active {
        border-left: none;
        border-bottom-color: var(--primary-color);
    }
    
    .user-info {
        margin-top: 1rem;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .login-container, .container {
        padding: 1.5rem;
        margin: 0.5rem;
    }
    
    .counters {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .financeiro-resumo {
        flex-direction: column;
        gap: 1rem;
    }
    
    .resumo-item {
        text-align: left;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem auto;
    }
    
    .dashboard-nav ul {
        flex-direction: column;
    }
    
    .dashboard-nav li {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .counters {
        grid-template-columns: 1fr;
    }
    
    .card-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .product-actions {
        flex-wrap: wrap;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .login-links {
        flex-direction: column;
        gap: 1rem;
    }
}

/* ===== GRID SYSTEM ===== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.col-md-6, .col-md-8, .col-md-4 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

@media (min-width: 768px) {
    .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .col-md-8 {
        flex: 0 0 66.666667%;
        max-width: 66.666667%;
    }
    
    .col-md-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
}

/* ===== INPUT GROUP ===== */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.input-group-append {
    display: flex;
}

.input-group-append .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: -1px;
}

/* ===== FORM SELECT ===== */
.form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background-color: white;
    cursor: pointer;
    text-color: black;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-select-sm {
    padding: 0.375rem 1.75rem 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* ===== FORM CONTROL FILE ===== */
.form-control-file {
    display: block;
    width: 100%;
    padding: 0.375rem 0;
}

/* ===== SYSTEM INFO ===== */
.system-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: var(--border-radius);
}

.system-info .info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed #dee2e6;
}

.system-info .info-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* ===== METRICS GRID ===== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.metric-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.metric-content {
    flex: 1;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.metric-label {
    font-size: 0.9rem;
    color: #666;
}

.bg-primary { background: #4361ee; }
.bg-success { background: #28a745; }
.bg-warning { background: #f8961e; }
.bg-info { background: #4cc9f0; }

/* ===== MELHORIAS PARA BOTÕES ===== */
.btn-sm {
    padding: 0.4rem 0.75rem !important;
    font-size: 0.8rem !important;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-sm i {
    font-size: 0.8rem;
    margin-right: 0.25rem;
}

.btn-sm span {
    display: inline;
}

@media (max-width: 768px) {
    .btn-sm span {
        display: none;
    }
    
    .btn-sm i {
        margin-right: 0;
    }
    
    .btn-sm {
        min-width: 36px;
        padding: 0.4rem !important;
    }
}

/* Botões em tabelas */
.table .btn-sm {
    margin: 0 2px;
}

/* Cards de produto melhorados */
.product-card .product-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 1rem;
}

.product-card .product-actions .btn {
    flex: 1;
    min-width: 0;
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
}

/* Modal improvements */
.modal-lg {
    max-width: 900px;
}

.modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

/* ===== CORREÇÕES PARA MENU MOBILE ===== */
@media (max-width: 992px) {
    .dashboard {
        flex-direction: column;
        position: relative;
        min-height: 100vh;
    }
    
    .dashboard-header {
        width: 280px;
        height: 100vh;
        position: fixed;
        left: -280px; /* Esconde completamente */
        top: 0;
        bottom: 0;
        z-index: 1100;
        transition: left 0.3s ease;
        box-shadow: 2px 0 15px rgba(0, 0, 0, 0.3);
        background: var(--primary-color);
        overflow-y: auto;
    }
    
    .dashboard-header.menu-open {
        left: 0;
    }
    
    /* Corrige a rolagem do conteúdo principal */
    .dashboard-content {
        margin-left: 0 !important;
        padding: 1.5rem;
        padding-top: 70px; /* Espaço para o botão hamburger */
        width: 100%;
        min-height: 100vh;
        height: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
        z-index: 1;
        background: #f8fafc;
    }
    
    .menu-toggle {
        display: flex;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1001;
        background: var(--primary-color);
        color: white;
        border: none;
        border-radius: var(--border-radius);
        width: 50px;
        height: 50px;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        box-shadow: var(--box-shadow);
    }
    
    .menu-close {
        display: block;
        position: absolute;
        top: 15px;
        right: 15px;
        z-index: 1102;
        background: transparent;
        color: white;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Overlay quando menu está aberto */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        z-index: 1099;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .menu-overlay.active {
        display: block;
        opacity: 1;
    }
    
    /* Ajusta o layout do menu para mobile */
    .dashboard-header .logo-container {
        padding: 1.5rem;
        padding-top: 60px; /* Espaço para o botão fechar */
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        background: rgba(0, 0, 0, 0.1);
        margin-bottom: 1rem;
    }
    
    .dashboard-header .logo {
        max-width: 120px;
        margin-bottom: 0.75rem;
    }
    
    .dashboard-header .logo-container h1 {
        font-size: 1.1rem;
        margin: 0;
    }
    
    .dashboard-nav {
        padding: 0;
        flex: 1;
    }
    
    .dashboard-nav ul {
        display: block;
        padding: 0;
        margin: 0;
    }
    
    .dashboard-nav li {
        width: 100%;
        margin: 0;
    }
    
    .dashboard-nav a {
        color: rgba(255, 255, 255, 0.9);
        text-decoration: none;
        padding: 1rem 1.5rem;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        transition: var(--transition);
        border-left: 4px solid transparent;
        font-weight: 500;
        font-size: 0.95rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .dashboard-nav a:hover {
        background: rgba(255, 255, 255, 0.15);
        color: white;
        border-left-color: white;
    }
    
    .dashboard-nav a.active {
        background: rgba(255, 255, 255, 0.2);
        color: white;
        border-left-color: white;
    }
    
    .dashboard-nav .logout {
        color: #ff9e9e;
        background: rgba(255, 107, 107, 0.1);
    }
    
    .dashboard-nav .logout:hover {
        background: rgba(255, 107, 107, 0.2);
        border-left-color: #ff6b6b;
    }
    
    .user-info {
        padding: 1.5rem;
        margin-top: auto;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        background: rgba(0, 0, 0, 0.15);
        text-align: center;
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
    }
    
    .user-info span {
        font-size: 0.85rem;
        opacity: 0.9;
        display: block;
        margin-bottom: 0.25rem;
    }
    
    .user-info .company {
        font-size: 0.8rem;
        opacity: 0.7;
        font-style: italic;
    }
    
    /* Remove margens excessivas do conteúdo */
    .page-header {
        margin-top: 0;
    }
    
    /* Garante que o conteúdo não fique escondido atrás do botão */
    .card:first-child {
        margin-top: 0;
    }
}

/* Melhorias para telas muito pequenas */
@media (max-width: 576px) {
    .dashboard-header {
        width: 260px;
        left: -260px;
    }
    
    .menu-toggle {
        top: 12px;
        left: 12px;
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
    }
    
    .dashboard-content {
        padding: 1rem;
        padding-top: 65px;
    }
    
    .dashboard-header .logo-container {
        padding: 1.25rem;
        padding-top: 55px;
    }
    
    .dashboard-header .logo {
        max-width: 100px;
    }
    
    .dashboard-nav a {
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .user-info {
        padding: 1.25rem;
    }
}

/* Ajustes para orientação paisagem em mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .dashboard-header {
        overflow-y: auto;
        max-height: 100vh;
    }
    
    .dashboard-header .logo-container {
        padding-top: 50px;
        padding-bottom: 1rem;
    }
    
    .dashboard-nav a {
        padding: 0.75rem 1.5rem;
        min-height: 44px;
    }
    
    .user-info {
        padding: 1rem;
    }
}

/* Garante que o conteúdo principal role normalmente */
@media (max-width: 992px) {
    html, body {
        overflow-x: hidden;
        position: relative;
        height: 100%;
    }
    
    body.menu-open {
        overflow: hidden;
    }
    
    .dashboard-content {
        overflow-y: auto;
        height: calc(100vh - 70px);
        margin-top: 0;
    }
}

/* ===== CORREÇÃO PARA DESKTOP - ESCONDER BOTÃO FECHAR ===== */
/* Esconde o botão de fechar em desktop */
@media (min-width: 993px) {
    .menu-close {
        display: none !important;
    }
    
    .menu-toggle {
        display: none !important;
    }
    
    .menu-overlay {
        display: none !important;
    }
    
    /* Garante que o menu fique sempre visível em desktop */
    .dashboard-header {
        position: fixed !important;
        left: 0 !important;
        width: 260px !important;
        transform: none !important;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .dashboard-content {
        margin-left: 260px !important;
        padding: 2rem !important;
        padding-top: 2rem !important;
        min-height: 100vh !important;
        height: auto !important;
    }
    
    /* Remove qualquer classe de menu aberto em desktop */
    .dashboard-header.menu-open {
        left: 0 !important;
        transform: none !important;
    }
    
    body.menu-open {
        overflow: visible !important;
    }
}

/* ===== AJUSTES ESPECÍFICOS PARA O MENU MOBILE ===== */
/* Apenas em mobile (até 992px) mostra os controles */
@media (max-width: 992px) {
    .menu-close {
        display: flex !important;
    }
    
    .menu-toggle {
        display: flex !important;
    }
    
    .menu-overlay {
        display: none; /* Só aparece quando ativo via JS */
    }
    
    .dashboard-header {
        left: -280px;
    }
    
    .dashboard-header.menu-open {
        left: 0;
    }
}

/* ===== CORREÇÃO DE ROLAGEM NO DESKTOP ===== */
@media (min-width: 993px) {
    body.dashboard {
        height: 100vh;
        overflow: hidden;
    }
    
    .dashboard-content {
        flex: 1;
        margin-left: 260px;
        padding: 2rem;
        background: #f8fafc;
        height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
        position: relative;
        -webkit-overflow-scrolling: touch; /* Para smooth scrolling */
    }
    
    /* Remove qualquer altura fixa que possa estar travando */
    .dashboard-content > * {
        max-width: 100%;
    }
}

/* Para garantir que o conteúdo interno possa expandir */
.dashboard-content .card,
.dashboard-content .table-container,
.dashboard-content .cards-grid {
    margin-bottom: 2rem;
}

/* Se ainda não rolar, force a rolagem com este hack */
@media (min-width: 993px) {
    .dashboard-content {
        display: block !important;
        position: relative !important;
    }
}