:root {
    --bg: #f4f7fb;
    --card: rgba(255, 255, 255, 0.86);
    --text: #0f172a;
    --muted: #64748b;
    --brand: #4f46e5;
    --brand-2: #7c3aed;
    --success: #16a34a;
    --warning: #f59e0b;
    --dark: #111827;
}

body {
    font-family: 'Cairo', sans-serif;
    background: radial-gradient(circle at top right, rgba(79,70,229,.12), transparent 28%), linear-gradient(180deg, #fbfdff 0%, #f2f6fb 100%);
    color: var(--text);
    min-height: 100vh;
}

.topbar {
    background: linear-gradient(135deg, #111827, #312e81 65%, #4f46e5);
}

.footer {
    background: #0f172a;
}

.glass-card {
    background: var(--card);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

.hero-card {
    background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,255,255,.75));
}

.btn-brand {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    border: 0;
    color: white;
    box-shadow: 0 12px 25px rgba(79, 70, 229, .22);
}

.btn-brand:hover {
    color: white;
    opacity: .95;
}

.form-control, .form-select, textarea {
    border-radius: 16px !important;
    padding: 0.9rem 1rem !important;
    border: 1px solid rgba(148, 163, 184, .35) !important;
    box-shadow: none !important;
}

.metric-card, .stat-card {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    padding: 1.25rem;
    color: white;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.metric-card h2, .stat-card h2 {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
}

.metric-card.primary, .stat-card {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}
.metric-card.success, .stat-card.green {
    background: linear-gradient(135deg, #16a34a, #22c55e);
}
.metric-card.warning, .stat-card.orange {
    background: linear-gradient(135deg, #f59e0b, #f97316);
}
.metric-card.dark, .stat-card.dark {
    background: linear-gradient(135deg, #111827, #334155);
}

.stat-card i {
    position: absolute;
    left: 18px;
    bottom: 16px;
    font-size: 2rem;
    opacity: .25;
}

.feature-grid .feature-item {
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 18px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    font-weight: 700;
}

.feature-grid .feature-item i,
.icon-bubble {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(79,70,229,.12), rgba(124,58,237,.14));
    border-radius: 16px;
    color: var(--brand);
    font-size: 1.25rem;
}

.stack-list {
    display: grid;
    gap: .85rem;
}

.stack-item, .assignment-mini, .selected-card, .code-box {
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 18px;
    padding: 1rem;
}

.soft-badge {
    background: rgba(79, 70, 229, .1);
    color: var(--brand);
}

.table thead th {
    background: #eef2ff;
    border-bottom: 0;
    color: #312e81;
}

.table > :not(caption) > * > * {
    padding: 1rem 0.85rem;
}

.attendance-table {
    max-height: 70vh;
    overflow: auto;
}

.selected-card {
    background: linear-gradient(135deg, rgba(79,70,229,.08), rgba(34,197,94,.08));
}

.code-box {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    direction: ltr;
    text-align: left;
}

.pagination .page-link {
    border-radius: 14px !important;
    margin: 0 4px;
}

@media (max-width: 768px) {
    .glass-card { border-radius: 20px; }
    .hero-card { padding: 1.5rem !important; }
}
