/* ========== ADMIN DASHBOARD CSS ========== */
/* Estilos específicos para o dashboard do administrador */

/* Estilos para o título da página */
.page-title {
    margin-bottom: 25px;
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 600;
}

/* Layout de duas colunas */
.dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.left-column {
    display: flex;
    flex-direction: column;
}

.right-column {
    display: flex;
    flex-direction: column;
}

/* Cards de estatísticas */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 10px;
}

.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 2px 15px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
}

.card-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #3f51b5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.card-icon i {
    font-size: 0.9rem;
}

.card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 3px;
}

.card-description {
    font-size: 0.75rem;
    color: #777;
    margin-bottom: 8px;
}

.card-trend {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
}

.card-trend.up {
    color: #4caf50;
}

.card-trend.down {
    color: #f44336;
}

.card-trend i {
    margin-right: 3px;
    font-size: 0.7rem;
}

/* Gráfico de atividades */
.chart-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 10px 20px;
    flex: 1;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

.chart-actions select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f5f5f5;
    font-size: 0.9rem;
    cursor: pointer;
}

.chart-placeholder {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    border-radius: 6px;
    color: #777;
    border: 1px dashed #ddd;
}

/* Gráfico de barras simulado */
.chart-bars {
    height: 300px;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.chart-bars::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(90deg, rgba(255,255,255,0.1) 50%, transparent 50%),
        linear-gradient(0deg, rgba(255,255,255,0.05) 50%, transparent 50%);
    background-size: 40px 40px;
    pointer-events: none;
}

.chart-bar {
    flex: 1;
    margin: 0 8px;
    border-radius: 8px 8px 0 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: barGrow 1.5s ease-out forwards;
    transform-origin: bottom;
    opacity: 0;
    max-width: 80px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.chart-bar:nth-child(1) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation-delay: 0.2s;
}

.chart-bar:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    animation-delay: 0.4s;
}

.chart-bar:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    animation-delay: 0.6s;
}

.chart-bar:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    animation-delay: 0.8s;
}

.chart-bar:nth-child(5) {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    animation-delay: 1.0s;
}

.chart-bar:nth-child(6) {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    animation-delay: 1.2s;
}

@keyframes barGrow {
    0% {
        height: 0;
        opacity: 0;
        transform: scaleY(0);
    }
    50% {
        opacity: 1;
        transform: scaleY(1.1);
    }
    100% {
        opacity: 1;
        transform: scaleY(1);
    }
}

.chart-bar-value {
    position: absolute;
    top: -30px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    opacity: 0;
    animation: fadeInValue 0.5s ease-out 1.8s forwards;
    white-space: nowrap;
}

.chart-bar-value::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0,0,0,0.8);
}

@keyframes fadeInValue {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chart-bar-label {
    position: absolute;
    bottom: -25px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #555;
    text-align: center;
    width: 100%;
    opacity: 0;
    animation: fadeInLabel 0.5s ease-out 2s forwards;
}

@keyframes fadeInLabel {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chart-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    opacity: 0;
    animation: fadeInLegend 0.5s ease-out 2.2s forwards;
}

.legend-item:nth-child(1) { animation-delay: 2.2s; }
.legend-item:nth-child(2) { animation-delay: 2.3s; }
.legend-item:nth-child(3) { animation-delay: 2.4s; }
.legend-item:nth-child(4) { animation-delay: 2.5s; }
.legend-item:nth-child(5) { animation-delay: 2.6s; }
.legend-item:nth-child(6) { animation-delay: 2.7s; }

@keyframes fadeInLegend {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 6px;
}

.legend-item:nth-child(1) .legend-color {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.legend-item:nth-child(2) .legend-color {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.legend-item:nth-child(3) .legend-color {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.legend-item:nth-child(4) .legend-color {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.legend-item:nth-child(5) .legend-color {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.legend-item:nth-child(6) .legend-color {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

/* Efeito hover nas barras */
.chart-bar:hover {
    transform: scaleY(1.05) scaleX(1.1);
    transition: transform 0.3s ease;
    filter: brightness(1.1);
}

.chart-bar:hover .chart-bar-value {
    background: rgba(0,0,0,0.9);
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

/* Atividades recentes */
.recent-activities {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 20px;
    height: fit-content;
}

.activities-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.activities-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

.view-all {
    color: #3f51b5;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.view-all:hover {
    color: #303f9f;
    text-decoration: underline;
}

.activity-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f0f4f8;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: #3f51b5;
}

.activity-details {
    flex: 1;
}

.activity-title {
    font-size: 0.95rem;
    margin-bottom: 3px;
    color: #333;
}

.activity-time {
    font-size: 0.8rem;
    color: #888;
}

/* Responsividade */
@media (max-width: 1400px) {
    .dashboard-cards {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
    
    .card {
        padding: 2px 12px;
    }
    
    .card-value {
        font-size: 1.3rem;
    }
}

@media (max-width: 1200px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .dashboard-cards {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
}

@media (max-width: 992px) {
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .card {
        padding: 2px 10px;
    }
    
    .card-title {
        font-size: 0.8rem;
    }
    
    .card-value {
        font-size: 1.2rem;
    }
    
    .card-description {
        font-size: 0.7rem;
    }
    
    .card-trend {
        font-size: 0.7rem;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chart-actions {
        margin-top: 10px;
        width: 100%;
    }
    
    .chart-actions select {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
}

/* Estilos específicos para cada card baseado no tipo */
.card:nth-child(1) .card-icon {
    background-color: #5c6bc0; /* Consultas - Azul */
}

.card:nth-child(2) .card-icon {
    background-color: #66bb6a; /* Pacientes - Verde */
}

.card:nth-child(3) .card-icon {
    background-color: #ffa726; /* Faturamento - Laranja */
}

.card:nth-child(4) .card-icon {
    background-color: #ef5350; /* Cirurgias - Vermelho */
}