/* ============================================================
   DASHBOARD — HUTECH Program Admin Dashboard
   ============================================================ */

.dashboard-container {
    padding: 16px 24px 32px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ── ROW 1: Stat Cards ── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.06);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon .material-symbols-outlined {
    font-size: 26px;
    color: #ffffff;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
    font-weight: 500;
}


/* ── ROW 2: Chart Cards ── */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.chart-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.chart-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-header h3 .material-symbols-outlined {
    font-size: 20px;
    color: #64748b;
}

.chart-total {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
    background: #f8fafc;
    padding: 4px 10px;
    border-radius: 6px;
}

.chart-body {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
}

.chart-body canvas {
    max-width: 100%;
    max-height: 260px;
}

.chart-empty {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
}

.chart-empty .material-symbols-outlined {
    font-size: 48px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.chart-empty p {
    font-size: 14px;
    margin: 0;
}

/* Fallback table (when Chart.js fails) */
.chart-fallback {
    padding: 0 20px 20px;
}

.fallback-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.fallback-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #f1f5f9;
}

.fallback-table td:first-child {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fallback-table .color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.fallback-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: #1e293b;
}


/* ── ROW 3: Activities ── */
.activities-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.activities-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.activities-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.activities-header h3 .material-symbols-outlined {
    font-size: 20px;
    color: #64748b;
}

.activities-body {
    padding: 0;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid #f8fafc;
    transition: background 0.15s;
}

.activity-item:hover {
    background: #f8fafc;
}

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

.activity-action {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 80px;
    text-align: center;
}

/* Action type colors */
.activity-action--create {
    background: #dbeafe;
    color: #1d4ed8;
}

.activity-action--update {
    background: #e0f2fe;
    color: #0369a1;
}

.activity-action--delete {
    background: #fee2e2;
    color: #dc2626;
}

.activity-action--submit {
    background: #fef3c7;
    color: #b45309;
}

.activity-action--approve {
    background: #d1fae5;
    color: #047857;
}

.activity-action--reject {
    background: #fce7f3;
    color: #be185d;
}

.activity-action--rollback {
    background: #ede9fe;
    color: #6d28d9;
}

.activity-detail {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: #475569;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-detail strong {
    color: #1e293b;
    font-weight: 600;
}

.activity-entity-type {
    margin-left: 4px;
    color: #94a3b8;
    font-size: 12px;
}

.activity-time {
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
}

.activities-empty {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
}

.activities-empty .material-symbols-outlined {
    font-size: 48px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.activities-empty p {
    font-size: 14px;
    margin: 0;
}

.activities-footer {
    padding: 12px 20px;
    border-top: 1px solid #f1f5f9;
    text-align: center;
}

.btn-load-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 24px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-load-more:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #1e293b;
}

.btn-load-more .material-symbols-outlined {
    font-size: 18px;
}

.btn-load-more:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-load-more--loading::after {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid #94a3b8;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* ── Responsive ── */
@media (max-width: 1024px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        padding: 12px 16px 24px;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .charts-row {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-number {
        font-size: 24px;
    }

    .chart-body {
        min-height: 220px;
    }

    .activity-item {
        flex-wrap: wrap;
        gap: 8px;
    }

    .activity-detail {
        order: 3;
        width: 100%;
        white-space: normal;
    }

    .activity-time {
        order: 2;
    }
}
