/* ─── TOKENS ──────────────────────────────────────────────── */
:root {
  --navy:       #0f172a;
  --navy-mid:   #1e293b;
  --navy-light: #334155;
  --teal:       #0EA5B0;
  --teal-dim:   #0c8a94;
  --teal-glow:  rgba(14,165,176,0.15);
  --sand:       #f8fafc;
  --sand-mid:   #f1f5f9;
  --text:       #0f172a;
  --text-soft:  #475569;
  --text-muted: #94a3b8;
  --border:     #e2e8f0;
  --radius:     10px;
  --radius-lg:  16px;
  --shadow:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10);
  --sidebar-w:  240px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Status colors */
--s-new:        #6366f1;
--s-screening:  #f59e0b;
--s-interview:  #3b82f6;
--s-shortlist:  #8b5cf6;
--s-offer:      #0EA5B0;
--s-joined:     #10b981;
--s-rejected:   #ef4444;
--s-onhold:     #6b7280;

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: var(--font); background: var(--sand); color: var(--text); }

/* ─── LAYOUT ──────────────────────────────────────────────── */
#app { display: flex; height: 100vh; overflow: hidden; }

/* SIDEBAR */
#sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  transition: transform .25s ease;
  z-index: 200;
}
.sidebar-logo {
  padding: 20px 20px 16px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.logo-icon {
  width: 36px; height: 36px; background: var(--teal); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.logo-text { color: #fff; font-weight: 700; font-size: 15px; line-height: 1.2; }
.logo-sub { color: var(--text-muted); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }

nav { padding: 12px 10px; flex: 1; }
.nav-section { font-size: 10px; color: var(--text-muted); letter-spacing: .08em; text-transform: uppercase; padding: 8px 10px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; cursor: pointer;
  color: #94a3b8; font-size: 13.5px; font-weight: 500; transition: all .15s;
  margin-bottom: 2px; user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--teal-glow); color: var(--teal); }
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto; background: var(--teal); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 99px; min-width: 18px; text-align: center;
}

.sidebar-footer {
  padding: 12px 10px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex; flex-direction: column; gap: 4px;
}
.sidebar-footer .nav-item { font-size: 12px; }

/* MAIN */
#main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* TOPBAR */
#topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px; gap: 12px; flex-shrink: 0;
}
#menu-toggle { display: none; background: none; border: none; cursor: pointer; font-size: 20px; color: var(--text-soft); padding: 4px; }
.topbar-title { font-size: 16px; font-weight: 700; color: var(--text); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* CONTENT */
#content { flex: 1; overflow-y: auto; padding: 24px; }

/* ─── CARDS / PANELS ─────────────────────────────────────── */
.card {
  background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border);
  box-shadow: var(--shadow); padding: 20px;
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 14px; font-weight: 600; color: var(--text-soft); text-transform: uppercase; letter-spacing: .04em; }

/* ─── DASHBOARD ──────────────────────────────────────────── */
#page-dashboard { display: none; }
.dash-kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi-card {
  background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; transition: all .15s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.kpi-value { font-size: 28px; font-weight: 800; line-height: 1; }
.kpi-dot { width: 8px; height: 8px; border-radius: 50%; }

.status-new        { color: #6366f1; } .dot-new        { background: #6366f1; }
.status-screening  { color: #f59e0b; } .dot-screening  { background: #f59e0b; }
.status-interview  { color: #3b82f6; } .dot-interview  { background: #3b82f6; }
.status-shortlisted{ color: #8b5cf6; } .dot-shortlisted{ background: #8b5cf6; }
.status-offer      { color: #0EA5B0; } .dot-offer      { background: #0EA5B0; }
.status-joined     { color: #10b981; } .dot-joined     { background: #10b981; }
.status-rejected   { color: #ef4444; } .dot-rejected   { background: #ef4444; }
.status-on-hold    { color: #6b7280; } .dot-on-hold    { background: #6b7280; }
.status-ref-call   { color: #db2777; } .dot-ref-call   { background: #db2777; }
.status-unresponsive { color: #92400e; } .dot-unresponsive { background: #92400e; }

.dash-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .dash-bottom { grid-template-columns: 1fr; } }

.recent-list { display: flex; flex-direction: column; gap: 10px; }
.recent-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 8px; border: 1px solid var(--border); transition: background .12s;
}
.recent-item:hover { background: var(--sand-mid); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--teal-glow);
  color: var(--teal); font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.recent-name { font-size: 13px; font-weight: 600; }
.recent-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* ─── CANDIDATES PAGE ────────────────────────────────────── */
#page-candidates { display: none; }
.toolbar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.search-wrap { position: relative; flex: 1; min-width: 180px; }
.search-wrap input { width: 100%; padding: 9px 12px 9px 36px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; background: #fff; outline: none; transition: border-color .15s; }
.search-wrap input:focus { border-color: var(--teal); }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 15px; pointer-events: none; }

select.filter-sel {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; background: #fff; outline: none; color: var(--text); cursor: pointer;
}
select.filter-sel:focus { border-color: var(--teal); }

.btn {
  padding: 9px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 600;
  cursor: pointer; border: none; display: inline-flex; align-items: center; gap: 6px; transition: all .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dim); }
.btn-ghost { background: #fff; color: var(--text-soft); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--sand-mid); }
.btn-danger { background: #fef2f2; color: #ef4444; border: 1px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 7px; }

/* TABLE */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 900px; }
thead th {
  padding: 11px 14px; text-align: left; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted);
  background: var(--sand); border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--sand-mid); }
td { padding: 12px 14px; vertical-align: middle; color: var(--text); }
.td-name { font-weight: 600; }
.td-actions { display: flex; gap: 4px; }

.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.pill-new        { background: #eef2ff; color: #6366f1; }
.pill-screening  { background: #fffbeb; color: #d97706; }
.pill-interview  { background: #eff6ff; color: #3b82f6; }
.pill-shortlisted{ background: #f5f3ff; color: #7c3aed; }
.pill-offer      { background: #ecfeff; color: #0891b2; }
.pill-joined     { background: #ecfdf5; color: #059669; }
.pill-rejected   { background: #fef2f2; color: #dc2626; }
.pill-on-hold    { background: #f9fafb; color: #6b7280; }
.pill-ref-call   { background: #fdf2f8; color: #db2777; }
.pill-unresponsive { background: #fffbeb; color: #92400e; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 14px; }

/* ─── MODAL ──────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal {
  background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 680px;
  max-height: 92vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25);
  transform: translateY(12px); transition: transform .2s;
}
.modal-backdrop.open .modal { transform: translateY(0); }
.modal-header {
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: #fff; z-index: 1;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 22px; color: var(--text-muted); line-height: 1; padding: 2px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* FORM */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
label { font-size: 12px; font-weight: 600; color: var(--text-soft); }
input[type=text], input[type=email], input[type=tel], input[type=number], textarea, select.form-sel {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; font-family: var(--font); color: var(--text); background: #fff; outline: none; transition: border-color .15s;
}
input:focus, textarea:focus, select.form-sel:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-glow); }
textarea { resize: vertical; min-height: 70px; }

/* FILE UPLOAD */
.file-drop {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 20px;
  text-align: center; cursor: pointer; transition: all .15s; background: var(--sand);
}
.file-drop:hover, .file-drop.drag { border-color: var(--teal); background: var(--teal-glow); }
.file-drop p { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.file-drop .icon { font-size: 24px; }
.file-info { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--sand-mid); border-radius: var(--radius); border: 1px solid var(--border); margin-top: 8px; }
.file-info-name { font-size: 12px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-info-size { font-size: 11px; color: var(--text-muted); }

/* DETAIL MODAL */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-item { }
.detail-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 3px; }
.detail-value { font-size: 14px; color: var(--text); word-break: break-word; }
.detail-value.mono { font-family: monospace; }

/* ─── BACKUP PAGE ────────────────────────────────────────── */
#page-backup { display: none; }
.backup-steps { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.backup-step {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px; background: var(--sand-mid); border-radius: var(--radius); border: 1px solid var(--border);
}
.step-num {
  width: 28px; height: 28px; border-radius: 50%; background: var(--teal); color: #fff;
  font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.step-text h4 { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.step-text p { font-size: 12px; color: var(--text-soft); line-height: 1.5; }

.backup-actions { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.backup-card { padding: 20px 24px; }

/* ─── INSTALL INSTRUCTIONS ───────────────────────────────── */
#page-install { display: none; }
.install-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .install-grid { grid-template-columns: 1fr; } }
.install-card { padding: 20px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: #fff; }
.install-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.install-card ol { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.install-card li { font-size: 13px; color: var(--text-soft); line-height: 1.5; }
.install-banner {
  background: linear-gradient(135deg, var(--navy) 0%, #1a3a4a 100%);
  border-radius: var(--radius-lg); padding: 24px; color: #fff; margin-bottom: 20px;
  display: flex; align-items: center; gap: 16px;
}
.install-banner .icon { font-size: 40px; }
.install-banner h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.install-banner p { font-size: 13px; color: #94a3b8; }

/* ─── TOAST ──────────────────────────────────────────────── */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 500; box-shadow: var(--shadow-md);
  animation: slideUp .25s ease; max-width: 300px;
  display: flex; align-items: center; gap: 8px;
}
.toast.success { border-left: 3px solid #10b981; }
.toast.error   { border-left: 3px solid #ef4444; }
.toast.info    { border-left: 3px solid var(--teal); }
@keyframes slideUp { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ─── CONFIRM DIALOG ─────────────────────────────────────── */
#confirm-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 2000;
  display: none; align-items: center; justify-content: center; padding: 16px;
}
#confirm-backdrop.open { display: flex; }
#confirm-box {
  background: #fff; border-radius: var(--radius-lg); padding: 24px; max-width: 380px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
#confirm-box h3 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
#confirm-box p { font-size: 13px; color: var(--text-soft); margin-bottom: 20px; line-height: 1.5; }
#confirm-box .btns { display: flex; gap: 10px; justify-content: flex-end; }

/* ─── PDF VIEWER ─────────────────────────────────────────── */
#pdf-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.8); z-index: 3000;
  display: none; flex-direction: column; align-items: center;
}
#pdf-backdrop.open { display: flex; }
#pdf-topbar {
  width: 100%; background: var(--navy); padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
#pdf-name { color: #fff; font-size: 14px; font-weight: 600; }
#pdf-frame { flex: 1; width: 100%; border: none; }
#pdf-close { background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; padding: 2px; }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  #sidebar {
    position: fixed; left: 0; top: 0; height: 100%;
    transform: translateX(-100%);
  }
  #sidebar.open { transform: translateX(0); }
  #menu-toggle { display: flex; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  #content { padding: 16px; }
}

.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 199;
}
.sidebar-overlay.show { display: block; }

/* Sort icon */
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { color: var(--teal); }
.sort-arrow { margin-left: 4px; opacity: .5; }
th.sorted .sort-arrow { opacity: 1; color: var(--teal); }

/* Progress bar for storage */
.storage-bar { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; margin: 6px 0; }
.storage-fill { height: 100%; background: var(--teal); border-radius: 99px; transition: width .3s; }

.tag { display: inline-block; padding: 2px 7px; background: var(--sand-mid); border-radius: 4px; font-size: 11px; color: var(--text-soft); margin: 1px; }

/* ─── NOTES ──────────────────────────────────────────────── */
#page-notes { display:none; height:calc(100vh - 56px); padding:0; overflow:hidden; }

#notes-layout {
  display:grid; grid-template-columns:260px 1fr; height:100%;
}

/* LEFT SIDEBAR */
#notes-sidebar {
  border-right:1px solid var(--border); background:#fff;
  display:flex; flex-direction:column; overflow:hidden;
}
#notebooks-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px 10px; border-bottom:1px solid var(--border); flex-shrink:0;
}
#notebooks-list { padding:8px; overflow-y:auto; max-height:200px; border-bottom:1px solid var(--border); }

.notebook-item {
  display:flex; align-items:center; gap:8px; padding:8px 10px;
  border-radius:8px; cursor:pointer; font-size:13px; font-weight:500;
  color:var(--text-soft); transition:all .12s; margin-bottom:2px;
}
.notebook-item:hover { background:var(--sand-mid); color:var(--text); }
.notebook-item.active { background:var(--teal-glow); color:var(--teal); }
.notebook-item .nb-icon { font-size:15px; }
.notebook-item .nb-count { margin-left:auto; font-size:11px; color:var(--text-muted); background:var(--sand-mid); padding:1px 6px; border-radius:99px; }
.notebook-item .nb-del { margin-left:2px; opacity:0; font-size:13px; background:none; border:none; cursor:pointer; padding:0 2px; }
.notebook-item:hover .nb-del { opacity:1; }

#notes-list-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 16px 8px; flex-shrink:0;
}
#notes-list { flex:1; overflow-y:auto; padding:8px; }

.note-item {
  padding:10px 12px; border-radius:8px; cursor:pointer; margin-bottom:4px;
  border:1px solid transparent; transition:all .12s;
}
.note-item:hover { background:var(--sand-mid); border-color:var(--border); }
.note-item.active { background:var(--teal-glow); border-color:var(--teal); }
.note-item-title { font-size:13px; font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.note-item-meta { font-size:11px; color:var(--text-muted); margin-top:3px; }
.note-item-preview { font-size:12px; color:var(--text-soft); margin-top:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* RIGHT EDITOR */
#notes-editor-pane { display:flex; flex-direction:column; overflow:hidden; background:var(--sand); }

#notes-empty-state {
  flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
  color:var(--text-muted); text-align:center; padding:40px;
}

#note-editor { display:flex; flex-direction:column; height:100%; }

#note-editor-header {
  padding:16px 20px 10px; background:#fff; border-bottom:1px solid var(--border); flex-shrink:0;
}
#note-title-input {
  width:100%; font-size:20px; font-weight:700; border:none; outline:none;
  color:var(--text); background:transparent; font-family:var(--font);
  margin-bottom:4px;
}
#note-meta { font-size:11px; color:var(--text-muted); }

#note-toolbar {
  display:flex; align-items:center; gap:4px; padding:8px 12px;
  background:#fff; border-bottom:1px solid var(--border); flex-wrap:wrap; flex-shrink:0;
}
.nt-btn {
  padding:5px 8px; border:none; background:none; border-radius:5px; cursor:pointer;
  font-size:13px; color:var(--text-soft); transition:all .12s; line-height:1;
}
.nt-btn:hover { background:var(--sand-mid); color:var(--text); }
.nt-btn.active { background:var(--teal-glow); color:var(--teal); }
.nt-sep { width:1px; height:18px; background:var(--border); margin:0 2px; }
#nt-heading {
  font-size:12px; padding:4px 6px; border:1px solid var(--border); border-radius:5px;
  background:#fff; color:var(--text); outline:none; cursor:pointer;
}
#nt-at-btn { background:var(--teal-glow); color:var(--teal); font-weight:600; font-size:12px; }

#note-content {
  flex:1; padding:20px 24px; outline:none; font-size:14px; line-height:1.7;
  color:var(--text); overflow-y:auto; background:#fff; margin:12px; border-radius:var(--radius-lg);
  border:1px solid var(--border); box-shadow:var(--shadow);
}
#note-content:empty:before { content:attr(data-placeholder); color:var(--text-muted); pointer-events:none; }
#note-content h1 { font-size:22px; font-weight:700; margin:8px 0; }
#note-content h2 { font-size:18px; font-weight:700; margin:8px 0; }
#note-content h3 { font-size:15px; font-weight:700; margin:6px 0; }
#note-content ul, #note-content ol { padding-left:22px; margin:6px 0; }
#note-content li { margin:3px 0; }
#note-content input[type=checkbox] { margin-right:6px; cursor:pointer; width:14px; height:14px; }

/* Candidate @mention links */
.cand-mention {
  display:inline-flex; align-items:center; gap:4px;
  background:var(--teal-glow); color:var(--teal); border-radius:4px;
  padding:1px 6px; font-weight:600; font-size:13px; cursor:pointer;
  border:1px solid rgba(14,165,176,.2); text-decoration:none;
}
.cand-mention:hover { background:var(--teal); color:#fff; }

/* @mention autocomplete */
#at-mention-dropdown {
  position:absolute; background:#fff; border:1px solid var(--border); border-radius:var(--radius);
  box-shadow:var(--shadow-md); z-index:500; max-height:200px; overflow-y:auto;
  display:none; min-width:220px;
}
#at-mention-dropdown.open { display:block; }
.mention-opt {
  padding:8px 12px; cursor:pointer; font-size:13px; display:flex; align-items:center; gap:8px;
}
.mention-opt:hover { background:var(--sand-mid); }
.mention-opt .m-name { font-weight:600; }
.mention-opt .m-sub { font-size:11px; color:var(--text-muted); }

/* Notebook modal */
#nb-modal-backdrop {
  position:fixed; inset:0; background:rgba(15,23,42,.55); z-index:1000;
  display:none; align-items:center; justify-content:center;
}
#nb-modal-backdrop.open { display:flex; }
#nb-modal {
  background:#fff; border-radius:var(--radius-lg); padding:24px; width:340px;
  box-shadow:0 20px 60px rgba(0,0,0,.25);
}
#nb-modal h3 { font-size:15px; font-weight:700; margin-bottom:14px; }
#nb-name-input {
  width:100%; padding:9px 12px; border:1px solid var(--border); border-radius:var(--radius);
  font-size:13px; outline:none; margin-bottom:14px;
}
#nb-name-input:focus { border-color:var(--teal); }
#nb-modal .btns { display:flex; gap:8px; justify-content:flex-end; }

/* Responsive notes */
@media (max-width:768px) {
  #notes-layout { grid-template-columns:1fr; }
  #notes-sidebar { max-height:250px; border-right:none; border-bottom:1px solid var(--border); }
  #note-content { margin:8px; padding:14px; }
}
