/* Dashboard de Vendas - Estilos */

/* Reset e base */
.dashboard-container * {
    box-sizing: border-box;
}

.dashboard-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #f8fafc;
    min-height: 100vh;
}

/* Login */
.dashboard-login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: -20px;
    padding: 20px;
}

.login-form-wrapper {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    width: 80px;
    height: auto;
    margin-bottom: 15px;
}

.login-header h2 {
    margin: 0 0 5px 0;
    color: #1a202c;
    font-size: 24px;
}

.login-header p {
    margin: 0;
    color: #718096;
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 5px;
    color: #2d3748;
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
}

.login-button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.login-button:hover {
    transform: translateY(-1px);
}

.error-message {
    color: #e53e3e;
    background: #fed7d7;
    padding: 10px;
    border-radius: 6px;
    margin-top: 15px;
    text-align: center;
}

/* Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    width: 50px;
    height: auto;
}

.header-title h1 {
    margin: 0;
    color: #1a202c;
    font-size: 24px;
    font-weight: 700;
}

.header-month {
    color: #718096;
    font-size: 14px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    color: #4a5568;
    font-weight: 500;
}

.logout-button {
    padding: 8px 16px;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.logout-button:hover {
    background: #c53030;
}

/* Tabs */
.dashboard-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    background: white;
    padding: 5px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.tab-button {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #718096;
    transition: all 0.2s;
}

.tab-button.active {
    background: #667eea;
    color: white;
}

.tab-button:hover:not(.active) {
    background: #f7fafc;
    color: #4a5568;
}

/* Configurações do Período */
.period-config {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.period-config h3 {
    margin: 0 0 10px 0;
    color: #1a202c;
    font-size: 18px;
}

.period-config p {
    margin: 0 0 15px 0;
    color: #718096;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.config-item label {
    display: block;
    margin-bottom: 5px;
    color: #2d3748;
    font-weight: 500;
}

.config-item input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 16px;
}

.config-item input:focus {
    outline: none;
    border-color: #667eea;
}

/* Projeções */
.projections-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.projections-section h3 {
    margin: 0 0 10px 0;
    color: #1a202c;
    font-size: 18px;
}

.projections-section p {
    margin: 0 0 15px 0;
    color: #718096;
}

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

.projection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f7fafc;
    border-radius: 8px;
}

.projection-item span:first-child {
    color: #4a5568;
    font-weight: 500;
}

.projection-item span:last-child {
    color: #1a202c;
    font-weight: 700;
}

/* Cards de Estatísticas */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 32px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7fafc;
    border-radius: 12px;
}

.stat-content h3 {
    margin: 0 0 5px 0;
    color: #718096;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-content p {
    margin: 0;
    color: #1a202c;
    font-size: 24px;
    font-weight: 700;
}

.stat-content small {
    color: #718096;
    font-size: 12px;
}

/* Gráficos */
.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.chart-container h3 {
    margin: 0 0 15px 0;
    color: #1a202c;
    font-size: 18px;
}

.chart-container canvas {
    width: 100% !important;
    height: 300px !important;
}

/* Tabela */
.data-table-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.table-header h3 {
    margin: 0;
    color: #1a202c;
    font-size: 18px;
}

.add-button {
    padding: 10px 16px;
    background: #48bb78;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.add-button:hover {
    background: #38a169;
}

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

.sales-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.sales-table th,
.sales-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.sales-table th {
    background: #f7fafc;
    color: #4a5568;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
}

.sales-table td {
    color: #2d3748;
}

.sales-table tr:hover {
    background: #f7fafc;
}

.edit-btn,
.delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    margin-right: 5px;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s;
}

.edit-btn:hover {
    background: #e2e8f0;
}

.delete-btn:hover {
    background: #fed7d7;
}

/* Formulário de Adição */
.add-form-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.add-form-section h3 {
    margin: 0 0 20px 0;
    color: #1a202c;
    font-size: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #2d3748;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-actions {
    display: flex;
    gap: 10px;
}

.save-button {
    padding: 10px 20px;
    background: #48bb78;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.save-button:hover {
    background: #38a169;
}

.cancel-button {
    padding: 10px 20px;
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.cancel-button:hover {
    background: #cbd5e0;
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: white;
    font-weight: 500;
}

/* Responsivo */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 10px;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .dashboard-tabs {
        flex-direction: column;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .config-grid,
    .projections-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .table-wrapper {
        font-size: 12px;
    }
    
    .sales-table th,
    .sales-table td {
        padding: 8px;
    }
}

