/* ============================================================
   Design tokens — light theme (default) + dark theme override.
   Dark mode is toggled by setting data-theme="dark" on <html>,
   persisted in localStorage (see hr.js). No external fonts or
   icon libraries are used anywhere in this file — the app's CSP
   is self-only, so everything here is self-contained.
   ============================================================ */
:root {
  --bg: #f3f4f8;
  --bg-subtle: #eceef4;
  --card: #ffffff;
  --card-2: #fafbfd;
  --border: #e3e6ee;
  --border-strong: #d3d8e4;
  --text: #171b26;
  --muted: #6b7280;
  --muted-2: #94a0b4;

  --primary: #4338ca;
  --primary-dark: #362cae;
  --primary-light: #eef0ff;
  --primary-contrast: #ffffff;

  --accent: #0891b2;
  --danger: #dc2626;
  --danger-light: #fdecec;
  --success: #15803d;
  --success-light: #eafbf1;
  --warn: #b45309;
  --warn-light: #fff6e0;
  --info: #1d4ed8;
  --info-light: #eaf1ff;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 6px 16px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.14);

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

html[data-theme="dark"] {
  --bg: #10131b;
  --bg-subtle: #151926;
  --card: #1a1f2e;
  --card-2: #20263a;
  --border: #2b3245;
  --border-strong: #394262;
  --text: #e8ebf3;
  --muted: #9aa4bd;
  --muted-2: #6c7691;

  --primary: #818cf8;
  --primary-dark: #6d78ea;
  --primary-light: #262c4d;
  --primary-contrast: #10131b;

  --accent: #22d3ee;
  --danger: #f87171;
  --danger-light: #3a1f22;
  --success: #4ade80;
  --success-light: #16321f;
  --warn: #fbbf24;
  --warn-light: #382a10;
  --info: #60a5fa;
  --info-light: #17263f;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

a { color: var(--primary); }

/* ---------- Top bar ---------- */
header.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.brand-mark svg { width: 18px; height: 18px; }

header.topbar h1 { font-size: 16.5px; margin: 0; font-weight: 700; letter-spacing: -0.1px; }
header.topbar .subtitle { font-size: 12px; color: var(--muted); margin-top: 1px; }

header.topbar nav { display: flex; align-items: center; gap: 6px; }
header.topbar nav a, header.topbar nav button.link-btn {
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  margin: 0;
}
header.topbar nav a:hover, header.topbar nav button.link-btn:hover { background: var(--bg-subtle); color: var(--primary); }
header.topbar #whoami {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  padding: 5px 12px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 999px;
  margin-right: 4px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  margin: 0;
  padding: 0;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), transform 0.15s var(--ease);
}
.icon-btn:hover { background: var(--bg-subtle); color: var(--primary); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .sun { display: none; }
html[data-theme="dark"] .icon-btn .sun { display: block; }
html[data-theme="dark"] .icon-btn .moon { display: none; }

/* ---------- Layout ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 28px 24px 60px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  margin-bottom: 18px;
  animation: fade-up 0.25s var(--ease);
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

h2 { margin-top: 0; font-size: 16.5px; font-weight: 700; letter-spacing: -0.1px; }
h2 .icon { vertical-align: -3px; margin-right: 6px; width: 17px; height: 17px; color: var(--primary); }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  padding: 5px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.tabs button {
  margin: 0;
  background: transparent;
  color: var(--muted);
  border: none;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.tabs button:hover { background: var(--bg-subtle); color: var(--text); }
.tabs button.active { background: var(--primary); color: var(--primary-contrast); box-shadow: var(--shadow-sm); }

#tabContent { animation: fade-up 0.2s var(--ease); }

/* ---------- Forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin: 14px 0 5px; }
label:first-of-type { margin-top: 0; }

input, textarea, select {
  width: 100%;
  padding: 9px 11px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--card-2);
  color: var(--text);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  background: var(--card);
}
textarea { resize: vertical; }
input[type="checkbox"] { width: auto; }

/* Keyboard-only focus ring for links/buttons (inputs already have their own
   focus style above) — :focus-visible so mouse clicks don't show a ring,
   only actual keyboard navigation does. */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip-to-content link — hidden until a keyboard user tabs to it, so they
   can jump past the topbar straight into the dashboard content. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary-dark);
  color: #fff;
  padding: 10px 16px;
  z-index: 1000;
  border-radius: 0 0 8px 0;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Buttons ---------- */
button {
  background: var(--primary);
  color: var(--primary-contrast);
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 14px;
  transition: background 0.15s var(--ease), transform 0.08s var(--ease), box-shadow 0.15s var(--ease);
  box-shadow: var(--shadow-sm);
}
button:hover { background: var(--primary-dark); }
button:active { transform: scale(0.97); }
button.secondary { background: transparent; color: var(--primary); border: 1.5px solid var(--border-strong); box-shadow: none; }
button.secondary:hover { background: var(--primary-light); border-color: var(--primary); }
/* Toggle-style filter chips (e.g. Blocked Attempts reason breakdown) — same
   secondary button, but visually "pressed" while its filter is active. */
button.secondary.active, button.secondary.active:hover { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); }
button.danger { background: var(--danger); }
button.danger:hover { filter: brightness(0.92); }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ---------- Alerts ---------- */
.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin: 12px 0;
  border-left: 3px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.alert.error { background: var(--danger-light); color: var(--danger); border-left-color: var(--danger); }
.alert.success { background: var(--success-light); color: var(--success); border-left-color: var(--success); }

.back-link { color: var(--muted); font-size: 13px; text-decoration: none; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.4px;
  position: sticky;
  top: 0;
  background: var(--card);
}
tbody tr { transition: background 0.1s var(--ease); }
tbody tr:hover { background: var(--bg-subtle); }
tbody tr:last-child td { border-bottom: none; }

.table-scroll { overflow-x: auto; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: capitalize;
  letter-spacing: 0.1px;
}
.badge.applied { background: var(--info-light); color: var(--info); }
.badge.screening { background: var(--warn-light); color: var(--warn); }
.badge.interview { background: #e6f0ff; color: #1a5fd1; }
html[data-theme="dark"] .badge.interview { background: #1c2c4a; color: #7db2ff; }
.badge.offer { background: var(--success-light); color: var(--success); }
.badge.shortlisted { background: #eef7ff; color: #0a6ebd; }
html[data-theme="dark"] .badge.shortlisted { background: #16324a; color: #6fc2ff; }
.badge.hired { background: #d9f4e4; color: #10693a; }
html[data-theme="dark"] .badge.hired { background: #123222; color: #4ade80; }
.badge.rejected { background: var(--danger-light); color: var(--danger); }
.badge.withdrawn { background: var(--bg-subtle); color: var(--muted); }

/* ---------- Stat cards ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-box .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--primary-light);
  color: var(--primary);
}
.stat-box .stat-icon svg { width: 20px; height: 20px; }
.stat-box.accent-success .stat-icon { background: var(--success-light); color: var(--success); }
.stat-box.accent-warn .stat-icon { background: var(--warn-light); color: var(--warn); }
.stat-box.accent-danger .stat-icon { background: var(--danger-light); color: var(--danger); }
.stat-box .num { font-size: 24px; font-weight: 800; line-height: 1; letter-spacing: -0.5px; }
.stat-box .label { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 600; }

.status-bars { display: flex; flex-direction: column; gap: 10px; }
.status-bar-row { display: flex; align-items: center; gap: 10px; }
.status-bar-row .status-bar-label { width: 110px; flex-shrink: 0; }
.status-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
}
.status-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.4s var(--ease);
}
.status-bar-row .status-bar-count { width: 34px; text-align: right; font-weight: 700; font-size: 13px; flex-shrink: 0; }

.flex-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hidden { display: none !important; }

/* ---------- Compose Email: recipient chips + search picker ---------- */
.recipient-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; min-height: 0; }
.recipient-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 999px;
  padding: 4px 6px 4px 12px;
  font-size: 12.5px;
  font-weight: 600;
}
.recipient-chip.manual { background: var(--bg-subtle); color: var(--text); }
.recipient-chip .chip-remove {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.08);
}
.recipient-chip .chip-remove:hover { background: rgba(0, 0, 0, 0.18); }
.recipient-search-wrap { position: relative; }
.recipient-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md, var(--shadow-sm));
  max-height: 260px;
  overflow-y: auto;
  z-index: 20;
}
.recipient-search-results .rs-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
}
.recipient-search-results .rs-item:hover { background: var(--bg-subtle); }
.recipient-search-results .rs-item .rs-sub { color: var(--muted); font-size: 11.5px; }
.recipient-search-results .rs-empty { padding: 10px 12px; color: var(--muted); font-size: 12.5px; }

/* ---------- Compose Email: template manager list ---------- */
.template-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.template-list-item:last-child { border-bottom: none; }
.template-list-item .tli-name { font-weight: 600; font-size: 13.5px; }
.template-list-item .tli-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
select#filterStatus, select#filterJob { width: auto; }

/* Notification provider settings — the SMTP/Beem/Brevo credential fields
   toggled visible under each mode dropdown in Settings > Notifications. */
.notif-subfields { margin: 10px 0 18px; padding: 12px 14px; background: var(--bg-subtle); border-radius: 8px; }
.notif-subfields label:first-child { margin-top: 0; }
.field-hint { font-size: 12px; color: var(--muted); margin: 2px 0 10px; }

/* ---------- Empty / skeleton loading states ---------- */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.empty-state .icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  color: var(--muted-2);
}
.empty-state .title { font-weight: 700; color: var(--text); font-size: 14.5px; margin-bottom: 4px; }
.empty-state .desc { font-size: 13px; }

.skeleton {
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--border) 37%, var(--bg-subtle) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
.skeleton-line { height: 12px; margin-bottom: 8px; }
.skeleton-block { height: 80px; margin-bottom: 14px; }
.skeleton-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; }
.skeleton-row .skeleton { flex: 1; height: 14px; }

/* ---------- Toasts ---------- */
#toastStack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
}
.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 12px 14px;
  font-size: 13.5px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: toast-in 0.25s var(--ease);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast .toast-icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--primary); }
.toast .toast-close {
  margin: 0;
  background: none;
  border: none;
  color: var(--muted);
  padding: 0;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  box-shadow: none;
}
.toast.leaving { animation: toast-out 0.2s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }

/* ---------- Confirm modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 30, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  animation: overlay-in 0.15s var(--ease);
  padding: 20px;
}
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 22px 24px;
  max-width: 380px;
  width: 100%;
  animation: modal-in 0.2s var(--ease);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-box h3 { margin: 0 0 8px; font-size: 15.5px; }
.modal-box p { margin: 0 0 18px; font-size: 13.5px; color: var(--muted); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.modal-actions button { margin-top: 0; }

/* ---------- Misc ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

/* ---------- App shell (sidebar layout, injected into #app for the dashboard) ---------- */
#app.shell-mode { max-width: none; padding: 0; margin: 0; }
.app-shell { display: flex; align-items: flex-start; }
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 18px 12px;
  position: sticky;
  top: 61px;
  align-self: flex-start;
  height: calc(100vh - 61px);
  overflow-y: auto;
}
.sidebar-search {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  margin-bottom: 16px;
}
.sidebar-search svg { width: 15px; height: 15px; flex-shrink: 0; }
.sidebar-search:hover { border-color: var(--border-strong); color: var(--text); }
.sidebar-search kbd {
  margin-left: auto;
  font-size: 10.5px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--muted-2);
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted-2); font-weight: 700; margin: 14px 8px 6px; }
.side-nav-label:first-child { margin-top: 0; }
.side-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--muted);
  border: none;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  margin: 0;
  box-shadow: none;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.side-nav button svg { width: 16px; height: 16px; flex-shrink: 0; }
.side-nav button:hover { background: var(--bg-subtle); color: var(--text); }
.side-nav button.active { background: var(--primary-light); color: var(--primary); }
.side-nav button .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 6px;
  min-width: 16px;
  text-align: center;
}
.shell-main { flex: 1; min-width: 0; padding: 24px 28px 60px; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 14px; min-height: 16px; }
.breadcrumb a, .breadcrumb button.link-btn {
  color: var(--muted); text-decoration: none; background: none; border: none; padding: 0; margin: 0;
  box-shadow: none; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.breadcrumb a:hover, .breadcrumb button.link-btn:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--muted-2); }
.breadcrumb .current { color: var(--text); font-weight: 600; }

/* ---------- Command palette ---------- */
.palette-overlay {
  position: fixed; inset: 0; background: rgba(15, 20, 30, 0.5);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12vh; z-index: 120; animation: overlay-in 0.15s var(--ease);
}
.palette-box {
  width: 100%; max-width: 560px; background: var(--card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden; animation: modal-in 0.15s var(--ease); border: 1px solid var(--border);
}
.palette-input-row { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.palette-input-row svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.palette-input-row input { border: none; padding: 0; box-shadow: none; font-size: 15px; background: transparent; }
.palette-input-row input:focus { border: none; box-shadow: none; }
.palette-results { max-height: 50vh; overflow-y: auto; padding: 6px; }
.palette-section-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted-2); font-weight: 700; padding: 10px 10px 4px; }
.palette-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: transparent; color: var(--text);
  border: none; padding: 9px 10px; border-radius: var(--radius-sm); margin: 0; box-shadow: none; font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.palette-item .pi-icon { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; }
.palette-item .pi-sub { color: var(--muted); font-weight: 400; margin-left: 4px; }
.palette-item:hover, .palette-item.hl { background: var(--primary-light); color: var(--primary); }
.palette-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }
.palette-footer { padding: 8px 14px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted-2); display: flex; gap: 12px; }
.palette-footer kbd { background: var(--bg-subtle); border: 1px solid var(--border-strong); border-radius: 3px; padding: 0 4px; }

/* ---------- Notification bell ---------- */
.notif-wrap { position: relative; }
.notif-dot {
  position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--card);
}
.notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: 340px; max-height: 420px; overflow-y: auto;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  z-index: 80; animation: modal-in 0.15s var(--ease);
}
.notif-panel-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 13px; }
.notif-panel-header button { margin: 0; background: none; box-shadow: none; color: var(--primary); font-size: 11.5px; font-weight: 600; padding: 2px 4px; }
.notif-item { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-subtle); }
.notif-item .notif-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-item .notif-icon svg { width: 14px; height: 14px; }
.notif-item .notif-title { font-size: 12.5px; font-weight: 600; }
.notif-item .notif-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.notif-item .notif-time { font-size: 10.5px; color: var(--muted-2); margin-top: 2px; }
.notif-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* ---------- Bulk action bar + selectable table rows ---------- */
.bulk-bar {
  display: flex; align-items: center; gap: 10px; background: var(--primary-light); border: 1px solid var(--primary);
  border-radius: var(--radius-sm); padding: 8px 12px; margin-top: 12px; flex-wrap: wrap;
}
.bulk-bar select { width: auto; margin: 0; }
.bulk-bar button { margin: 0; }
.bulk-bar #bulkCount, .bulk-bar #candBulkCount { font-size: 12.5px; font-weight: 700; color: var(--primary); }
th.ck-col, td.ck-col { width: 30px; }
td.ck-col input, th.ck-col input { width: auto; margin: 0; }

/* ---------- Quick-view drawer ---------- */
.drawer-overlay { position: fixed; inset: 0; background: rgba(15, 20, 30, 0.5); z-index: 95; display: flex; justify-content: flex-end; animation: overlay-in 0.15s var(--ease); }
.drawer { width: min(680px, 96vw); height: 100%; background: var(--bg); box-shadow: var(--shadow-lg); overflow-y: auto; animation: drawer-in 0.2s var(--ease); }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0.6; } to { transform: translateX(0); opacity: 1; } }
.drawer-header { position: sticky; top: 0; background: var(--card); border-bottom: 1px solid var(--border); padding: 10px 14px; display: flex; justify-content: flex-end; z-index: 2; }
.drawer-body { padding: 4px 20px 30px; }
.drawer-body .card { margin-bottom: 14px; }

/* ---------- Inline analytics charts (no external chart library) ---------- */
.chart-wrap { margin-top: 10px; }
.trend-svg { width: 100%; height: 120px; display: block; }
.funnel-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.funnel-row .funnel-label { width: 150px; flex-shrink: 0; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.funnel-segments { flex: 1; display: flex; height: 20px; border-radius: 6px; overflow: hidden; background: var(--bg-subtle); }
.funnel-segments span { height: 100%; }
.funnel-total { width: 30px; text-align: right; font-weight: 700; font-size: 12.5px; flex-shrink: 0; }
.funnel-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; font-size: 11.5px; color: var(--muted); }
.funnel-legend span { display: inline-flex; align-items: center; gap: 5px; }
.funnel-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

/* ---------- Activity timeline (per-application audit trail) ---------- */
.activity-list { display: flex; flex-direction: column; }
.activity-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-item .act-icon { width: 26px; height: 26px; border-radius: 50%; background: var(--bg-subtle); color: var(--muted); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.activity-item .act-icon svg { width: 13px; height: 13px; }
.activity-item .act-text { font-size: 12.5px; }
.activity-item .act-time { font-size: 11px; color: var(--muted-2); }

@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); padding: 10px 12px; }
  .side-nav { flex-direction: row; overflow-x: auto; gap: 4px; }
  .side-nav-label { display: none; }
  .side-nav button { width: auto; white-space: nowrap; }
  .sidebar-search { width: auto; margin-bottom: 8px; }
  .shell-main { padding: 18px 14px 48px; }
  .drawer { width: 100%; }
}

@media (max-width: 700px) {
  .container { padding: 18px 14px 48px; }
  header.topbar { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .card { padding: 16px; }
  th, td { padding: 8px; }
  #toastStack { left: 12px; right: 12px; max-width: none; }
  .notif-panel { width: calc(100vw - 24px); right: -12px; }
}
