/* Brokerr App Styles */
@import '/design-system/tokens.css';
@import '/design-system/components.css';

/* ---------- Help Tooltips ---------- */
.help-tip {
  display: inline-flex;
  align-items: center;
  cursor: help;
  color: var(--color-gray-400);
  margin-left: 6px;
  position: relative;
  vertical-align: middle;
}
.help-tip:hover, .help-tip:focus { color: var(--color-gray-600); outline: none; }
.help-tip:hover::after, .help-tip:focus::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  bottom: auto;
  left: 0;
  transform: none;
  background: var(--color-gray-900);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: normal;
  width: max-content;
  max-width: 260px;
  z-index: 1000;
  line-height: 1.4;
  font-weight: 400;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  pointer-events: none;
}

/* ---------- Profile Completeness ---------- */
.profile-completeness {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  cursor: help;
  position: relative;
}
.profile-completeness--high { background: #D1FAE5; color: #065F46; }
.profile-completeness--medium { background: #FEF3C7; color: #92400E; }
.profile-completeness--low { background: #FEE2E2; color: #991B1B; }
.profile-completeness:hover::after, .profile-completeness:focus::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  transform: none;
  background: var(--color-gray-900);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 11px;
  white-space: normal;
  width: max-content;
  max-width: 260px;
  z-index: 1000;
  line-height: 1.4;
  font-weight: 400;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  pointer-events: none;
}

/* ---------- App Footer ---------- */
.app-footer {
  text-align: center;
  padding: var(--sp-6) var(--sp-4) var(--sp-4);
  font-size: 11px;
  color: var(--color-gray-400);
}
.app-footer a { color: var(--color-gray-400); text-decoration: none; }
.app-footer a:hover { color: var(--color-gray-600); text-decoration: underline; }


/* Pipeline Stages + Bulk Edit -> css/pipeline.css */
/* ---------- Layout ---------- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar (collapsible) ---------- */
.sidebar {
  width: var(--sidebar-collapsed-width);
  background: linear-gradient(180deg, #0F172A 0%, #1B2A4A 100%);
  color: var(--color-white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow: hidden;
  transition: width 200ms ease;
}
/* Expand on hover (pointer devices) or when --expanded class is set (touch/click toggle) */
.sidebar:hover,
.sidebar--expanded { width: var(--sidebar-width); }

.sidebar-logo {
  padding: var(--sp-4) 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tight);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar:not(:hover):not(.sidebar--expanded) .sidebar-logo { font-size: 0; }
.sidebar:not(:hover):not(.sidebar--expanded) .sidebar-logo:not(.sidebar-logo--has-img)::before {
  content: 'B';
  font-size: var(--font-size-xl);
  display: inline-block;
}
.sidebar:not(:hover):not(.sidebar--expanded) .sidebar-logo img {
  max-height: 24px;
  max-width: 32px;
}
.sidebar:hover .sidebar-logo,
.sidebar--expanded .sidebar-logo { padding: var(--sp-4) var(--sp-5); text-align: left; }
.sidebar:hover .sidebar-logo:not(.sidebar-logo--has-img)::before,
.sidebar--expanded .sidebar-logo:not(.sidebar-logo--has-img)::before { display: none; }
.sidebar:hover .sidebar-logo img,
.sidebar--expanded .sidebar-logo img {
  max-height: 32px;
  max-width: 140px;
}

.sidebar .nav {
  padding: var(--sp-3) var(--sp-2);
  flex: 1;
  overflow: hidden;
}

.sidebar:not(:hover):not(.sidebar--expanded) .nav-item {
  justify-content: center;
  padding: var(--sp-3) 0;
  font-size: 0;
  gap: 0;
  position: relative;
}
.sidebar:not(:hover):not(.sidebar--expanded) .nav-item .nav-icon {
  font-size: initial;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}
.sidebar:not(:hover):not(.sidebar--expanded) .nav-item .nav-pro-badge { display: none; }
.sidebar:not(:hover):not(.sidebar--expanded) .nav-item .nav-badge {
  position: absolute;
  top: 2px;
  right: 6px;
  font-size: 9px;
  padding: 0 4px;
}
.sidebar:hover .nav-item,
.sidebar--expanded .nav-item { padding: 10px 14px; font-size: 0.8125rem; color: rgba(255,255,255,0.85); }
.sidebar:hover .nav-item:hover,
.sidebar--expanded .nav-item:hover { color: rgba(255,255,255,1); }
.sidebar:hover .nav-group__label,
.sidebar--expanded .nav-group__label { color: rgba(255,255,255,0.55); }
.sidebar:hover .nav-group__chevron,
.sidebar--expanded .nav-group__chevron { color: rgba(255,255,255,0.45); }

/* Collapsed: show only group icons, hide child items */
.sidebar:not(:hover):not(.sidebar--expanded) .nav-group { margin-bottom: 0; }
.sidebar:not(:hover):not(.sidebar--expanded) .nav-group__header {
  justify-content: center; padding: 12px 0;
}
.sidebar:not(:hover):not(.sidebar--expanded) .nav-group__label,
.sidebar:not(:hover):not(.sidebar--expanded) .nav-group__chevron { display: none; }
.sidebar:not(:hover):not(.sidebar--expanded) .nav-group__header .nav-icon { opacity: 0.7; }
.sidebar:not(:hover):not(.sidebar--expanded) .nav-group__items { display: none !important; }
.sidebar:hover .nav-group__items .nav-item,
.sidebar--expanded .nav-group__items .nav-item { padding: 8px 14px; font-size: 0.78rem; }

.sidebar:not(:hover):not(.sidebar--expanded) .sidebar-user-name,
.sidebar:not(:hover):not(.sidebar--expanded) .sidebar-user-role { display: none; }

.sidebar-footer {
  padding: var(--sp-3);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}
.sidebar:not(:hover):not(.sidebar--expanded) .sidebar-footer { justify-content: center; }
.sidebar:not(:hover):not(.sidebar--expanded) .sidebar-user-info { display: none; }
.sidebar:not(:hover):not(.sidebar--expanded) .sidebar-footer .btn-ghost { display: none; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
}

.sidebar-user .avatar {
  background: rgba(255, 255, 255, 0.15);
  color: var(--color-white);
  font-size: var(--font-size-xs);
  flex-shrink: 0;
}

.sidebar-user-info { min-width: 0; }

.sidebar-user-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: var(--font-size-xs);
  color: var(--color-gray-400);
  text-transform: capitalize;
}

.sidebar-footer .btn-ghost {
  color: var(--color-gray-400);
  flex-shrink: 0;
}
.sidebar-footer .btn-ghost:hover { color: var(--color-white); background: rgba(255, 255, 255, 0.08); }

/* ---------- Main Content ---------- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-collapsed-width);
  background: var(--color-gray-50);
  min-height: 100vh;
  overflow-x: hidden;
}

.page-container {
  max-width: none;
  padding: var(--sp-6);
  animation: page-fade-in 200ms ease;
  overflow-x: hidden;
}

@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Candidates page + profile uses full-bleed layout — no outer padding */
.page-container:has(.candidates-layout),
.page-container:has(.cand-profile) { padding: 0; }
/* Firefox <121 fallback — :has() not supported; JS adds this class */
.page-container.full-bleed { padding: 0; }

.page-header {
  margin-bottom: var(--sp-6);
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0F172A;
  letter-spacing: -0.02em;
}

.page-header .badge,
.page-header .count-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--color-gray-100);
  color: var(--color-gray-500);
}

/* ---------- Nav Icon ---------- */
.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ---------- Keyboard help overlay (press ?) ---------- */
.kb-help-overlay {
  position: fixed;
  inset: 0;
  z-index: 2300;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: kb-help-fade 150ms ease;
}
@keyframes kb-help-fade { from { opacity: 0; } to { opacity: 1; } }
.kb-help-box {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 560px;
  width: calc(100% - 32px);
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
}
.kb-help-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--color-gray-200);
}
.kb-help-head h2 { margin: 0; font-size: var(--font-size-lg); color: var(--color-primary); }
.kb-help-body {
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.kb-help-group-title {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-gray-500);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--sp-2);
}
.kb-help-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kb-help-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  font-size: var(--font-size-sm);
  padding: 4px 0;
}
.kb-help-keys {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}
.kb-key {
  display: inline-block;
  padding: 2px 8px;
  background: var(--color-gray-100);
  border: 1px solid var(--color-gray-300);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: var(--color-gray-700);
  min-width: 20px;
  text-align: center;
}
.kb-help-desc { color: var(--color-gray-700); text-align: right; }

/* ---------- Global omnibox (Cmd+Shift+F) ---------- */
.omni-overlay {
  position: fixed;
  inset: 0;
  z-index: 2200;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh var(--sp-4);
  animation: omni-fade 150ms ease;
}
@keyframes omni-fade { from { opacity: 0; } to { opacity: 1; } }
.omni-box {
  width: 100%;
  max-width: 640px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
}
.omni-input-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-gray-200);
}
.omni-icon {
  color: var(--color-gray-500);
  display: flex;
}
.omni-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: var(--font-size-lg);
  color: var(--color-gray-900);
  font-family: var(--font-family);
}
.omni-input::placeholder { color: var(--color-gray-400); font-size: var(--font-size-base); }
.omni-hint {
  font-size: 10px;
  color: var(--color-gray-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.omni-results {
  flex: 1;
  overflow-y: auto;
}
.omni-empty {
  padding: var(--sp-6);
  text-align: center;
  color: var(--color-gray-500);
  font-size: var(--font-size-sm);
}
.omni-group {
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--color-gray-100);
}
.omni-group:last-child { border-bottom: none; }
.omni-group-label {
  font-size: 10px;
  color: var(--color-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: var(--font-weight-semibold);
  padding: 6px var(--sp-4);
}
.omni-group-count {
  background: var(--color-gray-100);
  color: var(--color-gray-600);
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 4px;
}
.omni-item {
  padding: 8px var(--sp-4);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.1s;
}
.omni-item--selected {
  background: rgba(13, 148, 136, 0.08);
  border-left-color: var(--color-secondary);
}
.omni-item-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.omni-item-sub {
  font-size: var(--font-size-xs);
  color: var(--color-gray-500);
  margin-top: 2px;
}
@media (max-width: 640px) {
  .omni-box { max-width: 100%; max-height: 90vh; }
}

/* ---------- Call widget ---------- */
.call-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 320px;
  background: white;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  z-index: 2100;
  animation: call-in 200ms ease;
  overflow: hidden;
}
@keyframes call-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.call-widget-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-gray-200);
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.06), rgba(27, 42, 74, 0.03));
}
.call-widget-ident {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
}
.call-widget-name {
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  font-size: var(--font-size-sm);
}
.call-widget-phone {
  font-size: var(--font-size-xs);
  color: var(--color-gray-500);
}
.call-widget-banner {
  padding: 6px 14px;
  background: #FEF3C7;
  color: #92400E;
  font-size: var(--font-size-xs);
}
.call-widget-status {
  padding: 10px 14px 4px;
  font-size: var(--font-size-sm);
  color: var(--color-gray-700);
  text-align: center;
}
.call-widget-timer {
  padding: 0 14px;
  font-size: 28px;
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  text-align: center;
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.04em;
}
.call-widget-controls {
  display: flex;
  justify-content: center;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-3) var(--sp-4);
}
.call-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.call-btn--mute {
  background: var(--color-gray-100);
  color: var(--color-gray-700);
}
.call-btn--mute:hover { background: var(--color-gray-200); }
.call-btn--muted {
  background: var(--color-error) !important;
  color: white !important;
}
.call-btn--hangup {
  background: var(--color-error);
  color: white;
  transform: rotate(135deg);
}
.call-btn--hangup:hover {
  background: #C53030;
}

/* ---------- Notifications bell ---------- */
.sidebar-bell {
  position: relative;
}
.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--color-error);
  color: white;
  font-size: 9px;
  font-weight: var(--font-weight-bold);
  padding: 1px 5px;
  border-radius: 999px;
  line-height: 1.3;
  min-width: 16px;
  text-align: center;
}
.notif-dropdown {
  position: fixed;
  width: 340px;
  max-height: 480px;
  background: white;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
  z-index: 1800;
  display: flex;
  flex-direction: column;
  animation: notif-in 150ms ease;
  overflow-y: auto;
}
@keyframes notif-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.notif-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-gray-200);
}
.notif-head-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-900);
}
.notif-body {
  overflow-y: auto;
  flex: 1;
}
.notif-list {
  display: flex;
  flex-direction: column;
}
.notif-item {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--color-gray-100);
  text-align: left;
  cursor: pointer;
  align-items: flex-start;
  position: relative;
}
.notif-item:hover { background: var(--color-gray-50); }
.notif-item--read { opacity: 0.6; }
.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  position: absolute;
  top: 10px;
  left: 34px;
  z-index: 1;
  flex-shrink: 0;
}
.notif-dot--unread {
  background: var(--color-secondary);
  box-shadow: 0 0 0 2px white;
}
.notif-text { min-width: 0; flex: 1; }
.notif-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-900);
  line-height: 1.3;
}
.notif-body-text {
  font-size: var(--font-size-xs);
  color: var(--color-gray-600);
  margin-top: 2px;
  line-height: 1.4;
}
.notif-time {
  font-size: 10px;
  color: var(--color-gray-400);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.notif-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--color-gray-100);
  color: var(--color-gray-500);
}
.notif-icon--task_due { background: #FEF3C7; color: #D97706; }
.notif-icon--rule_fired { background: #E0F2FE; color: #0284C7; }
.notif-icon--reply_received { background: #D1FAE5; color: #059669; }
.notif-icon--event_soon { background: #EDE9FE; color: #7C3AED; }
.notif-icon--candidate_added { background: #ECFDF5; color: #0D9488; }
.notif-icon--candidate_applied { background: #DBEAFE; color: #2563EB; }
.notif-icon--onboarding_stage { background: #F3E8FF; color: #9333EA; }

/* Calendar → css/calendar.css */
/* Reports → css/reports.css */
/* Integrations -> css/integrations.css */
/* Jobs -> css/jobs.css */

/* Tag chip select -> css/pipeline.css */


/* Integrations overrides -> css/integrations.css */

/* Jobs overrides -> css/jobs.css */

/* Careers Upload + Jobs overrides -> css/jobs.css */

/* Import → css/imports.css */


/* Job Pipeline Grid -> css/jobs.css */
/* Job Kanban Grid -> css/jobs.css */
/* Pipeline View Toggle -> css/pipeline.css */
/* Pipeline Grid Cell -> css/pipeline.css */
/* Job Pipeline Dashboard -> css/dashboard.css */
/* Kanban -> css/pipeline.css */
/* ================================================================
   MOBILE — Premium Mobile Experience
   ================================================================ */

/* ---------- Mobile Bottom Navigation Bar ---------- */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 800;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  padding-bottom: var(--safe-area-bottom);
  height: calc(var(--mobile-nav-height) + var(--safe-area-bottom));
  align-items: stretch;
  justify-content: space-around;
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 4px;
  color: var(--color-gray-400);
  transition: color 0.2s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  min-height: 44px;
}

.mobile-nav-item:active { transform: scale(0.92); }

.mobile-nav-item--active {
  color: var(--color-secondary);
}

.mobile-nav-item--active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: var(--color-secondary);
  border-radius: 0 0 2px 2px;
}

.mobile-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.mobile-nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
}

/* ---------- More Menu Overlay ---------- */
.mobile-more-overlay {
  position: fixed;
  inset: 0;
  z-index: 850;
  pointer-events: none;
  visibility: hidden;
}

.mobile-more-overlay--open {
  pointer-events: auto;
  visibility: visible;
}

.mobile-more-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0);
  transition: background 0.3s ease;
}

.mobile-more-overlay--open .mobile-more-backdrop {
  background: rgba(15, 23, 42, 0.4);
}

.mobile-more-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
  background: var(--color-white);
  border-radius: 20px 20px 0 0;
  padding: var(--sp-2) var(--sp-5) var(--sp-4);
  padding-bottom: calc(var(--mobile-nav-height) + var(--safe-area-bottom) + var(--sp-4));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.12);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 80vh;
  max-height: 80dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-more-overlay--open .mobile-more-sheet {
  transform: translateY(0);
}

.mobile-more-handle {
  width: 36px;
  height: 4px;
  background: var(--color-gray-300);
  border-radius: 2px;
  margin: 4px auto 16px;
}

.mobile-more-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
}

.mobile-more-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 8px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--color-gray-700);
  transition: background 0.15s ease;
  min-height: 44px;
}

.mobile-more-item:hover,
.mobile-more-item:active {
  background: var(--color-gray-50);
  text-decoration: none;
}

.mobile-more-item--active {
  background: rgba(13, 148, 136, 0.08);
  color: var(--color-secondary);
}

.mobile-more-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-gray-50);
  border-radius: 12px;
}

.mobile-more-item--active .mobile-more-icon {
  background: rgba(13, 148, 136, 0.12);
}

.mobile-more-label {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.mobile-more-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--color-gray-100);
}

.mobile-more-user {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.mobile-more-user-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-900);
}

.mobile-more-user-role {
  font-size: var(--font-size-xs);
  color: var(--color-gray-500);
  text-transform: capitalize;
}

/* ---------- Mobile Notification Bell (hidden on desktop) ---------- */
.mobile-notif-bell {
  display: none;
  position: fixed;
  right: var(--sp-4);
  bottom: calc(var(--mobile-nav-height) + var(--safe-area-bottom) + var(--sp-3));
  z-index: 801;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mobile-notif-bell:active {
  transform: scale(0.92);
}
.mobile-notif-bell .notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
}

/* ---------- Mobile: 768px Breakpoint ---------- */
@media (max-width: 768px) {
  /* Show mobile bottom nav & notif bell, hide sidebar */
  .mobile-bottom-nav { display: flex; }
  .mobile-notif-bell { display: flex; }
  .sidebar { display: none !important; }
  .main-content { margin-left: 0 !important; padding-bottom: calc(var(--mobile-nav-height) + var(--safe-area-bottom)); }
  /* When candidates/vault layout is present, it handles its own height — remove parent padding */
  .main-content:has(.candidates-layout) { padding-bottom: 0 !important; }
  .page-container { padding: var(--sp-4) var(--sp-4) var(--sp-4); }
  body.mobile-more-open { overflow: hidden; }

  /* Prevent zoom on input focus (font-size >= 16px) */
  input, select, textarea { font-size: 16px !important; }
  .input, .select { font-size: 16px !important; }

  /* Global touch targets — min 44px */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 44px; }

  /* Prevent horizontal overflow on mobile — use clip (not hidden) to avoid suppressing inner scroll containers on WebKit */
  html, body { overflow-x: clip; }
  .main-content { overflow-x: hidden; }

  /* Page headers — stack vertically */
  .page-header { flex-direction: column; gap: var(--sp-2); align-items: stretch !important; }
  .page-header .flex { flex-wrap: wrap; gap: var(--sp-2); }
  .page-header h1 { font-size: var(--font-size-xl) !important; }

  /* All modals — full-screen on mobile */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100vw !important;
    width: 100vw !important;
    max-height: 95vh;
    max-height: 95dvh;
    margin: 0;
    border-radius: 20px 20px 0 0;
    animation: modal-slide-up 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  @keyframes modal-slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  /* Inline grids inside modals/drawers — collapse to single column on mobile */
  .modal [style*="grid-template-columns"],
  .cand-drawer [style*="grid-template-columns"],
  .hh-drawer [style*="grid-template-columns"],
  #sa-drawer [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  .modal-header { padding: var(--sp-4); }
  .modal-body { padding: var(--sp-4); overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
  .modal-footer {
    padding: var(--sp-3) var(--sp-4);
    padding-bottom: calc(var(--sp-3) + env(safe-area-inset-bottom, 0px));
    flex-wrap: wrap;
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 1px solid var(--color-gray-100);
    z-index: 2;
    flex-shrink: 0;
  }
  .modal-footer .btn { flex: 1; min-width: 0; }
  .modal .input, .modal .select, .modal .textarea { font-size: 16px; }

  /* Delete Pipeline — icon-only on mobile to reduce accidental taps */
  #delete-pipeline-btn { font-size: 0; padding: 6px; min-width: 40px; }
  #delete-pipeline-btn svg { font-size: initial; }

  /* All drawers — full screen */
  .cand-drawer,
  .hh-drawer {
    width: 100vw !important;
    min-width: 0 !important;
    border-radius: 0;
  }

  /* Toasts — bottom-center above nav, wider */
  .toast-container {
    top: auto !important;
    bottom: calc(var(--mobile-nav-height) + var(--safe-area-bottom) + var(--sp-3)) !important;
    left: var(--sp-3) !important;
    right: var(--sp-3) !important;
    max-width: none !important;
  }
  .toast { min-width: 0 !important; width: 100%; }

  /* Notification dropdown — position above bottom nav */
  .notif-dropdown {
    width: 90vw !important;
    left: 5vw !important;
    bottom: calc(var(--mobile-nav-height) + var(--safe-area-bottom) + var(--sp-2)) !important;
    top: auto !important;
    max-height: 60vh;
  }


  /* ---- Omnibox ---- */
  .omni-box { max-width: 100% !important; max-height: 90vh; }


  /* ---- Call Widget Mobile ---- */
  .call-widget {
    bottom: calc(var(--mobile-nav-height) + var(--safe-area-bottom) + var(--sp-3)) !important;
    width: calc(100vw - 2 * var(--sp-4)) !important;
    right: var(--sp-4) !important;
  }
  .call-widget .btn-sm { min-width: 44px; min-height: 44px; }
  .call-btn { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

  /* ---- Toast Mobile ---- */
  .toast { animation: toast-mobile-in 0.3s ease; }
  @keyframes toast-mobile-in {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* ---- Help Tooltips — show on tap via focus ---- */
  .help-tip { cursor: pointer; }
  .help-tip:focus::after,
  .help-tip:active::after {
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* ---- Omnibox Mobile ---- */
  .omni-overlay { padding-top: var(--sp-4); }
  .omni-box { max-height: 80vh; max-height: 80dvh; }
  .omni-item { min-height: 44px; display: flex; flex-direction: column; justify-content: center; }
  .omni-hint { display: none; }


  /* ---- Superadmin Mobile ---- */
  #sa-drawer {
    width: 100vw !important;
    height: 100dvh !important;
    height: 100vh !important;
  }
  #sa-drawer table { font-size: var(--font-size-xs); }
  #sa-drawer .sa-td { padding: var(--sp-2); }
  #sa-drawer [style*="display:flex"][style*="gap"] {
    flex-wrap: wrap;
  }
  /* SA page header — stack on mobile */
  .page-header[style*="padding"] {
    padding: var(--sp-4) !important;
  }
  /* SA customer table — horizontal scroll (card wrapping tables) */
  #sa-tab-customers .card,
  #sa-tab-demos .card,
  #sa-tab-activity .card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #sa-tab-customers table,
  #sa-tab-demos table,
  #sa-tab-activity table { min-width: 600px; }
  /* SA search + filter row — stack */
  #sa-tab-customers > div:first-child {
    flex-direction: column;
    align-items: stretch !important;
  }
  #sa-tab-customers > div:first-child .input,
  #sa-tab-customers > div:first-child select {
    max-width: 100% !important;
    width: 100% !important;
  }
  /* SA tabs — horizontal scroll, touch targets */
  .sa-tab { min-height: 44px; padding: var(--sp-3); white-space: nowrap; }
  /* SA impersonate banner — larger touch target */
  #sa-impersonate-banner button {
    min-height: 36px;
    padding: 6px 16px;
  }

  /* ---- Keyboard Help — full screen on mobile ---- */
  .kb-help-overlay { padding: var(--sp-3); }
  .kb-help-box { max-height: 85vh; max-height: 85dvh; overflow-y: auto; }
  .kb-help-body { overflow-y: auto; }
  .kb-key { padding: 4px 8px; }


  /* ---- More Menu Sheet — ensure bottom safe area ---- */
  .mobile-more-sheet {
    padding-bottom: calc(var(--sp-4) + var(--safe-area-bottom));
  }
}

/* ---------- Mobile: 480px Small Phone ---------- */
@media (max-width: 480px) {
  .page-container { padding: var(--sp-3); }


  .mobile-more-grid { grid-template-columns: repeat(3, 1fr); gap: var(--sp-1); }
  .mobile-more-item { padding: 12px 4px; }


}

/* Shared UI: Page Empty/Error State → css/ui.css */
/* Shared UI: Sync Banner → css/ui.css */
/* Shared UI: Setup Checklist → css/ui.css */

/* ========== Global Polish ========== */

/* Scrollbar — thin, subtle */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-gray-400); }

/* Selection colour */
::selection { background: rgba(13, 148, 136, 0.2); }

/* Focus rings — consistent teal */
*:focus-visible { outline: 2px solid var(--color-secondary, #0D9488); outline-offset: 2px; }
input:focus, select:focus, textarea:focus { border-color: var(--color-secondary, #0D9488); box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1); }

/* Card hover — subtle shadow lift */
.card { transition: box-shadow 0.2s ease, transform 0.2s ease; }
.card:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06); }

/* Button hover/active states */
.btn { transition: all 0.15s ease; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-secondary:hover:not(:disabled) { filter: brightness(1.05); }
.btn-ghost:hover:not(:disabled) { background: var(--color-gray-100); }

/* Table striping — very subtle */
.table tbody tr:nth-child(even) { background: rgba(248, 250, 252, 0.6); }
.table tbody tr:hover { background: rgba(241, 245, 249, 0.8); }

/* Dashboard Widgets -> css/dashboard.css */

