/* --- Variáveis CSS para cores e tamanhos (melhora a manutenção) --- */
:root {
    --primary-color: #6a4b8a;
    --secondary-color: #89739c;
    --text-dark: #2c2c2c;
    --text-medium: #333;
    --text-light: #888;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-light: #f0f0f0;
    --border-medium: #e0e0e0;
    --border-dark: #e8e8e8;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
    --radius-sm: 10px;
    --radius-md: 15px;
    --radius-lg: 20px;
    --font-size-sm: 13px;
    --font-size-md: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-xxl: 24px;
}

/* --- Estilos Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Consolidado: A fonte Poppins é a principal, outras são fallbacks. */
    font-family: 'Poppins', -apple-system, BlinkMacMacFont, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-medium);
    padding: 20px;
}

.main-container {
    width: 100%;
    max-width: 1000px;
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- Header --- */
.header {
    padding: 25px 30px;
    background-color: var(--bg-white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.profile {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--bg-white);
    font-weight: bold;
    font-size: var(--font-size-xl);
    box-shadow: 0 4px 10px rgba(106, 75, 138, 0.3);
}

.greeting h1 {
    font-size: var(--font-size-xxl);
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
}

.greeting p {
    color: var(--text-light);
    font-size: var(--font-size-md);
    font-weight: 500;
}

.actions {
    display: flex;
    gap: 20px;
}

.action-btn {
    width: 45px;
    height: 45px;
    border-radius: var(--radius-md);
    background: var(--bg-light); 
    justify-content: center;
    align-items: center;
    color: var(--primary-color);
    font-size: var(--font-size-xl);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.action-btn:hover {
    background: #eaeaea; 
    transform: translateY(-2px);
}

.action-btn:active {
    transform: scale(0.95);
    background: #dcdcdc; 
}

.stock-section {
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-md);
    text-align: center;
    display: flex;
    flex-direction: column;
    margin: 20px;
}

.chart-section .chart-title,
.data-display-area h2 { /* Consolidado: Ambos títulos tinham estilos semelhantes */
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px; 
}

/* --- Gráficos --- */
.chart-container {
    position: relative;
    height: 240px;
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 10px;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
    max-height: 240px;
    object-fit: contain;
    background-color: var(--bg-white);
    border-radius: var(--radius-sm); 
    box-shadow: var(--shadow-sm); 
}

/* --- Botões de Ação --- */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 0;
}

.action-button {
    padding: 22px 30px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    border-radius: 30px;
    color: var(--bg-white);
    font-size: var(--font-size-lg);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(137, 115, 156, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: none;
}

.action-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(137, 115, 156, 0.4);
}

.action-button:active {
    transform: scale(0.98);
    box-shadow: 0 4px 12px rgba(137, 115, 156, 0.5);
}

.action-button i {
    font-size: 22px;
}


.data-display-area p { /* Estilo para o parágrafo de simulação de dados */
    text-align: center;
    color: var(--text-light);
    padding: 20px;
}

.table-placeholder {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    margin-top: 20px;
}

.table-placeholder h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
    padding: 15px;
    background-color: var(--border-light);
    border-bottom: 1px solid var(--border-medium);
}

.table-placeholder table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-white);
}

.table-placeholder th,
.table-placeholder td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-dark);
    text-align: center;
}

.table-placeholder th {
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    background-color: var(--border-light);
}

/* --- Footer (Nav-Bar) --- */
.nav-bar {
    width: 100%;
    max-width: 1000px;
    background-color: var(--bg-white);
    padding: 15px 25px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-around;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.05); /* Mantido fixo */
    border: 1px solid var(--secondary-color);
    border-radius: var(--radius-md);
    margin-top: 30px;
    margin-bottom: 20px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #999; /* Mantido fixo para o tom de cinza específico */
    font-size: var(--font-size-sm);
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 18px; 
    border: none;
    background: none;
}

.nav-item.active {
    color: var(--primary-color);
    background-color: rgba(106, 75, 138, 0.1);
    transform: translateY(-5px);
}

.nav-item:hover {
    color: var(--secondary-color);
    transform: translateY(-2px);
}

.nav-item i {
    font-size: 24px;
    margin-bottom: 5px;
}

.nav-item span {
    font-weight: 500;
}

/* --- Media Queries para Mobile (max-width: 768px) --- */
@media (max-width: 768px) {
    body {
        padding: 0; /* Remove padding do body para mobile, a nav-bar é fixa */
    }

    /* Consolidado: Estilos para .chart-container e canvas mobile */
    .chart-container {
        height: 150px; /* Reduzido para mobile */
        padding: 10px 15px 20px;
        margin: 0 auto;
        border-radius: var(--radius-sm);
        background-color: var(--bg-white);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    }

    .chart-container canvas {
        max-height: 100%; 
        border-radius: var(--radius-sm);
    }

    .header {
        padding: 16px 20px 10px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    }

    .user-info {
        gap: 12px;
    }

    .profile {
        width: 42px;
        height: 42px;
        font-size: var(--font-size-lg);
    }

    .greeting h1 {
        font-size: var(--font-size-xl);
    }

    .greeting p {
        font-size: 14px;
    }

    .actions {
        gap: 15px;
    }

    .action-btn {
        width: 38px;
        height: 38px;
        font-size: var(--font-size-lg);
    }

    .stock-section {
        padding: 20px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
        margin: 15px;
    }

    .chart-section .chart-title {
        font-size: 17px;
    }

    .action-buttons {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .action-button {
        padding: 18px 25px;
        font-size: var(--font-size-md);
        gap: 10px;
    }

    .action-button i {
        font-size: var(--font-size-lg);
    }

    .nav-bar {
        position: fixed;
        bottom: 0;
        width: 100%;
        max-width: none;
        border: none;
        border-top: 1px solid var(--border-light);
        border-radius: 0;
        margin-top: 0;
        margin-bottom: 0;
        box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
        padding: 8px 12px;
    }

    .nav-item {
        padding: 8px 12px;
        font-size: 11px;
    }

    .nav-item i {
        font-size: var(--font-size-xl);
        margin-bottom: 3px;
    }

    /* Estilos para a tabela em si em mobile */
    .table-placeholder table {
        display: table;
        white-space: normal;
        overflow-x: auto;
        width: 100%;
    }

    .table-placeholder th,
    .table-placeholder td {
        min-width: 100px;
        padding: 10px;
        font-size: var(--font-size-sm);
        white-space: normal;
    }
}