:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.3);
    --secondary: #64748b;
    --bg-dark: #0a0e1a;
    --bg-darker: #060912;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --glass: rgba(15, 23, 42, 0.8);
    --glass-border: rgba(255, 255, 255, 0.08);
    --sidebar-width: 260px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; }

body {
    background: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    background-image: radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.08) 0%, transparent 50%),
                      radial-gradient(ellipse at 80% 20%, rgba(168,85,247,0.06) 0%, transparent 50%);
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed; top: 0; left: 0;
    width: var(--sidebar-width); height: 100vh;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex; flex-direction: column;
    z-index: 200; padding: 0;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex; align-items: center; gap: 0.75rem;
    text-decoration: none;
}

.sidebar-brand i { font-size: 1.75rem; color: var(--primary); }
.sidebar-brand span { font-weight: 800; font-size: 1.3rem; background: linear-gradient(135deg, #818cf8, #c084fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.sidebar-nav { flex: 1; padding: 1rem 0.75rem; overflow-y: auto; }

.sidebar-nav a, .sidebar-nav button {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem; margin-bottom: 0.25rem;
    border-radius: 10px; color: var(--text-muted);
    text-decoration: none; font-weight: 500; font-size: 0.9rem;
    transition: all 0.2s ease; border: none; background: none; width: 100%; cursor: pointer; text-align: left;
}

.sidebar-nav a:hover, .sidebar-nav button:hover { background: rgba(99, 102, 241, 0.1); color: var(--text-main); }
.sidebar-nav a.active { background: rgba(99, 102, 241, 0.15); color: var(--primary); font-weight: 600; }
.sidebar-nav a i, .sidebar-nav button i { width: 20px; text-align: center; font-size: 1rem; }

.sidebar-section { padding: 0.75rem 1rem 0.4rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); opacity: 0.6; }

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--glass-border);
}

.sidebar-user {
    display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem;
}

.user-avatar {
    width: 38px; height: 38px; border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem; color: white; flex-shrink: 0;
}

.user-info { overflow: hidden; }
.user-info .name { font-weight: 600; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .role { font-size: 0.7rem; color: var(--text-muted); text-transform: capitalize; }

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* ===== TOP BAR ===== */
.topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 2rem;
    background: rgba(10, 14, 26, 0.6);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky; top: 0; z-index: 100;
}

.topbar-left { display: flex; align-items: center; gap: 1rem; }
.topbar-right { display: flex; align-items: center; gap: 1rem; }

.mobile-toggle {
    display: none; background: none; border: none; color: var(--text-main);
    font-size: 1.25rem; cursor: pointer; padding: 0.5rem;
}

.search-container { position: relative; max-width: 400px; width: 100%; }
.search-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-input { padding-left: 2.75rem; background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); }

.notif-btn {
    position: relative; background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border);
    border-radius: 10px; padding: 0.6rem 0.75rem; color: var(--text-muted);
    cursor: pointer; transition: all 0.2s; text-decoration: none; display: flex; align-items: center;
}
.notif-btn:hover { background: rgba(99,102,241,0.1); color: var(--primary); }

.notif-badge {
    position: absolute; top: -4px; right: -4px;
    background: var(--danger); color: white; font-size: 0.65rem;
    font-weight: 700; border-radius: 50%; width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }

/* ===== CONTAINER ===== */
.container { max-width: 100%; margin: 0 auto; padding: 2rem; }

/* ===== GLASS CARD ===== */
.glass-card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.glass-card:hover { box-shadow: 0 12px 40px rgba(0,0,0,0.3); }

/* ===== TYPOGRAPHY ===== */
h1, h2, h3 { margin-bottom: 1.5rem; font-weight: 700; }
.gradient-text { background: linear-gradient(135deg, #818cf8, #c084fc, #f472b6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-size: 200% auto; animation: gradient-shift 3s ease infinite; }
@keyframes gradient-shift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

.page-title { font-size: 1.6rem; margin-bottom: 0.25rem; }
.page-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 2rem; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.25rem; }
label { display: block; margin-bottom: 0.5rem; color: var(--text-muted); font-size: 0.875rem; font-weight: 500; }

input, select, textarea {
    width: 100%; padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.5); border: 1px solid var(--glass-border);
    border-radius: 10px; color: white; transition: all 0.3s ease; font-size: 0.9rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
textarea { resize: vertical; min-height: 80px; }

/* ===== BUTTONS ===== */
button { cursor: pointer; padding: 0.75rem 1.5rem; border-radius: 10px; border: none; font-weight: 600; transition: all 0.3s ease; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; font-size: 0.875rem; }

.btn-primary { background: linear-gradient(135deg, var(--primary), #7c3aed); color: white; box-shadow: 0 4px 15px rgba(99,102,241,0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99,102,241,0.4); }

.btn-success { background: linear-gradient(135deg, #22c55e, #16a34a); color: white; }
.btn-success:hover { transform: translateY(-2px); }

.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; }
.btn-danger:hover { transform: translateY(-2px); }

.btn-ghost { background: transparent; border: 1px solid var(--glass-border); color: var(--text-main); }
.btn-ghost:hover { background: rgba(255,255,255,0.05); border-color: var(--primary); }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; border-radius: 8px; }

.text-link { background: none; border: none; padding: 0; color: var(--primary); text-decoration: none; font-weight: 600; cursor: pointer; transition: color 0.3s; }
.text-link:hover { color: var(--text-main); }

/* ===== TABLES ===== */
.table-container { overflow-x: auto; margin-top: 1.5rem; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 0.85rem 0.75rem; border-bottom: 2px solid var(--glass-border); color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; background: rgba(0,0,0,0.2); }
td { padding: 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.04); }
tr { transition: background 0.2s; }
tr:hover td { background: rgba(99,102,241,0.05); }

/* ===== BADGES ===== */
.badge { padding: 0.3rem 0.8rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; display: inline-block; }
.badge-success { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }
.badge-warning { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.2); }
.badge-info { background: rgba(99,102,241,0.15); color: #818cf8; border: 1px solid rgba(99,102,241,0.2); }
.badge-danger { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }

/* ===== STATS GRID ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.stat-card { padding: 1.5rem; background: var(--card-bg); border-radius: 14px; border: 1px solid var(--glass-border); position: relative; overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0,0,0,0.3); }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--primary), #a855f7); }
.stat-value { font-size: 1.75rem; font-weight: 800; margin: 0.5rem 0; }
.stat-label { color: var(--text-muted); font-size: 0.8rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-icon { position: absolute; top: 1.25rem; right: 1.25rem; font-size: 1.5rem; color: var(--primary); opacity: 0.4; }

/* ===== CGPA CARD ===== */
.cgpa-card {
    background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(168,85,247,0.2));
    border: 1px solid rgba(99,102,241,0.3); border-radius: 16px; padding: 2rem; text-align: center;
}
.cgpa-value { font-size: 3rem; font-weight: 800; background: linear-gradient(135deg, #818cf8, #c084fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.cgpa-label { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.25rem; }

/* ===== GRADE INPUT ===== */
.grade-input { width: 60px !important; padding: 0.4rem !important; font-size: 0.85rem !important; font-weight: 600 !important; text-align: center; -moz-appearance: textfield; }
.grade-input::-webkit-outer-spin-button, .grade-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ===== COURSE SEARCH ===== */
.course-search-container { display: flex; justify-content: flex-end; margin-bottom: 1rem; }
.course-search-input { max-width: 250px; background: rgba(255,255,255,0.05); }

/* ===== MESSAGE CARDS ===== */
.msg-card {
    padding: 1rem 1.25rem; border-radius: 12px;
    background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border);
    margin-bottom: 0.75rem; transition: all 0.2s;
}
.msg-card:hover { background: rgba(99,102,241,0.05); }
.msg-card.unread { border-left: 3px solid var(--primary); background: rgba(99,102,241,0.08); }
.msg-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
.msg-sender { font-weight: 600; font-size: 0.9rem; }
.msg-time { font-size: 0.75rem; color: var(--text-muted); }
.msg-subject { font-weight: 500; margin-bottom: 0.25rem; }
.msg-body { color: var(--text-muted); font-size: 0.85rem; }

/* ===== NOTIFICATION ITEMS ===== */
.notif-item {
    padding: 1rem 1.25rem; border-radius: 12px;
    background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border);
    margin-bottom: 0.5rem; display: flex; gap: 1rem; align-items: flex-start; transition: all 0.2s;
}
.notif-item:hover { background: rgba(99,102,241,0.05); }
.notif-item.unread { border-left: 3px solid var(--primary); }
.notif-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.9rem; }
.notif-icon.success { background: rgba(34,197,94,0.15); color: #4ade80; }
.notif-icon.info { background: rgba(99,102,241,0.15); color: #818cf8; }
.notif-icon.warning { background: rgba(245,158,11,0.15); color: #fbbf24; }
.notif-icon.danger { background: rgba(239,68,68,0.15); color: #f87171; }

/* ===== TABS ===== */
.tabs { display: flex; gap: 0.25rem; margin-bottom: 1.5rem; background: rgba(0,0,0,0.2); border-radius: 12px; padding: 0.3rem; }
.tab-btn { flex: 1; padding: 0.65rem 1rem; border: none; background: none; color: var(--text-muted); font-weight: 600; border-radius: 10px; cursor: pointer; transition: all 0.2s; font-size: 0.85rem; }
.tab-btn.active { background: var(--primary); color: white; }
.tab-btn:hover:not(.active) { background: rgba(255,255,255,0.05); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== FLASH MESSAGES ===== */
.flash-msg {
    margin-bottom: 1rem; padding: 1rem 1.25rem; border-radius: 12px;
    border: 1px solid var(--glass-border);
    display: flex; align-items: center; gap: 0.75rem;
    animation: slideDown 0.3s ease;
    position: relative;
}
.flash-msg.success { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.3); color: #4ade80; }
.flash-msg.danger { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: #f87171; }
.flash-msg.warning { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.3); color: #fbbf24; }
.flash-msg.info { background: rgba(99,102,241,0.1); border-color: rgba(99,102,241,0.3); color: #818cf8; }
.flash-close { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); background: none; border: none; color: inherit; cursor: pointer; font-size: 1.1rem; padding: 0.25rem; opacity: 0.7; }
.flash-close:hover { opacity: 1; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 3rem 2rem; }
.empty-state i { font-size: 3rem; color: var(--text-muted); margin-bottom: 1rem; opacity: 0.5; }
.empty-state h3 { color: var(--text-muted); font-weight: 500; }
.empty-state p { color: var(--text-muted); font-size: 0.85rem; opacity: 0.7; }

/* ===== TWO COLUMN LAYOUT ===== */
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-toggle { display: block; }
    .two-col { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .topbar { padding: 1rem; }
    .container { padding: 1rem; }
    .search-container { max-width: 200px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .search-container { display: none; }
}

/* ===== OVERLAY ===== */
.sidebar-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 150;
}
.sidebar-overlay.active { display: block; }

/* ===== NEWS TICKER ===== */
.news-ticker-bar {
    display: flex; align-items: center; gap: 0;
    background: linear-gradient(90deg, rgba(99,102,241,0.15), rgba(168,85,247,0.08));
    border-bottom: 1px solid rgba(99,102,241,0.2);
    height: 36px; overflow: hidden;
}
.ticker-label {
    padding: 0 1rem; font-size: 0.7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--primary); white-space: nowrap;
    border-right: 1px solid rgba(99,102,241,0.3);
    height: 100%; display: flex; align-items: center; gap: 0.4rem;
    background: rgba(99,102,241,0.12); flex-shrink: 0;
}
.ticker-wrap { flex: 1; overflow: hidden; position: relative; }
.ticker-content {
    display: inline-flex; align-items: center;
    animation: ticker-scroll 40s linear infinite;
    white-space: nowrap;
}
.ticker-content:hover { animation-play-state: paused; }
.ticker-item {
    padding: 0 3rem; font-size: 0.82rem; color: var(--text-muted);
}
.ticker-item::before { content: '◆'; margin-right: 3rem; color: var(--primary); opacity: 0.5; font-size: 0.5rem; }
@keyframes ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ===== MESSAGE MODAL ===== */
.msg-modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 500;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    align-items: center; justify-content: center;
}
.msg-modal-overlay.active { display: flex; animation: fadeIn 0.2s ease; }
.msg-modal-box {
    background: #1e293b; border: 1px solid var(--glass-border);
    border-radius: 20px; padding: 2rem;
    max-width: 560px; width: 90%; position: relative;
    box-shadow: 0 24px 60px rgba(0,0,0,0.5);
    animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { opacity:0; transform: translateY(20px); } to { opacity:1; transform: translateY(0); } }
.msg-modal-close {
    position: absolute; top: 1rem; right: 1rem;
    background: rgba(255,255,255,0.07); border: 1px solid var(--glass-border);
    color: var(--text-muted); border-radius: 50%;
    width: 34px; height: 34px; cursor: pointer; font-size: 0.9rem;
    display: flex; align-items: center; justify-content: center;
}
.msg-modal-close:hover { background: rgba(239,68,68,0.15); color: #f87171; }
.msg-modal-header { margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--glass-border); }
.msg-modal-subject { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.35rem; }
.msg-modal-meta { font-size: 0.78rem; color: var(--text-muted); }
.msg-modal-body { color: var(--text-muted); font-size: 0.9rem; line-height: 1.7; white-space: pre-wrap; }

