/* Nazoft CRM — unified professional interface layer.
   This file intentionally sits last so legacy screens share one visual language. */
:root {
  --pro-canvas: #f6f7f9;
  --pro-sidebar: #fbfbfc;
  --pro-surface: #ffffff;
  --pro-surface-subtle: #fafbfc;
  --pro-surface-blue: #f2f7ff;
  --pro-ink: #161a22;
  --pro-muted: #697386;
  --pro-faint: #9199a7;
  --pro-line: #e2e5ea;
  --pro-line-strong: #d3d8e0;
  --pro-blue: #2f80ed;
  --pro-blue-hover: #1e6fd9;
  --pro-blue-soft: #eaf3ff;
  --pro-green: #25845d;
  --pro-amber: #a76b16;
  --pro-red: #c44555;
  --pro-shadow-xs: 0 1px 2px rgba(16, 24, 40, .035);
  --pro-shadow-sm: 0 4px 14px rgba(16, 24, 40, .055);
  --pro-shadow-md: 0 18px 50px rgba(16, 24, 40, .14);
  --pro-radius-sm: 8px;
  --pro-radius: 11px;
  --pro-radius-lg: 14px;
  --pro-motion: 160ms cubic-bezier(.2, .8, .2, 1);
  --bg: var(--pro-canvas);
  --white: var(--pro-surface);
  --ink: var(--pro-ink);
  --muted: var(--pro-muted);
  --line: var(--pro-line);
  --blue: var(--pro-blue);
  --blue2: var(--pro-blue-soft);
  --shadow: var(--pro-shadow-sm);
}

html { color-scheme: light; background: var(--pro-canvas); }
body {
  background: var(--pro-canvas) !important;
  color: var(--pro-ink) !important;
  font-size: 13px !important;
  line-height: 1.45;
  letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { letter-spacing: inherit; }
button { -webkit-tap-highlight-color: transparent; }
::selection { background: #cfe3ff; color: #102b51; }

/* App frame */
.app, .app.sidebar-collapsed { background: var(--pro-canvas) !important; }
.app { grid-template-columns: 238px minmax(0, 1fr) !important; }
.side {
  width: 238px !important;
  padding: 18px 14px 16px !important;
  background: var(--pro-sidebar) !important;
  border-right: 1px solid var(--pro-line) !important;
  box-shadow: none !important;
}
.side > .brand {
  min-height: 52px;
  padding: 2px 8px 18px !important;
  gap: 10px;
  color: #2d3440 !important;
  font-size: 17px !important;
  font-weight: 780 !important;
  letter-spacing: -.025em;
}
.side > .brand .brand-logo { width: 31px !important; height: 31px !important; }
.nav { gap: 4px !important; }
.nav button {
  min-height: 42px !important;
  gap: 10px !important;
  padding: 9px 11px !important;
  border: 1px solid transparent !important;
  border-radius: 9px !important;
  background: transparent !important;
  color: #444b57 !important;
  font-weight: 650 !important;
  box-shadow: none !important;
  transition: color var(--pro-motion), background var(--pro-motion), border-color var(--pro-motion), transform var(--pro-motion) !important;
}
.nav button .nav-icon { width: 18px !important; height: 18px !important; color: #646d7b; stroke-width: 1.75 !important; }
.nav button:hover { border-color: #e1e8f1 !important; background: #f2f6fb !important; color: #1d5fae !important; transform: none !important; }
.nav button.active {
  border-color: #cfe1fa !important;
  background: #e8f2ff !important;
  color: #1768c7 !important;
  box-shadow: inset 3px 0 0 #2f80ed !important;
}
.nav button.active .nav-icon { color: #2374d5 !important; }
.side .profile {
  position: relative;
  margin: auto 0 0 !important;
  padding: 14px 7px 2px !important;
  border-top: 1px solid var(--pro-line) !important;
  gap: 9px !important;
}
.avatar, #profileAvatar {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  flex-basis: 34px !important;
  border: 1px solid #cfe0f6;
  background: #e6f1ff !important;
  color: #2369be !important;
  font-size: 11px !important;
  box-shadow: none !important;
}
.profile b { color: #252b35; font-size: 12px; }
.profile small { max-width: 122px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.profile-settings { width: 30px !important; height: 30px !important; border-radius: 8px !important; }
.sidebar-toggle {
  left: 199px !important;
  top: 22px !important;
  width: 29px !important;
  height: 29px !important;
  border: 1px solid var(--pro-line-strong) !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: var(--pro-shadow-xs) !important;
}
.sidebar-collapsed { grid-template-columns: 76px minmax(0, 1fr) !important; }
.sidebar-collapsed .side { width: 76px !important; }
.sidebar-collapsed .sidebar-toggle { left: 60px !important; }

/* Header and global actions */
.top {
  height: 66px !important;
  padding: 0 clamp(20px, 2.2vw, 38px) !important;
  gap: 10px !important;
  background: rgba(255, 255, 255, .92) !important;
  border-bottom: 1px solid var(--pro-line) !important;
  backdrop-filter: blur(16px) saturate(1.1);
}
.top .search { max-width: 460px !important; }
.search input, .top .search input {
  min-height: 40px !important;
  padding: 8px 40px 8px 35px !important;
  border: 1px solid var(--pro-line-strong) !important;
  border-radius: 9px !important;
  background: #fff !important;
  color: var(--pro-ink) !important;
  box-shadow: var(--pro-shadow-xs) !important;
}
.search::before { top: 4px !important; left: 12px !important; color: #8792a2 !important; font-size: 20px !important; }
.search input::placeholder, input::placeholder, textarea::placeholder { color: #939caa !important; opacity: 1; }
.smartfind-shortcut {
  right: 8px !important;
  padding: 3px 5px !important;
  border-color: #dde2e9 !important;
  border-radius: 5px !important;
  background: #f6f7f9 !important;
  color: #8b94a2 !important;
  font-size: 9px !important;
  box-shadow: none !important;
}
.top-actions { gap: 7px !important; }

/* Page rhythm */
.main { background: var(--pro-canvas) !important; }
.content {
  width: 100%;
  max-width: 1680px !important;
  padding: clamp(22px, 2.2vw, 36px) clamp(22px, 2.5vw, 42px) 46px !important;
}
.head {
  align-items: center !important;
  margin-bottom: 20px !important;
  gap: 18px !important;
}
.head h1, #today .dashboard-hero h1 {
  margin: 2px 0 3px !important;
  color: #151922 !important;
  font-size: clamp(24px, 1.8vw, 31px) !important;
  font-weight: 760 !important;
  line-height: 1.12 !important;
  letter-spacing: -.035em !important;
}
.head p { color: var(--pro-muted) !important; font-size: 13px; }
.eyebrow, .login-eyebrow {
  color: #2671c9 !important;
  font-size: 9px !important;
  font-weight: 800 !important;
  letter-spacing: .13em !important;
}
.head .actions { align-items: center; gap: 7px !important; }

/* Unified controls */
.btn, .control, .pretty-select-trigger, .date-trigger,
.filterbox input, .filterbox select, .field input, .field select, .field textarea,
.note-compose textarea {
  border: 1px solid var(--pro-line-strong) !important;
  border-radius: 9px !important;
  background: #fff !important;
  color: #2b313b !important;
  box-shadow: var(--pro-shadow-xs) !important;
}
.btn {
  min-height: 38px !important;
  padding: 8px 12px !important;
  font-size: 12px !important;
  font-weight: 680 !important;
  transition: color var(--pro-motion), background var(--pro-motion), border-color var(--pro-motion), box-shadow var(--pro-motion), transform var(--pro-motion) !important;
}
.btn.small { min-height: 32px !important; padding: 6px 9px !important; font-size: 11px !important; }
.btn:hover {
  border-color: #b9c7d8 !important;
  background: #f8fafc !important;
  color: #155cae !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 9px rgba(30, 54, 83, .07) !important;
}
.btn:active { transform: translateY(0) scale(.985) !important; }
.btn.primary {
  border-color: #2f80ed !important;
  background: #2f80ed !important;
  color: #fff !important;
  box-shadow: 0 3px 9px rgba(47, 128, 237, .2) !important;
}
.btn.primary:hover { border-color: #1e6fd9 !important; background: #1e6fd9 !important; color: #fff !important; }
.btn.soft { border-color: #cfe1f8 !important; background: #eef6ff !important; color: #2467b5 !important; }
.btn.danger { border-color: #efcbd1 !important; background: #fff !important; color: #b8394b !important; }
.btn.danger:hover { background: #fff4f5 !important; }
.control { height: 38px !important; min-width: 140px !important; font-size: 12px; }
.pretty-select-trigger, .date-trigger { min-height: 38px !important; padding: 8px 10px !important; font-size: 12px; font-weight: 650 !important; }
.pretty-select-trigger .chevron { width: 19px !important; height: 19px !important; border-radius: 6px !important; background: #f1f5fa !important; font-size: 10px !important; }
.pretty-select-menu {
  padding: 5px !important;
  border-color: var(--pro-line) !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: 0 14px 38px rgba(16, 24, 40, .14) !important;
}
.pretty-select-option { min-height: 36px; padding: 8px 9px !important; border-radius: 7px !important; font-size: 12px; font-weight: 620 !important; }
.pretty-select-option:hover, .pretty-select-option:focus-visible { background: #f3f6fa !important; color: #195fae !important; }
.pretty-select-option.selected { background: #eaf3ff !important; color: #1965bc !important; }
.btn:focus-visible, .nav button:focus-visible, .pretty-select-trigger:focus-visible, .date-trigger:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 0 !important;
  border-color: #68a4f3 !important;
  box-shadow: 0 0 0 3px rgba(47, 128, 237, .14) !important;
}
.close {
  width: 32px !important;
  height: 32px !important;
  border: 1px solid #e0e4ea !important;
  border-radius: 9px !important;
  background: #f7f8fa !important;
  color: #687386 !important;
  box-shadow: none !important;
}
.close:hover { background: #eef2f6 !important; color: #303844 !important; transform: none !important; }

/* Cards and dashboards */
.metric, .panel, .taskbox, .contentcard, .settings-menu, .settings-pane,
.activity-kpi, .dashboard-metric, .inbox-card, .admin-card, .security-card,
.lead-form-card, .filterbox, .deal, .column {
  border: 1px solid var(--pro-line) !important;
  border-radius: var(--pro-radius-lg) !important;
  background: var(--pro-surface) !important;
  box-shadow: var(--pro-shadow-xs) !important;
}
.metrics, .dashboard-metrics { gap: 12px !important; }
.metric, .dashboard-metric { min-height: 108px !important; padding: 16px 17px !important; }
.metric label, .dashboard-metric label { color: #727c8c !important; font-size: 11px !important; font-weight: 580 !important; }
.metric strong, .dashboard-metric strong { margin-top: 4px !important; color: #171b23 !important; font-size: clamp(23px, 1.65vw, 29px) !important; font-weight: 720 !important; letter-spacing: -.035em; }
.metric em, .dashboard-metric em { font-size: 10px !important; font-weight: 560; }
.grid2, .dashboard-grid { gap: 14px !important; }
.panel { padding: 17px !important; }
.panel h2, .taskhead { color: #20252e !important; font-size: 15px !important; font-weight: 720 !important; letter-spacing: -.02em; }
.taskbox { overflow: hidden; }
.taskhead { padding: 12px 14px !important; background: #fff; }
.task { padding: 12px 14px !important; border-color: #eceef2 !important; }
.ico { width: 32px !important; height: 32px !important; border-radius: 9px !important; background: #edf5ff !important; color: #2872c9 !important; }
.assigned-summary, .dashboard-assigned-summary { border-radius: 11px !important; background: #f4f8fd !important; border-color: #dae6f4 !important; }

/* Tabs, toolbars, and filters */
.tabs, .report-tabs { gap: 4px !important; border-color: var(--pro-line) !important; }
.tabs button, .report-tabs button {
  min-height: 38px;
  padding: 8px 10px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #6e7787 !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  box-shadow: inset 0 -2px transparent;
}
.tabs button:hover, .report-tabs button:hover { color: #1f65b4 !important; background: transparent !important; transform: none !important; }
.tabs button.active, .report-tabs button.active {
  border-color: transparent !important;
  background: transparent !important;
  color: #1768c7 !important;
  box-shadow: inset 0 -2px #2f80ed !important;
}
.toolbar { min-height: 42px; gap: 7px !important; margin-bottom: 12px !important; }
.filterbox { gap: 8px !important; padding: 10px !important; margin-bottom: 12px !important; background: rgba(255, 255, 255, .9) !important; }
.filterbox .pretty-select-trigger, .filterbox > input, .filterbox select { min-height: 36px !important; font-size: 11px !important; }
.commandbar { border-color: #d7e4f4 !important; border-radius: 10px !important; background: #f2f7fd !important; }

/* Data tables */
.table-scroll {
  overflow: auto;
  padding: 0 !important;
  border-radius: var(--pro-radius-lg) !important;
  background: #fff !important;
}
.table { border-collapse: separate !important; border-spacing: 0 !important; }
.table th {
  height: 42px;
  padding: 10px 12px !important;
  border-bottom: 1px solid var(--pro-line) !important;
  background: #fafbfc !important;
  color: #737d8d !important;
  font-size: 9px !important;
  font-weight: 760 !important;
  letter-spacing: .08em !important;
}
.table td {
  min-height: 52px;
  padding: 11px 12px !important;
  border-bottom: 1px solid #eceef2 !important;
  color: #2c323c;
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0 !important; }
.table tbody tr:hover td { background: #f7fafe !important; }
.table tbody tr:focus-within td { background: #f2f7fd !important; }
.table td b { color: #20252e; font-weight: 680; }
.pill, .source, .status, .temperature, .score-badge, .role-badge {
  border-radius: 999px !important;
  padding: 4px 8px !important;
  font-size: 9px !important;
  font-weight: 720 !important;
  box-shadow: none !important;
}

/* Pipeline */
.pipeline-head { margin-bottom: 10px !important; }
.pipeline-head .eyebrow { margin-bottom: 4px; }
.pipeline-toolbar { min-height: 36px !important; margin-bottom: 8px !important; }
.pipeline-filters {
  grid-template-columns: repeat(8, minmax(112px, 1fr)) !important;
  padding: 7px !important;
  border-radius: 11px !important;
  box-shadow: none !important;
}
.pipeline-filters .pretty-select-trigger, .pipeline-filters > input {
  min-height: 34px !important;
  border-radius: 8px !important;
  background: #fff !important;
}
#pipeline .boardwrap { margin-inline: -2px; padding: 3px 2px 12px !important; }
#pipeline .board { gap: 9px !important; }
#pipeline .column {
  min-height: clamp(520px, calc(100dvh - 254px), 820px) !important;
  padding: 8px !important;
  border-radius: 12px !important;
  background: #f9fafc !important;
  box-shadow: none !important;
}
.colhead { padding: 4px 3px 10px !important; color: #29303a; font-size: 12px; }
.colhead .dot { width: 6px !important; height: 6px !important; }
.count { border-color: #e0e4ea !important; background: #fff !important; }
.deal {
  padding: 11px !important;
  border-radius: 10px !important;
  background: #fff !important;
  transition: border-color var(--pro-motion), box-shadow var(--pro-motion), transform var(--pro-motion) !important;
}
.deal:hover { border-color: #b8d1ef !important; box-shadow: 0 7px 20px rgba(27, 70, 120, .08) !important; transform: translateY(-1px); }
.deal h3 { font-size: 12px !important; font-weight: 690 !important; }
.deal .value { margin: 8px 0 !important; }
.column.over { border-color: #73a9ee !important; background: #eef6ff !important; box-shadow: inset 0 0 0 1px #73a9ee !important; }

/* Library, activities, and settings */
.cards { gap: 11px !important; }
.contentcard { padding: 15px !important; transition: border-color var(--pro-motion), box-shadow var(--pro-motion), transform var(--pro-motion); }
.contentcard:hover { border-color: #c2d5ec !important; box-shadow: var(--pro-shadow-sm) !important; transform: translateY(-1px); }
.contentcard h3 { color: #20252e; font-size: 14px; }
.timeline { max-width: none !important; }
.timeline-item { border-left-color: #dbe6f4 !important; }
.timeline-item::before { background: #5b95dc !important; box-shadow: 0 0 0 3px #edf5ff; }
.settings-layout { grid-template-columns: 226px minmax(0, 1fr) !important; gap: 12px !important; }
.settings-menu { padding: 7px !important; border-radius: 12px !important; }
.settings-menu .group { padding: 12px 10px 5px !important; color: #979fab !important; font-size: 8px !important; }
.settings-menu button {
  min-height: 36px !important;
  padding: 8px 9px !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #5f6979 !important;
  font-size: 11px !important;
  font-weight: 640 !important;
  box-shadow: none !important;
}
.settings-menu button:hover { background: #f3f6fa !important; color: #2365b1 !important; transform: none !important; }
.settings-menu button.active { border-color: #d7e5f7 !important; background: #eaf3ff !important; color: #1965bc !important; box-shadow: none !important; }
.settings-pane { padding: 18px !important; border-radius: 12px !important; }
.setting-row { padding: 12px 0 !important; border-color: #eceef2 !important; }
.choice-card { border-color: var(--pro-line) !important; border-radius: 9px !important; background: #fff !important; }
.choice-card:hover { border-color: #c4d7ee !important; background: #f7fafe !important; transform: none !important; }
.choice-card:has(input:checked) { border-color: #a9c8ef !important; background: #eef6ff !important; }

/* Overlays */
body:has(.modal.open)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 129;
  background: rgba(31, 40, 52, .28);
  -webkit-backdrop-filter: blur(4px) saturate(.92);
  backdrop-filter: blur(4px) saturate(.92);
  animation: modal-backdrop-in .16s ease-out both;
}
@keyframes modal-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
html[data-theme="dark"] body:has(.modal.open)::before {
  background: rgba(3, 8, 15, .48);
}
.drawer-backdrop {
  background: rgba(31, 40, 52, .48) !important;
  backdrop-filter: blur(3px) saturate(.8) !important;
}
.modal, .drawer {
  border: 1px solid rgba(216, 221, 228, .95) !important;
  background: #fff !important;
  color: var(--pro-ink) !important;
  box-shadow: var(--pro-shadow-md) !important;
}
.modal {
  padding: 21px !important;
  border-radius: 15px !important;
}
.drawer {
  padding: 20px !important;
  border-radius: 15px 0 0 15px !important;
}
.modalhead { margin-bottom: 15px !important; padding-bottom: 13px !important; border-bottom: 1px solid #eceef2 !important; }
.modalhead h2 { color: #191e27; font-size: 19px; font-weight: 730; letter-spacing: -.03em; }
.drawer .panel { border-radius: 12px !important; box-shadow: none !important; }
.drawer .btn, .drawer .close, .drawer .pretty-select-trigger, .drawer .date-trigger { border-radius: 9px !important; }
.drawer .btn:hover, .drawer .close:hover { box-shadow: var(--pro-shadow-xs) !important; }
.formgrid { gap: 12px !important; }
.field { gap: 5px !important; }
.field label { color: #3b424e; font-size: 10px !important; font-weight: 700 !important; }
.field input, .field select, .field textarea { min-height: 40px; padding: 9px 10px !important; }
.currency-input { grid-template-columns: 58px minmax(0, 1fr) !important; min-height: 46px; }
.currency-input > span { align-self: stretch; display: flex; align-items: center; justify-content: center; padding: 0 12px !important; border-right: 1px solid var(--pro-line); background: color-mix(in srgb, var(--pro-blue-soft) 45%, transparent); }
.currency-input input { width: 100%; min-width: 0; min-height: 44px; padding: 9px 14px !important; }
.actions-end { gap: 7px !important; padding-top: 4px; }
.toast {
  border: 1px solid #c8d9ee !important;
  border-radius: 10px !important;
  background: rgba(250, 252, 255, .98) !important;
  color: #234f82 !important;
  box-shadow: 0 16px 38px rgba(26, 56, 90, .16) !important;
}
.notification-button { width: 40px !important; height: 40px !important; border-radius: 9px !important; }
.notification-popover, .account-menu { border-radius: 12px !important; border-color: var(--pro-line) !important; box-shadow: var(--pro-shadow-md) !important; }

/* Every icon and icon-label pair shares the same optical centering rules. */
.btn, button.pretty-select-trigger, button.date-trigger,
.notification-button, .sidebar-toggle, .profile-settings, .close,
.smart-result-icon, .dash-icon, .activity-icon, .ico, .notification-item-icon {
  align-items: center !important;
  justify-content: center !important;
}
.btn, button.pretty-select-trigger, button.date-trigger { display: inline-flex !important; gap: 7px; }
.notification-button, .sidebar-toggle, .profile-settings, .close,
.smart-result-icon, .dash-icon, .activity-icon, .ico, .notification-item-icon {
  display: inline-grid !important;
  place-items: center !important;
  line-height: 1 !important;
}
.ui-icon, button > svg, .nav-icon {
  display: block !important;
  flex: 0 0 auto;
  margin: 0 !important;
  transform: none;
}
.notification-button { position: relative !important; padding: 0 !important; }
.notification-button > .ui-icon { grid-area: 1 / 1; width: 18px !important; height: 18px !important; }
.notification-badge { line-height: 1 !important; }
#leadMenu .btn { justify-content: flex-start !important; }

/* The collapse control belongs to the global header, directly beside SmartFind. */
.top > .sidebar-toggle,
.sidebar-collapsed .top > .sidebar-toggle {
  position: relative !important;
  inset: auto !important;
  left: auto !important;
  top: auto !important;
  z-index: 1 !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px;
  flex: 0 0 40px;
  border-radius: 9px !important;
  transform: none !important;
}
.top > .sidebar-toggle.is-collapsed { transform: none !important; }
.top > .sidebar-toggle .sidebar-toggle-icon { display: grid; place-items: center; gap: 3px; width: 17px; height: 17px; }
.top > .sidebar-toggle .sidebar-toggle-icon > span { width: 15px; margin: 0; }

/* Numeric qualification is centered with its table heading. */
#leads .table th:nth-child(5), #leads #leadRows td:nth-child(5) { text-align: center !important; }
#leads #leadRows td:nth-child(5) .score-badge { display: flex !important; width: max-content; margin-inline: auto; }
#leads #leadRows td:nth-child(5) .score-note { text-align: center; }

/* Lead overflow actions stay visually quiet until the user points at one. */
html:not([data-theme="dark"]) #leadMenu {
  padding: 5px !important;
  border-color: var(--pro-line) !important;
  border-radius: 11px !important;
  background: #fff !important;
  box-shadow: 0 14px 36px rgba(16, 24, 40, .14) !important;
}
html:not([data-theme="dark"]) #leadMenu .btn,
html:not([data-theme="dark"]) #leadMenu .btn.danger {
  min-height: 38px !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: #3d4653 !important;
  box-shadow: none !important;
  transform: none !important;
}
html:not([data-theme="dark"]) #leadMenu .btn:hover {
  background: #f1f6fc !important;
  color: #155fae !important;
}
html:not([data-theme="dark"]) #leadMenu .btn.danger:hover {
  background: #fff1f3 !important;
  color: #b83246 !important;
}
.drawer-context-row { margin: 16px 0 0 !important; padding-top: 13px; border-top: 1px solid #eceef2; }
.drawer-context-row .btn { margin-left: 4px; }
.drawer-context-help { display: block; max-width: 390px; margin-top: 6px; color: var(--pro-muted); font-size: 10px; line-height: 1.45; }
html[data-theme="dark"] #leadMenu .btn { background: transparent !important; color: #c5ccd5 !important; box-shadow: none !important; }
html[data-theme="dark"] #leadMenu .btn:hover { background: #202934 !important; color: #9fc7f7 !important; }
html[data-theme="dark"] #leadMenu .btn.danger:hover { background: #351d23 !important; color: #f09aa7 !important; }
html[data-theme="dark"] .drawer-context-row { border-color: var(--pro-line); }

/* Dark theme receives the same hierarchy instead of a separate component language. */
html[data-theme="dark"] {
  color-scheme: dark;
  --pro-canvas: #101318;
  --pro-sidebar: #14181e;
  --pro-surface: #191e25;
  --pro-surface-subtle: #1d232b;
  --pro-surface-blue: #17283d;
  --pro-ink: #eef1f5;
  --pro-muted: #9ba5b3;
  --pro-faint: #747e8d;
  --pro-line: #2c333d;
  --pro-line-strong: #3a424d;
  --pro-blue: #69a7f4;
  --pro-blue-hover: #83b7f6;
  --pro-blue-soft: #172b44;
  --bg: var(--pro-canvas);
  --ink: var(--pro-ink);
  --muted: var(--pro-muted);
  --line: var(--pro-line);
  --blue: var(--pro-blue);
  --blue2: var(--pro-blue-soft);
}
html[data-theme="dark"] body, html[data-theme="dark"] .app, html[data-theme="dark"] .main,
html[data-theme="dark"] .content { background: var(--pro-canvas) !important; color: var(--pro-ink) !important; }
html[data-theme="dark"] .side, html[data-theme="dark"] .top { background: rgba(20, 24, 30, .96) !important; border-color: var(--pro-line) !important; }
html[data-theme="dark"] .nav button { color: #bac2cd !important; }
html[data-theme="dark"] .nav button:hover { background: #1c2632 !important; }
html[data-theme="dark"] .nav button.active { border-color: #29476a !important; background: #172b44 !important; color: #8ebdf7 !important; }
html[data-theme="dark"] .metric, html[data-theme="dark"] .panel, html[data-theme="dark"] .taskbox,
html[data-theme="dark"] .contentcard, html[data-theme="dark"] .settings-menu, html[data-theme="dark"] .settings-pane,
html[data-theme="dark"] .activity-kpi, html[data-theme="dark"] .dashboard-metric, html[data-theme="dark"] .filterbox,
html[data-theme="dark"] .deal, html[data-theme="dark"] .modal, html[data-theme="dark"] .drawer,
html[data-theme="dark"] .table-scroll { border-color: var(--pro-line) !important; background: var(--pro-surface) !important; color: var(--pro-ink) !important; }
html[data-theme="dark"] .column { border-color: var(--pro-line) !important; background: #151a20 !important; }
html[data-theme="dark"] .btn, html[data-theme="dark"] .control, html[data-theme="dark"] .pretty-select-trigger,
html[data-theme="dark"] .date-trigger, html[data-theme="dark"] input, html[data-theme="dark"] select,
html[data-theme="dark"] textarea { border-color: var(--pro-line-strong) !important; background: #171c23 !important; color: var(--pro-ink) !important; }
html[data-theme="dark"] .btn:hover { background: #202731 !important; color: #9fc7f7 !important; }
html[data-theme="dark"] .btn.primary { border-color: #4b90e5 !important; background: #397fcf !important; color: #fff !important; }
html[data-theme="dark"] .head h1, html[data-theme="dark"] .panel h2, html[data-theme="dark"] .metric strong,
html[data-theme="dark"] .dashboard-metric strong, html[data-theme="dark"] .modalhead h2 { color: var(--pro-ink) !important; }
html[data-theme="dark"] .table th { border-color: var(--pro-line) !important; background: #15191f !important; color: #9da7b5 !important; }
html[data-theme="dark"] .table td { border-color: #282f38 !important; color: #d8dde5; }
html[data-theme="dark"] .table tbody tr:hover td { background: #1d242d !important; }

/* Responsive behavior */
@media (max-width: 1280px) {
  .content { padding-inline: 24px !important; }
  .metrics { grid-template-columns: repeat(2, minmax(180px, 1fr)) !important; }
  .dashboard-metrics { grid-template-columns: repeat(3, minmax(170px, 1fr)) !important; }
  .pipeline-filters { grid-template-columns: repeat(4, minmax(130px, 1fr)) !important; }
}
@media (max-width: 980px) {
  .app, .app.sidebar-collapsed { grid-template-columns: minmax(0, 1fr) !important; }
  .side, .sidebar-toggle { display: none !important; }
  .settings-layout { grid-template-columns: 1fr !important; }
  .settings-menu { display: flex !important; gap: 4px !important; overflow-x: auto; }
  .settings-menu .group { display: none !important; }
  .settings-menu button { width: auto !important; flex: 0 0 auto; white-space: nowrap; }
}
@media (max-width: 720px) {
  .top { min-height: 66px !important; height: auto !important; padding: 10px 14px !important; flex-wrap: wrap; }
  .top .search { order: 2; max-width: none !important; flex-basis: 100%; }
  .content { padding: 18px 14px 88px !important; }
  .head { align-items: flex-start !important; flex-direction: column; }
  .head .actions { width: 100%; margin-left: 0 !important; display: grid !important; grid-template-columns: 1fr 1fr; }
  .head .actions > * { width: 100%; }
  .metrics, .dashboard-metrics, .activity-grid, .cards { grid-template-columns: 1fr !important; }
  .pipeline-filters { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .toolbar { align-items: stretch !important; flex-wrap: wrap; }
  .toolbar > *, .toolbar .search, .toolbar .control-group { max-width: none !important; }
  .formgrid { grid-template-columns: 1fr !important; }
  .mobile { background: rgba(255, 255, 255, .97) !important; border-color: var(--pro-line) !important; box-shadow: 0 -8px 28px rgba(16, 24, 40, .09) !important; }
  .mobile button { border-radius: 8px !important; }
  .mobile button.active { background: #eaf3ff !important; color: #1965bc !important; }
}
@media (max-width: 460px) {
  .head .actions { grid-template-columns: 1fr; }
  .pipeline-filters { grid-template-columns: 1fr !important; }
  .modal, .drawer { border-radius: 0 !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Buttons retain their color identity through hover, press, and keyboard focus. */
html:not([data-theme="dark"]) body .btn:not(.primary):not(.danger):hover,
html:not([data-theme="dark"]) body .btn:not(.primary):not(.danger):active,
html:not([data-theme="dark"]) body .btn:not(.primary):not(.danger)[aria-expanded="true"],
html:not([data-theme="dark"]) body .sidebar-toggle:hover,
html:not([data-theme="dark"]) body .sidebar-toggle:active,
html:not([data-theme="dark"]) body .notification-button:hover,
html:not([data-theme="dark"]) body .notification-button:active,
html:not([data-theme="dark"]) body .profile-settings:hover,
html:not([data-theme="dark"]) body .profile-settings:active,
html:not([data-theme="dark"]) body .pretty-select-trigger:hover,
html:not([data-theme="dark"]) body .pretty-select-trigger:active,
html:not([data-theme="dark"]) body .date-trigger:hover,
html:not([data-theme="dark"]) body .date-trigger:active {
  border-color: #b9d2f1 !important;
  background: #e7f1fd !important;
  color: #1f61aa !important;
  box-shadow: 0 3px 10px rgba(39, 94, 158, .1) !important;
}
html:not([data-theme="dark"]) body .btn.primary:hover,
html:not([data-theme="dark"]) body .btn.primary:active,
html:not([data-theme="dark"]) body .btn.primary:focus-visible {
  border-color: #1e6fd9 !important;
  background: #1e6fd9 !important;
  color: #fff !important;
  box-shadow: 0 5px 14px rgba(31, 105, 192, .24) !important;
}
html:not([data-theme="dark"]) body .btn.primary:active { background: #195fbc !important; transform: translateY(0) scale(.985) !important; }
html:not([data-theme="dark"]) body .btn.soft:hover,
html:not([data-theme="dark"]) body .btn.soft:active {
  border-color: #aac9ee !important;
  background: #deedff !important;
  color: #195da9 !important;
}
html:not([data-theme="dark"]) body .btn.danger:hover,
html:not([data-theme="dark"]) body .btn.danger:active {
  border-color: #e9b7c0 !important;
  background: #fff0f2 !important;
  color: #b52e43 !important;
}
html:not([data-theme="dark"]) body .nav button:hover,
html:not([data-theme="dark"]) body .settings-menu button:hover,
html:not([data-theme="dark"]) body .mobile button:hover {
  background: #e7f1fd !important;
  color: #1f61aa !important;
}
html[data-theme="dark"] body .btn:hover,
html[data-theme="dark"] body .btn:active,
html[data-theme="dark"] body .pretty-select-trigger:hover,
html[data-theme="dark"] body .date-trigger:hover,
html[data-theme="dark"] body .sidebar-toggle:hover,
html[data-theme="dark"] body .notification-button:hover {
  border-color: #3b5879 !important;
  background: #1d3047 !important;
  color: #a8cdf7 !important;
}
html[data-theme="dark"] body .btn.primary:hover,
html[data-theme="dark"] body .btn.primary:active {
  border-color: #65a4ed !important;
  background: #397fcf !important;
  color: #fff !important;
}

/* Refined shell interactions and a full desktop-style navigation drawer on mobile. */
html:not([data-theme="dark"]) body .btn.primary {
  border-color: #7fa9df !important;
  background: #82ade5 !important;
  color: #fff !important;
  box-shadow: 0 6px 15px rgba(74, 123, 186, .17) !important;
  transition: background-color .22s cubic-bezier(.22, .61, .36, 1), border-color .22s cubic-bezier(.22, .61, .36, 1), box-shadow .22s cubic-bezier(.22, .61, .36, 1), transform .22s cubic-bezier(.22, .61, .36, 1) !important;
}
html:not([data-theme="dark"]) body .btn.primary:hover,
html:not([data-theme="dark"]) body .btn.primary:focus-visible {
  border-color: #74a2dc !important;
  background: #76a6e1 !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(74, 123, 186, .2) !important;
  transform: translateY(-1px) !important;
}
html:not([data-theme="dark"]) body .btn.primary:active {
  border-color: #6e9bd5 !important;
  background: #70a0da !important;
  box-shadow: 0 3px 9px rgba(74, 123, 186, .18) !important;
  transform: translateY(0) scale(.985) !important;
}

#pipelineDescription {
  display: block;
  margin-top: 4px !important;
  color: #68758a;
  font-size: 12px;
}

.sidebar-collapsed .side .profile {
  width: 100%;
  min-height: 58px;
  margin-inline: 0 !important;
  padding: 13px 0 2px !important;
  justify-content: center !important;
  gap: 0 !important;
}
.sidebar-collapsed .side .profile > #profileAvatar {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  flex: 0 0 36px !important;
  aspect-ratio: 1;
  border-radius: 50% !important;
}
.sidebar-collapsed .side .profile > .grow,
.sidebar-collapsed .side .profile > .profile-settings {
  display: none !important;
}

.mobile-sidebar-backdrop,
.mobile-sidebar-close { display: none; }

@media (max-width: 980px) {
  .app, .app.sidebar-collapsed { grid-template-columns: minmax(0, 1fr) !important; }
  .top > .sidebar-toggle,
  .sidebar-collapsed .top > .sidebar-toggle { display: inline-grid !important; }
  .mobile { display: none !important; }
  body.mobile-sidebar-open { overflow: hidden; }
  .side,
  .sidebar-collapsed .side {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    z-index: 160 !important;
    display: flex !important;
    width: min(286px, 86vw) !important;
    height: 100dvh !important;
    padding: max(16px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom)) !important;
    background: #f4f7fb !important;
    box-shadow: 22px 0 56px rgba(18, 35, 58, .18) !important;
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform .24s cubic-bezier(.22, .61, .36, 1), visibility .24s step-end !important;
    overflow-y: auto;
  }
  body.mobile-sidebar-open .side {
    transform: translateX(0);
    visibility: visible;
    transition: transform .24s cubic-bezier(.22, .61, .36, 1), visibility 0s step-start !important;
  }
  .mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 150;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(29, 42, 59, .34);
    -webkit-backdrop-filter: blur(3px) saturate(.92);
    backdrop-filter: blur(3px) saturate(.92);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s step-end;
  }
  body.mobile-sidebar-open .mobile-sidebar-backdrop {
    display: block;
    opacity: 1;
    visibility: visible;
    transition: opacity .2s ease, visibility 0s step-start;
  }
  .side > .brand,
  .sidebar-collapsed .side > .brand {
    position: relative;
    justify-content: flex-start !important;
    gap: 10px !important;
    padding: 6px 46px 20px 10px !important;
    overflow: visible !important;
  }
  .side > .brand .sidebar-wordmark,
  .sidebar-collapsed .side > .brand .sidebar-wordmark {
    display: block !important;
    width: 126px !important;
    max-width: 126px !important;
    flex: 0 1 126px !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .mobile-sidebar-close {
    position: absolute;
    top: 7px;
    right: 6px;
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid #d4e1f0;
    border-radius: 10px;
    background: #fff;
    color: #315f9c;
    font-size: 25px;
    line-height: 1;
    transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
  }
  .mobile-sidebar-close:hover { border-color: #bad0ea; background: #eaf3ff; transform: scale(1.03); }
  .sidebar-collapsed .side .nav button,
  .side .nav button {
    justify-content: flex-start !important;
    gap: 11px !important;
    padding: 10px 13px !important;
  }
  .sidebar-collapsed .side .nav button span,
  .side .nav button span {
    display: inline-block !important;
    width: auto !important;
    max-width: none !important;
    opacity: 1 !important;
  }
  .sidebar-collapsed .side .nav .nav-icon,
  .side .nav .nav-icon {
    width: 18px !important;
    height: 18px !important;
    margin-right: 0 !important;
  }
  .sidebar-collapsed .side .profile,
  .side .profile {
    display: flex !important;
    width: auto !important;
    min-height: 58px;
    margin: auto 0 0 !important;
    padding: 14px 7px 2px !important;
    justify-content: flex-start !important;
    gap: 9px !important;
    cursor: default;
  }
  .sidebar-collapsed .side .profile > #profileAvatar,
  .side .profile > #profileAvatar {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    flex: 0 0 36px !important;
  }
  .sidebar-collapsed .side .profile > .grow,
  .side .profile > .grow { display: block !important; }
  .sidebar-collapsed .side .profile > .profile-settings,
  .side .profile > .profile-settings { display: inline-grid !important; margin-left: auto; }
  .content { padding-bottom: 28px !important; }
}

@media (max-width: 720px) {
  .top { gap: 8px !important; }
  .top > .sidebar-toggle { order: 0; }
  .notification-button { order: 0; }
  .top-actions { order: 0; width: auto !important; margin-left: auto !important; }
  .top-actions .btn { flex: 0 1 auto; min-height: 40px; padding-inline: 11px; }
  .top .search { order: 2; }
  .content { padding: 18px 14px 28px !important; }
  .pipeline-head { gap: 14px !important; }
  #pipelineDescription { line-height: 1.4; }
  #pipeline .boardwrap { margin-inline: 0 !important; }
  #pipeline .board { grid-template-columns: repeat(8, minmax(260px, 82vw)) !important; }
  #pipeline .column { min-height: 58vh !important; }
}

@media (max-width: 460px) {
  .top-actions { gap: 6px !important; }
  .top-actions .btn { padding-inline: 9px; font-size: 12px; }
  .pipeline-filters { grid-template-columns: 1fr !important; }
  #pipeline .board { grid-template-columns: repeat(8, minmax(252px, 88vw)) !important; }
}

html[data-theme="dark"] .side,
html[data-theme="dark"] .mobile-sidebar-close { background: #0d0d0d !important; }
html[data-theme="dark"] .mobile-sidebar-backdrop { background: rgba(0, 0, 0, .58); }

/* Assignment privacy and user-to-user lead transfers. */
.assignment-locked {
  pointer-events: none;
  opacity: .72;
}
.assigned-empty {
  padding: 40px !important;
  text-align: center !important;
  color: var(--muted) !important;
}
.reassign-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d6e5f7;
  border-radius: 12px;
  background: #f3f8ff;
  color: #1f426c;
}
.reassign-summary .activity-icon { flex: 0 0 38px; }
.reassign-summary b,
.reassign-summary small { display: block; }
.reassign-summary small { margin-top: 3px; color: #68788e; }
.user-row .settings-actions [data-reassign-user] { min-width: 132px; }
html[data-theme="dark"] .reassign-summary {
  border-color: #2d4969;
  background: #17283c;
  color: #dce9f8;
}

/* Premium neutral-black dark theme. Keep every surface readable without white leaks. */
html[data-theme="dark"] {
  color-scheme: dark;
  --pro-canvas: #08090b;
  --pro-sidebar: #0a0b0d;
  --pro-surface: #111419;
  --pro-surface-subtle: #15191f;
  --pro-surface-blue: #121c28;
  --pro-ink: #f1f3f5;
  --pro-muted: #9aa3ae;
  --pro-faint: #727b86;
  --pro-line: #242a31;
  --pro-line-strong: #343b44;
  --pro-blue-soft: #142235;
  --bg: var(--pro-canvas);
  --white: var(--pro-surface);
  --ink: var(--pro-ink);
  --muted: var(--pro-muted);
  --line: var(--pro-line);
  --blue2: var(--pro-blue-soft);
}
html[data-theme="dark"] body,
html[data-theme="dark"] .app,
html[data-theme="dark"] .main,
html[data-theme="dark"] .content {
  background: var(--pro-canvas) !important;
  color: var(--pro-ink) !important;
}
html[data-theme="dark"] .side {
  background: var(--pro-sidebar) !important;
  border-color: #20242a !important;
}
html[data-theme="dark"] .top {
  background: rgba(12, 14, 17, .96) !important;
  border-color: #242a31 !important;
}
html[data-theme="dark"] .profile b,
html[data-theme="dark"] #profileName {
  color: #f0f2f4 !important;
}
html[data-theme="dark"] .profile small,
html[data-theme="dark"] #profileEmail {
  color: #9099a5 !important;
}
html[data-theme="dark"] .nav button {
  border-color: transparent !important;
  color: #b7bec8 !important;
}
html[data-theme="dark"] .nav button:hover {
  border-color: #252c34 !important;
  background: #12161b !important;
  color: #e2e8ef !important;
}
html[data-theme="dark"] .nav button.active {
  border-color: #283442 !important;
  background: #131920 !important;
  color: #c9ddf5 !important;
  box-shadow: inset 3px 0 0 #4c92e7 !important;
}
html[data-theme="dark"] .nav button.active .nav-icon {
  color: #69a7f4 !important;
}
html[data-theme="dark"] #pipeline .column {
  border-color: #272d34 !important;
  background: #111419 !important;
  box-shadow: none !important;
}
html[data-theme="dark"] #pipeline .column.over {
  border-color: #416f9f !important;
  background: #121a23 !important;
  box-shadow: inset 0 0 0 1px #416f9f !important;
}
html[data-theme="dark"] #pipeline .colhead,
html[data-theme="dark"] #pipeline .deal h3 {
  color: #eef1f4 !important;
}
html[data-theme="dark"] #pipeline .count {
  border-color: #303740 !important;
  background: #171b21 !important;
  color: #aeb7c2 !important;
}
html[data-theme="dark"] #pipelineDescription {
  color: #9099a5 !important;
}
html[data-theme="dark"] .pipeline-filters,
html[data-theme="dark"] .deal,
html[data-theme="dark"] .metric,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .taskbox,
html[data-theme="dark"] .contentcard,
html[data-theme="dark"] .settings-menu,
html[data-theme="dark"] .settings-pane,
html[data-theme="dark"] .activity-kpi,
html[data-theme="dark"] .dashboard-metric,
html[data-theme="dark"] .table-scroll,
html[data-theme="dark"] .notification-popover,
html[data-theme="dark"] .account-menu {
  border-color: var(--pro-line) !important;
  background: var(--pro-surface) !important;
  color: var(--pro-ink) !important;
}
html[data-theme="dark"] .pretty-select-trigger,
html[data-theme="dark"] .date-trigger,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .btn:not(.primary),
html[data-theme="dark"] .sidebar-toggle,
html[data-theme="dark"] .notification-button,
html[data-theme="dark"] .profile-settings,
html[data-theme="dark"] .mobile-sidebar-close {
  border-color: var(--pro-line-strong) !important;
  background: #12161b !important;
  color: #dfe4ea !important;
}
html[data-theme="dark"] .pretty-select-trigger .chevron,
html[data-theme="dark"] .date-trigger .chevron {
  background: #1b2530 !important;
  color: #83b7f6 !important;
}
html[data-theme="dark"] .pretty-select-menu {
  border-color: var(--pro-line) !important;
  background: #12151a !important;
  color: var(--pro-ink) !important;
}
html[data-theme="dark"] .pretty-select-option {
  color: #c9d0d9 !important;
}
html[data-theme="dark"] .pretty-select-option:hover,
html[data-theme="dark"] .pretty-select-option:focus-visible,
html[data-theme="dark"] .pretty-select-option.selected {
  background: #192330 !important;
  color: #a9cff8 !important;
}
html[data-theme="dark"] .pipeline-filters .pretty-select-trigger,
html[data-theme="dark"] .pipeline-filters > input {
  border-color: #303740 !important;
  background: #12161b !important;
  color: #dfe4ea !important;
}
html[data-theme="dark"] .smartfind-shortcut {
  border-color: #343b44 !important;
  background: #1a1f25 !important;
  color: #aeb8c4 !important;
}
html[data-theme="dark"] .pill,
html[data-theme="dark"] .source,
html[data-theme="dark"] .status,
html[data-theme="dark"] .temperature,
html[data-theme="dark"] .score-badge,
html[data-theme="dark"] .role-badge {
  border-color: #303740 !important;
  background: #1b2027 !important;
  color: #bcc5cf !important;
}
html[data-theme="dark"] .temperature.warm {
  background: #2b2316 !important;
  color: #e6bf70 !important;
}
html[data-theme="dark"] .temperature.hot {
  background: #2b1a19 !important;
  color: #e89991 !important;
}
html[data-theme="dark"] .temperature.cold,
html[data-theme="dark"] .source,
html[data-theme="dark"] .status.contacted {
  background: #172331 !important;
  color: #91bcea !important;
}
html[data-theme="dark"] .status.qualified,
html[data-theme="dark"] .status.won,
html[data-theme="dark"] .score-badge.high {
  background: #15271f !important;
  color: #8ed0ad !important;
}

/* Final interaction and contrast pass shared by every CRM view. */
.nav button {
  position: relative;
  overflow: hidden;
}
.nav button.active {
  box-shadow: none !important;
}
.nav button.active::before {
  content: "";
  position: absolute;
  inset: 9px auto 9px 0;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: #2f80ed;
}
html[data-theme="dark"] .nav button.active {
  box-shadow: none !important;
}
html[data-theme="dark"] .nav button.active::before {
  background: #4c92e7;
}

.top > .sidebar-toggle .sidebar-toggle-icon,
.sidebar-toggle .sidebar-toggle-icon {
  width: 18px !important;
  height: 18px !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px !important;
  margin: auto !important;
  transform: none !important;
}
.top > .sidebar-toggle .sidebar-toggle-icon > span,
.sidebar-toggle .sidebar-toggle-icon > span {
  width: 16px !important;
  height: 2px !important;
  flex: 0 0 2px;
  margin: 0 !important;
}

html[data-theme="dark"] .table td b,
html[data-theme="dark"] .table td strong,
html[data-theme="dark"] .table td a {
  color: #eef1f4 !important;
}

:where(.btn, .nav button, .sidebar-toggle, .notification-button, .profile-settings, .tabs button, .settings-menu button, .pretty-select-trigger, .date-trigger) {
  -webkit-tap-highlight-color: transparent;
  transition: color .18s cubic-bezier(.22, .61, .36, 1),
              background-color .18s cubic-bezier(.22, .61, .36, 1),
              border-color .18s cubic-bezier(.22, .61, .36, 1),
              box-shadow .18s cubic-bezier(.22, .61, .36, 1),
              transform .18s cubic-bezier(.22, .61, .36, 1),
              opacity .18s cubic-bezier(.22, .61, .36, 1) !important;
}
:where(.btn, .nav button, .sidebar-toggle, .notification-button, .profile-settings, .tabs button, .settings-menu button, .pretty-select-trigger, .date-trigger):active:not(:disabled) {
  transform: scale(.985) !important;
}
:where(.btn, .nav button, .sidebar-toggle, .notification-button, .profile-settings, .tabs button, .settings-menu button, .pretty-select-trigger, .date-trigger):focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(66, 133, 220, .22) !important;
}
:where(button, .btn):disabled {
  cursor: not-allowed;
  opacity: .58;
}

/* Genuine loading uses the bare N mark; instant page changes only fade content. */
.app-loader-mark {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.app-loader-logo {
  filter: none !important;
}
html[data-theme="dark"] .app-loader {
  background: #08090b;
}
.page.active {
  animation: page-arrive .24s cubic-bezier(.22, .61, .36, 1) both;
}
@keyframes page-arrive {
  from { opacity: .72; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .page.active { animation: none !important; }
}

/* Dark-mode integrity: prevent light-only component rules leaking into the CRM. */
html[data-theme="dark"] #today .dashboard-title,
html[data-theme="dark"] .contentcard h3,
html[data-theme="dark"] .taskhead,
html[data-theme="dark"] .field label,
html[data-theme="dark"] .score-heading label {
  color: #eef1f4 !important;
}
html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .login-eyebrow {
  color: #69a7f4 !important;
}
html[data-theme="dark"] .taskhead {
  border-color: #2a3038 !important;
  background: #15191f !important;
}
html[data-theme="dark"] .taskhead > span {
  border-color: #30455e !important;
  background: #1a2633 !important;
  color: #9cc8f7 !important;
}
html[data-theme="dark"] .task,
html[data-theme="dark"] .setting-row,
html[data-theme="dark"] .activity-row,
html[data-theme="dark"] .modalhead {
  border-color: #2a3038 !important;
}
html[data-theme="dark"] .timeline-item {
  border-left-color: #34475f !important;
}
html[data-theme="dark"] .timeline-item::before {
  background: #69a7f4 !important;
  box-shadow: 0 0 0 3px #18212b !important;
}

html[data-theme="dark"] .tabs button,
html[data-theme="dark"] .report-tabs button {
  color: #aeb7c2 !important;
}
html[data-theme="dark"] .tabs button:hover,
html[data-theme="dark"] .report-tabs button:hover {
  color: #dce8f7 !important;
}
html[data-theme="dark"] .tabs button.active,
html[data-theme="dark"] .report-tabs button.active {
  border-color: transparent !important;
  background: transparent !important;
  color: #83b7f6 !important;
  box-shadow: inset 0 -2px #4c92e7 !important;
}

html[data-theme="dark"] .settings-menu button {
  color: #b5bec9 !important;
}
html[data-theme="dark"] .settings-menu button:hover {
  border-color: #2f3945 !important;
  background: #171c23 !important;
  color: #e3e9f0 !important;
}
html[data-theme="dark"] .settings-menu button.active {
  border-color: #29476a !important;
  background: #172b44 !important;
  color: #a9cff8 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .choice-card {
  border-color: #303740 !important;
  background: #151a20 !important;
  color: #dfe4ea !important;
}
html[data-theme="dark"] .choice-card:hover {
  border-color: #40546c !important;
  background: #18212b !important;
}
html[data-theme="dark"] .choice-card:has(input:checked) {
  border-color: #416f9f !important;
  background: #17283d !important;
  color: #b9d7f8 !important;
}

html[data-theme="dark"] .contact-status-select .pretty-select-trigger.contact-uncontacted,
html[data-theme="dark"] .contact-choice.contact-uncontacted:hover,
html[data-theme="dark"] .contact-choice.contact-uncontacted.selected {
  border-color: #5d4c27 !important;
  background: #2d2618 !important;
  color: #e3be6c !important;
}
html[data-theme="dark"] .contact-status-select .pretty-select-trigger.contact-contacted,
html[data-theme="dark"] .contact-choice.contact-contacted:hover,
html[data-theme="dark"] .contact-choice.contact-contacted.selected {
  border-color: #31577e !important;
  background: #17283a !important;
  color: #91c0ef !important;
}
html[data-theme="dark"] .contact-status-select .pretty-select-trigger.contact-qualified,
html[data-theme="dark"] .contact-choice.contact-qualified:hover,
html[data-theme="dark"] .contact-choice.contact-qualified.selected {
  border-color: #4c416e !important;
  background: #231f35 !important;
  color: #c0aef2 !important;
}
html[data-theme="dark"] .contact-status-select .pretty-select-trigger.contact-won,
html[data-theme="dark"] .contact-choice.contact-won:hover,
html[data-theme="dark"] .contact-choice.contact-won.selected {
  border-color: #2f5a43 !important;
  background: #162820 !important;
  color: #8ed0ad !important;
}
html[data-theme="dark"] .contact-status-select .pretty-select-trigger.contact-lost,
html[data-theme="dark"] .contact-choice.contact-lost:hover,
html[data-theme="dark"] .contact-choice.contact-lost.selected {
  border-color: #663541 !important;
  background: #2d1b20 !important;
  color: #f09aa7 !important;
}
html[data-theme="dark"] .contact-status-select .pretty-select-trigger.contact-no-decision,
html[data-theme="dark"] .contact-choice.contact-no-decision:hover,
html[data-theme="dark"] .contact-choice.contact-no-decision.selected {
  border-color: #3b424b !important;
  background: #20242a !important;
  color: #b8c0ca !important;
}
html[data-theme="dark"] .toast {
  border-color: #34495f !important;
  background: rgba(24, 34, 46, .98) !important;
  color: #cfe1f5 !important;
  box-shadow: 0 16px 38px rgba(0, 0, 0, .34) !important;
}
