/**
 * APX - Modern UI Stylesheet
 * Clean, professional design system with dark/light mode support
 */

/* ============================================================================
   THEME VARIABLES
   ============================================================================ */

:root {
  /* Base Colors */
  --bg: #18181b;
  --bg2: #101012;

  /* Surface Colors */
  --card: rgba(255, 255, 255, 0.06);
  --card2: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.10);

  /* Solid surface for popups, modals, dropdowns — must be opaque */
  --overlay-bg: #27272a;

  /* Text Colors — neutral white, no blue tint */
  --text: #ececf0;
  --muted: rgba(236, 236, 240, 0.72);

  /* Brand Colors */
  --accent: #6366f1;
  --accent2: #4f46e5;
  --accent-teal: #14b8a6;

  /* State Colors */
  --danger: #f87171;
  --warn: #fbbf24;
  --success: #34d399;

  /* Shadows */
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
  --shadow2: 0 2px 8px rgba(0, 0, 0, 0.22);

  /* Border Radius */
  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 12px;

  /* Form Controls */
  --control-bg: rgba(0, 0, 0, 0.20);
  --control-bg-solid: #0b1220;
  --control-text: #ececf0;
  --control-border: rgba(255, 255, 255, 0.15);
  --control-focus: rgba(99, 102, 241, 0.50);

  /* Background — softer glow, less intense */
  --body-bg:
    radial-gradient(900px 600px at 12% 8%, rgba(99, 102, 241, 0.09), transparent 55%),
    radial-gradient(600px 400px at 88% 90%, rgba(20, 184, 166, 0.05), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg2));

  color-scheme: dark;
}

/* Light Mode Theme */
body[data-theme="light"] {
  --bg: #f4f6f9;
  --bg2: #eceef3;

  /* White cards on a gray background — clear elevation */
  --card: #ffffff;
  --card2: #f0f2f7;

  /* Solid surface for popups, modals, dropdowns */
  --overlay-bg: #ffffff;
  --border: rgba(0, 0, 0, 0.10);

  --text: #0f0f11;
  --muted: rgba(0, 0, 0, 0.60);

  --accent: #5558e8;
  --accent2: #4338ca;
  --accent-teal: #0d9488;

  --danger: #dc2626;
  --warn: #d97706;
  --success: #16a34a;

  --shadow: 0 2px 12px rgba(0, 0, 0, 0.09);
  --shadow2: 0 1px 6px rgba(0, 0, 0, 0.07);

  --control-bg: #ffffff;
  --control-bg-solid: #ffffff;
  --control-text: #0f0f11;
  --control-border: rgba(0, 0, 0, 0.14);
  --control-focus: rgba(85, 88, 232, 0.30);

  --body-bg:
    radial-gradient(900px 600px at 10% 5%, rgba(99, 102, 241, 0.05), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg2));

  color-scheme: light;
}

/* ============================================================================
   BASE STYLES
   ============================================================================ */

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
               ui-sans-serif, system-ui, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--body-bg);
  background-attachment: fixed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Typography */
h1,
h2,
h3 {
  letter-spacing: -0.02em;
}

h1 {
  margin: 0 0 6px;
  font-size: 24px;
}

h2 {
  margin: 0 0 10px;
}

h3 {
  margin: 0 0 10px;
}

h4 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
}

.muted-small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.muted {
  color: var(--muted);
}

::placeholder {
  color: rgba(232, 238, 252, 0.45);
}

body[data-theme="light"] ::placeholder {
  color: rgba(29, 29, 31, 0.40);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ============================================================================
   TOP BAR
   ============================================================================ */

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom-color: rgba(0, 0, 0, 0.10);
}

/* Brand & Logo */
:root {
  --logo-bg: rgba(255, 255, 255, 0.10);
  --logo-border: rgba(255, 255, 255, 0.14);
}

body[data-theme="light"] {
  --logo-bg: rgba(0, 0, 0, 0.04);
  --logo-border: rgba(0, 0, 0, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 12px;
  background: var(--logo-bg);
  padding: 6px;
  border: 1px solid var(--logo-border);
  flex: 0 0 auto;
}

.brand-title {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.1;
  color: var(--accent);
}

.brand-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Global search */
.topbar-search {
  position: relative;
  flex: 1;
  max-width: 480px;
  margin: 0 24px;
}

.topbar-search input {
  width: 100%;
  padding: 7px 12px 7px 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}

.topbar-search input:focus {
  border-color: var(--accent);
}

.topbar-search::before {
  content: "⌕";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1rem;
  pointer-events: none;
  z-index: 1;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--overlay-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 400;
  max-height: 380px;
  overflow-y: auto;
  display: none;
}

.search-dropdown.visible { display: block; }

.search-result-group { padding: 4px 0; }

.search-result-group + .search-result-group {
  border-top: 1px solid var(--border);
}

.search-result-group-label {
  padding: 6px 14px 2px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.search-result-item {
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-result-item:hover {
  background: rgba(99, 102, 241, 0.08);
}

.search-result-item .sri-title { font-weight: 500; }
.search-result-item .sri-sub { font-size: 0.78rem; color: var(--muted); }

.search-no-results {
  padding: 16px 14px;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
}

/* ============================================================================
   LAYOUT
   ============================================================================ */

.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 64px);
}

/* Sidebar */
.sidebar {
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  background: rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
}

body[data-theme="light"] .sidebar {
  background: var(--bg2);
  border-right-color: var(--border);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
}

/* Menu Items */
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  margin-bottom: 4px;
  border: 1px solid transparent;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
  font-size: 15.5px;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.10);
  transform: translateY(-1px);
}

body[data-theme="light"] .menu-item:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.06);
}

.menu-item.active {
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.35);
  font-weight: 600;
}

body[data-theme="light"] .menu-item.active {
  background: rgba(85, 88, 232, 0.12);
  border: 1px solid rgba(85, 88, 232, 0.28);
  font-weight: 600;
}

/* Nav icons */
.menu-item svg {
  flex-shrink: 0;
  opacity: 0.45;
  transition: opacity 120ms ease, color 120ms ease;
}

.menu-item:hover svg {
  opacity: 0.75;
}

.menu-item.active svg {
  opacity: 1;
  color: var(--accent);
}

/* ============================================================================
   PAGE TRANSITIONS
   ============================================================================ */

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-entering {
  animation: pageFadeIn 200ms ease both;
}

/* ============================================================================
   BENTO DASHBOARD
   ============================================================================ */

.stat-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tile-value {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.tile-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
  margin-top: 4px;
}

.tile-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Nav section separator */
.nav-sep {
  height: 1px;
  background: var(--border);
  margin: 8px 4px 10px;
}

/* Collapsible nav group (e.g. Clients) */
.nav-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--text);
  cursor: pointer;
  user-select: none;
  margin-bottom: 4px;
  border: 1px solid transparent;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
  font-size: 15.5px;
}
.nav-group-header:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.10);
  transform: translateY(-1px);
}
body[data-theme="light"] .nav-group-header:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.06);
}
.nav-group-header.active {
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.35);
  font-weight: 600;
}
body[data-theme="light"] .nav-group-header.active {
  background: rgba(85, 88, 232, 0.12);
  border: 1px solid rgba(85, 88, 232, 0.28);
  font-weight: 600;
}
.nav-group-header svg:first-child {
  flex-shrink: 0;
  opacity: 0.45;
}
.nav-group-header.active svg:first-child {
  opacity: 1;
  color: var(--accent);
}
.nav-chevron {
  margin-left: auto;
  opacity: 0.4;
  transition: transform 200ms ease;
}
.nav-group-header.open .nav-chevron {
  transform: rotate(180deg);
}

.nav-group-items {
  overflow: hidden;
  max-height: 0;
  transition: max-height 220ms ease;
}
.nav-group-items.open {
  max-height: 320px;
}

.menu-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 38px;
  border-radius: var(--r-sm);
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  margin-bottom: 2px;
  border: 1px solid transparent;
  font-size: 14px;
  transition: color 120ms ease, background 120ms ease;
}
.menu-sub-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
body[data-theme="light"] .menu-sub-item:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.03);
}
.menu-sub-item.active {
  color: var(--accent);
  font-weight: 600;
  background: rgba(99, 102, 241, 0.10);
  border-color: rgba(99, 102, 241, 0.20);
}

.logout {
  margin-top: 14px;
  width: 100%;
}

/* Main Content */
.content {
  padding: 16px 44px;
}

.content > * {
  max-width: 100%;
}

.page-header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.page-header h1 {
  letter-spacing: -0.02em;
}

/* ============================================================================
   CARDS & SURFACES
   ============================================================================ */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow2);
  margin-bottom: 20px;
}

body[data-theme="light"] .card {
  background: var(--card);
  box-shadow: var(--shadow2);
}

.card.compact {
  padding: 12px 14px;
  border-radius: 16px;
}

/* Money / currency input with $ prefix */
.money-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.money-wrap::before {
  content: "$";
  position: absolute;
  left: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 1;
}
.money-wrap input {
  padding-left: 22px;
  width: 100%;
}

/* Cards inside grid layouts rely on gap, not margin */
.grid-2 > .card,
.grid-3 > .card,
.grid-4 > .card {
  margin-bottom: 0;
}

/* ============================================================================
   TABLES
   ============================================================================ */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

body[data-theme="light"] .table-wrap {
  background: rgba(0, 0, 0, 0.02);
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.table thead th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  text-align: left;
}

.table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* Data Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.15);
}

.data-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

body[data-theme="light"] .data-table tbody td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

body[data-theme="light"] .data-table thead th {
  background: rgba(0, 0, 0, 0.04);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

body[data-theme="light"] .data-table tbody tr:nth-child(odd) td {
  background: rgba(0, 0, 0, 0.02);
}

.data-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.06);
}

body[data-theme="light"] .data-table tbody tr:hover td {
  background: rgba(0, 0, 0, 0.08);
}

.table-link {
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
}

.table-link:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.nowrap {
  white-space: nowrap;
}

.clickable-row {
  cursor: pointer;
}

/* Row Actions */
.row-actions {
  display: flex;
  gap: 6px;
}

/* ============================================================================
   TIMELINE
   ============================================================================ */

.timeline {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.timeline-scroll {
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  align-items: start;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 6px;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.20);
}

body[data-theme="light"] .timeline-dot {
  box-shadow: 0 0 0 3px rgba(85, 88, 232, 0.18);
}

.list-item {
  padding: 10px 6px;
  border-bottom: 1px solid var(--border);
}

.list-item:last-child {
  border-bottom: none;
}

/* ============================================================================
   LINKS
   ============================================================================ */

.link {
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.link:hover {
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.35);
}

body[data-theme="light"] .link:hover {
  text-decoration-color: rgba(0, 0, 0, 0.25);
}

.link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.20);
  border-radius: 10px;
}

/* ============================================================================
   FORMS
   ============================================================================ */

label {
  display: block;
  margin-top: 10px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

label .required {
  color: var(--danger);
  margin-left: 3px;
}

.field-error-message {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--danger);
  font-weight: 500;
}

input,
textarea,
select {
  width: 100%;
  padding: 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  color: var(--control-text);
  outline: none;
  font-size: 14px;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
  color-scheme: light dark;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.20);
  background: rgba(255, 255, 255, 0.07);
}

body[data-theme="light"] input:focus,
body[data-theme="light"] textarea:focus,
body[data-theme="light"] select:focus {
  border-color: #5558e8;
  box-shadow: 0 0 0 4px rgba(85, 88, 232, 0.18);
  background: #ffffff;
}

select option,
select optgroup {
  background: var(--control-bg-solid);
  color: var(--control-text);
}

textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.6;
}

input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: transform 120ms ease, filter 120ms ease, background 120ms ease, border-color 120ms ease;
}

body[data-theme="light"] .btn {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
}

.btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.24);
  border-color: rgba(99, 102, 241, 0.55);
}

/* Primary Button */
.btn-primary {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.30);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

body[data-theme="light"] .btn-primary {
  background: #5558e8;
  border-color: #4338ca;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(85, 88, 232, 0.30);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
  filter: brightness(1.1);
}

body[data-theme="light"] .btn-primary:hover {
  background: #4338ca;
  filter: none;
}

/* Secondary Button */
.btn-secondary {
  background: var(--card);
  border: 1px solid var(--border);
}

/* Danger Button */
.btn-danger {
  background: rgba(255, 59, 48, 0.12);
  border: 1px solid rgba(255, 59, 48, 0.30);
  color: var(--danger);
  font-weight: 600;
}

body[data-theme="light"] .btn-danger {
  background: rgba(255, 59, 48, 0.08);
  border-color: rgba(255, 59, 48, 0.25);
  color: #d70015;
}

.btn-danger:hover {
  background: rgba(255, 59, 48, 0.18);
  border-color: rgba(255, 59, 48, 0.45);
}

/* Small Button */
.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.full {
  width: 100%;
}

/* ============================================================================
   PIPELINE / KANBAN
   ============================================================================ */

.pipeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  align-items: start;
}

.column {
  min-width: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

body[data-theme="light"] .column {
  background: rgba(0, 0, 0, 0.04);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.column-title {
  padding: 5px 4px 8px;
  font-weight: 700;
  font-size: 11px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Stage-specific subtle color accents */
.column:first-child .column-title {
  border-bottom-color: rgba(59, 130, 246, 0.3);
}

.column:nth-child(2) .column-title {
  border-bottom-color: rgba(245, 158, 11, 0.3);
}

.column:nth-child(3) .column-title {
  border-bottom-color: rgba(168, 85, 247, 0.3);
}

.column:nth-child(4) .column-title {
  border-bottom-color: rgba(34, 197, 94, 0.3);
}

.column:nth-child(5) .column-title {
  border-bottom-color: rgba(236, 72, 153, 0.3);
}

.empty {
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

body[data-theme="light"] .empty {
  background: rgba(0, 0, 0, 0.02);
}

.candidate-card {
  margin-bottom: 6px;
}

/* Compact pipeline cards */
.candidate-card.card {
  padding: 8px 10px;
}

.candidate-card .candLink {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 22px;
}

.candidate-card .muted-small {
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.candidate-card select {
  font-size: 0.75rem;
  padding: 4px 6px;
}

.candidate-card .btn-sm {
  font-size: 0.72rem;
  padding: 2px 6px;
}

.candidate-card .detachBtn {
  padding: 1px 5px;
  font-size: 0.7rem;
}

.attach-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
}

/* ============================================================================
   DASHBOARD COMPONENTS
   ============================================================================ */

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
}

.grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 18px;
}

.grid-2.compact,
.grid-3.compact {
  gap: 8px;
}

.stat {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: var(--shadow2);
}

body[data-theme="light"] .stat {
  background: rgba(0, 0, 0, 0.02);
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  opacity: 0.75;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  margin-top: 4px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
}

body[data-theme="light"] .pill {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.75);
}

/* ============================================================================
   TAGS
   ============================================================================ */

.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.30);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  margin-right: 6px;
  margin-bottom: 4px;
  white-space: nowrap;
}

body[data-theme="light"] .tag {
  background: rgba(85, 88, 232, 0.10);
  border-color: rgba(85, 88, 232, 0.25);
  color: var(--accent);
}

/* ============================================================================
   STATUS PILLS
   ============================================================================ */

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.status-open {
  background: rgba(34, 197, 94, 0.25);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #4ade80;
}

body[data-theme="light"] .status-open {
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.30);
  color: #16a34a;
}

.status-closed {
  background: rgba(156, 163, 175, 0.15);
  border: 1px solid rgba(156, 163, 175, 0.25);
  color: #9ca3af;
}

body[data-theme="light"] .status-closed {
  background: rgba(156, 163, 175, 0.12);
  border: 1px solid rgba(156, 163, 175, 0.20);
  color: #6b7280;
}

.status-archived {
  background: rgba(156, 163, 175, 0.15);
  border: 1px solid rgba(156, 163, 175, 0.25);
  color: #9ca3af;
}

body[data-theme="light"] .status-archived {
  background: rgba(156, 163, 175, 0.12);
  border: 1px solid rgba(156, 163, 175, 0.20);
  color: #6b7280;
}

/* ============================================================================
   CANDIDATE PROFILE
   ============================================================================ */

/* ============================================================================
   CANDIDATE PROFILE LAYOUT
   ============================================================================ */

.candidate-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}

.candidate-details {
  min-width: 0;
}

.candidate-resume {
  min-width: 0;
  position: sticky;
  top: 80px;          /* clears the 64px topbar + 16px content padding */
  align-self: start;
  height: calc(100vh - 100px);
}

.candidate-resume > .card {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ============================================================================
   NOTE ITEMS
   ============================================================================ */

.note-item {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

body[data-theme="light"] .note-item {
  background: rgba(0, 0, 0, 0.01);
}

/* ============================================================================
   LOGIN OVERLAY
   ============================================================================ */

.overlay {
  position: fixed;
  inset: 0;
  background: var(--body-bg);
  background-attachment: fixed;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 18px;
}

.overlay.hidden {
  display: none;
}

.overlay-card {
  width: min(440px, 92vw);
  background: var(--overlay-bg);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
  text-align: center;
}

.login-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.login-logo {
  width: 92px;
  height: 92px;
  object-fit: contain;
  border-radius: 20px;
  background: var(--logo-bg);
  padding: 10px;
  border: 1px solid var(--logo-border);
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.error {
  color: var(--danger);
  margin-top: 8px;
  font-size: 12px;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 1000px) {
  .candidate-split {
    grid-template-columns: 1fr;
  }

  .candidate-resume {
    order: -1;
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .sidebar-footer {
    margin-top: 0;
    padding-top: 0;
    margin-left: auto;
  }

  .pipeline {
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .grid-4 {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 600px) {
  .attach-row {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   BREADCRUMBS
   ============================================================================ */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--muted);
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb-link {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
  font-weight: 500;
  transition: opacity 120ms ease;
}

.breadcrumb-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.breadcrumb-separator {
  color: var(--muted);
  opacity: 0.5;
}

.breadcrumb-current {
  color: var(--text);
  font-weight: 500;
}

/* ============================================================================
   EMPTY STATES
   ============================================================================ */

.empty-state {
  padding: 56px 32px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.02);
}

.empty-state-icon {
  display: block;
  font-size: 2.2rem;
  margin-bottom: 14px;
  opacity: 0.35;
}

.th-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.th-sortable:hover {
  color: var(--accent);
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.empty-state-message {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.empty-state-action {
  display: inline-block;
}

body[data-theme="light"] .empty-state {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.12);
}

/* ============================================================================
   LOADING INDICATORS
   ============================================================================ */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}

.loading-overlay.visible {
  display: flex;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

body[data-theme="light"] .loading-overlay {
  background: rgba(0, 0, 0, 0.3);
}

body[data-theme="light"] .spinner {
  border-color: rgba(85, 88, 232, 0.20);
  border-top-color: var(--accent);
  border-right-color: var(--accent);
}

/* ============================================================================
   BULK ACTIONS
   ============================================================================ */

.bulk-action-toolbar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--accent);
  color: white;
  padding: 16px 20px;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
  z-index: 100;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.bulk-action-toolbar.active {
  display: flex;
}

.bulk-action-toolbar .selection-count {
  font-weight: 600;
  margin-right: 16px;
}

.bulk-action-toolbar .btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
}

.bulk-action-toolbar .btn:hover {
  background: rgba(255, 255, 255, 0.3);
  filter: none;
  transform: none;
}

.bulk-action-toolbar .btn-danger {
  background: rgba(255, 59, 48, 0.8);
  border-color: rgba(255, 59, 48, 0.9);
}

.bulk-action-toolbar .btn-danger:hover {
  background: rgba(255, 59, 48, 0.95);
}

.row-checkbox {
  cursor: pointer;
  user-select: none;
}

.checkbox-col {
  width: 40px;
  text-align: center;
  padding: 12px 14px !important;
  vertical-align: middle;
}

.checkbox-col input {
  width: auto;
  margin: 0;
  cursor: pointer;
  vertical-align: middle;
  position: relative;
  top: 1px;
}

/* ============================================================================
   FORM TABS
   ============================================================================ */

.form-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.form-tab {
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: color 120ms ease, border-color 120ms ease;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.form-tab:hover {
  color: var(--text);
}

.form-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.form-tab-content {
  display: none;
}

.form-tab-content.active {
  display: block;
}

body[data-theme="light"] .form-tab {
  color: rgba(0, 0, 0, 0.55);
}

body[data-theme="light"] .form-tab:hover {
  color: #0f0f11;
}

/* ============================================================================
   STEP INDICATOR (Multi-Step Wizard)
   ============================================================================ */

.step-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 8px;
  flex-wrap: wrap;
}

.step-indicator .step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  flex: 1;
  min-width: 120px;
}

.step-indicator .step::before {
  content: attr(data-step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 50%;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
  transition: all 120ms ease;
}

.step-indicator .step.active::before {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.step-indicator .step.completed::before {
  content: "✓";
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
  font-size: 16px;
}

.step-indicator .step.completed {
  color: var(--success);
}

.step-indicator .step-arrow {
  width: 24px;
  height: 2px;
  background: var(--border);
  margin: 0 -8px;
  flex-shrink: 0;
  transition: background 120ms ease;
}

/* Step navigation buttons */
.step-buttons {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 32px;
}

.step-buttons .btn-back {
  visibility: hidden;
  opacity: 0;
}

.step-buttons.step-2 .btn-back,
.step-buttons.step-3 .btn-back {
  visibility: visible;
  opacity: 1;
}

.step-buttons .btn-next {
  margin-left: auto;
}

.step-buttons.step-2 .btn-next {
  margin-left: auto;
}

.step-buttons.step-3 .btn-next {
  display: none;
}

.step-buttons.step-3 .btn-finalize {
  margin-left: auto;
  display: inline-block;
}

.wizard-form-container {
  position: relative;
}

.wizard-form-container .form-tabs {
  display: none;
}

/* Edit mode preserves tabbed interface */
.wizard-form-container.edit-mode .form-tabs {
  display: flex;
}

.edit-mode .step-indicator {
  display: none;
}

.edit-mode .step-buttons {
  display: none;
}

/* Mobile responsiveness for step indicator */
@media (max-width: 768px) {
  .step-indicator {
    flex-direction: column;
    gap: 16px;
  }

  .step-indicator .step {
    width: 100%;
  }

  .step-indicator .step-arrow {
    display: none;
  }

  .step-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .step-buttons .btn-back {
    width: 100%;
  }

  .step-buttons .btn-next,
  .step-buttons .btn-finalize {
    width: 100%;
    margin-left: 0;
  }
}

/* ============================================================================
   DROPDOWNS & COLUMN VISIBILITY
   ============================================================================ */

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--overlay-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow2);
  padding: 8px;
  min-width: 200px;
  z-index: 100;
}

.dropdown-header {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: var(--r-sm);
  font-size: 14px;
  user-select: none;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

body[data-theme="light"] .dropdown-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.dropdown-item input[type="checkbox"] {
  width: auto;
  margin: 0;
  cursor: pointer;
}

.dropdown-item input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* ============================================================================
   MOBILE CARD VIEWS
   ============================================================================ */

.mobile-card-view {
  display: none;
}

.mobile-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.mobile-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent);
}

body[data-theme="light"] .mobile-card:hover {
  background: rgba(0, 0, 0, 0.03);
}

.mobile-card-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--text);
}

.mobile-card-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  color: var(--text);
}

.mobile-card-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

@media (max-width: 768px) {
  .data-table {
    display: none;
  }

  .mobile-card-view {
    display: block;
  }
}

@media (min-width: 769px) {
  .mobile-card-view {
    display: none !important;
  }
}

/* ============================================================================
   MOBILE RESPONSIVE IMPROVEMENTS
   ============================================================================ */

@media (max-width: 900px) {
  .data-table thead th {
    position: static;
  }

  .pipeline {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }

  .column {
    scroll-snap-align: start;
    min-width: 280px;
  }

  .pipeline::after {
    content: '→ Scroll for more';
    position: sticky;
    right: 0;
    bottom: 10px;
    padding: 8px 12px;
    background: var(--accent);
    color: white;
    font-size: 12px;
    border-radius: 20px;
    opacity: 0.8;
    pointer-events: none;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 22px;
  }

  h3 {
    font-size: 18px;
  }

  .stat-value {
    font-size: 28px;
  }

  .btn {
    padding: 12px 16px;
    min-height: 44px;
  }

  .btn-sm {
    padding: 10px 14px;
    min-height: 40px;
  }

  .candidate-resume iframe {
    min-height: 400px !important;
  }
}

/* ============================================================================
   REDZONE PAGE STYLES
   ============================================================================ */

.redzone-summary-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.redzone-stat-card {
  flex: 1;
  min-width: 200px;
}

.redzone-stage-section {
  margin-bottom: 20px;
}

.redzone-stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  cursor: pointer;
  transition: background 0.2s;
  user-select: none;
}

.redzone-stage-header:hover {
  background: var(--card2);
}

.redzone-stage-body {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 12px 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
}

body[data-theme="light"] .redzone-stage-body {
  background: rgba(0, 0, 0, 0.01);
}

.redzone-job-group {
  margin-bottom: 16px;
}

.redzone-job-group:last-child {
  margin-bottom: 0;
}

.redzone-job-header {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text);
}

.redzone-candidate-card {
  margin-bottom: 8px;
}

.redzone-candidate-card:last-child {
  margin-bottom: 0;
}

.redzone-stale-indicator {
  color: var(--warn);
  font-weight: 600;
  font-size: 14px;
}

.redzone-collapse-icon {
  display: inline-block;
  transition: transform 0.2s;
  font-size: 12px;
}

.redzone-stage-section.collapsed .redzone-collapse-icon {
  transform: rotate(-90deg);
}

.redzone-stage-section.collapsed .redzone-stage-body {
  display: none;
}

.redzone-job-list {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.redzone-job-list::-webkit-scrollbar {
  width: 6px;
}

.redzone-job-list::-webkit-scrollbar-track {
  background: transparent;
}

.redzone-job-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.redzone-job-list::-webkit-scrollbar-thumb:hover {
  background: var(--text);
}

.redzone-days-in-stage {
  white-space: nowrap;
}

/* ============================================================================
   PAGINATION
   ============================================================================ */

.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.38;
  cursor: not-allowed;
}

/* ============================================================================
   FUNNEL CHART
   ============================================================================ */

.funnel-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.funnel-row {
  display: grid;
  grid-template-columns: 160px 1fr 44px 56px;
  align-items: center;
  gap: 10px;
}

.funnel-stage-label {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.funnel-bar-wrap {
  height: 26px;
  background: rgba(255,255,255,0.04);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.funnel-bar {
  height: 100%;
  border-radius: 5px;
  min-width: 3px;
  transition: width 0.4s ease;
}

.funnel-stat {
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}

.funnel-conv {
  text-align: right;
  font-size: 12px;
}

@media (max-width: 600px) {
  .funnel-row {
    grid-template-columns: 110px 1fr 36px 48px;
  }
}

/* ============================================================================
   NOTIFICATION BELL & DROPDOWN
   ============================================================================ */

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}

.notif-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 340px;
  background: var(--overlay-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 300;
  max-height: 420px;
  overflow-y: auto;
}

.notif-dropdown.open { display: block; }

.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.9rem;
}

.notif-item {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background 120ms;
}

.notif-item:hover { background: rgba(255,255,255,0.04); }
.notif-item:last-child { border-bottom: none; }

.notif-item-title { font-size: 0.88rem; font-weight: 600; margin-bottom: 2px; }
.notif-item-msg { font-size: 0.8rem; color: var(--muted); }
.notif-item-time { font-size: 0.75rem; color: var(--muted); margin-top: 3px; }

.notif-empty {
  padding: 24px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ============================================================================
   BULK ACTION TOOLBAR (candidates page)
   ============================================================================ */

.bulk-action-bar {
  position: fixed;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--overlay-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 200;
  transition: bottom 220ms ease;
  white-space: nowrap;
}

.bulk-action-bar.visible { bottom: 24px; }

.bulk-action-bar .bulk-count {
  font-weight: 700;
  font-size: 0.9rem;
  margin-right: 6px;
  color: var(--accent);
}

/* ============================================================================
   INTERVIEW CALENDAR
   ============================================================================ */

.calendar-wrap {
  overflow-x: auto;
}

.calendar-grid {
  display: grid;
  grid-template-columns: 56px repeat(5, 1fr);
  min-width: 640px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.calendar-day-header {
  background: var(--bg);
  padding: 10px 6px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.calendar-day-header.today { background: rgba(99,102,241,0.12); color: var(--accent); }
.calendar-day-header:last-child { border-right: none; }

.calendar-time-label {
  padding: 4px 4px 0;
  font-size: 0.7rem;
  color: var(--muted);
  text-align: right;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: top;
}

.calendar-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  min-height: 44px;
  padding: 2px;
  vertical-align: top;
  position: relative;
}

.calendar-cell:last-child { border-right: none; }

.calendar-event {
  background: rgba(99,102,241,0.18);
  border-left: 3px solid var(--accent);
  border-radius: 5px;
  padding: 4px 7px;
  font-size: 0.78rem;
  margin-bottom: 2px;
  cursor: pointer;
  transition: background 120ms;
  line-height: 1.3;
}

.calendar-event:hover { background: rgba(99,102,241,0.30); }
.calendar-event strong { display: block; font-size: 0.8rem; }
.calendar-event span { color: var(--muted); font-size: 0.74rem; }

/* ============================================================================
   MODAL TABS
   ============================================================================ */

.modal-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin: -4px 0 18px 0;
}
.modal-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 14px;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.15s;
}
.modal-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.modal-tab:hover:not(.active) { color: var(--text); }

/* ============================================================================
   CLIENT CONTACTS
   ============================================================================ */

.contact-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.contact-item:last-child { border-bottom: none; }
.contact-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.contact-name {
  font-weight: 600;
  font-size: 0.9rem;
}
.contact-title {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 1px;
}
.contact-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.contact-meta a { color: var(--accent); text-decoration: none; }
.contact-meta a:hover { text-decoration: underline; }
.contact-notes {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
  font-style: italic;
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* ============================================================================
   QUILL RICH TEXT EDITOR
   ============================================================================ */

.ql-toolbar.ql-snow {
  border: 1px solid var(--control-border);
  border-bottom: none;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: var(--control-bg);
  padding: 6px 8px;
}

.ql-container.ql-snow {
  border: 1px solid var(--control-border);
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  background: var(--control-bg);
  font-size: 14px;
  font-family: inherit;
}

.ql-editor {
  color: var(--control-text);
  min-height: 140px;
  line-height: 1.6;
}

.ql-editor.ql-blank::before {
  color: var(--muted);
  font-style: normal;
}

/* Dark theme icon colours */
body[data-theme="dark"] .ql-snow .ql-stroke {
  stroke: var(--muted);
}
body[data-theme="dark"] .ql-snow .ql-fill,
body[data-theme="dark"] .ql-snow .ql-stroke.ql-fill {
  fill: var(--muted);
}
body[data-theme="dark"] .ql-snow .ql-picker {
  color: var(--muted);
}
body[data-theme="dark"] .ql-snow .ql-picker-options {
  background: var(--overlay-bg);
  border-color: var(--control-border);
}
body[data-theme="dark"] .ql-snow .ql-picker-item {
  color: var(--control-text);
}
body[data-theme="dark"] .ql-snow.ql-toolbar button:hover .ql-stroke,
body[data-theme="dark"] .ql-snow.ql-toolbar button.ql-active .ql-stroke {
  stroke: var(--accent);
}
body[data-theme="dark"] .ql-snow.ql-toolbar button:hover .ql-fill,
body[data-theme="dark"] .ql-snow.ql-toolbar button.ql-active .ql-fill {
  fill: var(--accent);
}
body[data-theme="dark"] .ql-snow.ql-toolbar .ql-picker-label:hover,
body[data-theme="dark"] .ql-snow.ql-toolbar .ql-picker-label.ql-active {
  color: var(--accent);
}
body[data-theme="dark"] .ql-snow.ql-toolbar button:hover,
body[data-theme="dark"] .ql-snow.ql-toolbar button.ql-active {
  color: var(--accent);
}

/* ============================================================================
   RICH TEXT DISPLAY — reset browser default margins on Quill-generated HTML
   ============================================================================ */
#jobDescDisplay p,
.rich-text-display p {
  margin: 0 0 3px 0;
}
#jobDescDisplay ul,
#jobDescDisplay ol,
.rich-text-display ul,
.rich-text-display ol {
  margin: 2px 0 4px 0;
  padding-left: 22px;
}
#jobDescDisplay li,
.rich-text-display li {
  margin-bottom: 1px;
}
#jobDescDisplay strong,
.rich-text-display strong {
  font-weight: 600;
}