.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--bg-card, #fff);
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    border: 1px solid var(--border-color, #e2e8f0);
    transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.stat-icon { font-size: 2rem; flex-shrink: 0; }
.stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; opacity: .6; margin-top: .25rem; }

.stat-card.danger .stat-value { color: #ef4444; }
.stat-card.warning .stat-value { color: #f59e0b; }
.stat-card.success .stat-value { color: #22c55e; }
.stat-card.info .stat-value { color: #3b82f6; }

/* Bar chart */
.bar-chart { display: flex; flex-direction: column; gap: .5rem; }
.bar-row { display: flex; align-items: center; gap: .75rem; font-size: .8125rem; }
.bar-label { width: 6rem; flex-shrink: 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; opacity: .75; }
.bar-track { flex: 1; height: .75rem; border-radius: 999px; background: rgba(0,0,0,.06); overflow: hidden; }
.dark .bar-track { background: rgba(255,255,255,.08); }
.bar-fill { height: 100%; border-radius: 999px; background: #3b82f6; transition: width .4s ease; }
.bar-fill.orange { background: #f97316; }
.bar-fill.green  { background: #22c55e; }
.bar-fill.red    { background: #ef4444; }
.bar-count { width: 2.5rem; text-align: right; font-weight: 700; opacity: .8; }

/* Conflict list */
.conflict-item {
    display: flex; gap: .75rem; align-items: flex-start;
    padding: .625rem .75rem;
    border-radius: .5rem;
    background: rgba(239,68,68,.06);
    border-left: 3px solid #ef4444;
    font-size: .8125rem;
}
.dark .conflict-item { background: rgba(239,68,68,.1); }
.conflict-item.class-type { background: rgba(245,158,11,.06); border-color: #f59e0b; }
.dark .conflict-item.class-type { background: rgba(245,158,11,.1); }
.conflict-badge {
    font-size: .65rem; font-weight: 700; padding: .15rem .45rem;
    border-radius: .25rem; white-space: nowrap; flex-shrink: 0; margin-top: .1rem;
}
.conflict-badge.teacher { background: #fee2e2; color: #dc2626; }
.dark .conflict-badge.teacher { background: rgba(220,38,38,.3); color: #fca5a5; }
.conflict-badge.class { background: #fef3c7; color: #d97706; }
.dark .conflict-badge.class { background: rgba(217,119,6,.3); color: #fcd34d; }

/* Audit log */
.audit-row {
    display: flex; gap: .75rem; align-items: center;
    padding: .5rem .25rem;
    border-bottom: 1px dashed rgba(0,0,0,.07);
    font-size: .8rem;
}
.dark .audit-row { border-color: rgba(255,255,255,.07); }
.audit-row:last-child { border: none; }
.audit-action {
    font-size: .65rem; font-weight: 700; padding: .15rem .4rem;
    border-radius: .25rem; white-space: nowrap;
}
.action-create { background: #d1fae5; color: #065f46; }
.dark .action-create { background: rgba(6,95,70,.4); color: #6ee7b7; }
.action-update { background: #dbeafe; color: #1e40af; }
.dark .action-update { background: rgba(30,64,175,.4); color: #93c5fd; }
.action-delete { background: #fee2e2; color: #991b1b; }
.dark .action-delete { background: rgba(153,27,27,.4); color: #fca5a5; }
.action-swap, .action-import, .action-generate { background: #f3e8ff; color: #6b21a8; }
.dark .action-swap, .dark .action-import, .dark .action-generate { background: rgba(107,33,168,.4); color: #d8b4fe; }
.audit-desc { flex: 1; opacity: .9; }
.audit-time { opacity: .45; white-space: nowrap; }

/* Gap analysis */
.gap-positive { color: #ef4444; font-weight: 700; }
.gap-negative { color: #22c55e; font-weight: 700; }

/* Spinner */
.dash-spinner {
    display: flex; align-items: center; justify-content: center;
    padding: 3rem; color: #94a3b8; font-size: .9rem; gap: .5rem;
}
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Section card */
.dash-section {
    background: var(--bg-card, #fff);
    border-radius: 1rem;
    border: 1px solid var(--border-color, #e2e8f0);
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    overflow: hidden;
}
.dash-section-header {
    padding: .875rem 1.25rem;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    display: flex; align-items: center; justify-content: space-between;
    font-weight: 700; font-size: .9rem;
}
.dash-section-body { padding: 1rem 1.25rem; }
