/* ===============================
   Dashboard 2.0 — Layout Ajustado
=============================== */

:root {
    --bg: #0f172a;
    --bg2: #1e293b;
    --card: #1e293b;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --primary: #3b82f6;
    --danger: #ef4444;
}

.dashboard2-page {
    margin: 0;
    background: var(--bg);
    font-family: 'Outfit', sans-serif;
    color: var(--text);
    min-height: 100vh;
    display: block;
}

.dashboard2-page .main {
    margin-left: 240px;
    padding: 32px clamp(24px, 4vw, 72px);
    width: calc(100% - 240px);
    max-width: 1800px;
    margin-right: auto;
}

/* ALERTA */
.alert-banner {
    width: 100%;
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.35);
    padding: 12px 16px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.hidden { display: none; }

.header {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.action-group {
    display: flex;
    gap: 12px;
}

.btn-action {
    background: var(--primary);
    border: none;
    padding: 12px 20px;
    font-size: 14px;
    border-radius: 10px;
    cursor: pointer;
    color: #fff;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-action:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

.btn-action.outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-action.outline:hover {
    background: rgba(59,130,246,0.1);
    transform: translateY(-2px);
}

.top-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.card {
    background: linear-gradient(135deg, var(--card) 0%, rgba(30,41,59,0.8) 100%);
    padding: 20px;
    border-radius: 14px;
    width: 100%;
    min-height: 110px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 16px;
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(59,130,246,0.3);
    box-shadow: 0 8px 24px rgba(59,130,246,0.15);
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: rgba(59,130,246,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary);
    flex-shrink: 0;
}

.card-icon.online {
    background: rgba(34,197,94,0.15);
    color: #22c55e;
}

.card-icon.activity {
    background: rgba(139,92,246,0.15);
    color: #8b5cf6;
}

.card-icon.warning {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
}

.card-icon.speed {
    background: rgba(234,179,8,0.15);
    color: #eab308;
}

.card-icon.success {
    background: rgba(16,185,129,0.15);
    color: #10b981;
}

.card-title { 
    font-size: 13px; 
    color: var(--muted); 
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.card-value { 
    font-size: clamp(24px, 3vw, 32px); 
    margin-top: 4px;
    font-weight: 700;
    color: var(--text);
}

.card-value.small-text {
    font-size: 16px;
    line-height: 1.3;
}

.card-trend {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend-up {
    color: #22c55e;
}

.trend-down {
    color: #ef4444;
}

/* GRID */
.layout-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 28px;
    align-items: flex-start;
}

.col-left,
.col-right {
    width: 100%;
}

.col-right {
    max-width: 360px;
}

/* PAINÉIS */
.chart-panel,
.ai-card {
    background: var(--card);
    padding: 20px;
    border-radius: 14px;
    margin-bottom: 24px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.3s ease;
}

.chart-panel:hover {
    border-color: rgba(255,255,255,0.1);
}

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

.panel-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.panel-title i {
    color: var(--primary);
}

.panel-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
}

.status-dot.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

.recent-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.recent-item:hover {
    padding-left: 8px;
    color: var(--primary);
}

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

/* RISCO */
.server-risk-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.server-risk-item:hover {
    background: rgba(255,255,255,0.04);
    transform: translateX(4px);
}

.risk-low { 
    color: #22c55e; 
    background: rgba(34,197,94,0.15);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.risk-medium { 
    color: #eab308; 
    background: rgba(234,179,8,0.15);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.risk-high,
.risk-critical { 
    color: #ef4444; 
    background: rgba(239,68,68,0.15);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.pred-tag {
    display: inline-flex;
    align-items: center;
    background: rgba(59,130,246,0.15);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin: 0 8px 8px 0;
    font-weight: 500;
    color: var(--primary);
    border: 1px solid rgba(59,130,246,0.3);
    transition: all 0.2s;
}

.pred-tag:hover {
    background: rgba(59,130,246,0.25);
    transform: translateY(-2px);
}

@media (max-width: 1200px) {
    .dashboard2-page .main {
        margin-left: 240px;
        width: calc(100% - 240px);
    }

    .layout-grid {
        grid-template-columns: 1fr;
    }

    .col-right {
        max-width: none;
    }
    
    .top-cards {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .dashboard2-page .main {
        margin-left: 0;
        width: 100%;
        padding: 16px;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
    }
    
    .top-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .card {
        padding: 16px;
        min-height: 90px;
    }
    
    .card-icon {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    
    .card-value {
        font-size: 20px;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .action-group {
        width: 100%;
    }
    
    .action-group button {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .top-cards {
        grid-template-columns: 1fr;
    }
    
    .card {
        flex-direction: row;
    }
}
