/* Variáveis CSS para fácil manutenção */
:root {
    --primary-color: #007bff; /* Azul para destaque */
    --secondary-color: #6c757d; /* Cinza para elementos secundários */
    --background-light: #f4f7fa; /* Fundo claro geral */
    --text-dark: #333; /* Texto principal */
    --text-light: #f8f9fa; /* Texto claro (em backgrounds escuros) */
    --sidebar-bg: #2d3e50; /* Fundo da sidebar */
    --card-bg: #ffffff; /* Fundo dos cards */
    --border-color: #e0e0e0; /* Cor da borda */
    --success-color: #28a745; /* Cor de sucesso */
    --warning-color: #ffc107; /* Cor de alerta */
    --info-color: #17a2b8; /* Cor de informação */
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-light);
    color: var(--text-dark);
    display: flex;
    min-height: 100vh;
}

.dashboard-container {
    display: flex;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    color: var(--text-light);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    display: flex;
    align-items: center;
    padding: 0 20px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.sidebar-header .logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    background-color: #fff; /* Apenas para o placeholder */
}

.sidebar-header .system-name {
    font-size: 1.2em;
    font-weight: 600;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1; /* Faz o menu ocupar o espaço restante */
}

.sidebar-menu .menu-item a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-light);
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-menu .menu-item a i {
    margin-right: 10px;
    font-size: 1.1em;
}

.sidebar-menu .menu-item a:hover,
.sidebar-menu .menu-item.active a {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--primary-color); /* Realça o item ativo/hover */
    border-left: 3px solid var(--primary-color);
    padding-left: 17px; /* Compensar a borda */
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

/* Switch de toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
    -webkit-transform: translateX(16px);
    -ms-transform: translateX(16px);
    transform: translateX(16px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}


/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.topbar {
    background-color: var(--card-bg);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.topbar .breadcrumb {
    font-size: 0.9em;
    color: var(--secondary-color);
}

.topbar-actions {
    display: flex;
    align-items: center;
}

.search-box {
    position: relative;
    margin-right: 20px;
}

.search-box input {
    border: 1px solid var(--border-color);
    padding: 8px 10px 8px 30px;
    border-radius: 5px;
    font-size: 0.9em;
    outline: none;
    transition: border-color 0.2s ease;
}

.search-box input:focus {
    border-color: var(--primary-color);
}

.search-box i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
}

.topbar-actions .icon {
    font-size: 1.2em;
    color: var(--secondary-color);
    margin-right: 20px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.topbar-actions .icon:hover {
    color: var(--primary-color);
}

.user-profile {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.user-profile .avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 8px;
    background-color: var(--primary-color); /* Para o placeholder */
    color: var(--text-light);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8em;
    font-weight: 500;
}

.user-profile span {
    font-weight: 500;
    margin-right: 5px;
}

.user-profile i {
    font-size: 0.8em;
    color: var(--secondary-color);
}

/* Dashboard Area */
.dashboard-area {
    padding: 30px;
    flex-grow: 1;
    overflow-y: auto; /* Para rolagem se o conteúdo for muito grande */
}

.dashboard-area h1 {
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 25px;
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    padding: 25px;
    margin-bottom: 20px;
}

.card h3 {
    font-size: 1.2em;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 20px;
}

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

/* Project Progress Card */
.project-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.progress-circle {
    position: relative;
    width: 150px;
    height: 150px;
    margin-top: 15px;
}

.progress-circle canvas {
    width: 100% !important;
    height: 100% !important;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-text .percentage {
    font-size: 2.2em;
    font-weight: 700;
    color: var(--success-color);
    display: block;
}

.progress-text .initiatives {
    font-size: 0.8em;
    color: var(--secondary-color);
    margin-top: -5px;
    display: block;
}

/* Pending Tasks Card */
.pending-tasks .task-bars {
    margin-top: 10px;
}

.pending-tasks .bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--background-light);
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    font-weight: 500;
}

.pending-tasks .bar.high {
    background-color: #ffe0b2; /* Laranja claro */
    color: #e65100; /* Laranja escuro */
}

.pending-tasks .bar.medium {
    background-color: #e3f2fd; /* Azul claro */
    color: #1565c0; /* Azul escuro */
}

.pending-tasks .bar.low {
    background-color: #e8f5e9; /* Verde claro */
    color: #2e7d32; /* Verde escuro */
}

/* Recent Activity Card */
.recent-activity ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-activity li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95em;
    color: #555;
}

.recent-activity li:last-child {
    border-bottom: none;
}

/* Grid de Gráficos e Ações */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; /* 2/3 para o gráfico, 1/3 para ações rápidas */
    gap: 20px;
}

@media (max-width: 992px) {
    .charts-grid {
        grid-template-columns: 1fr; /* Coluna única em telas menores */
    }
}

/* Team Performance Card */
.team-performance {
    min-height: 300px; /* Garante altura para o gráfico */
    display: flex;
    flex-direction: column;
}

.team-performance canvas {
    flex-grow: 1; /* Faz o canvas expandir */
}


/* Quick Actions Card */
.quick-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn i {
    margin-right: 8px;
}

.btn.primary {
    background-color: var(--primary-color);
    color: var(--text-light);
}

.btn.primary:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

.btn.secondary {
    background-color: var(--secondary-color);
    color: var(--text-light);
}

.btn.secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

.btn.tertiary {
    background-color: var(--background-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn.tertiary:hover {
    background-color: var(--border-color);
    transform: translateY(-1px);
}

/* Responsividade Básica */
@media (max-width: 768px) {
    .sidebar {
        width: 80px; /* Sidebar mais compacta */
        align-items: center;
    }

    .sidebar .system-name,
    .sidebar-menu span {
        display: none; /* Esconde texto do menu em mobile */
    }

    .sidebar-menu .menu-item a {
        justify-content: center;
    }

    .sidebar-menu .menu-item a i {
        margin-right: 0;
    }

    .sidebar-header .logo {
        margin-right: 0;
    }
    .sidebar-header {
        justify-content: center;
        padding-bottom: 10px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }

    .topbar-actions {
        margin-top: 15px;
        width: 100%;
        justify-content: space-between;
    }

    .search-box {
        flex-grow: 1;
        margin-right: 10px;
    }

    .dashboard-area {
        padding: 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr; /* Coluna única em telas menores */
    }
}