:root {
  --blue: #2563EB; --blue-light: #EFF6FF;
  --green: #16A34A; --green-light: #F0FDF4;
  --red: #DC2626; --red-light: #FEF2F2;
  --yellow: #D97706; --yellow-light: #FFFBEB;
  --purple: #7C3AED; --purple-light: #F5F3FF;
  --orange: #EA580C; --orange-light: #FFF7ED;
  --teal: #0D9488; --teal-light: #F0FDFA;
  --bg: #F1F5F9; --sidebar: #0F172A;
  --sidebar-text: #94A3B8; --card: #FFFFFF;
  --text: #0F172A; --text-muted: #64748B;
  --border: #E2E8F0;
  --shadow: 0 1px 3px rgba(0,0,0,0.07), 0 4px 16px rgba(0,0,0,0.05);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'DM Sans',sans-serif; background:var(--bg); color:var(--text); }

/* ─── LAYOUT ─── */
.layout { display:flex; height:100vh; overflow:hidden; }
.sidebar { width:240px; min-width:240px; background:var(--sidebar); display:flex; flex-direction:column; height:100vh; overflow-y:auto; z-index:100; }
.sidebar::-webkit-scrollbar { width:4px; }
.sidebar::-webkit-scrollbar-thumb { background:#1E293B; border-radius:2px; }
.main { flex:1; display:flex; flex-direction:column; overflow:hidden; }
.content { flex:1; overflow-y:auto; padding:24px 28px; }
.content::-webkit-scrollbar { width:5px; }
.content::-webkit-scrollbar-thumb { background:#CBD5E1; border-radius:3px; }

/* ─── SIDEBAR ─── */
.sidebar-logo { padding:24px 20px 20px; display:flex; align-items:center; gap:12px; border-bottom:1px solid #1E293B; }
.logo-icon { width:38px; height:38px; background:linear-gradient(135deg,#2563EB,#7C3AED); border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:18px; }
.logo-text { font-family:'Syne',sans-serif; font-weight:800; color:#fff; font-size:16px; line-height:1.1; }
.logo-text span { color:#60A5FA; font-size:11px; font-weight:400; display:block; letter-spacing:1.5px; }
.sidebar-section { padding:16px 12px 4px; font-size:10px; font-weight:600; color:#475569; letter-spacing:1.5px; text-transform:uppercase; }
.nav-item { display:flex; align-items:center; gap:12px; padding:10px 16px; color:var(--sidebar-text); cursor:pointer; border-radius:8px; margin:2px 8px; font-size:13.5px; font-weight:500; transition:all .18s; }
.nav-item:hover { background:#1E293B; color:#E2E8F0; }
.nav-item.active { background:linear-gradient(90deg,#1D4ED8,#2563EB); color:#fff; }
.nav-icon { font-size:16px; width:20px; text-align:center; }
.nav-badge { margin-left:auto; background:#DC2626; color:#fff; font-size:10px; font-weight:700; padding:2px 7px; border-radius:99px; }
.nav-badge.green { background:#16A34A; }
.nav-badge.yellow { background:#D97706; }

/* ─── TOPBAR ─── */
.topbar { background:#fff; border-bottom:1px solid var(--border); padding:0 28px; height:60px; display:flex; align-items:center; gap:16px; flex-shrink:0; }
.topbar-title { font-family:'Syne',sans-serif; font-size:20px; font-weight:800; flex:1; }
.topbar-title span { color:var(--blue); }
.search-box { display:flex; align-items:center; gap:8px; background:var(--bg); border:1px solid var(--border); border-radius:10px; padding:8px 14px; width:220px; }
.search-box input { border:none; background:transparent; outline:none; font-size:13px; color:var(--text); width:100%; }
.topbar-actions { display:flex; align-items:center; gap:12px; }
.icon-btn { width:36px; height:36px; border-radius:9px; background:var(--bg); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; cursor:pointer; font-size:15px; position:relative; }
.notif-dot { width:8px; height:8px; background:#DC2626; border-radius:50%; position:absolute; top:6px; right:6px; border:1.5px solid #fff; }
.avatar { width:36px; height:36px; border-radius:50%; background:linear-gradient(135deg,#2563EB,#7C3AED); display:flex; align-items:center; justify-content:center; color:#fff; font-weight:700; font-size:14px; cursor:pointer; }

/* ─── CARDS ─── */
.card { background:var(--card); border-radius:16px; padding:22px; box-shadow:var(--shadow); border:1px solid var(--border); margin-bottom:0; }
.card-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; }
.card-title { font-family:'Syne',sans-serif; font-size:15px; font-weight:700; }
.card-action { font-size:12px; color:var(--blue); cursor:pointer; font-weight:600; }

/* ─── STATS ─── */
.stats-grid { display:grid; gap:16px; margin-bottom:24px; }
.stats-5 { grid-template-columns:repeat(5,1fr); }
.stats-4 { grid-template-columns:repeat(4,1fr); }
.stats-3 { grid-template-columns:repeat(3,1fr); }
.stat-card { background:var(--card); border-radius:16px; padding:18px 20px; box-shadow:var(--shadow); border:1px solid var(--border); position:relative; overflow:hidden; cursor:pointer; transition:transform .2s,box-shadow .2s; }
.stat-card:hover { transform:translateY(-2px); box-shadow:var(--shadow-lg); }
.stat-card::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; }
.stat-card.blue::before { background:linear-gradient(90deg,#2563EB,#60A5FA); }
.stat-card.green::before { background:linear-gradient(90deg,#16A34A,#4ADE80); }
.stat-card.purple::before { background:linear-gradient(90deg,#7C3AED,#A78BFA); }
.stat-card.yellow::before { background:linear-gradient(90deg,#D97706,#FCD34D); }
.stat-card.red::before { background:linear-gradient(90deg,#DC2626,#F87171); }
.stat-top { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:12px; }
.stat-icon { width:44px; height:44px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:20px; }
.stat-icon.blue { background:var(--blue-light); }
.stat-icon.green { background:var(--green-light); }
.stat-icon.purple { background:var(--purple-light); }
.stat-icon.yellow { background:var(--yellow-light); }
.stat-icon.red { background:var(--red-light); }
.stat-change { font-size:11px; font-weight:600; padding:3px 8px; border-radius:99px; }
.stat-change.up { color:#16A34A; background:#F0FDF4; }
.stat-value { font-family:'Syne',sans-serif; font-size:28px; font-weight:800; line-height:1; }
.stat-label { font-size:12.5px; color:var(--text-muted); margin-top:4px; font-weight:500; }

/* ─── GRID LAYOUTS ─── */
.row-2 { display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-bottom:24px; }
.row-3 { display:grid; grid-template-columns:2fr 1fr 1fr; gap:20px; margin-bottom:24px; }
.row-3-equal { display:grid; grid-template-columns:1fr 1fr 1fr; gap:20px; margin-bottom:24px; }

/* ─── TABLE ─── */
.table-wrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; font-size:13px; }
th { text-align:left; padding:10px 12px; color:var(--text-muted); font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.5px; border-bottom:2px solid var(--border); }
td { padding:12px 12px; border-bottom:1px solid var(--border); vertical-align:middle; }
tr:last-child td { border-bottom:none; }
tr:hover td { background:#F8FAFC; }

/* ─── BADGES ─── */
.badge { display:inline-block; font-size:10.5px; font-weight:600; padding:3px 10px; border-radius:99px; }
.badge.blue { background:var(--blue-light); color:var(--blue); }
.badge.green { background:var(--green-light); color:var(--green); }
.badge.red { background:var(--red-light); color:var(--red); }
.badge.yellow { background:var(--yellow-light); color:var(--yellow); }
.badge.purple { background:var(--purple-light); color:var(--purple); }
.badge.orange { background:var(--orange-light); color:var(--orange); }
.badge.teal { background:var(--teal-light); color:var(--teal); }

/* ─── BUTTONS ─── */
.btn { display:inline-flex; align-items:center; gap:6px; padding:9px 18px; border-radius:9px; font-size:13px; font-weight:600; cursor:pointer; border:none; transition:all .18s; font-family:'DM Sans',sans-serif; }
.btn-primary { background:var(--blue); color:#fff; }
.btn-primary:hover { background:#1D4ED8; }
.btn-success { background:var(--green); color:#fff; }
.btn-success:hover { background:#15803D; }
.btn-danger { background:var(--red); color:#fff; }
.btn-danger:hover { background:#B91C1C; }
.btn-outline { background:transparent; color:var(--blue); border:1.5px solid var(--blue); }
.btn-outline:hover { background:var(--blue-light); }
.btn-outline-red { background:transparent; color:var(--red); border:1.5px solid var(--red); }
.btn-sm { padding:5px 12px; font-size:11.5px; border-radius:7px; }
.btn-icon { background:#F8FAFC; border:1px solid var(--border); color:var(--text); }
.btn-icon:hover { background:var(--blue-light); color:var(--blue); border-color:var(--blue); }

/* ─── FORM ELEMENTS ─── */
.form-group { margin-bottom:16px; }
.form-label { display:block; font-size:12px; font-weight:600; color:var(--text-muted); margin-bottom:6px; text-transform:uppercase; letter-spacing:.4px; }
.form-control { width:100%; border:1.5px solid var(--border); border-radius:9px; padding:10px 14px; font-size:13px; outline:none; font-family:'DM Sans',sans-serif; color:var(--text); background:#fff; transition:border-color .18s; }
.form-control:focus { border-color:var(--blue); box-shadow:0 0 0 3px rgba(37,99,235,0.1); }
select.form-control { cursor:pointer; }
textarea.form-control { resize:vertical; min-height:80px; }
.form-row { display:grid; gap:14px; }
.form-row-2 { grid-template-columns:1fr 1fr; }
.form-row-3 { grid-template-columns:1fr 1fr 1fr; }

/* ─── MODAL ─── */
.modal-overlay { display:none; position:fixed; inset:0; background:rgba(15,23,42,0.6); z-index:1000; align-items:center; justify-content:center; padding:20px; backdrop-filter:blur(4px); }
.modal-overlay.open { display:flex; }
.modal { background:#fff; border-radius:20px; width:100%; max-width:600px; max-height:90vh; overflow-y:auto; box-shadow:0 20px 60px rgba(0,0,0,0.2); animation:modalIn .25s ease; }
.modal.modal-lg { max-width:780px; }
.modal-header { padding:24px 28px 0; display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; }
.modal-title { font-family:'Syne',sans-serif; font-size:18px; font-weight:800; }
.modal-close { width:32px; height:32px; border-radius:8px; background:var(--bg); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; cursor:pointer; font-size:16px; }
.modal-body { padding:0 28px 28px; }
.modal-footer { padding:16px 28px 24px; display:flex; gap:12px; justify-content:flex-end; border-top:1px solid var(--border); }
@keyframes modalIn { from { opacity:0; transform:scale(.95) translateY(10px); } to { opacity:1; transform:scale(1) translateY(0); } }

/* ─── MISC ─── */
.diff-dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:5px; }
.prog-bar { height:6px; background:#E2E8F0; border-radius:99px; overflow:hidden; margin-top:4px; }
.prog-fill { height:100%; border-radius:99px; }
.tabs { display:flex; gap:4px; background:var(--bg); border-radius:10px; padding:4px; }
.tab { padding:7px 16px; border-radius:7px; font-size:12.5px; font-weight:600; cursor:pointer; color:var(--text-muted); transition:all .18s; }
.tab.active { background:#fff; color:var(--text); box-shadow:0 1px 4px rgba(0,0,0,0.08); }
.page-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; }
.page-title { font-family:'Syne',sans-serif; font-size:22px; font-weight:800; }
.page-subtitle { font-size:13px; color:var(--text-muted); margin-top:2px; }
.gap-12 { gap:12px; }
.mt-20 { margin-top:20px; }
.mt-16 { margin-top:16px; }
.flex { display:flex; }
.flex-center { display:flex; align-items:center; }
.flex-between { display:flex; align-items:center; justify-content:space-between; }
.gap-8 { gap:8px; }
.gap-10 { gap:10px; }
.cat-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:24px; }
.cat-badge { border-radius:14px; padding:16px; cursor:pointer; transition:transform .18s,box-shadow .18s; color:#fff; }
.cat-badge:hover { transform:translateY(-2px); box-shadow:0 6px 20px rgba(0,0,0,0.15); }
.user-avatar { border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:700; color:#fff; flex-shrink:0; }
.notif-item { display:flex; align-items:flex-start; gap:10px; padding:10px 0; border-bottom:1px solid var(--border); }
.notif-item:last-child { border-bottom:none; }
.notif-dot2 { width:8px; height:8px; border-radius:50%; margin-top:5px; flex-shrink:0; }
.leader-row { display:flex; align-items:center; gap:12px; padding:9px 0; border-bottom:1px solid var(--border); }
.leader-row:last-child { border-bottom:none; }
.rank-num { font-family:'Syne',sans-serif; font-size:16px; font-weight:800; width:28px; text-align:center; }
.rank-1 { color:#F59E0B; } .rank-2 { color:#94A3B8; } .rank-3 { color:#D97706; }
.toggle-wrap { display:flex; align-items:center; justify-content:space-between; background:var(--bg); border-radius:10px; padding:12px 16px; }
.toggle { width:44px; height:24px; border-radius:99px; position:relative; cursor:pointer; transition:background .2s; }
.toggle.on { background:#16A34A; }
.toggle.off { background:#CBD5E1; }
.toggle-knob { width:20px; height:20px; background:#fff; border-radius:50%; position:absolute; top:2px; transition:left .2s; }
.toggle.on .toggle-knob { left:22px; }
.toggle.off .toggle-knob { left:2px; }
.chart-bars { display:flex; align-items:flex-end; gap:8px; height:100px; }
.bar-wrap { flex:1; display:flex; flex-direction:column; align-items:center; gap:4px; }
.bar { width:100%; border-radius:6px 6px 0 0; }
.bar-label { font-size:10px; color:var(--text-muted); font-weight:500; }
.option-row { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.option-letter { width:28px; height:28px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:12px; flex-shrink:0; }
.correct-mark { color:#16A34A; font-size:18px; cursor:pointer; }
.correct-mark.selected { color:#16A34A; }
.correct-mark.unselected { color:#CBD5E1; }
.cms-page-card { cursor:pointer; transition:transform .2s,box-shadow .2s; }
.cms-page-card:hover { transform:translateY(-2px); box-shadow:var(--shadow-lg); }
.editor-area { border:1.5px solid var(--border); border-radius:12px; overflow:hidden; }
.editor-toolbar { background:var(--bg); border-bottom:1px solid var(--border); padding:8px 12px; display:flex; gap:6px; flex-wrap:wrap; }
.editor-btn { padding:4px 10px; border-radius:6px; font-size:12px; font-weight:600; background:#fff; border:1px solid var(--border); cursor:pointer; }
.editor-btn:hover { background:var(--blue-light); color:var(--blue); border-color:var(--blue); }
.editor-content { min-height:200px; padding:16px; outline:none; font-size:14px; line-height:1.7; }
.donut-wrap { display:flex; align-items:center; justify-content:center; gap:20px; }
.donut-legend { display:flex; flex-direction:column; gap:8px; }
.legend-item { display:flex; align-items:center; gap:8px; font-size:12px; }
.legend-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.legend-val { font-weight:700; margin-left:auto; padding-left:8px; }
svg.donut { transform:rotate(-90deg); }
.payment-row { display:flex; align-items:center; justify-content:space-between; padding:10px 0; border-bottom:1px solid var(--border); }
.payment-row:last-child { border-bottom:none; }
.payment-info { display:flex; align-items:center; gap:10px; }
.payment-icon { width:32px; height:32px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:14px; }
.payment-amount { font-family:'Syne',sans-serif; font-size:15px; font-weight:700; }
@keyframes fadeUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
.fadeUp { animation:fadeUp .3s ease both; }
.alert { padding:12px 16px; border-radius:10px; font-size:13px; font-weight:500; margin-bottom:16px; display:flex; align-items:center; gap:8px; }
.alert-success { background:#F0FDF4; color:#15803D; border:1px solid #86EFAC; }
.alert-danger { background:#FEF2F2; color:#B91C1C; border:1px solid #FECACA; }
.hidden { display:none !important; }

/* ─── QUESTION BUILDER PAGE ─── */
.aqp-layout { display:grid; grid-template-columns:1fr 420px; gap:24px; align-items:start; }
.aqp-form-box { background:#fff; border-radius:20px; border:1px solid var(--border); box-shadow:var(--shadow); overflow:hidden; position:sticky; top:0; }
.aqp-form-header { background:linear-gradient(135deg,#1D4ED8,#7C3AED); padding:20px 24px; }
.aqp-form-title { color:#fff; font-family:'Syne',sans-serif; font-size:16px; font-weight:800; }
.aqp-form-subtitle { color:rgba(255,255,255,0.75); font-size:12px; margin-top:2px; }
.aqp-qnum-label { display:inline-flex; align-items:center; gap:8px; background:rgba(255,255,255,0.15); border-radius:99px; padding:4px 14px; color:#fff; font-size:13px; font-weight:700; margin-top:10px; }
.aqp-form-body { padding:20px 24px; max-height:calc(100vh - 200px); overflow-y:auto; }
.aqp-form-body::-webkit-scrollbar { width:4px; }
.aqp-form-body::-webkit-scrollbar-thumb { background:#E2E8F0; border-radius:2px; }
.aqp-option-input-row { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:8px; margin-bottom:10px; }
.aqp-opt-badge { width:30px; height:30px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-weight:800; font-size:12px; flex-shrink:0; }
.aqp-correct-radio { width:20px; height:20px; accent-color:#16A34A; cursor:pointer; flex-shrink:0; }
.aqp-correct-hint { font-size:10px; color:var(--text-muted); margin-bottom:10px; }
.aqp-list-box { background:#fff; border-radius:20px; border:1px solid var(--border); box-shadow:var(--shadow); overflow:hidden; }
.aqp-list-header { padding:18px 22px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; position:sticky; top:0; background:#fff; z-index:1; }
.aqp-list-title { font-family:'Syne',sans-serif; font-size:15px; font-weight:800; }
.aqp-list-body { max-height:calc(100vh - 140px); overflow-y:auto; padding:16px; }
.aqp-list-body::-webkit-scrollbar { width:4px; }
.aqp-list-body::-webkit-scrollbar-thumb { background:#E2E8F0; border-radius:2px; }
.aqp-qcard { background:#F8FAFC; border:1.5px solid var(--border); border-radius:14px; padding:14px 16px; margin-bottom:12px; transition:all .2s; }
.aqp-qcard:hover { border-color:#93C5FD; box-shadow:0 2px 12px rgba(37,99,235,0.08); }
.aqp-qcard-editing { border-color:#2563EB; background:#EFF6FF; box-shadow:0 0 0 3px rgba(37,99,235,0.12); }
.aqp-qcard-header { display:flex; align-items:center; gap:8px; margin-bottom:8px; flex-wrap:wrap; }
.aqp-qnum-badge { background:linear-gradient(135deg,#1D4ED8,#7C3AED); color:#fff; font-family:'Syne',sans-serif; font-weight:800; font-size:12px; padding:3px 10px; border-radius:99px; flex-shrink:0; }
.aqp-qmeta { display:flex; align-items:center; gap:5px; flex-wrap:wrap; }
.aqp-qtext { font-size:13px; font-weight:600; color:var(--text); margin-bottom:10px; line-height:1.5; }
.aqp-options { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-bottom:8px; }
.aqp-option { display:flex; align-items:center; gap:6px; background:#fff; border:1.5px solid var(--border); border-radius:8px; padding:6px 10px; }
.aqp-option-correct { border-color:#16A34A; background:#F0FDF4; }
.aqp-opt-letter { width:22px; height:22px; border-radius:6px; display:flex; align-items:center; justify-content:center; font-weight:800; font-size:11px; flex-shrink:0; }
.aqp-opt-text { font-size:12px; flex:1; }
.aqp-correct-tick { font-size:14px; margin-left:auto; }
.aqp-explanation-box { background:#FFFBEB; border:1px solid #FDE68A; border-radius:8px; padding:8px 12px; font-size:12px; color:#92400E; margin-top:6px; }
.aqp-publish-bar { background:linear-gradient(135deg,#0F172A,#1E293B); border-radius:14px; padding:16px 20px; display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.aqp-publish-info { color:#fff; }
.aqp-publish-info b { font-family:'Syne',sans-serif; font-size:15px; }
.aqp-publish-info span { font-size:12px; color:#94A3B8; display:block; }
.quiz-thumb-upload { border:2px dashed var(--border); border-radius:12px; padding:20px; text-align:center; cursor:pointer; transition:all .2s; background:#F8FAFC; }
.quiz-thumb-upload:hover { border-color:var(--blue); background:var(--blue-light); }
.quiz-thumb-upload input { display:none; }
