/* AMC Study Hub - Main Stylesheet */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --sidebar-w: 260px;
  --sidebar-bg: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-active: #3b82f6;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1);
}

body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); margin: 0; font-size: 14px; }

/* ─── LAYOUT ─────────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }
.main-layout { display: flex; flex: 1; min-height: 100vh; overflow: hidden; }
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* ─── SIDEBAR ─────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto; overflow-x: hidden;
  flex-shrink: 0; z-index: 100;
  scrollbar-width: thin; scrollbar-color: #334155 transparent;
  transition: transform .3s;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 14px; border-bottom: 1px solid #293548; }
.brand-logo { width: 36px; height: 36px; background: var(--accent); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px; flex-shrink: 0; }
.brand-name { font-size: 14px; font-weight: 700; color: #f1f5f9; display: block; }
.brand-sub { font-size: 10px; color: var(--sidebar-text); display: block; }

.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.user-name { font-size: 13px; font-weight: 600; color: #f1f5f9; }
.user-exam { font-size: 11px; color: #f59e0b; }

.sidebar-streak { display: flex; align-items: center; gap: 8px; padding: 6px 16px 10px; color: #f59e0b; font-size: 12px; font-weight: 600; }
.sidebar-streak i { font-size: 14px; }

.sidebar-nav { flex: 1; padding: 8px 8px; }
.nav-section-label { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #475569; padding: 8px 8px 4px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 7px; text-decoration: none;
  color: var(--sidebar-text); font-size: 13px; font-weight: 500;
  margin-bottom: 2px; transition: background .15s, color .15s; position: relative;
  cursor: pointer;
}
.nav-item:hover { background: #293548; color: #e2e8f0; text-decoration: none; }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-item i { width: 16px; text-align: center; flex-shrink: 0; }
.nav-item span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-badge { background: var(--danger); color: #fff; border-radius: 10px; font-size: 10px; padding: 2px 6px; font-weight: 700; margin-left: auto; }
.nav-badge-red { background: var(--danger); }
.nav-item-hy { color: #fbbf24; }
.nav-item-hy:hover, .nav-item-hy.active { background: #854d0e; color: #fef9c3; }
.nav-item-revision { color: #f87171; }
.nav-item-logout { color: #f87171; }
.nav-item-logout:hover { background: #450a0a; }

.sidebar-footer { padding: 8px; border-top: 1px solid #293548; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99; }

/* ─── TOPBAR ─────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  min-height: 60px;
}
.btn-menu { display: none; background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text); padding: 4px 8px; }
.topbar-title h1 { font-size: 18px; font-weight: 700; margin: 0; line-height: 1.2; }
.topbar-date { font-size: 12px; color: var(--text-muted); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ─── CONTENT ─────────────────────────────────────────── */
.content-body { flex: 1; padding: 20px; overflow-y: auto; }

/* ─── CARDS ─────────────────────────────────────────── */
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { padding: 14px 16px; border-bottom: 1px solid var(--border); background: transparent; }
.card-body { padding: 16px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 0; }

/* ─── STAT CARDS ─────────────────────────────────────── */
.stat-card { background: var(--card-bg); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); border: 1px solid var(--border); display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.stat-icon { font-size: 20px; margin-bottom: 4px; }
.stat-num { font-size: 28px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat-card-blue .stat-icon { color: var(--accent); }
.stat-card-blue .stat-num { color: var(--accent); }
.stat-card-green .stat-icon { color: var(--success); }
.stat-card-green .stat-num { color: var(--success); }
.stat-card-amber .stat-icon { color: var(--warning); }
.stat-card-amber .stat-num { color: var(--warning); }
.stat-card-red .stat-icon { color: var(--danger); }
.stat-card-red .stat-num { color: var(--danger); }

/* ─── EXAM COUNTDOWN ─────────────────────────────────── */
.exam-countdown-card {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff; border-radius: var(--radius); padding: 16px;
  display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-md);
}
.exam-countdown-card.urgent { background: linear-gradient(135deg, #b91c1c, #dc2626); }
.countdown-icon { font-size: 30px; opacity: .8; }
.countdown-num { font-size: 36px; font-weight: 900; line-height: 1; }
.countdown-label { font-size: 12px; opacity: .9; font-weight: 600; }
.countdown-date { font-size: 11px; opacity: .75; }

.streak-card {
  background: linear-gradient(135deg, #92400e, #d97706);
  color: #fff; border-radius: var(--radius); padding: 16px;
  display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-md);
}
.streak-fire { font-size: 36px; }
.streak-num { font-size: 36px; font-weight: 900; line-height: 1; }
.streak-label { font-size: 12px; opacity: .9; font-weight: 600; }
.streak-sub { font-size: 11px; opacity: .75; }

.today-tasks-card {
  background: linear-gradient(135deg, #065f46, #059669);
  color: #fff; border-radius: var(--radius); padding: 16px;
  display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-md);
}
.today-icon { font-size: 30px; opacity: .8; }
.today-num { font-size: 28px; font-weight: 800; line-height: 1; }
.today-label { font-size: 12px; font-weight: 600; opacity: .9; }
.today-overdue { font-size: 11px; color: #fcd34d; font-weight: 600; }

/* ─── PROGRESS ───────────────────────────────────────── */
.progress { height: 8px; background: #e2e8f0; border-radius: 10px; overflow: hidden; }
.progress-lg { height: 14px; }
.progress-sm { height: 5px; }
.progress-bar { transition: width .5s; }
.progress-pct { font-size: 20px; font-weight: 800; color: var(--success); }
.progress-labels { font-size: 12px; }

.subject-progress-list { display: flex; flex-direction: column; gap: 10px; }
.subject-prog-item { }
.subject-prog-name { font-size: 12px; font-weight: 600; color: var(--text); text-decoration: none; }
.subject-prog-name:hover { color: var(--accent); }
.subject-prog-name i { margin-right: 5px; }

/* ─── TASK LIST ──────────────────────────────────────── */
.task-list { list-style: none; margin: 0; padding: 0; }
.task-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.task-item:last-child { border-bottom: none; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 13px; font-weight: 500; }
.task-meta { font-size: 11px; color: var(--text-muted); }

.task-board { display: flex; flex-direction: column; gap: 8px; }
.task-board-item {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
  border-left: 3px solid transparent; transition: all .2s;
}
.task-board-item:hover { box-shadow: var(--shadow-md); }
.priority-high { border-left-color: var(--danger) !important; }
.priority-medium { border-left-color: var(--warning) !important; }
.priority-low { border-left-color: var(--success) !important; }
.task-done { opacity: .5; }
.task-done .task-board-title { text-decoration: line-through; }
.task-board-body { flex: 1; min-width: 0; }
.task-board-title { font-size: 14px; font-weight: 600; }
.task-board-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.task-board-meta { font-size: 12px; margin-top: 4px; }
.task-board-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.btn-task-del { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 12px; padding: 2px 4px; }
.btn-task-del:hover { color: var(--danger); }
.priority-indicator { font-size: 10px; font-weight: 700; }
.priority-indicator.priority-high { color: var(--danger); }
.priority-indicator.priority-medium { color: var(--warning); }
.priority-indicator.priority-low { color: var(--success); }

.task-type-badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; text-transform: uppercase; }
.task-type-recall { background: #dbeafe; color: #1d4ed8; }
.task-type-study { background: #dcfce7; color: #15803d; }
.task-type-revision { background: #fef3c7; color: #92400e; }
.task-type-general { background: #f1f5f9; color: #475569; }

.task-filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.task-tab { padding: 6px 14px; border-radius: 20px; text-decoration: none; font-size: 13px; font-weight: 500; color: var(--text-muted); background: var(--card-bg); border: 1px solid var(--border); }
.task-tab:hover { background: var(--bg); text-decoration: none; color: var(--text); }
.task-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tab-badge { background: var(--danger); color: #fff; border-radius: 10px; font-size: 10px; padding: 1px 5px; margin-left: 4px; }
.tab-badge-red { background: var(--danger); }

/* ─── RECALL BANNER ──────────────────────────────────── */
.recall-banner {
  background: linear-gradient(135deg, #1d4ed8, #7c3aed);
  color: #fff; border-radius: var(--radius); padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
}
.recall-banner-icon { font-size: 28px; }
.recall-banner-text strong { display: block; font-size: 14px; }
.recall-banner-text span { font-size: 12px; opacity: .9; }
.recall-banner .btn { margin-left: auto; flex-shrink: 0; }

/* ─── CUSTOM CHECKBOX ────────────────────────────────── */
.task-check { display: inline-block; position: relative; cursor: pointer; padding-left: 0; }
.task-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.checkmark {
  display: inline-block; width: 18px; height: 18px; border: 2px solid #cbd5e1;
  border-radius: 50%; transition: all .2s; vertical-align: middle;
}
.task-check input:checked ~ .checkmark { background: var(--success); border-color: var(--success); }
.task-check input:checked ~ .checkmark::after { content: '✓'; position: absolute; top: -1px; left: 2px; font-size: 12px; color: #fff; font-weight: 700; }

/* ─── STATUS BADGES ──────────────────────────────────── */
.status-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.status-not-started { background: #f1f5f9; color: #64748b; }
.status-studying { background: #fef9c3; color: #a16207; }
.status-completed { background: #dcfce7; color: #15803d; }
.status-revision { background: #fee2e2; color: #b91c1c; }

.status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.status-dot-not_started { background: #94a3b8; }
.status-dot-studying { background: #f59e0b; }
.status-dot-completed { background: #22c55e; }
.status-dot-needs_revision { background: #ef4444; }

/* ─── TOPIC CARDS (in subject page) ─────────────────── */
.topic-group { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.topic-group-header { padding: 10px 14px; cursor: pointer; display: flex; align-items: center; background: #f8fafc; border-bottom: 1px solid var(--border); user-select: none; }
.topic-group-header:hover { background: #f1f5f9; }
.topic-group-title { margin: 0; font-size: 13px; font-weight: 700; display: flex; align-items: center; flex: 1; gap: 8px; }
.group-count { font-size: 11px; background: #e2e8f0; color: var(--text-muted); padding: 1px 8px; border-radius: 10px; font-weight: 500; margin-left: 4px; }
.group-pct { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--success); }

.topic-group-body { padding: 8px; }
.topics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 4px; }

.topic-card {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 7px; border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.topic-card:hover { background: #f8fafc; border-color: var(--border); }
.topic-card-left { flex-shrink: 0; }
.topic-card-body { flex: 1; min-width: 0; }
.topic-name { font-size: 13px; font-weight: 500; color: var(--text); text-decoration: none; display: block; }
.topic-name:hover { color: var(--accent); }
.topic-last-studied { font-size: 11px; color: var(--text-muted); }
.topic-card-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.btn-fav { background: none; border: none; cursor: pointer; color: #cbd5e1; font-size: 14px; padding: 2px; transition: color .15s; }
.btn-fav:hover, .btn-fav.active { color: #f59e0b; }
.btn-fav-lg { background: none; border: 1px solid var(--border); border-radius: 7px; cursor: pointer; color: #94a3b8; font-size: 16px; padding: 6px 10px; transition: all .15s; }
.btn-fav-lg:hover, .btn-fav-lg.active { color: #f59e0b; border-color: #f59e0b; background: #fef9c3; }

.btn-status-quick { background: none; border: none; cursor: pointer; padding: 2px; }
.btn-status-quick .dropdown-toggle::after { display: none; }

.status-filter-group { display: flex; gap: 4px; flex-wrap: wrap; }

/* ─── TOPIC PAGE ──────────────────────────────────────── */
.topic-header-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  border-left: 4px solid var(--accent); padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap;
}
.topic-header-meta { display: flex; flex-direction: column; gap: 4px; }
.meta-item { font-size: 12px; color: var(--text-muted); }
.meta-item i { margin-right: 5px; }

.status-selector { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.btn-status-opt {
  padding: 4px 12px; border-radius: 20px; border: 1.5px solid var(--border);
  background: var(--bg); font-size: 12px; cursor: pointer; transition: all .15s;
}
.btn-status-opt:hover { border-color: var(--accent); background: #eff6ff; }
.btn-status-opt.selected { background: var(--accent); color: #fff; border-color: var(--accent); }

.breadcrumb-small { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; }
.breadcrumb-small a { color: var(--text-muted); text-decoration: none; }
.breadcrumb-small a:hover { color: var(--accent); }
.hy-badge { background: #fef9c3; color: #a16207; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 10px; }
.hy-badge-lg { background: #fef9c3; color: #a16207; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 10px; display: inline-block; }

.topic-tabs .nav-link { font-size: 13px; font-weight: 500; color: var(--text-muted); border-bottom: 2px solid transparent; }
.topic-tabs .nav-link.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-count { background: #e2e8f0; color: var(--text-muted); border-radius: 10px; font-size: 10px; padding: 1px 6px; margin-left: 3px; }

/* ─── HIGH YIELD POINTS ──────────────────────────────── */
.hy-point-item { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
.hy-point-item:last-child { border-bottom: none; }
.hy-point-dot { width: 8px; height: 8px; background: #f59e0b; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.hy-point-text { flex: 1; font-size: 14px; line-height: 1.5; outline: none; min-height: 20px; padding: 2px 4px; border-radius: 4px; }
.hy-point-text:focus { background: #fef9c3; }
.hy-point-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.hy-exam-toggle { font-size: 11px; cursor: pointer; display: flex; align-items: center; gap: 3px; color: var(--text-muted); }
.hy-exam-toggle input { accent-color: #f59e0b; }
.btn-hy-delete { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 12px; padding: 2px; }
.btn-hy-delete:hover { color: var(--danger); }
.hy-add-form .form-text { color: var(--text-muted); font-size: 12px; }

/* ─── RESOURCES ──────────────────────────────────────── */
.resource-list { display: flex; flex-direction: column; gap: 6px; }
.resource-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px; background: #f8fafc; border-radius: 7px; border: 1px solid var(--border); }
.resource-icon { width: 32px; height: 32px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.res-guideline { background: #dbeafe; color: #1d4ed8; }
.res-book { background: #dcfce7; color: #15803d; }
.res-video { background: #fee2e2; color: #b91c1c; }
.res-link { background: #f3e8ff; color: #7c3aed; }
.resource-title { font-size: 13px; font-weight: 600; color: var(--text); }
a.resource-title:hover { color: var(--accent); }
.resource-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.resource-body { flex: 1; min-width: 0; }
.btn-resource-del { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 12px; padding: 4px; flex-shrink: 0; }
.btn-resource-del:hover { color: var(--danger); }

/* ─── IMAGES ──────────────────────────────────────────── */
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.image-item { position: relative; border-radius: 7px; border: 1px solid var(--border); background: #fff; }
.topic-img { width: 100%; height: 130px; object-fit: cover; cursor: pointer; display: block; border-radius: 7px 7px 0 0; }
.topic-img:hover { opacity: .88; }
.img-caption { font-size: 11px; padding: 4px 6px; background: #f8fafc; color: var(--text-muted); }
.btn-img-del { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.6); color: #fff; border: none; border-radius: 50%; width: 20px; height: 20px; cursor: pointer; font-size: 10px; display: flex; align-items: center; justify-content: center; }
.upload-drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 30px;
  text-align: center; cursor: pointer; color: var(--text-muted);
  transition: border-color .15s; background: #f8fafc;
}
.upload-drop-zone:hover { border-color: var(--accent); background: #eff6ff; color: var(--accent); }
.upload-drop-zone i { font-size: 28px; margin-bottom: 8px; }

/* ─── LIGHTBOX ────────────────────────────────────────── */
.lightbox { display:none; position:fixed; inset:0; background:rgba(0,0,0,.92); z-index:9999; }
.lb-overlay { position:absolute; inset:0; pointer-events:none; }
.lb-image-wrap { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; overflow:hidden; cursor:default; user-select:none; }
#lightboxImg { max-width:90vw; max-height:88vh; object-fit:contain; transform-origin:center center; border-radius:6px; pointer-events:none; user-select:none; will-change:transform; }
.lb-controls { position:fixed; bottom:20px; left:50%; transform:translateX(-50%); display:flex; gap:10px; z-index:10001; }
.lb-btn { width:44px; height:44px; border-radius:50%; background:rgba(255,255,255,.15); border:1px solid rgba(255,255,255,.25); color:#fff; font-size:17px; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:background .15s; backdrop-filter:blur(4px); }
.lb-btn:hover { background:rgba(255,255,255,.3); }
.lb-close-btn { position:fixed; top:16px; right:20px; z-index:10001; }
.lb-zoom-label { position:fixed; bottom:74px; left:50%; transform:translateX(-50%); color:rgba(255,255,255,.6); font-size:12px; letter-spacing:.5px; z-index:10001; }

/* ─── REVISION ────────────────────────────────────────── */
.revision-info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.rev-info-box { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 14px; text-align: center; }
.rev-info-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; margin-bottom: 4px; }
.rev-info-val { font-size: 20px; font-weight: 800; color: var(--text); }

.sr-timeline { display: flex; align-items: center; gap: 0; margin-top: 12px; }
.sr-step { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; }
.sr-step::before { content: ''; position: absolute; top: 8px; left: 50%; right: -50%; height: 2px; background: var(--border); z-index: 0; }
.sr-step:last-child::before { display: none; }
.sr-dot { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--border); background: #fff; z-index: 1; margin-bottom: 4px; }
.sr-step.done .sr-dot { background: var(--success); border-color: var(--success); }
.sr-step.current .sr-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px #dbeafe; }
.sr-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-align: center; }

/* ─── REVISION LIST ──────────────────────────────────── */
.revision-list { list-style: none; margin: 0; padding: 0; }
.revision-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.revision-item:last-child { border-bottom: none; }
.rev-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.rev-body { flex: 1; min-width: 0; }
.rev-name { font-size: 13px; font-weight: 500; color: var(--text); text-decoration: none; }
.rev-name:hover { color: var(--accent); }
.rev-meta { font-size: 11px; color: var(--text-muted); }
.btn-xs { font-size: 11px; padding: 2px 8px; }

/* ─── RECENT TOPICS ──────────────────────────────────── */
.recent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.recent-card { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: var(--text); transition: all .15s; }
.recent-card:hover { background: var(--bg); border-color: var(--accent); transform: translateY(-1px); text-decoration: none; }
.recent-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.recent-body { flex: 1; min-width: 0; }
.recent-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-subject { font-size: 11px; color: var(--text-muted); }

/* ─── HIGH YIELD PAGE ────────────────────────────────── */
.hy-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hy-filter-sep { color: var(--border); }
.hy-subject-section { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.hy-subject-header {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  cursor: pointer; background: #f8fafc; border-bottom: 1px solid var(--border); user-select: none;
}
.hy-subject-header:hover { background: #f1f5f9; }
.hy-subject-header h4 { margin: 0; font-size: 15px; font-weight: 700; flex: 1; }
.hy-topic-count { font-size: 12px; color: var(--text-muted); }
.toggle-icon { transition: transform .2s; }
.hy-subject-body { padding: 10px; }

.hy-topic-card { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.hy-topic-header { display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; background: #f1f5f9; border-bottom: 1px solid var(--border); user-select: none; }
.hy-topic-header:hover { background: #e2e8f0; }
.hy-topic-name { font-size: 13px; font-weight: 700; color: var(--text); text-decoration: none; flex: 1; }
.hy-topic-name:hover { color: var(--accent); text-decoration: underline; }
.hy-points-count { font-size: 11px; color: var(--text-muted); }
.toggle-icon-sm { transition: transform .2s; font-size: 11px; }

.hy-topic-body { padding: 10px 14px; }
.hy-points-list { margin: 0; padding-left: 0; list-style: none; }
.hy-pt-item { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; font-size: 13px; border-bottom: 1px solid #e2e8f0; }
.hy-pt-item:last-child { border-bottom: none; }
.hy-pt-item::before { content: '•'; color: #f59e0b; font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.hy-pt-item.exam-view { background: #fffbeb; margin: 2px -14px; padding-left: 10px; padding-right: 10px; }
.hy-exam-dot { color: #f59e0b; flex-shrink: 0; }
.hy-empty { padding: 60px 20px; text-align: center; }
.hy-empty i { font-size: 48px; color: #f59e0b; margin-bottom: 16px; }
.hy-empty h3 { font-size: 20px; font-weight: 700; }

/* ─── SEARCH ─────────────────────────────────────────── */
.search-hero { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.search-input-wrap { position: relative; }
.search-icon-big { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 16px; z-index: 1; }
.search-input-big { padding-left: 44px; font-size: 16px; height: 48px; border-radius: 10px; }
.search-clear { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); text-decoration: none; font-size: 16px; }
.search-result-count { margin-top: 8px; font-size: 13px; color: var(--text-muted); }

.search-section-title { font-size: 14px; font-weight: 700; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .05em; }
.search-results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.search-result-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: var(--text); }
.search-result-card:hover { border-color: var(--accent); background: #f0f9ff; text-decoration: none; }
.src-icon { font-size: 18px; }
.src-title { font-size: 13px; font-weight: 600; }
.src-meta { font-size: 11px; color: var(--text-muted); }

.search-result-note { display: block; background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin-bottom: 6px; text-decoration: none; color: var(--text); }
.search-result-note:hover { border-color: var(--accent); text-decoration: none; }
.srn-header { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.srn-snippet { font-size: 12px; color: var(--text-muted); }

.search-result-resource, .search-result-hy { display: flex; align-items: center; gap: 10px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin-bottom: 6px; text-decoration: none; color: var(--text); }
.search-result-resource:hover, .search-result-hy:hover { border-color: var(--accent); text-decoration: none; }
.srr-icon { width: 28px; height: 28px; background: #dbeafe; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--accent); }
.srr-title { font-size: 13px; font-weight: 600; }
.srr-meta { font-size: 11px; color: var(--text-muted); }
.hy-icon { font-size: 16px; }
.sry-point { font-size: 13px; font-weight: 500; }
.sry-meta { font-size: 11px; color: var(--text-muted); }

.search-placeholder { text-align: center; padding: 60px 20px; }
.search-placeholder i { font-size: 48px; color: var(--border); margin-bottom: 16px; }
.search-placeholder h3 { font-size: 20px; font-weight: 700; }
.search-tips .tip { background: #f8fafc; border-radius: 8px; padding: 10px 14px; font-size: 13px; color: var(--text-muted); display: inline-block; }

/* ─── FAVORITES ──────────────────────────────────────── */
.fav-list { display: flex; flex-direction: column; }
.fav-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.fav-item:last-child { border-bottom: none; }
.fav-body { flex: 1; min-width: 0; }
.fav-name { font-size: 13px; font-weight: 600; color: var(--text); text-decoration: none; }
.fav-name:hover { color: var(--accent); }
.fav-meta { margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.fav-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* ─── PROFILE ────────────────────────────────────────── */
.profile-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ps-item { text-align: center; background: #f8fafc; border-radius: 8px; padding: 14px; }
.ps-val { font-size: 28px; font-weight: 800; color: var(--accent); }
.ps-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* ─── TOPIC NAVIGATION ───────────────────────────────── */
.topic-navigation { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* ─── AUTH PAGES ─────────────────────────────────────── */
.auth-body { background: linear-gradient(135deg, #1e293b 0%, #1d4ed8 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-container { width: 100%; padding: 20px; display: flex; justify-content: center; }
.auth-card { background: #fff; border-radius: 16px; padding: 36px; width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.auth-card-wide { max-width: 600px; }
.auth-logo { width: 60px; height: 60px; background: linear-gradient(135deg, #1d4ed8, #7c3aed); border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff; margin: 0 auto 16px; }
.auth-title { font-size: 22px; font-weight: 800; text-align: center; margin-bottom: 4px; }
.auth-subtitle { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-muted); }

/* ─── EMPTY STATE ────────────────────────────────────── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state i { font-size: 36px; margin-bottom: 10px; display: block; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text); }

/* ─── SAVE STATUS ────────────────────────────────────── */
.save-status { font-size: 12px; font-weight: 600; }
.save-status.success { color: var(--success); }
.save-status.error { color: var(--danger); }

/* ─── TOAST ──────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9998; display: flex; flex-direction: column; gap: 8px; }
.toast-msg { background: #1e293b; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-md); animation: slideIn .3s; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: none; opacity: 1; } }

/* ─── MARKS ──────────────────────────────────────────── */
mark { background: #fef08a; color: var(--text); padding: 0 2px; border-radius: 2px; }

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { position: fixed; left: 0; top: 0; height: 100vh; transform: translateX(-100%); z-index: 200; }
  .sidebar.open { transform: none; }
  .sidebar-overlay.open { display: block; }
  .btn-menu { display: block; }
  .main-layout { display: block; }
  .main-content { min-height: 100vh; }
  .topics-grid { grid-template-columns: 1fr; }
  .topic-navigation { flex-wrap: wrap; }
  .status-selector { }
  .task-board-right { flex-direction: row; align-items: center; }
  .profile-stats-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .content-body { padding: 12px; }
  .topbar { padding: 10px 12px; }
  .auth-card { padding: 24px 20px; }
  .countdown-num, .streak-num { font-size: 28px; }
}

/* ─── UTILS ──────────────────────────────────────────── */
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── EXAM SETS NAV ──────────────────────────────────── */
.nav-item-examset { color: #a78bfa; }
.nav-item-examset:hover, .nav-item-examset.active { background: #4c1d95; color: #ede9fe; }

/* ─── HY TOPIC TOGGLE (topbar) ──────────────────────── */
.btn-hy-topic {
  background: none; border: 1.5px solid #fbbf24; color: #d97706;
  border-radius: 7px; padding: 5px 12px; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: all .15s;
}
.btn-hy-topic:hover, .btn-hy-topic.active {
  background: #fef9c3; border-color: #f59e0b; color: #92400e;
}

/* ─── CUSTOM TOPIC BADGE ─────────────────────────────── */
.custom-topic-badge { background: #f3e8ff; color: #7c3aed; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.badge-custom { background: #f3e8ff; color: #7c3aed; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; margin-left: 4px; }

/* ─── ENHANCED HY POINTS ─────────────────────────────── */
.hy-point-content { flex: 1; min-width: 0; }
.hy-point-pills { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.hy-pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border-radius: 12px; font-size: 11px; font-weight: 600; text-decoration: none;
}
.hy-pill:hover { opacity: .85; text-decoration: none; }
.hy-pill-link  { background: #dbeafe; color: #1d4ed8; }
.hy-pill-video { background: #fee2e2; color: #b91c1c; }

.btn-hy-link { background: none; border: none; color: #94a3b8; cursor: pointer; font-size: 12px; padding: 2px 4px; }
.btn-hy-link:hover { color: var(--accent); }
.hy-inline-link-form { background: #f8fafc; border: 1px solid var(--border); border-radius: 7px; padding: 8px; margin-top: 4px; }

/* ─── BOOK LIBRARY ───────────────────────────────────── */
.book-lib-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.book-lib-item:last-child { border-bottom: none; }
.book-lib-item:hover { background: #f8fafc; }
.book-lib-icon { width: 32px; height: 32px; background: #dcfce7; color: #15803d; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.book-lib-info { flex: 1; min-width: 0; }
.book-lib-title { font-size: 13px; font-weight: 600; color: var(--text); }
.book-lib-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.btn-book-del { background: none; border: none; color: #cbd5e1; cursor: pointer; font-size: 12px; padding: 4px; flex-shrink: 0; }
.btn-book-del:hover { color: var(--danger); }

.book-ref-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; }
.book-ref-icon { width: 32px; height: 32px; background: #dbeafe; color: #1d4ed8; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.book-ref-body { flex: 1; min-width: 0; }
.book-ref-title { font-size: 13px; font-weight: 600; color: var(--text); }
.book-ref-page { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.add-book-ref-form { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 12px; }

/* ─── EXAM SETS ──────────────────────────────────────── */
.es-sets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.es-set-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.es-set-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.es-set-top { padding: 18px 16px 14px; color: #fff; }
.es-set-name { font-size: 16px; font-weight: 700; }
.es-set-count { font-size: 12px; opacity: .85; margin-top: 3px; }
.es-set-body { padding: 12px 16px; }
.es-set-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.es-set-date { font-size: 11px; color: var(--text-muted); }
.es-set-footer { padding: 10px 12px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 6px; background: #f8fafc; }

/* ─── EXAM SET DETAIL ────────────────────────────────── */
.es-detail-header { display: flex; align-items: flex-start; gap: 14px; }
.es-detail-color-bar { width: 6px; border-radius: 3px; min-height: 60px; flex-shrink: 0; }
.es-detail-info h2 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }

.es-topic-list { list-style: none; margin: 0; padding: 0; }
.es-topic-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.es-topic-item:last-child { border-bottom: none; }
.es-topic-color { width: 4px; height: 36px; border-radius: 2px; flex-shrink: 0; }
.es-topic-body { flex: 1; min-width: 0; }
.es-topic-name { font-size: 13px; font-weight: 600; color: var(--text); text-decoration: none; display: block; }
.es-topic-name:hover { color: var(--accent); }
.es-topic-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px; }
.es-topic-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.btn-es-remove { background: none; border: none; color: #cbd5e1; cursor: pointer; font-size: 12px; padding: 3px 5px; border-radius: 4px; }
.btn-es-remove:hover { color: var(--danger); background: #fee2e2; }

/* ─── EXAM SET SEARCH ────────────────────────────────── */
.es-search-results { max-height: 200px; overflow-y: auto; border: 1px solid var(--border); border-radius: 7px; display: none; }
.es-search-results:not(:empty) { display: block; }
.es-sr-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; border-bottom: 1px solid #f1f5f9; }
.es-sr-item:last-child { border-bottom: none; }
.es-sr-item:hover { background: #f0f9ff; }
.es-sr-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.es-sr-name { font-size: 13px; font-weight: 500; }
.es-sr-sub { font-size: 11px; color: var(--text-muted); }
.es-sr-empty { padding: 12px; text-align: center; font-size: 13px; color: var(--text-muted); }

/* ─── EXAM SET DROPDOWN DOT ──────────────────────────── */
.es-color-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* Add topic inline form (subject page) */
.add-topic-inline-form { border-bottom: 1px solid var(--border); }
.btn-add-topic-group { font-size: 10px !important; padding: 2px 7px !important; line-height: 1.4; }
.topic-group-title .btn-add-topic-group { vertical-align: middle; }
.btn.btn-xs { font-size: 11px; padding: 2px 8px; line-height: 1.5; }

/* ── Local file attachments (PDF / Video) ── */
.btn-file-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600;
    padding: 3px 8px; border-radius: 20px; cursor: pointer; white-space: nowrap; text-decoration: none; border: none; }
.btn-file-pdf   { background: #fee2e2; color: #dc2626; }
.btn-file-pdf:hover { background: #fca5a5; color: #991b1b; }
.btn-file-attach { background: #f1f5f9; color: #64748b; }
.btn-file-attach:hover { background: #e2e8f0; color: #334155; cursor: pointer; }

/* Local video list */
.local-video-item { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.local-video-header { display: flex; align-items: center; gap: 6px; }
.local-video-title { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.local-video-player { width: 100%; max-height: 360px; border-radius: 8px; background: #000; display: block; }

/* Local video upload area */
.local-video-upload { border-top: 1px dashed var(--border); padding-top: 14px; margin-top: 6px; }

/* PDF pill on resource items — inside .resource-item */
.resource-item { align-items: center; }
.resource-item .btn-file-pill { margin-right: 4px; flex-shrink: 0; }

/* ── HY point image ── */
.hy-point-image { margin-top: 7px; }
.hy-point-image img { max-width: 260px; max-height: 180px; border-radius: 7px; cursor: zoom-in; border: 1px solid var(--border); object-fit: cover; }
.hy-img-paste-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.hy-img-preview { display:flex; align-items:center; gap:8px; margin-top:6px; }
.hy-img-preview img { max-height:60px; max-width:80px; border-radius:5px; object-fit:cover; border:1px solid var(--border); }
.hy-img-preview .btn-hy-img-clear { background:none; border:none; color:#ef4444; cursor:pointer; font-size:12px; padding:2px 5px; }
.hy-add-form textarea { font-size: 14px; resize: vertical; min-height: 64px; }
.hy-add-form-extras { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:6px; }
.btn-hy-img-attach { background:#f1f5f9; border:1px dashed #94a3b8; color:#475569; font-size:12px; border-radius:7px; padding:5px 10px; cursor:pointer; display:inline-flex; align-items:center; gap:5px; transition:background .15s; }
.btn-hy-img-attach:hover { background:#e2e8f0; }
.hy-reveal-btn { font-size: 12px; }

/* ── Sidebar subjects toggle ── */
.nav-subjects-header { display:flex; align-items:center; justify-content:space-between; cursor:pointer; padding-right:4px; }
.nav-subjects-header:hover .sidebar-subj-chevron { color: var(--accent); }
.sidebar-subj-chevron { font-size: 10px; color: var(--text-muted); transition: transform .2s; }
.sidebar-subj-chevron.collapsed { transform: rotate(-90deg); }

/* ── Sidebar topic tree ── */
.nav-subj-row { display: flex; align-items: center; position: relative; }
.nav-subj-row .nav-item { flex: 1; min-width: 0; }
.btn-subj-expand { flex-shrink: 0; background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px 6px; border-radius: 5px; font-size: 10px; line-height: 1; transition: background .15s, color .15s; }
.btn-subj-expand:hover, .btn-subj-expand.active { background: #e0e7ff; color: var(--accent); }
.sidebar-topic-list { padding: 2px 0 4px 20px; border-left: 2px solid #e2e8f0; margin-left: 18px; margin-bottom: 2px; }
.stl-sub-label { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; padding: 4px 6px 2px; }
.stl-sub-group { margin-bottom: 2px; }
.stl-topic { display: block; font-size: 12px; color: var(--text); padding: 3px 6px; border-radius: 5px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .12s; }
.stl-topic:hover { background: #f1f5f9; color: var(--accent); }
.stl-topic-active { background: #eff6ff; color: var(--accent); font-weight: 600; }
.stl-hy { color: #f59e0b; font-size: 10px; margin-left: 3px; }
.stl-loading, .stl-empty { font-size: 11px; color: var(--text-muted); padding: 4px 6px; }

/* ── Image caption edit UI ── */
.img-caption-wrap { padding: 4px 6px 5px; background: #f8fafc; border-top: 1px solid var(--border); min-height: 24px; }
.img-caption-wrap .img-caption { font-size: 11px; color: var(--text-muted); min-height: 14px; word-break: break-word; }
.img-caption-edit { padding: 2px 0; }
.img-caption-edit input { font-size: 12px; }
/* Overlay action buttons */
.img-actions { position: absolute; top: 5px; right: 5px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.image-item:hover .img-actions { opacity: 1; }
.btn-img-edit, .btn-img-replace { background: rgba(255,255,255,.92); border: 1px solid #cbd5e1; color: #475569; font-size: 11px; padding: 3px 7px; border-radius: 5px; cursor: pointer; line-height: 1.4; backdrop-filter: blur(2px); }
.btn-img-edit:hover { background: #dbeafe; color: var(--accent); border-color: #bfdbfe; }
.btn-img-replace:hover { background: #dcfce7; color: #16a34a; border-color: #86efac; }
.btn-img-del { background: rgba(255,255,255,.92); border: 1px solid #fca5a5; color: #dc2626; font-size: 11px; padding: 3px 7px; border-radius: 5px; cursor: pointer; line-height: 1.4; backdrop-filter: blur(2px); }
.btn-img-del:hover { background: #fca5a5; }

/* ── Resource / Book edit button ── */
.btn-res-edit { background: #f1f5f9; border: 1px solid #e2e8f0; color: #64748b; font-size: 11px; padding: 3px 8px; border-radius: 5px; cursor: pointer; flex-shrink: 0; transition: background .12s; }
.btn-res-edit:hover { background: #dbeafe; color: var(--accent); border-color: #bfdbfe; }
.res-edit-form, .book-edit-form, .book-ref-edit-form { flex: 1; padding: 4px 0; }

/* ── Syllabus page (/subjects.php) ── */
.syllabus-grid { display: flex; flex-direction: column; gap: 12px; max-width: 900px; }
.syllabus-subject-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.syllabus-subject-header { display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; user-select: none; transition: background .12s; }
.syllabus-subject-header:hover { background: #f8fafc; }
.syllabus-subject-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.syllabus-subject-info { flex: 1; min-width: 0; }
.syllabus-subject-name { font-size: 15px; font-weight: 700; color: var(--text); }
.syllabus-subject-meta { font-size: 12px; color: var(--text-muted); margin: 2px 0 5px; }
.syllabus-progress-bar { height: 4px; background: #e2e8f0; border-radius: 2px; overflow: hidden; }
.syllabus-progress-fill { height: 100%; border-radius: 2px; transition: width .4s; }
.syllabus-chevron { color: var(--text-muted); font-size: 13px; flex-shrink: 0; transition: transform .2s; }
.syllabus-topic-panel { border-top: 1px solid var(--border); padding: 8px 0 10px; }
.syllabus-sub-label { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; padding: 8px 18px 3px; }
.syllabus-topic-row { display: flex; align-items: center; gap: 8px; padding: 6px 18px; text-decoration: none; color: var(--text); font-size: 13px; transition: background .1s; }
.syllabus-topic-row:hover { background: #f1f5f9; color: var(--accent); }
.syl-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: #cbd5e1; }
.status-learned .syl-status-dot, .status-mastered .syl-status-dot { background: #22c55e; }
.status-in_progress .syl-status-dot { background: #f59e0b; }
.status-needs_revision .syl-status-dot { background: #ef4444; }
.syl-topic-name { flex: 1; min-width: 0; }
.syl-hy-badge { font-size: 10px; background: #fef3c7; color: #92400e; border-radius: 4px; padding: 1px 5px; flex-shrink: 0; }
.syl-fav-badge { color: #f59e0b; font-size: 11px; flex-shrink: 0; }
.syllabus-empty { padding: 10px 18px; color: var(--text-muted); font-size: 13px; }

/* Multiline HY point text */
.hy-point-text { white-space: pre-wrap; }
.hy-pt-image img { max-width: 220px; max-height: 160px; border-radius: 6px; border: 1px solid var(--border); cursor: zoom-in; transition: max-width .2s; }
