:root {
  --bg: #07090e;
  --bg-gradient: radial-gradient(circle at 50% 50%, #0d111d 0%, #05060a 100%);
  --surface: rgba(15, 19, 32, 0.65);
  --surface-hover: rgba(23, 29, 47, 0.85);
  --surface-solid: #0d101b;
  --ink: #f8fafc;
  --muted: #64748b;
  --line: rgba(255, 255, 255, 0.06);
  --line-active: rgba(255, 255, 255, 0.12);
  --sidebar-w: 250px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  --radius: 12px;
  --radius-sm: 8px;

  /* Accent Colors */
  --primary: #6366f1;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.25);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --success-line: rgba(16, 185, 129, 0.2);

  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --danger-line: rgba(239, 68, 68, 0.2);

  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --warning-line: rgba(245, 158, 11, 0.2);

  --jamb: #3b82f6;
  --waec: #10b981;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
html, body {
  margin: 0; min-height: 100%; font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg); background-image: var(--bg-gradient); color: var(--ink);
  background-attachment: fixed;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.muted-sm { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }

/* Scrollbar customization */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ─── Login ─── */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.login-card {
  width: min(420px, 100%); background: var(--surface);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  padding: 40px 32px; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.login-badge {
  display: inline-block; padding: 5px 9px; margin-bottom: 16px;
  border: 1px solid var(--primary); color: #818cf8; font-size: 10px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase; border-radius: 4px;
  background: rgba(99, 102, 241, 0.08);
}
.login-card h1 { margin: 0 0 8px; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.login-card p { margin: 0 0 24px; color: var(--muted); line-height: 1.5; font-size: 14px; }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; background: rgba(0, 0, 0, 0.2); color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 10px var(--primary-glow);
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.5; }

.btn {
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 10px 18px; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: all 0.2s ease;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary { background: var(--primary-gradient); color: #fff; box-shadow: 0 4px 14px var(--primary-glow); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: rgba(255,255,255,0.03); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.15); }
.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25); }
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(239, 68, 68, 0.4); }
.btn-danger:disabled { opacity: 0.4; transform: none; box-shadow: none; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 6px; }
#login-form .btn-primary { width: 100%; margin-top: 6px; }
.error-text { color: var(--danger); font-size: 13px; font-weight: 600; }

/* ─── Shell: sidebar + main ─── */
.admin-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: #05060b; color: #fff;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 40;
  border-right: 1px solid var(--line);
}
.sidebar-brand {
  padding: 24px 20px 20px; border-bottom: 1px solid var(--line);
}
.sidebar-logo {
  display: block; color: #fff; text-decoration: none;
  font-size: 16px; font-weight: 800; letter-spacing: -0.03em;
}
.sidebar-tag {
  display: inline-block; margin-top: 4px; font-size: 9px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary);
  background: rgba(99, 102, 241, 0.12); padding: 2px 6px; border-radius: 4px;
}
.sidebar-nav {
  flex: 1; overflow-y: auto; padding: 16px 12px;
}
.sidebar-link {
  display: flex; align-items: center; padding: 10px 14px; margin-bottom: 4px;
  border-radius: 8px; text-decoration: none; color: #94a3b8;
  font-size: 13.5px; font-weight: 600; transition: all 0.15s ease;
}
.sidebar-link:hover { background: rgba(255,255,255,0.04); color: #fff; }
.sidebar-link.active {
  background: var(--primary-gradient); color: #fff; font-weight: 700;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.sidebar-foot {
  padding: 16px 20px; border-top: 1px solid var(--line); background: rgba(0,0,0,0.15);
}
.sidebar-foot-label {
  display: block; font-size: 9px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); margin-bottom: 4px;
}
.sidebar-foot-email {
  display: block; font-size: 12px; color: #cbd5e1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600;
}

.sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 35;
  backdrop-filter: blur(4px);
}
.sidebar-backdrop.open { display: block; }

.main-wrap {
  flex: 1; margin-left: var(--sidebar-w); min-width: 0;
  display: flex; flex-direction: column; min-height: 100vh;
}

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 24px; background: rgba(7, 9, 14, 0.8);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.sidebar-toggle {
  display: none; width: 38px; height: 38px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); cursor: pointer;
  font-size: 16px; line-height: 1; align-items: center; justify-content: center;
}
.page-heading h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
.page-heading p { margin: 4px 0 0; font-size: 13px; color: var(--muted); font-weight: 500; }
.topbar-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.user-pill {
  font-size: 13px; font-weight: 600; color: #e2e8f0;
  background: rgba(255,255,255,0.04); padding: 6px 12px; border-radius: 20px;
  border: 1px solid var(--line); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.content { flex: 1; padding: 28px 24px; max-width: 1240px; width: 100%; }

/* ─── Loading ─── */
.page-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 120px 24px; color: var(--muted); font-weight: 600;
}
.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--primary);
  animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Dashboard home ─── */
.dash-welcome {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 16px; margin-bottom: 20px;
}
.dash-welcome-title { margin: 0 0 6px; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.dash-welcome-meta { display: flex; flex-direction: column; gap: 4px; text-align: right; }
.dash-meta-item { font-size: 13px; color: var(--muted); }
.dash-meta-item strong { color: var(--ink); font-weight: 700; }

.dash-links {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px;
}
.dash-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; background: rgba(255,255,255,0.02); font-weight: 600; font-size: 14px;
  transition: all 0.2s ease;
}
.dash-link:hover {
  background: var(--surface-hover); border-color: var(--primary);
  transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}
.dash-arrow { color: var(--primary); font-size: 16px; transition: transform 0.15s ease; }
.dash-link:hover .dash-arrow { transform: translateX(2px); }

/* ─── Panels & stats ─── */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.stat-card {
  background: var(--surface); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow); transition: border-color 0.2s;
}
.stat-card:hover { border-color: rgba(255,255,255,0.12); }
.stat-card strong { display: block; font-size: 32px; font-weight: 800; line-height: 1; margin-bottom: 8px; color: #fff; }
.stat-card span { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }

.panel {
  background: var(--surface); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 16px; margin-bottom: 18px;
}
.panel-head h2 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar-stack { width: 100%; }
.search {
  min-width: 0; flex: 1 1 200px; max-width: 100%;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 14px; background: rgba(0,0,0,0.2); color: #fff;
  transition: all 0.15s ease;
}
.search:focus { outline: none; border-color: var(--primary); background: rgba(0,0,0,0.35); box-shadow: 0 0 10px var(--primary-glow); }

.select-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  padding: 10px 14px; margin-bottom: 14px;
  background: rgba(255,255,255,0.02); border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: #cbd5e1;
}
.select-bar label { display: flex; align-items: center; gap: 8px; cursor: pointer; }

.page-form { max-width: 100%; }
.edit-layout {
  display: flex; gap: 28px; flex-wrap: wrap; align-items: flex-start;
}
.edit-form { flex: 1 1 500px; min-width: 320px; }
.edit-preview {
  width: 340px; flex-shrink: 0; position: sticky; top: 90px;
  display: flex; flex-direction: column; gap: 10px; z-index: 5;
}

.form-actions {
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; padding-top: 18px;
  border-top: 1px solid var(--line);
}

.global-lock {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px; border-radius: var(--radius);
  background: rgba(239, 68, 68, 0.05); border: 1px solid rgba(239, 68, 68, 0.15); margin-bottom: 20px;
}
.global-lock strong { font-size: 14.5px; font-weight: 700; color: #fecdd3; }
.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; background: rgba(255,255,255,0.15); border-radius: 999px;
  cursor: pointer; transition: 0.2s;
}
.slider::before {
  content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: 0.2s;
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ─── Tables ─── */
.table-wrap {
  overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(0,0,0,0.1);
}
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td {
  text-align: left; padding: 12px 16px;
  border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 14.5px;
}
th {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); background: rgba(255,255,255,0.02); font-weight: 700;
  border-bottom: 1px solid var(--line); padding-top: 14px; padding-bottom: 14px;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.01); }

.tag {
  display: inline-flex; padding: 3px 8px; border-radius: 4px;
  font-size: 10.5px; font-weight: 700; border: 1px solid rgba(255,255,255,0.1);
  letter-spacing: 0.02em; text-transform: uppercase;
}
.tag-cat { background: rgba(99, 102, 241, 0.08); color: #a5b4fc; border-color: rgba(99, 102, 241, 0.2); }
.tag-breaking { background: var(--danger-bg); color: #fca5a5; border-color: var(--danger-line); }
.tag-locked { background: var(--warning-bg); color: #fcd34d; border-color: var(--warning-line); }

.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); font-size: 14.5px; }
.empty a { font-weight: 700; color: var(--primary); text-decoration: none; }
.empty a:hover { text-decoration: underline; }

/* ─── Cards & lists ─── */
.syllabus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.subject-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
}
.subject-card:hover {
  background: var(--surface-hover); border-color: var(--primary);
  transform: translateY(-2px);
}
.subject-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.subject-dot {
  width: 44px; height: 44px; border-radius: 10px;
  display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--primary);
  box-shadow: 0 4px 10px var(--primary-glow); font-size: 18px;
}
.subject-card h3 { margin: 0; flex: 1; font-size: 16px; font-weight: 700; color: #fff; }
.topic-preview { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 10px 0 0; }

.subtabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.subtab {
  border: 1px solid var(--line); background: rgba(255,255,255,0.02); border-radius: var(--radius-sm);
  padding: 8px 16px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--muted);
  transition: all 0.15s ease;
}
.subtab:hover { color: #fff; border-color: rgba(255,255,255,0.15); }
.subtab.active { background: var(--primary-gradient); color: #fff; border-color: var(--primary); box-shadow: 0 4px 10px var(--primary-glow); }

.inline-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.code-area { min-height: 240px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 13px; line-height: 1.5; background: rgba(0,0,0,0.3); }

.preview-panel { margin-top: 24px; padding-top: 18px; border-top: 1px dashed var(--line); }
.preview-panel h3 { margin: 0 0 12px; font-size: 15px; font-weight: 800; color: #fff; }
.q-preview-list { display: grid; gap: 10px; max-height: 450px; overflow: auto; padding-right: 4px; }
.q-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: rgba(255,255,255,0.01); }
.q-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.q-options { margin: 10px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.6; color: #cbd5e1; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.check-row { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 8px; }
.check-row label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; cursor: pointer; }

.comments-list { display: grid; gap: 10px; }
.comment { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: rgba(255,255,255,0.01); }
.comment-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; align-items: center; }

.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 60;
  background: var(--primary-gradient); color: #fff; padding: 12px 20px;
  border-radius: var(--radius); font-weight: 600; font-size: 14px;
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
  animation: rise 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ─── Mobile Preview Card Device Mockup ─── */
.preview-title {
  font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.05em; display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
}
.device-container {
  width: 100%; max-width: 340px; height: 530px; border-radius: 32px;
  border: 10px solid #1e293b; background: #080a10; position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6); overflow: hidden;
  display: flex; flex-direction: column; border-color: #1e293b;
}
.device-screen {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  padding: 16px; color: #fff; font-family: system-ui, -apple-system, sans-serif;
}
.device-header {
  height: 20px; display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: rgba(255,255,255,0.5); font-weight: 600; margin-bottom: 14px;
  padding: 0 4px;
}
.device-app-bar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.device-back-btn {
  width: 28px; height: 28px; border-radius: 14px; background: rgba(255,255,255,0.08);
  display: grid; place-items: center; font-size: 12px; font-weight: bold;
}
.device-title {
  font-size: 14px; font-weight: 800; color: #fff; margin: 0; flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.device-content {
  flex: 1; overflow-y: auto; padding-right: 2px;
}

/* Specific Card Styles for Mockups */
.preview-update-card {
  background: #111524; border-radius: 16px; padding: 16px; border: 1px solid rgba(255,255,255,0.06);
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 8px;
}
.preview-update-top {
  display: flex; justify-content: space-between; align-items: center;
}
.preview-update-cat {
  font-size: 9px; font-weight: 800; padding: 3px 6px; border-radius: 4px; text-transform: uppercase;
}
.preview-update-date {
  font-size: 10px; color: rgba(255,255,255,0.45); font-weight: 500;
}
.preview-update-title {
  font-size: 14px; font-weight: 800; color: #fff; line-height: 1.4; margin: 4px 0 0;
}
.preview-update-desc {
  font-size: 12px; color: #94a3b8; line-height: 1.5; margin: 0;
}
.preview-update-btn {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 11px; font-weight: 700; color: #818cf8;
}

.preview-video-card {
  background: #121824; border-radius: 18px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06); display: flex; flex-direction: column;
}
.preview-video-thumb {
  height: 120px; background: #1e293b; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.preview-video-play {
  width: 40px; height: 40px; border-radius: 20px; background: rgba(99, 102, 241, 0.9);
  display: grid; place-items: center; font-size: 16px; color: #fff; box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
}
.preview-video-duration {
  position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.7);
  padding: 2px 6px; border-radius: 4px; font-size: 9px; font-weight: 700;
}
.preview-video-info {
  padding: 12px; display: flex; flex-direction: column; gap: 4px;
}
.preview-video-subj {
  font-size: 8px; font-weight: 800; text-transform: uppercase; color: #6366f1; letter-spacing: 0.05em;
}
.preview-video-title {
  font-size: 13px; font-weight: 700; color: #fff; margin: 0;
}
.preview-video-instr {
  font-size: 10.5px; color: #64748b; margin: 0;
}

.preview-novel-card {
  background: #0f131c; border-radius: 16px; padding: 12px;
  border: 1px solid rgba(255,255,255,0.06); display: flex; gap: 12px; align-items: flex-start;
}
.preview-novel-cover {
  width: 65px; height: 90px; border-radius: 8px; background: #6366f1;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 24px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3); flex-shrink: 0;
}
.preview-novel-info {
  flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.preview-novel-title {
  font-size: 13px; font-weight: 700; color: #fff; margin: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.preview-novel-author {
  font-size: 10px; color: #6366f1; font-weight: 600; margin: 0;
}
.preview-novel-desc {
  font-size: 10.5px; color: #64748b; line-height: 1.4; margin: 2px 0 0;
}

.preview-note-card {
  background: #131722; border-radius: 16px; padding: 14px;
  border: 1px solid rgba(255,255,255,0.06); display: flex; flex-direction: column; gap: 10px;
}
.preview-note-top {
  display: flex; justify-content: space-between; align-items: center;
}
.preview-note-sub {
  font-size: 9px; font-weight: 800; text-transform: uppercase; color: #ec4899;
}
.preview-note-time {
  font-size: 9px; color: #64748b; font-weight: 600;
}
.preview-note-title {
  font-size: 13.5px; font-weight: 700; color: #fff; margin: 0;
}
.preview-note-points {
  display: flex; flex-direction: column; gap: 5px; margin-top: 4px;
}
.preview-note-point {
  display: flex; align-items: flex-start; gap: 6px; font-size: 10.5px; color: #94a3b8; line-height: 1.4;
}
.preview-note-bullet {
  color: #ec4899; font-size: 8px; line-height: 1.4;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1); }
  .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .content { padding: 20px 16px; }
  .dash-welcome-meta { text-align: left; }
  .edit-preview { width: 100%; max-width: 100%; position: static; margin-top: 16px; }
  .device-container { max-width: 100%; height: auto; min-height: 380px; }
}

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .topbar { padding: 12px 16px; }
  .page-heading h1 { font-size: 18px; }
  .user-pill { display: none; }
  .toolbar { flex-direction: column; align-items: stretch; width: 100%; }
  .toolbar .btn, .toolbar .search, .toolbar select, .toolbar a.btn { width: 100%; }
  .global-lock { flex-direction: column; align-items: flex-start; gap: 12px; }
  .subject-card-head { flex-direction: column; align-items: flex-start; }
  .subject-card h3 { min-width: 0; width: 100%; }
  .login-card { padding: 32px 20px; }
  .toast { left: 16px; right: 16px; bottom: 16px; text-align: center; }

  .table-wrap table { min-width: 0; }
  .table-wrap thead { display: none; }
  .table-wrap tbody tr {
    display: block; margin-bottom: 12px; padding: 16px;
    border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,0.01);
  }
  .table-wrap tbody td {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 8px 0; border: none; font-size: 14px;
  }
  .table-wrap tbody td::before {
    content: attr(data-label); font-weight: 700; color: var(--muted);
    font-size: 11px; text-transform: uppercase; flex-shrink: 0;
  }
  .table-wrap tbody td:last-child { justify-content: flex-end; padding-top: 12px; border-top: 1px solid var(--line); }
  .table-wrap tbody td:last-child::before { display: none; }
  .table-wrap tbody td:not([data-label])::before { content: ''; display: none; }
}
