:root {
  --primary: #6C3483;
  --primary-light: #8E44AD;
  --primary-dark: #5B2C6F;
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --text: #1A1A2E;
  --text-secondary: #6B7280;
  --border: #E5E7EB;
  --success: #4CAF50;
  --error: #F44336;
  --warning: #FFC107;
  --blue: #1A73E8;
  --green: #1E8449;
  --orange: #E67E22;
  --sidebar-width: 260px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
}
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: 'Poppins', sans-serif; background: var(--bg); color: var(--text); overflow-x: hidden; }

/* Screens */
.screen { display:none; min-height:100vh; }
.screen.active { display:flex; }

/* Login */
.login-container { display:flex; align-items:center; justify-content:center; width:100%; min-height:100vh; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, #3498DB 100%); }
.login-card { background: var(--surface); border-radius: 20px; padding: 40px; width: 400px; max-width: 90vw; box-shadow: var(--shadow-lg); }
.login-header { text-align: center; margin-bottom: 30px; }
.login-icon { font-size: 48px; margin-bottom: 8px; }
.login-header h1 { font-size: 24px; font-weight: 700; color: var(--primary); }
.login-header p { color: var(--text-secondary); font-size: 14px; }
.form-group { margin-bottom: 18px; }
.form-group label { display:block; font-size:13px; font-weight:500; margin-bottom:6px; color: var(--text); }
.form-group input { width:100%; padding:12px 14px; border:1.5px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size:14px; transition: border-color 0.2s; }
.form-group input:focus { outline:none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,52,131,0.1); }
.error-msg { color: var(--error); font-size:13px; margin-bottom:12px; min-height:20px; }

/* Buttons */
.btn { display:inline-flex; align-items:center; gap:6px; padding:10px 20px; border:none; border-radius:var(--radius-sm); font-family:inherit; font-size:14px; font-weight:600; cursor:pointer; transition:all 0.2s; }
.btn-primary { background:var(--primary); color:white; }
.btn-primary:hover { background:var(--primary-dark); transform:translateY(-1px); box-shadow:0 4px 12px rgba(108,52,131,0.3); }
.btn-outline { background:transparent; color:var(--primary); border:1.5px solid var(--primary); }
.btn-outline:hover { background:var(--primary); color:white; }
.btn-full { width:100%; justify-content:center; }
.btn-sm { padding:6px 12px; font-size:12px; }
.btn-success { background:var(--success); color:white; }
.btn-danger { background:var(--error); color:white; }
.btn:disabled { opacity:0.6; cursor:not-allowed; }
.btn-loader { width:18px; height:18px; border:2px solid rgba(255,255,255,0.3); border-top-color:white; border-radius:50%; animation:spin 0.8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

/* Sidebar */
.sidebar { width:var(--sidebar-width); min-height:100vh; background:linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%); color:white; display:flex; flex-direction:column; position:fixed; left:0; top:0; z-index:100; transition:transform 0.3s; }
.sidebar-header { padding:24px 20px 16px; text-align:center; border-bottom:1px solid rgba(255,255,255,0.1); }
.sidebar-logo { font-size:36px; }
.sidebar-header h2 { font-size:18px; font-weight:700; }
.sidebar-subtitle { font-size:11px; color:rgba(255,255,255,0.6); }
.sidebar-user { padding:16px 20px; display:flex; align-items:center; gap:12px; border-bottom:1px solid rgba(255,255,255,0.1); }
.avatar { width:40px; height:40px; border-radius:50%; background:rgba(255,255,255,0.2); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:16px; }
.user-info { display:flex; flex-direction:column; }
.user-name { font-size:14px; font-weight:600; }
.user-college { font-size:11px; color:rgba(255,255,255,0.6); }
.nav-menu { list-style:none; flex:1; padding:12px 0; overflow-y:auto; }
.nav-item { display:flex; align-items:center; gap:12px; padding:12px 20px; cursor:pointer; transition:all 0.2s; font-size:14px; border-left:3px solid transparent; }
.nav-item:hover { background:rgba(255,255,255,0.1); }
.nav-item.active { background:rgba(255,255,255,0.15); border-left-color:white; }
.nav-item .material-icons-round { font-size:20px; }
.sidebar-footer { padding:16px 20px; border-top:1px solid rgba(255,255,255,0.1); }

/* Main */
.main-content { margin-left:var(--sidebar-width); flex:1; display:flex; flex-direction:column; min-height:100vh; }
.topbar { display:flex; align-items:center; gap:16px; padding:16px 24px; background:var(--surface); border-bottom:1px solid var(--border); position:sticky; top:0; z-index:50; }
.topbar h2 { flex:1; font-size:18px; font-weight:600; }
.menu-toggle { display:none; background:none; border:none; cursor:pointer; color:var(--text); font-size:24px; }
.user-badge { background:var(--primary); color:white; padding:6px 14px; border-radius:20px; font-size:12px; font-weight:600; }
.content-area { flex:1; padding:24px; }

/* Pages */
.page { display:none; }
.page.active { display:block; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* Stats */
.stats-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:16px; margin-bottom:24px; }
.stat-card { background:var(--surface); border-radius:var(--radius); padding:20px; display:flex; align-items:center; gap:16px; box-shadow:var(--shadow); border-left:4px solid; }
.stat-card .material-icons-round { font-size:36px; }
.stat-info { display:flex; flex-direction:column; }
.stat-value { font-size:28px; font-weight:700; }
.stat-label { font-size:12px; color:var(--text-secondary); }
.stat-purple { border-color:var(--primary); color:var(--primary); }
.stat-blue { border-color:var(--blue); color:var(--blue); }
.stat-green { border-color:var(--green); color:var(--green); }
.stat-orange { border-color:var(--orange); color:var(--orange); }
.stat-card .stat-info { color:var(--text); }

/* Cards */
.card { background:var(--surface); border-radius:var(--radius); padding:20px; box-shadow:var(--shadow); margin-bottom:16px; }
.card h3 { font-size:16px; font-weight:600; margin-bottom:16px; }

/* Quick Actions */
.quick-actions { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:12px; }
.action-card { display:flex; flex-direction:column; align-items:center; gap:8px; padding:20px; background:var(--primary); color:white; border:none; border-radius:var(--radius-sm); cursor:pointer; font-family:inherit; font-size:13px; font-weight:600; transition:all 0.2s; }
.action-card:hover { transform:translateY(-2px); box-shadow:0 6px 16px rgba(108,52,131,0.3); }
.action-card .material-icons-round { font-size:28px; }

/* Page header */
.page-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; flex-wrap:wrap; gap:12px; }
.page-header h3 { font-size:20px; font-weight:700; }
.page-actions { display:flex; gap:8px; }
.upload-btn { cursor:pointer; }

/* Search */
.search-bar { display:flex; align-items:center; gap:8px; background:var(--surface); border:1.5px solid var(--border); border-radius:var(--radius-sm); padding:8px 14px; margin-bottom:16px; }
.search-bar input { border:none; outline:none; flex:1; font-family:inherit; font-size:14px; }
.search-bar .material-icons-round { color:var(--text-secondary); font-size:20px; }

/* Tables */
.table-container { overflow-x:auto; }
table { width:100%; border-collapse:collapse; }
th { background:var(--bg); padding:12px 14px; text-align:left; font-size:12px; font-weight:600; color:var(--text-secondary); text-transform:uppercase; letter-spacing:0.5px; border-bottom:2px solid var(--border); }
td { padding:12px 14px; font-size:14px; border-bottom:1px solid var(--border); }
tr:hover td { background:rgba(108,52,131,0.02); }
.empty-msg { text-align:center; color:var(--text-secondary); padding:40px !important; }

/* HOD Grid */
.hod-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); gap:16px; }
.hod-card { background:var(--surface); border-radius:var(--radius); padding:20px; box-shadow:var(--shadow); display:flex; align-items:center; gap:16px; }
.hod-card .icon-wrap { width:48px; height:48px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:24px; }
.hod-card .icon-wrap.assigned { background:rgba(76,175,80,0.1); color:var(--success); }
.hod-card .icon-wrap.unassigned { background:rgba(255,193,7,0.1); color:var(--warning); }
.hod-card .hod-info { flex:1; }
.hod-card .dept-name { font-weight:600; font-size:15px; }
.hod-card .hod-name { font-size:12px; color:var(--text-secondary); }
.hod-card select { padding:6px 10px; border:1.5px solid var(--border); border-radius:var(--radius-sm); font-family:inherit; font-size:13px; }

/* Marks Grid */
.marks-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(340px,1fr)); gap:16px; }
.marks-card { background:var(--surface); border-radius:var(--radius); padding:20px; box-shadow:var(--shadow); }
.marks-card .paper-header { display:flex; justify-content:space-between; align-items:start; margin-bottom:8px; }
.marks-card .paper-name { font-weight:600; font-size:14px; }
.marks-card .paper-code { background:rgba(108,52,131,0.1); color:var(--primary); padding:2px 8px; border-radius:4px; font-size:11px; font-weight:600; }
.marks-card .class-name { font-size:12px; color:var(--text-secondary); margin-bottom:10px; }
.progress-bar { height:6px; background:var(--border); border-radius:3px; overflow:hidden; margin-bottom:6px; }
.progress-fill { height:100%; border-radius:3px; transition:width 0.5s ease; }
.marks-card .stats-text { font-size:11px; color:var(--text-secondary); margin-bottom:12px; }
.lock-row { display:flex; gap:8px; }
.lock-chip { flex:1; display:flex; align-items:center; justify-content:center; gap:4px; padding:8px; border-radius:var(--radius-sm); font-size:12px; font-weight:600; cursor:pointer; border:1.5px solid; transition:all 0.2s; }
.lock-chip.locked { background:rgba(244,67,54,0.06); border-color:rgba(244,67,54,0.3); color:var(--error); }
.lock-chip.open { background:rgba(76,175,80,0.06); border-color:rgba(76,175,80,0.3); color:var(--success); }
.lock-chip:hover { transform:translateY(-1px); }

/* Links / Timetable grid */
.links-grid, .timetable-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:16px; }
.link-card, .tt-card { background:var(--surface); border-radius:var(--radius); padding:20px; box-shadow:var(--shadow); }
.link-card h4, .tt-card h4 { font-size:14px; font-weight:600; margin-bottom:4px; }
.link-card p, .tt-card p { font-size:12px; color:var(--text-secondary); margin-bottom:8px; }
.link-card a { color:var(--primary); font-size:13px; text-decoration:none; font-weight:500; }
.link-card a:hover { text-decoration:underline; }

/* Modal */
.modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.5); display:flex; align-items:center; justify-content:center; z-index:200; }
.modal-card { background:var(--surface); border-radius:var(--radius); padding:28px; width:480px; max-width:90vw; max-height:80vh; overflow-y:auto; }
.modal-card h3 { font-size:18px; font-weight:600; margin-bottom:16px; }

/* Toast */
.toast { position:fixed; bottom:24px; right:24px; background:var(--text); color:white; padding:14px 24px; border-radius:var(--radius-sm); font-size:14px; font-weight:500; z-index:300; transform:translateY(100px); opacity:0; transition:all 0.3s ease; }
.toast.show { transform:translateY(0); opacity:1; }
.toast.success { background:var(--success); }
.toast.error { background:var(--error); }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { transform:translateX(-100%); }
  .sidebar.open { transform:translateX(0); }
  .main-content { margin-left:0; }
  .menu-toggle { display:block; }
  .stats-grid { grid-template-columns:repeat(2,1fr); }
}
