/* Reset global */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    background-attachment: fixed;
    color: #333;
    height: 100vh;
    overflow-x: hidden;
}

/* Container principal - OCUPA TODA A TELA */
.dashboard-container {
    height: 100vh;
    padding: 30px;
    margin-left: 350px;
    width: calc(100vw - 350px);
    display: flex;
    flex-direction: column;
    gap: 30px;
    overflow-y: auto;
}

/* Header de boas-vindas - MAIOR */
.welcome-header {
    background-color: #fcb900;
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    min-height: 120px;
}

.welcome-info h2 {
    color: #2c3e50;
    font-size: 2rem;
    margin-bottom: 8px;
    font-weight: 700;
}

.welcome-info p {
    color: #7f8c8d;
    font-size: 1.2rem;
    font-weight: 500;
}

.current-time {
    color: #34495e;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Grid de estatísticas - CARDS MAIORES */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    width: 100%;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 20px 20px 0 0;
}

.stat-card.warning::before {
    background: linear-gradient(90deg, #f39c12, #e74c3c);
}

.stat-card.success::before {
    background: linear-gradient(90deg, #2ecc71, #27ae60);
}

.stat-card.danger::before {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.stat-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.stat-icon.blue { background: linear-gradient(135deg, #3498db, #2980b9); }
.stat-icon.green { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.stat-icon.orange { background: linear-gradient(135deg, #f39c12, #e67e22); }
.stat-icon.red { background: linear-gradient(135deg, #e74c3c, #c0392b); }

.stat-number {
    font-size: 3.5rem;
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 8px;
    line-height: 1;
}

.stat-label {
    color: #7f8c8d;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Seção de gráficos - MUITO MAIOR */
.charts-section {
    display: grid;
    grid-template-columns: 1fr; /* Agora há apenas uma coluna que ocupa todo o espaço */
    gap: 30px;
    width: 100%;
    flex: 1;
    min-height: 500px;
    overflow: auto;
}

.chart-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.chart-card h3 {
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    /* Altere de 'height' para 'min-height' para que a caixa possa crescer */
    min-height: 300px;
    overflow: auto;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.table-title {
    font-size: 1.6rem;
    color: #2c3e50;
    font-weight: 700;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 4px 16px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(52, 152, 219, 0.4);
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 15px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
    background: white;
}

.orders-table th,
.orders-table td {
    text-align: left;
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
    font-size: 1rem;
}

.orders-table th {
    background: #f8f9fa;
    color: #2c3e50;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.orders-table tbody tr {
    transition: all 0.2s ease;
}

.orders-table tbody tr:hover {
    background: #f8f9fa;
    transform: scale(1.01);
}

.status-badge {
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.status-aberto {
    background: #e3f2fd;
    color: #1976d2;
}

.status-andamento {
    background: #fff3e0;
    color: #f57c00;
}

.status-concluido {
    background: #e8f5e8;
    color: #388e3c;
}

.status-atrasado {
    background: #ffebee;
    color: #d32f2f;
}

.priority-high { color: #e74c3c; font-weight: 700; }
.priority-medium { color: #f39c12; font-weight: 700; }
.priority-low { color: #2ecc71; font-weight: 700; }

/* Ações rápidas - MAIORES */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    width: 100%;
}

.quick-action-btn {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 20px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    min-height: 120px;
}

.quick-action-btn:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.quick-action-icon {
    width: 70px;
    height: 70px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.quick-action-text {
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.2rem;
}

/* Placeholders para gráficos - ALTURA COMPLETA */
.chart-placeholder {
    flex: 1;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
    min-height: 400px;
    border: 2px dashed #dee2e6;
}

.donut-chart {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 25px;
    min-height: 400px;
}

.donut-placeholder {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: conic-gradient(
        #3498db 0deg 120deg,
        #2ecc71 120deg 240deg,
        #f39c12 240deg 300deg,
        #e74c3c 300deg 360deg
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.donut-placeholder::after {
    content: '';
    width: 160px;
    height: 160px;
    background: white;
    border-radius: 50%;
    box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.1);
}

.legend {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* RESPONSIVIDADE COMPLETA */

@media (max-width: 1400px) {
    .dashboard-container {
        margin-left: 300px;
        width: calc(100vw - 300px);
    }
}

@media (max-width: 1200px) {
    .dashboard-container {
        margin-left: 280px;
        width: calc(100vw - 280px);
        padding: 25px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 1024px) {
    .dashboard-container {
        margin-left: 250px;
        width: calc(100vw - 250px);
        padding: 20px;
    }
    
    .charts-section {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .chart-card {
        min-height: 400px;
    }
    
    .donut-placeholder {
        width: 220px;
        height: 220px;
    }
    
    .donut-placeholder::after {
        width: 130px;
        height: 130px;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        margin-left: 0;
        width: 100vw;
        padding: 20px;
        padding-top: 100px;
        height: calc(100vh - 80px);
    }
    
    .welcome-header {
        flex-direction: column;
        text-align: center;
        padding: 25px;
        min-height: auto;
    }
    
    .welcome-info h2 {
        font-size: 1.6rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stat-card {
        min-height: 160px;
        padding: 25px;
    }
    
    .stat-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .chart-card {
        min-height: 350px;
        padding: 25px;
    }
    
    .donut-chart {
        min-height: 300px;
    }
    
    .donut-placeholder {
        width: 180px;
        height: 180px;
    }
    
    .donut-placeholder::after {
        width: 108px;
        height: 108px;
    }
    
    .table-section {
        padding: 20px;
    }
    
    .orders-table th,
    .orders-table td {
        padding: 15px 10px;
        font-size: 0.9rem;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .dashboard-container {
        padding: 15px;
        padding-top: 85px;
    }
    
    .welcome-header {
        padding: 20px;
    }
    
    .welcome-info h2 {
        font-size: 1.4rem;
    }
    
    .stat-card {
        min-height: 140px;
        padding: 20px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .chart-card {
        min-height: 300px;
        padding: 20px;
    }
    
    .chart-placeholder {
        min-height: 250px;
        font-size: 1.1rem;
    }
    
    .donut-chart {
        min-height: 250px;
    }
    
    .donut-placeholder {
        width: 150px;
        height: 150px;
    }
    
    .donut-placeholder::after {
        width: 90px;
        height: 90px;
    }
    
    .table-title {
        font-size: 1.3rem;
    }
    
    .orders-table {
        min-width: 600px;
    }
    
    .orders-table th,
    .orders-table td {
        padding: 12px 8px;
        font-size: 0.85rem;
    }
    
    .quick-action-btn {
        min-height: 100px;
        padding: 20px;
    }
    
    .quick-action-icon {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }
}