/* ── PeopleIndex CSS ────────────────────────────────── */
/* UI styling — animations, transitions, and resets */

:root {
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --crm-primary: #1473F9;
  --app-canvas: #F1F3F5;
  --surface-white: #FFFFFF;
  --surface-subtle: #F8F9FA;
  --outline-gray-1: #E9ECEF;
  --outline-gray-2: #DEE2E6;
  --ink-gray-8: #343A40;
  --ink-gray-6: #868E96;
}

html, body, #app {
  height: 100%;
  min-height: 100%;
  font-family: var(--font-family);
  margin: 0;
  padding: 0;
  background-color: var(--app-canvas);
}

.hidden {
  display: none !important;
}

body {
  color: #111827;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}

/* ── Slick Scrollbars ────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

.no-scrollbar::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
.no-scrollbar { -ms-overflow-style: none !important; scrollbar-width: none !important; }

.custom-scroll::-webkit-scrollbar { width: 4px; height: 4px; }
.custom-scroll::-webkit-scrollbar-thumb { background: #E2E8F0; border-radius: 4px; }
.custom-scroll::-webkit-scrollbar-thumb:hover { background: #CBD5E1; }
.custom-scroll::-webkit-scrollbar-track { background: transparent; }

/* ── Skeleton Shimmer Animation ──────────────────── */
.crm-skeleton,
.crm-skeleton-soft {
  --skeleton-shimmer: rgba(255, 255, 255, 0.78);
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent, var(--skeleton-shimmer), transparent),
    var(--skeleton-bg);
  background-size: 220% 100%;
  animation: crm-skeleton-shimmer var(--skeleton-speed, 1.45s) ease-in-out infinite;
}

.crm-skeleton {
  --skeleton-bg: #E8EAED;
}

.crm-skeleton-soft {
  --skeleton-bg: #F1F3F5;
}

.crm-skeleton-card {
  border: 1px solid #DEE1E5;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
  animation: skeleton-card-enter 180ms ease-out both;
}

@keyframes skeleton-card-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes crm-skeleton-shimmer {
  0% {
    background-position: 220% 0;
  }
  100% {
    background-position: -220% 0;
  }
}

/* ── Application bootstrap states ───────────────── */
.crm-startup-sidebar {
  width: 72px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  padding: 6px 0 24px;
  background: var(--surface-white);
  border-right: 1px solid var(--outline-gray-1);
}

.crm-startup-logo,
.crm-startup-failure-logo {
  display: block;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  object-fit: contain;
}

.crm-startup-nav-dot {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 7px;
}

.crm-startup-board {
  height: 100%;
  display: flex;
  gap: 20px;
  padding: 26px 28px;
  overflow: hidden;
  background: var(--app-canvas);
}

.crm-startup-column { width: 350px; min-width: 350px; }
.crm-startup-column-heading { height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 4px 12px; }
.crm-startup-heading-line { width: 130px; height: 18px; border-radius: 6px; }
.crm-startup-count { width: 42px; height: 24px; border-radius: 999px; }
.crm-startup-card {
  height: 136px;
  margin-bottom: 14px;
  padding: 28px 24px;
  border-radius: 14px;
  display: flex;
  align-items: flex-start;
  gap: 18px;
}
.crm-startup-avatar { width: 54px; height: 54px; flex: 0 0 54px; border-radius: 50%; }
.crm-startup-card-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 12px; padding-top: 4px; }
.crm-startup-name, .crm-startup-meta { display: block; height: 16px; border-radius: 5px; }
.crm-startup-name { width: 68%; }
.crm-startup-meta { width: 46%; height: 13px; }

.crm-startup-failure {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px;
  background: var(--app-canvas);
}

.crm-startup-failure-card {
  width: min(460px, 100%);
  padding: 42px;
  border: 1px solid var(--outline-gray-1);
  border-radius: 20px;
  background: var(--surface-white);
  box-shadow: 0 18px 48px rgba(17, 24, 39, 0.08);
  text-align: center;
}

.crm-startup-failure-logo { width: min(264px, 100%); height: auto; margin: 0 auto 20px; }
.crm-startup-failure-eyebrow { margin: 0 0 8px; color: var(--crm-primary); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.crm-startup-failure h1 { margin: 0; color: #111827; font-size: 25px; line-height: 1.25; }
.crm-startup-failure p:not(.crm-startup-failure-eyebrow) { margin: 14px auto 0; color: var(--ink-gray-6); font-size: 14px; line-height: 1.6; }
.crm-startup-failure-actions { display: flex; justify-content: center; gap: 10px; margin-top: 26px; }
.crm-startup-failure-actions button,
.crm-startup-failure-actions a {
  min-width: 126px;
  padding: 10px 16px;
  border-radius: 9px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.crm-startup-failure-actions button { border: 1px solid var(--crm-primary); background: var(--crm-primary); color: white; }
.crm-startup-failure-actions a { border: 1px solid var(--outline-gray-2); color: var(--ink-gray-8); background: var(--surface-white); }
.crm-startup-failure small { display: block; margin-top: 24px; color: #ADB5BD; font-size: 11px; }

@media (max-width: 700px) {
  .crm-startup-sidebar { display: none; }
  .crm-startup-board { padding: 18px; }
  .crm-startup-column { width: calc(100vw - 36px); min-width: calc(100vw - 36px); }
  .crm-startup-failure { padding: 18px; }
  .crm-startup-failure-card { padding: 32px 22px; }
  .crm-startup-failure-actions { flex-direction: column; }
}

/* ── Kanban Board & Column Scrollbar-Free Layout ───────── */
.kanban-board,
#kanban-board-scroll,
.kanban-cards,
.column-scroll-area {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  will-change: scroll-position;
  transform: translateZ(0);
}

.kanban-board,
#kanban-board-scroll {
  overscroll-behavior-x: contain;
  backface-visibility: hidden;
  contain: layout;
}

.column-scroll-area {
  contain: layout style;
}

.kanban-board::-webkit-scrollbar,
#kanban-board-scroll::-webkit-scrollbar,
.kanban-cards::-webkit-scrollbar,
.column-scroll-area::-webkit-scrollbar,
.kanban-column::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* ── Modern Web Performance: Layout Containment & Content Visibility ── */
.kanban-column {
  content-visibility: auto;
  contain-intrinsic-size: auto 360px auto 800px;
  contain: layout style;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.kanban-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 344px auto 104px;
  contain: layout style;
  will-change: transform, box-shadow;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.deal-kanban-board .kanban-card,
.loan-kanban-board .kanban-card {
  contain-intrinsic-size: auto 344px auto 120px;
}

.lead-kanban-board .kanban-card {
  width: 344px;
  min-height: 104px;
  height: 104px;
  border-radius: 12px !important;
  padding: 0px 20px !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 15px !important;
  border: 1px solid rgba(15, 23, 42, 0.043) !important;
  background: #ffffff !important;
  outline: none !important;
  box-shadow: rgba(15, 23, 42, 0.25) 0px 14px 14px -11px, rgba(15, 23, 42, 0.48) 0px 42px 50px -42px !important;
  cursor: pointer;
  -webkit-user-drag: none;
  user-drag: none;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 180ms ease, opacity 160ms ease;
}

/* ── Deal, SA & Loan Kanban Board Card Layout ──────── */

.deal-kanban-board .kanban-card,
.sa-kanban-board .kanban-card,
.loan-kanban-board .kanban-card {
  width: 344px !important;
  min-height: auto !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  padding: 12px 14px !important;
  border-radius: 12px !important;
  border: 1px solid rgb(229, 231, 235) !important;
  box-shadow: rgba(15, 23, 42, 0.25) 0px 14px 14px -11px, rgba(15, 23, 42, 0.48) 0px 42px 50px -42px !important;
  background: #ffffff !important;
  display: flex !important;
  flex-direction: column !important;
  cursor: pointer;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 180ms ease, border-color 180ms ease, opacity 160ms ease;
  box-sizing: border-box !important;
}

.deal-kanban-board .kanban-card:hover,
.sa-kanban-board .kanban-card:hover,
.loan-kanban-board .kanban-card:hover {
  transform: translateY(-1px);
  border-color: rgba(16, 24, 40, 0.16) !important;
  box-shadow: rgba(15, 23, 42, 0.28) 0px 16px 18px -11px, rgba(15, 23, 42, 0.52) 0px 46px 54px -42px !important;
}

.deal-avatar-ring {
  box-shadow: none !important;
}

.deal-meta-dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 9999px;
  background-color: #6b7280;
  margin: 0 6px;
  flex-shrink: 0;
}

.deal-kanban-board .kanban-card .deal-title-owner,
.sa-kanban-board .kanban-card .deal-title-owner,
.loan-kanban-board .kanban-card .deal-title-owner {
  box-sizing: border-box;
  width: 45px;
  min-width: 45px;
  height: 45px;
  border-radius: 9999px;
  overflow: visible;
}

.deal-kanban-board .kanban-card .deal-study-summary,
.sa-kanban-board .kanban-card .deal-study-summary,
.loan-kanban-board .kanban-card .deal-study-summary {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 20px !important;
  padding-left: 55px !important;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 2px;
}

.deal-kanban-board .kanban-card .kanban-card-fields,
.sa-kanban-board .kanban-card .kanban-card-fields,
.loan-kanban-board .kanban-card .kanban-card-fields {
  margin-top: 4px;
  gap: 4px;
}

.deal-kanban-board .kanban-card .deal-card-meta-row,
.sa-kanban-board .kanban-card .deal-card-meta-row,
.loan-kanban-board .kanban-card .deal-card-meta-row {
  order: 1;
  margin-top: 4px;
  padding-left: 55px !important;
  border-top: 0px;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0;
}

.deal-kanban-board .kanban-card .deal-card-meta-row .deal-intake-pill,
.sa-kanban-board .kanban-card .deal-card-meta-row .deal-intake-pill,
.loan-kanban-board .kanban-card .deal-card-meta-row .deal-intake-pill {
  border-radius: 9999px !important;
  height: 28px;
  padding: 0px 10px;
  font-size: 12px;
  font-weight: 600;
}

.deal-kanban-board .kanban-card .deal-card-meta-row .deal-status-pill,
.sa-kanban-board .kanban-card .deal-card-meta-row .deal-status-pill,
.loan-kanban-board .kanban-card .deal-card-meta-row .deal-status-pill {
  border-radius: 8px !important;
  height: 28px;
  padding: 0px 10px;
  font-size: 12px;
  font-weight: 600;
}

.deal-kanban-board .invoice-stack-card,
.sa-kanban-board .invoice-stack-card,
.loan-kanban-board .invoice-stack-card {
  padding: 16px !important;
  border: 1px solid #f3f4f6 !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  background: #ffffff !important;
  width: 344px !important;
}

.deal-kanban-board .invoice-stack-card:hover,
.sa-kanban-board .invoice-stack-card:hover,
.loan-kanban-board .invoice-stack-card:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08) !important;
}

.kanban-column.kanban-column-collapsed {
  width: 64px !important;
  min-width: 64px !important;
  max-width: 64px !important;
  height: 290px !important;
  min-height: 290px !important;
  max-height: 290px !important;
  align-self: flex-start !important;
  background: #f3f4f6 !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 20px !important;
  margin-right: 16px !important;
  margin-bottom: 12px !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  cursor: pointer !important;
  transition: background 0.15s ease, border-color 0.15s ease !important;
}

.kanban-column.kanban-column-collapsed:hover {
  background: #ebeef2 !important;
  border-color: #d1d5db !important;
}

.kanban-column.kanban-column-collapsed .kanban-column-header {
  height: 100% !important;
  min-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 20px 6px 14px 6px !important;
  box-sizing: border-box !important;
}

.kanban-column.kanban-column-collapsed .btn-collapse-col {
  background: transparent !important;
  border: none !important;
  color: #9ca3af !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 20px !important;
  height: 20px !important;
  transition: color 0.15s ease !important;
}

.kanban-column.kanban-column-collapsed:hover .btn-collapse-col {
  color: #4b5563 !important;
}

.kanban-column.kanban-column-collapsed .kanban-column-title {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  overflow: visible !important;
  gap: 12px !important;
  margin-top: 14px !important;
  padding: 0 !important;
}

.kanban-column.kanban-column-collapsed .kanban-column-title-text {
  writing-mode: vertical-rl !important;
  text-orientation: mixed !important;
  white-space: nowrap !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #2D3748 !important;
  letter-spacing: -0.01em !important;
  user-select: none !important;
  cursor: pointer !important;
}

.kanban-column.kanban-column-collapsed .kanban-column-students {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #64748b !important;
  line-height: 1 !important;
  background: transparent !important;
  border-radius: 0 !important;
  min-width: 0 !important;
  height: auto !important;
  padding: 0 !important;
}

.kanban-column.kanban-column-collapsed .kanban-column-students svg {
  width: 14px !important;
  height: 14px !important;
  color: #8a94a6 !important;
  flex-shrink: 0 !important;
}

.kanban-column.kanban-column-collapsed .kanban-column-count {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 2.5px 8px !important;
  border-radius: 9999px !important;
  background-color: #e5e7eb !important;
  color: #64748b !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  margin-top: auto !important;
  border: none !important;
}

.sa-kanban-board ~ #btn-open-shortcuts,
.deal-kanban-board ~ #btn-open-shortcuts {
  display: none !important;
}

.column-dot {
  width: 10px !important;
  height: 10px !important;
  border-radius: 9999px !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
}

.bg-crm-primary\/20 {
  background-color: rgba(20, 115, 249, 0.2) !important;
}
.bg-crm-primary {
  background-color: var(--crm-primary) !important;
}
.text-crm-primary {
  color: var(--crm-primary) !important;
}
.border-crm-primary {
  border-color: var(--crm-primary) !important;
}
.hover\:bg-crm-primary:hover {
  background-color: var(--crm-primary) !important;
}
.hover\:text-crm-primary:hover {
  color: var(--crm-primary) !important;
}
.font-sans {
  font-family: var(--font-family) !important;
}

/* Collapsed column handled by .kanban-column.kanban-column-collapsed above */

/* Avatar Colors (Pastel fills + deep readable text) */
.avatar-letter-A { background-color: #DBEAFE !important; color: #1D4ED8 !important; }
.avatar-letter-B { background-color: #FEF3C7 !important; color: #B45309 !important; }
.avatar-letter-C { background-color: #FEF3C7 !important; color: #B45309 !important; }
.avatar-letter-D { background-color: #DCFCE7 !important; color: #15803D !important; }
.avatar-letter-E { background-color: #FCE7F3 !important; color: #BE185D !important; }
.avatar-letter-F { background-color: #FCE7F3 !important; color: #BE185D !important; }
.avatar-letter-G { background-color: #FFE4E6 !important; color: #E11D48 !important; }
.avatar-letter-H { background-color: #FEE2E2 !important; color: #B91C1C !important; }
.avatar-letter-I { background-color: #EDE9FE !important; color: #6D28D9 !important; }
.avatar-letter-J { background-color: #D1FAE5 !important; color: #065F46 !important; }
.avatar-letter-K { background-color: #F3E8FF !important; color: #9333EA !important; }
.avatar-letter-L { background-color: #CCFBF1 !important; color: #0F766E !important; }
.avatar-letter-M { background-color: #FFEDD5 !important; color: #C2410C !important; }
.avatar-letter-N { background-color: #F3E8FF !important; color: #7E22CE !important; }
.avatar-letter-O { background-color: #FEF3C7 !important; color: #B45309 !important; }
.avatar-letter-P { background-color: #FCE7F3 !important; color: #BE185D !important; }
.avatar-letter-Q { background-color: #EDE9FE !important; color: #6D28D9 !important; }
.avatar-letter-R { background-color: #FEF9C3 !important; color: #A16207 !important; }
.avatar-letter-S { background-color: #EDE9FE !important; color: #6D28D9 !important; }
.avatar-letter-T { background-color: #CCFBF1 !important; color: #0F766E !important; }
.avatar-letter-U { background-color: #DBEAFE !important; color: #1D4ED8 !important; }
.avatar-letter-V { background-color: #FFE4E6 !important; color: #E11D48 !important; }
.avatar-letter-W { background-color: #CCFBF1 !important; color: #0F766E !important; }
.avatar-letter-X { background-color: #F3E8FF !important; color: #9333EA !important; }
.avatar-letter-Y { background-color: #E0E7FF !important; color: #4338CA !important; }
.avatar-letter-Z { background-color: #FEF3C7 !important; color: #B45309 !important; }
.sa-pill-awaiting-input {
  background-color: #FEF3ED !important;
  color: #EA580B !important;
}

.sa-pill-doc-in-progress {
  background-color: #ECFDF3 !important;
  color: #16A34A !important;
}

.sa-pill-to-do {
  background-color: #F9F5FF !important;
  color: #9333EA !important;
}

.sa-pill-in-progress {
  background-color: #EFF8FF !important;
  color: #2563EB !important;
}

.sa-pill-awaiting-decision {
  background-color: #F0F9FF !important;
  color: #026AA2 !important;
}

.sa-pill-conditional,
.sa-pill-interview {
  background-color: #FEF0C7 !important;
  color: #B54708 !important;
}

.sa-pill-funds {
  background-color: #FDF2F8 !important;
  color: #C11574 !important;
}

.sa-pill-visa-not-required {
  background-color: #F4F3FF !important;
  color: #5925DC !important;
}

.sa-pill-visa-rejected {
  background-color: #FEF3F2 !important;
  color: #DF3330 !important;
}

.sa-pill-default {
  background-color: #F2F4F7 !important;
  color: #344054 !important;
}

.kanban-card:hover {
  transform: translateY(-1px);
  border-color: transparent !important;
  box-shadow: rgba(15, 23, 42, 0.29) 0px 16px 16px -12px, rgba(15, 23, 42, 0.54) 0px 48px 58px -46px !important;
}

.kanban-card:focus {
  outline: none !important;
}

.kanban-column-students {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  padding: 0px 6px;
  border-radius: 9999px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  background: rgb(228, 231, 235) !important;
  color: rgb(154, 157, 163) !important;
  font-size: 12px !important;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

/* ── Next Year Card Format ─────────────────────── */
.card-next-year {
  background: #FEF3C7B3 !important;
  border: 1px dashed rgb(252, 211, 77) !important;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 0px !important;
  min-height: 80px;
  width: 344px;
  box-shadow: none !important;
  transition: all 150ms ease;
}

.card-next-year:hover {
  box-shadow: 0 3px 10px #00000014 !important;
}

.next-year-move-menu {
  position: absolute;
  z-index: 60;
  right: 0;
  top: calc(100% + 6px);
  display: none;
  min-width: 220px;
  overflow: hidden;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #fff;
  padding: 4px 0;
  box-shadow: 0 12px 30px rgb(16 24 40 / 16%);
}

.next-year-move-menu.is-open { display: block; animation: popover-in 140ms cubic-bezier(.16, 1, .3, 1); }
.btn-move-target { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 12px; color: #344054; font-size: 13px; text-align: left; }
.btn-move-target:hover { background: #f9fafb; color: #101828; }
.move-target-dot { width: 9px; height: 9px; flex: none; border: 1.5px solid; border-radius: 999px; }
.btn-claim-card { margin-left: auto; display: inline-flex; width: 28px; height: 28px; flex: none; align-items: center; justify-content: center; border: 1px solid #d0d5dd; border-radius: 999px; color: #16a34a; background: #fff; transition: background-color 140ms ease, transform 140ms ease; }
.btn-claim-card:hover { background: #ecfdf3; transform: scale(1.04); }
.btn-claim-card:disabled { opacity: .55; cursor: wait; }
.btn-claim-card svg { width: 14px; height: 14px; }

@keyframes popover-in {
  from { opacity: 0; transform: translateY(-4px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}



/* ── Modal / Overlay Animations ────────────────── */
.animate-fadeIn {
  animation: fadeIn 0.15s ease-out forwards;
}

.animate-scaleUp {
  animation: scaleUp 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* ── Lead drawer motion — translated from SlideOverPanel.vue ── */
.drawer-backdrop {
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-panel {
  gap: 7px;
  transition: transform 340ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  backface-visibility: hidden;
}

/* Individual Drawer Panel Animations */
.drawer-single-panel {
  width: 30vw;
  min-width: 30vw;
  max-width: 30vw;
  transition: transform 340ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease-out;
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform-origin: right center;
  contain: layout paint;
}

.drawer-single-panel.is-active {
  z-index: 60;
}

/* 1. Source slide-in for a newly opened panel */
@keyframes drawerSlideIn {
  0% {
    opacity: 0;
    transform: translate3d(72px, 0, 0) scale(0.992);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.drawer-enter-anim {
  animation: drawerSlideIn 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* 2. Source slide-out when dismissed */
@keyframes drawerSlideOut {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate3d(72px, 0, 0) scale(0.992);
  }
}

.drawer-exit-anim {
  animation: drawerSlideOut 200ms ease-in forwards !important;
  pointer-events: none !important;
}

/* 3. FIFO collapse when the fourth panel displaces the oldest */
@keyframes drawerFifoShiftOut {
  0% {
    transform: translateX(0);
    max-width: 30vw;
  }
  100% {
    transform: translateX(-100%);
    max-width: 0px;
    padding-left: 0 !important;
    padding-right: 0 !important;
    border-left-width: 0 !important;
    overflow: hidden !important;
  }
}

.drawer-fifo-exit {
  animation: drawerFifoShiftOut 200ms ease-in forwards !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

/* 4. Smooth Cross-Fade & Slide for view toggle (Dashboard <-> Activity) */
@keyframes drawerViewFadeSlide {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.drawer-view-anim {
  animation: drawerViewFadeSlide 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Full-card data skeleton keeps the 3x3 metrics geometry stable while the
   detailed record and notes are loaded. */
.drawer-detail-skeleton {
  opacity: 1;
  transition: opacity 180ms ease-out;
}

.drawer-skeleton-tile {
  min-height: 108px;
  overflow: hidden;
  border-radius: 12px;
  background: #f7f8fa;
}

.drawer-skeleton-tile > div:first-child {
  min-height: 72px;
}

.drawer-skeleton-tile > div:last-child {
  min-height: 34px;
}

.drawer-skeleton-note {
  min-height: 94px;
  border-radius: 12px;
  background: #f7f8fa;
  padding: 12px;
}

/* 5. Spring Pop for Stage Menu & Dropdowns */
@keyframes menuSpringPop {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.94);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.drawer-menu-spring {
  animation: menuSpringPop 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
  transform-origin: top left;
}

.drawer-popover {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, -6px, 0) scale(0.975);
  transform-origin: top left;
  transition:
    opacity 150ms ease,
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 180ms;
  will-change: transform, opacity;
}

.drawer-popover.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
  transition-delay: 0s;
}

.drawer-popover button,
.drawer-popover input {
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.drawer-inline-spinner {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border: 1.5px solid #d8dde5;
  border-top-color: #64748b;
  border-radius: 999px;
  animation: spin 650ms linear infinite;
}

.drawer-workflow-dialog {
  animation: drawer-workflow-backdrop-in 150ms ease-out both;
}

.drawer-workflow-form {
  animation: drawer-workflow-card-in 190ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.drawer-workflow-input {
  display: block;
  width: 100%;
  height: 38px;
  border: 1px solid #dfe3e8;
  border-radius: 10px;
  padding: 0 10px;
  background: #fff;
  color: #1f2937;
  font-size: 12px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.drawer-workflow-input:focus {
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.16);
}

@keyframes drawer-workflow-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes drawer-workflow-card-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 6. Optimistic Note Insert Animation */
@keyframes notePopSlideIn {
  0% {
    opacity: 0;
    transform: translateY(-12px) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.note-new-anim {
  animation: notePopSlideIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Legacy keyframe retained for older markup; the source-matched panel is static. */
@keyframes chevronFloat {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  50% {
    transform: translateY(3.5px);
    opacity: 0.9;
  }
}

.chevron-float-anim {
  animation: chevronFloat 2.2s ease-in-out infinite;
}

/* 8. Profile completion line */
.profile-progress-bar {
  height: 1px;
  background: #00c85e;
  transition: width 300ms ease-out;
}

/* 9. Source white detail header */
.drawer-sticky-header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

/* 10. Source metric tile surface (no lift or glow) */
.drawer-metric-tile {
  background: #f7f8fa;
}

.drawer-metric-tile > div:first-child {
  min-height: 72px;
}

.drawer-metric-tile > div:last-child {
  min-height: 34px;
}

.drawer-members-menu {
  z-index: 70;
  width: min(470px, calc(100vw - 32px));
}

.drawer-members-menu .custom-scroll,
.drawer-members-menu > .custom-scroll {
  max-height: 256px;
}

.btn-toggle-add-member > span {
  border-style: dashed;
}

.btn-assign-self > span:last-child {
  position: relative;
  width: 36px;
  height: 20px;
}

.btn-assign-self > span:last-child > span {
  position: absolute;
  top: 2px;
  width: 16px;
  height: 16px;
}

.btn-assign-self[aria-pressed="true"] > span:last-child > span {
  right: 2px;
}

.btn-assign-self[aria-pressed="false"] > span:last-child > span {
  left: 2px;
}

.drawer-metric-tile:hover {
  background: #f7f8fa;
}

/* 11. BottomActionBar composer and active send state */
.drawer-composer-pill {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-composer-pill:focus-within {
  background: #fff;
}

.drawer-send-btn-active {
  background: #f97316 !important;
  color: #FFFFFF !important;
}

.drawer-send-btn-active:hover {
  background: #ea580c !important;
}

/* Open detail panels are tracked through aria-expanded, without a visual ring. */
.kanban-card.card-active-drawer {
  outline: none !important;
  border-color: inherit !important;
  box-shadow: inherit !important;
  transform: none !important;
}

/* 13. Reduced Motion Accessibility */
@media (prefers-reduced-motion: reduce) {
  .drawer-enter-anim,
  .drawer-exit-anim,
  .drawer-fifo-exit,
  .drawer-view-anim,
  .drawer-menu-spring,
  .settings-content-enter,
  .note-new-anim,
  .chevron-float-anim,
  .profile-progress-bar {
    animation: none !important;
    transition: none !important;
  }

  .drawer-panel,
  .drawer-single-panel,
  .drawer-detail-skeleton {
    transition: none !important;
  }
}

/* ── Calendar — translated from Uniting's Frappe UI calendar ─────────── */
.calendar-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  background: #fff;
  color: #171d2c;
}

.calendar-header {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid #e8ebef;
  background: #fff;
}

.calendar-header h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.calendar-primary-button,
.calendar-secondary-button,
.calendar-delete-button,
.calendar-today-button,
.calendar-date-button,
.calendar-icon-button,
.calendar-user-button {
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  background: #fff;
  color: #242b3a;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.calendar-primary-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-color: #171d2c;
  background: #171d2c;
  color: #fff;
}

.calendar-primary-button:hover { background: #2d3545; }
.calendar-primary-button:disabled { cursor: wait; opacity: .55; }
.calendar-primary-button svg { width: 15px; height: 15px; }
.calendar-primary-button svg path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.calendar-toolbar {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  border-bottom: 1px solid #e8ebef;
  background: #fff;
}

.calendar-toolbar-group { display: flex; align-items: center; gap: 6px; min-width: 0; }
.calendar-date-button { min-width: 196px; padding: 8px 11px; text-align: left; }
.calendar-icon-button { width: 34px; height: 34px; padding: 0; font-size: 23px; line-height: 30px; }
.calendar-today-button { height: 34px; padding: 0 13px; }
.calendar-toolbar button:hover,
.calendar-select-wrap select:hover { background: #f6f7f9; border-color: #d5d9df; }

.calendar-select-wrap select {
  min-width: 94px;
  height: 34px;
  padding: 0 28px 0 11px;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  background: #fff;
  color: #242b3a;
  font: inherit;
  font-size: 13px;
}

.calendar-user-button { display: inline-flex; height: 34px; align-items: center; gap: 7px; padding: 0 10px; }
.calendar-user-avatar { display: grid; width: 21px; height: 21px; place-items: center; border-radius: 50%; background: #e7edff; color: #4864de; font-size: 10px; font-weight: 700; }

.calendar-alert { margin: 10px 20px 0; padding: 9px 12px; border: 1px solid #fed7d7; border-radius: 8px; background: #fff5f5; color: #b42318; font-size: 13px; }
.calendar-stage { position: relative; min-height: 0; flex: 1; overflow: hidden; background: #fff; }
.calendar-stage.is-loading > :not(.calendar-loading) { opacity: .55; }
.calendar-loading { position: absolute; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center; gap: 5px; pointer-events: none; }
.calendar-loading span { width: 6px; height: 6px; border-radius: 50%; background: #7a8393; animation: calendarLoading 900ms ease-in-out infinite; }
.calendar-loading span:nth-child(2) { animation-delay: 120ms; }
.calendar-loading span:nth-child(3) { animation-delay: 240ms; }
@keyframes calendarLoading { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }

.calendar-week { display: flex; height: 100%; flex-direction: column; min-width: 820px; overflow: hidden; }
.calendar-week-header,
.calendar-all-day-row { display: grid; grid-template-columns: 68px repeat(7, minmax(104px, 1fr)); flex: none; border-bottom: 1px solid #e8ebef; }
.calendar-week-header { min-height: 58px; }
.calendar-time-gutter { display: flex; align-items: center; justify-content: flex-end; padding-right: 9px; border-right: 1px solid #e8ebef; color: #9aa1ae; font-size: 10px; text-transform: uppercase; }
.calendar-day-heading { display: flex; align-items: center; justify-content: center; gap: 7px; border-right: 1px solid #eef0f3; color: #7a8393; font-size: 12px; }
.calendar-day-heading strong { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: #242b3a; font-size: 15px; font-weight: 500; }
.calendar-day-heading.is-today strong { background: #1473f9; color: #fff; }
.calendar-all-day-row { min-height: 35px; }
.calendar-all-day-cell { min-width: 0; padding: 4px; border-right: 1px solid #eef0f3; }

.calendar-week-scroll { display: grid; grid-template-columns: 68px repeat(7, minmax(104px, 1fr)); min-height: 0; flex: 1; overflow-y: auto; overflow-x: hidden; }
.calendar-time-column { height: calc(var(--calendar-hour-height) * 24); border-right: 1px solid #e8ebef; }
.calendar-time-label { height: var(--calendar-hour-height); padding: 3px 9px 0 0; color: #9aa1ae; font-size: 10px; text-align: right; transform: translateY(-8px); }
.calendar-day-column { position: relative; height: calc(var(--calendar-hour-height) * 24); border-right: 1px solid #eef0f3; background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--calendar-hour-height) - 1px), #e9ecf0 calc(var(--calendar-hour-height) - 1px), #e9ecf0 var(--calendar-hour-height)); }
.calendar-day-column.is-today { background-color: #fbfdff; }
.calendar-slot { display: block; width: 100%; height: calc(var(--calendar-hour-height) / 2); padding: 0; border: 0; border-bottom: 1px solid transparent; background: transparent; cursor: pointer; }
.calendar-slot:hover { background: rgba(20, 115, 249, .045); border-bottom-color: rgba(20, 115, 249, .16); }
.calendar-now-line { position: absolute; z-index: 3; left: 0; right: 0; height: 1px; background: #e5484d; pointer-events: none; }
.calendar-now-line span { position: absolute; left: -4px; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: #e5484d; }
.calendar-week-event { position: absolute; z-index: 2; left: 3px; right: 3px; min-height: 24px; overflow: hidden; padding: 4px 6px; border: 0; border-left: 3px solid var(--event-color); border-radius: 5px; background: color-mix(in srgb, var(--event-color) 12%, white); color: #263246; text-align: left; cursor: pointer; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--event-color) 22%, transparent); }
.calendar-week-event:hover { filter: brightness(.985); box-shadow: 0 2px 8px rgba(25, 34, 50, .12); }
.calendar-week-event strong,
.calendar-week-event span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-week-event strong { font-size: 11px; font-weight: 600; }
.calendar-week-event span { margin-top: 1px; color: #697386; font-size: 9px; }
.calendar-event-pill { display: block; width: 100%; overflow: hidden; margin-bottom: 2px; padding: 3px 5px; border: 0; border-left: 3px solid var(--event-color); border-radius: 4px; background: color-mix(in srgb, var(--event-color) 12%, white); color: #31394a; font: inherit; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; text-align: left; cursor: pointer; }

.calendar-month { display: flex; height: 100%; flex-direction: column; min-width: 720px; overflow: auto; }
.calendar-month-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); flex: none; border-bottom: 1px solid #e8ebef; }
.calendar-month-weekdays span { padding: 10px; border-right: 1px solid #eef0f3; color: #7a8393; font-size: 11px; font-weight: 600; text-align: center; text-transform: uppercase; }
.calendar-month-grid { display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(6, minmax(92px, 1fr)); min-height: 610px; flex: 1; }
.calendar-month-cell { min-width: 0; padding: 5px; border-right: 1px solid #e8ebef; border-bottom: 1px solid #e8ebef; }
.calendar-month-cell.is-outside { background: #fafbfc; color: #b2b7c0; }
.calendar-month-day { display: grid; width: 25px; height: 25px; place-items: center; margin: 0 0 3px auto; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; font: inherit; font-size: 11px; cursor: pointer; }
.calendar-month-day:hover { background: #edf0f4; }
.calendar-month-cell.is-today .calendar-month-day { background: #1473f9; color: #fff; }
.calendar-more-events { display: block; padding: 2px 5px; color: #697386; font-size: 10px; }

.calendar-dialog-layer { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 20px; }
.calendar-dialog-layer[hidden] { display: none; }
.calendar-dialog-backdrop { position: absolute; inset: 0; background: rgba(22, 28, 40, .34); backdrop-filter: blur(1px); animation: calendarFadeIn 160ms ease-out both; }
.calendar-event-dialog { position: relative; width: min(600px, calc(100vw - 32px)); max-height: min(720px, calc(100dvh - 32px)); overflow: auto; border: 1px solid #dfe3e8; border-radius: 13px; background: #fff; box-shadow: 0 24px 70px rgba(18, 26, 39, .22); animation: calendarDialogIn 180ms cubic-bezier(.2,.8,.2,1) both; }
.calendar-dialog-layer.is-closing .calendar-dialog-backdrop { animation: calendarFadeOut 160ms ease-in both; }
.calendar-dialog-layer.is-closing .calendar-event-dialog { animation: calendarDialogOut 160ms ease-in both; }
@keyframes calendarFadeIn { from { opacity: 0; } }
@keyframes calendarFadeOut { to { opacity: 0; } }
@keyframes calendarDialogIn { from { opacity: 0; transform: translateY(10px) scale(.985); } }
@keyframes calendarDialogOut { to { opacity: 0; transform: translateY(8px) scale(.985); } }
.calendar-event-dialog > header { display: flex; align-items: flex-start; justify-content: space-between; padding: 18px 20px 14px; border-bottom: 1px solid #e8ebef; }
.calendar-event-dialog > header span { color: #8a93a2; font-size: 11px; font-weight: 500; text-transform: uppercase; }
.calendar-event-dialog > header h2 { max-width: 470px; overflow: hidden; margin: 3px 0 0; font-size: 17px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event-dialog > header > button { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #737c8c; font-size: 24px; line-height: 26px; cursor: pointer; }
.calendar-event-dialog > header > button:hover { background: #f1f3f5; }
.calendar-event-dialog form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 18px 20px 20px; }
.calendar-form-wide { grid-column: 1 / -1; }
.calendar-form-field { display: flex; min-width: 0; flex-direction: column; gap: 6px; color: #555e6e; font-size: 11px; font-weight: 500; }
.calendar-form-field input,
.calendar-form-field select,
.calendar-form-field textarea { width: 100%; min-height: 38px; box-sizing: border-box; padding: 8px 10px; border: 1px solid #dfe3e8; border-radius: 8px; outline: 0; background: #fff; color: #242b3a; font: inherit; font-size: 13px; font-weight: 400; }
.calendar-form-field textarea { resize: vertical; }
.calendar-form-field input:focus,
.calendar-form-field select:focus,
.calendar-form-field textarea:focus { border-color: #a7b4c7; box-shadow: 0 0 0 3px rgba(20, 115, 249, .09); }
.calendar-form-field input[type="color"] { padding: 4px; }
.calendar-check-field { display: flex; align-items: center; gap: 8px; align-self: end; min-height: 38px; color: #444d5c; font-size: 12px; }
.calendar-check-field input { width: 15px; height: 15px; accent-color: #1473f9; }
.calendar-event-dialog footer { display: flex; grid-column: 1 / -1; align-items: center; justify-content: space-between; gap: 12px; padding-top: 3px; }
.calendar-event-dialog footer > div { display: flex; gap: 8px; }
.calendar-secondary-button,
.calendar-delete-button { min-height: 34px; padding: 7px 12px; }
.calendar-delete-button { border-color: #f4cece; color: #bd3035; }
.calendar-delete-button:hover { background: #fff5f5; }

@media (max-width: 639px) {
  .calendar-view { overflow: hidden; }
  .calendar-header { min-height: 54px; padding: 0 14px; }
  .calendar-header h1 { font-size: 16px; }
  .calendar-header .calendar-primary-button span { display: none; }
  .calendar-toolbar { min-height: 96px; align-items: stretch; flex-direction: column; gap: 7px; padding: 9px 12px; }
  .calendar-toolbar-group { justify-content: space-between; }
  .calendar-date-button { min-width: 0; flex: 1; }
  .calendar-toolbar-right { justify-content: flex-end; }
  .calendar-user-button { flex: 1; justify-content: center; }
  .calendar-stage { overflow-x: auto; }
  .calendar-week { min-width: 760px; }
  .calendar-week-header,
  .calendar-all-day-row,
  .calendar-week-scroll { grid-template-columns: 54px repeat(7, minmax(100px, 1fr)); }
  .calendar-event-dialog { width: 100%; max-height: calc(100dvh - 18px); border-radius: 14px 14px 0 0; }
  .calendar-dialog-layer { align-items: end; padding: 18px 0 0; }
  .calendar-event-dialog form { grid-template-columns: 1fr; padding: 16px; }
  .calendar-form-wide,
  .calendar-event-dialog footer { grid-column: 1; }
  .calendar-month { min-width: 700px; }
}

/* ── Uniting-style RBAC settings dialog ───────────────────────── */
#settings-modal-container {
  width: min(2040px, 70vw);
}

.settings-dialog {
  display: flex;
  width: 100%;
  height: 83vh;
  min-height: 560px;
  max-height: none;
  overflow: hidden;
  border: 1px solid var(--outline-gray-1);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 65px rgba(15, 23, 42, 0.2);
  animation: scaleUp 150ms ease-out both;
}

.settings-sidebar {
  width: 20%;
  flex: 0 0 20%;
  overflow-y: auto;
  border-right: 1px solid var(--outline-gray-1);
  background: #fafbfc;
  padding: 12px 8px 18px;
  scrollbar-width: none;
}

.settings-sidebar::-webkit-scrollbar { display: none; }

.settings-sidebar-role {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 4px 12px;
  padding: 9px 10px;
  border: 1px solid #e9eaec;
  border-radius: 9px;
  background: #fff;
}

.settings-sidebar-role span { color: #25262b; font-size: 12px; font-weight: 600; }
.settings-sidebar-role small { color: #9a9ca3; font-size: 10px; }

.settings-group-divider { height: 1px; margin: 10px 4px; background: var(--outline-gray-1); }
.settings-group-label {
  padding: 4px 8px 6px;
  color: #a0a2a9;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.settings-nav-list { display: flex; flex-direction: column; gap: 2px; }
.settings-nav-item {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6b6d75;
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.settings-nav-item svg { width: 16px; height: 16px; flex: 0 0 16px; }
.settings-nav-item:hover { color: #35363b; background: #f0f1f3; }
.settings-nav-item.is-active {
  color: var(--crm-primary);
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.035);
}

.settings-content {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 30px 34px 42px;
  background: #fff;
  color: #25262b;
}

.settings-close-button {
  position: absolute;
  z-index: 2;
  top: 17px;
  right: 18px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #92949b;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.settings-close-button:hover { color: #3d3f45; background: #f4f5f6; }
.settings-content-header {
  display: flex;
  min-height: 42px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-right: 34px;
  margin-bottom: 28px;
}

.settings-content-header h2 { margin: 0; color: #27282d; font-size: 20px; font-weight: 600; line-height: 25px; }
.settings-content-header p { margin: 5px 0 0; color: #8b8d94; font-size: 12px; line-height: 18px; }

.settings-profile-summary { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.settings-avatar {
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  place-items: center;
  border-radius: 50%;
  background: #fce7f3;
  color: #db2777;
  font-size: 18px;
  font-weight: 600;
}
.settings-profile-summary div { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.settings-profile-summary strong { font-size: 15px; font-weight: 600; }
.settings-profile-summary span:not(.settings-avatar) { color: #7f8188; font-size: 12px; }
.settings-profile-summary em { width: max-content; margin-top: 3px; padding: 2px 7px; border-radius: 999px; background: #f1f2f4; color: #696b72; font-size: 10px; font-style: normal; font-weight: 600; }
.settings-password-row { display: flex; grid-column: 1 / -1; align-items: center; justify-content: space-between; gap: 20px; margin-top: 5px; padding-top: 18px; border-top: 1px solid #eceef0; }
.settings-password-row > div { display: flex; flex-direction: column; gap: 3px; }
.settings-password-row strong { color: #303238; font-size: 12px; }
.settings-password-row span { color: #858890; font-size: 11px; }

.settings-form { display: flex; flex-direction: column; gap: 17px; }
.settings-form-narrow { max-width: 520px; }
.settings-form label { display: flex; flex-direction: column; gap: 6px; }
.settings-form label > span { color: #484a50; font-size: 12px; font-weight: 600; }
.settings-form label > small { color: #9a9ca3; font-size: 10px; line-height: 15px; }
.settings-form input, .settings-form textarea, .settings-form select, .settings-inline-form input, .settings-table select {
  min-height: 36px;
  box-sizing: border-box;
  border: 1px solid #dedfe2;
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: #303238;
  padding: 7px 10px;
  font-size: 12px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.settings-form textarea { width: 100%; resize: vertical; }
.settings-form input:focus, .settings-form textarea:focus, .settings-form select:focus, .settings-inline-form input:focus, .settings-table select:focus { border-color: #9b9da4; box-shadow: 0 0 0 2px rgba(107,114,128,.1); }
.settings-form input:disabled { background: #f6f7f8; color: #96989f; }

.settings-config-form { display: flex; flex-direction: column; }
.settings-config-row { display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 30px; border-bottom: 1px solid #eceef0; padding: 13px 8px; }
.settings-config-row > div:first-child { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 4px; }
.settings-config-row > div:first-child > strong { color: #4a4d54; font-size: 12px; font-weight: 600; }
.settings-config-row > div:first-child > span { max-width: 560px; color: #9699a1; font-size: 10px; line-height: 16px; }
.settings-config-control { display: flex; min-width: 176px; align-items: center; justify-content: flex-end; }
.settings-config-control select, .settings-config-control input, .settings-field input, .settings-field select {
  width: 190px; min-height: 36px; box-sizing: border-box; border: 1px solid #dedfe2; border-radius: 8px; outline: 0; background: #fff; color: #34363c; padding: 7px 10px; font-size: 12px;
}
.settings-config-control input:focus, .settings-config-control select:focus, .settings-field input:focus, .settings-field select:focus { border-color: #9b9da4; box-shadow: 0 0 0 2px rgba(107,114,128,.1); }
.settings-readonly-value { color: #383b42; font-size: 13px; font-weight: 550; }
.settings-config-form > [data-exchange-access-key] { display: block; }
.settings-config-form > [data-exchange-access-key][hidden] { display: none; }
.settings-config-save { margin-top: 20px; }
.settings-switch { position: relative; display: inline-flex; width: 32px; height: 18px; cursor: pointer; }
.settings-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.settings-switch span { width: 32px; height: 18px; border-radius: 999px; background: #d7d9de; transition: background 150ms ease; }
.settings-switch span::after { display: block; width: 14px; height: 14px; margin: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); content: ''; transition: transform 150ms ease; }
.settings-switch input:checked + span { background: #2563eb; }
.settings-switch input:checked + span::after { transform: translateX(14px); }
.settings-privacy-roles { padding: 22px 8px; }
.settings-privacy-roles > strong { color: #45484f; font-size: 12px; }
.settings-privacy-roles > p { margin: 4px 0 13px; color: #9699a1; font-size: 10px; }
.settings-field { display: flex; max-width: 520px; flex-direction: column; gap: 6px; }
.settings-field > span { color: #484a50; font-size: 12px; font-weight: 600; }
.settings-field input, .settings-field select { width: 100%; }
.settings-brand-form { gap: 20px; padding: 2px 8px; }
.settings-brand-asset { display: flex; align-items: center; gap: 16px; border-top: 1px solid #eceef0; padding-top: 18px; }
.settings-brand-asset > img, .settings-brand-asset > span { display: grid; width: 72px; height: 72px; flex: 0 0 72px; box-sizing: border-box; place-items: center; border: 1px solid #e4e5e8; border-radius: 10px; object-fit: contain; padding: 14px; color: #999ca4; }
.settings-brand-asset svg { width: 22px; height: 22px; }
.settings-brand-asset > div { display: flex; flex-direction: column; gap: 5px; }
.settings-brand-asset strong { color: #42454c; font-size: 12px; }
.settings-brand-asset small { color: #9699a1; font-size: 10px; }
.settings-asset-url { margin-left: 88px; }
.settings-health-form { display: flex; max-width: 620px; flex-direction: column; gap: 23px; }
.settings-health-heading { display: flex; align-items: center; justify-content: space-between; }
.settings-health-heading > strong, .settings-thresholds > strong { color: #3d4047; font-size: 12px; }
.settings-health-heading em { border-radius: 999px; background: #fff7ed; color: #c2410c; padding: 4px 8px; font-size: 10px; font-style: normal; font-weight: 650; }
.settings-health-heading em.is-valid { background: #ecfdf3; color: #15803d; }
.settings-health-weight { display: flex; flex-direction: column; gap: 7px; }
.settings-health-weight > span { display: flex; align-items: center; justify-content: space-between; }
.settings-health-weight strong, .settings-health-weight output { color: #4a4d54; font-size: 11px; font-weight: 600; }
.settings-health-weight input { width: 100%; accent-color: var(--crm-primary); }
.settings-health-weight small { color: #9a9da4; font-size: 9px; }
.settings-thresholds { display: flex; flex-direction: column; gap: 4px; border: 1px solid #eceef0; border-radius: 10px; background: #fafbfc; padding: 15px; }
.settings-thresholds .settings-config-row:last-child { border-bottom: 0; }
.settings-thresholds .settings-config-control input { width: 84px; }
.settings-record-summary { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 15px; }
.settings-record-summary > span { display: inline-flex; align-items: baseline; gap: 5px; border: 1px solid #e6e7ea; border-radius: 8px; background: #fafbfc; padding: 7px 10px; color: #8c8f97; font-size: 10px; }
.settings-record-summary strong { color: #35383f; font-size: 14px; }
.settings-slab-form { margin-bottom: 18px; border: 1px solid #e4e6e9; border-radius: 12px; background: #fafbfc; padding: 16px; }
.settings-slab-form > header, .settings-slab-rates > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.settings-slab-form > header > div { display: flex; flex-direction: column; gap: 3px; }
.settings-slab-form > header strong, .settings-slab-rates > header strong { color: #373a41; font-size: 12px; }
.settings-slab-form > header span { color: #92959c; font-size: 10px; }
.settings-slab-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.settings-slab-rates { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid #e7e8eb; padding-top: 14px; }
.settings-slab-rates > header span { border-radius: 999px; background: #fff7ed; color: #c2410c; padding: 4px 8px; font-size: 10px; font-weight: 650; }
.settings-slab-rates > header span.is-valid { background: #ecfdf3; color: #15803d; }
.settings-slab-rates > label { display: grid; grid-template-columns: minmax(170px, 1fr) 110px 100px; align-items: center; gap: 10px; }
.settings-slab-rates > label > span { overflow: hidden; color: #555860; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.settings-slab-rates > label input { width: 100%; min-height: 34px; box-sizing: border-box; border: 1px solid #dedfe2; border-radius: 8px; background: #fff; padding: 6px 9px; font-size: 11px; }
.settings-slab-rates output { color: #45484f; font-size: 11px; font-weight: 600; text-align: right; }
.settings-slab-rates p { margin: 0; color: #9a9da4; font-size: 10px; }
.settings-slab-actions { display: flex; align-items: center; justify-content: flex-end; white-space: nowrap; }
@media(max-width:850px){.settings-slab-grid{grid-template-columns:1fr}.settings-slab-rates>label{grid-template-columns:1fr 90px 80px}}
.settings-operational-table { max-height: 500px; overflow: auto; }
.settings-operational-table td { max-width: 220px; overflow: hidden; color: #4f5259; text-overflow: ellipsis; white-space: nowrap; }
.settings-muted { color: #a5a8af; }
.settings-import-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px dashed #d7d9de; border-radius: 12px; background: #fafbfc; padding: 22px; }
.settings-import-panel > div { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 3px 12px; }
.settings-import-panel svg { width: 21px; height: 21px; grid-row: 1 / 3; color: #777a82; }
.settings-import-panel strong { color: #3f4249; font-size: 12px; }
.settings-import-panel span { max-width: 560px; color: #9699a1; font-size: 10px; line-height: 15px; }
.settings-import-panel label { position: relative; flex: 0 0 auto; opacity: .55; }
.settings-import-panel input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.settings-bordered-empty { border: 1px solid #e6e7ea; border-radius: 10px; background: #fafbfc; }
.settings-provider-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.settings-provider-card { display: flex; flex-direction: column; gap: 15px; border: 1px solid #e4e6e9; border-radius: 12px; background: #fff; padding: 16px; }
.settings-provider-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; border-bottom: 1px solid #eceef0; padding-bottom: 13px; }
.settings-provider-card > header > div { display: flex; min-width: 0; align-items: center; gap: 10px; }
.settings-provider-card > header svg { width: 19px; height: 19px; flex: 0 0 19px; color: #7f8289; }
.settings-provider-card > header span { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.settings-provider-card > header strong { color: #35383f; font-size: 12px; }
.settings-provider-card > header small { color: #9699a1; font-size: 9px; }
.settings-provider-card > header .settings-primary-button { min-height: 30px; padding: 5px 10px; }
.settings-provider-card > header > .settings-provider-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.settings-provider-actions > button:not(.settings-primary-button) { min-height: 30px; border: 1px solid #dfe2e7; border-radius: 8px; background: #f6f7f9; padding: 5px 10px; color: #535862; font-size: 11px; font-weight: 600; }
.settings-provider-actions > button:disabled { cursor: wait; opacity: .6; }
.settings-connection-status { display: flex; align-items: center; gap: 8px; border: 1px solid #e5e7eb; border-radius: 9px; background: #f8f9fb; padding: 9px 11px; }
.settings-connection-status strong { flex: 0 0 auto; color: #4b5563; font-size: 11px; }
.settings-connection-status span { min-width: 0; color: #747982; font-size: 10px; line-height: 1.4; }
.settings-connection-status[data-status="connected"] { border-color: #b7ebcf; background: #f0fbf5; }
.settings-connection-status[data-status="connected"] strong { color: #14804a; }
.settings-connection-status[data-status="authentication_failed"], .settings-connection-status[data-status="incomplete"] { border-color: #f5d0b3; background: #fff8f1; }
.settings-connection-status[data-status="authentication_failed"] strong, .settings-connection-status[data-status="incomplete"] strong { color: #b45309; }
.settings-whatsapp-templates { margin-top:16px; }
.settings-template-create { display:grid; grid-template-columns:1.2fr .8fr .6fr auto; gap:10px; align-items:end; }
.settings-template-create .settings-template-body { grid-column:1 / -2; }.settings-template-create textarea{min-height:74px;resize:vertical}
.settings-template-list { display:flex; flex-direction:column; gap:8px; max-height:420px; overflow-y:auto; }
.settings-template-list article { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; padding:11px 12px; border:1px solid #eceef1; border-radius:9px; }
.settings-template-list article>div{min-width:0}.settings-template-list article strong,.settings-template-list article small{display:block}.settings-template-list article small{margin-top:2px;color:#9699a1;font-size:9px}.settings-template-list article p{margin:7px 0 0;color:#60646c;font-size:10px;white-space:pre-wrap}.settings-template-list article>span{display:flex;gap:5px}.settings-template-list article button{padding:5px 7px;border:1px solid #dde1e6;border-radius:6px;color:#59606b;font-size:9px}.settings-template-list article button:hover{background:#f5f7f9}
@media(max-width:850px){.settings-template-create{grid-template-columns:1fr}.settings-template-create .settings-template-body{grid-column:auto}}
.settings-provider-wide { max-width: 880px; }
.settings-provider-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.settings-provider-columns > div { display: flex; flex-direction: column; gap: 15px; }

/* WhatsApp settings mirrors Uniting's WhatsAppSettings.vue composition. */
.settings-content:has(.settings-whatsapp-page) { overflow: hidden; padding: 0; }
.settings-whatsapp-page { display: flex; height: 100%; min-height: 0; box-sizing: border-box; flex-direction: column; gap: 24px; padding: 32px 24px; color: #333b47; }
.settings-whatsapp-header { flex: 0 0 auto; min-height: 42px; margin: 0; padding: 0 8px; }
.settings-whatsapp-header .settings-primary-button { width: auto; height: 28px; min-height: 28px; padding: 0 8px; border-radius: 8px; font-size: 14px; }
.settings-whatsapp-header .settings-primary-button:disabled { border-color: #e8e9eb; background: #f1f2f4; color: #a4a7ad; cursor: default; opacity: 1; }
.settings-whatsapp-title { display: flex; align-items: center; gap: 8px; }
.settings-unsaved-badge { border-radius: 999px; background: #fff3e8; padding: 3px 7px; color: #b85c16; font-size: 9px; font-weight: 600; }
.settings-whatsapp-scroll { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 24px; overflow-y: auto; padding: 0 8px; }
.settings-whatsapp-enable-row { display: flex; align-items: stretch; gap: 24px; }
.settings-whatsapp-enable-row > * { flex: 1; }
.settings-whatsapp-check { display: flex; min-height: 54px; align-items: center; gap: 12px; color: #333b47; font-size: 13px; font-weight: 500; cursor: pointer; }
.settings-whatsapp-check input { appearance: none; width: 16px; height: 16px; flex: 0 0 16px; margin: 0; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; }
.settings-whatsapp-check input:checked { border-color: transparent; background: #2563eb url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e") center/100% 100% no-repeat; }
.settings-whatsapp-section { border: 1px solid #e6e7ea; border-radius: 8px; background: #fff; padding: 20px; }
.settings-whatsapp-section > h3, .settings-whatsapp-section-head h3 { margin: 0 0 16px; color: #333b47; font-size: 14px; font-weight: 600; line-height: 19.6px; }
.settings-whatsapp-section > p, .settings-whatsapp-section-head p { margin: -12px 0 16px; color: #6b7280; font-size: 12px; line-height: 18px; }
.settings-whatsapp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.settings-whatsapp-grid .settings-field { max-width: none; }
.settings-whatsapp-page .settings-field > span, .settings-whatsapp-field > span { margin-bottom: 0; color: #4b5563; font-size: 14px; font-weight: 500; line-height: 21px; }
.settings-whatsapp-page .settings-field input, .settings-whatsapp-page .settings-field select,
.settings-whatsapp-field input { height: 32px; min-height: 32px; border: 1px solid #f1f3f5; border-radius: 8px; background: #f1f3f5; padding: 6px 8px; color: #333b47; font: inherit; font-size: 14px; outline: none; }
.settings-whatsapp-page .settings-field input:focus, .settings-whatsapp-page .settings-field select:focus,
.settings-whatsapp-field input:focus { border-color: #b9bcc3; box-shadow: 0 0 0 2px rgba(20,115,249,.08); }
.settings-whatsapp-field { display: flex; min-width: 0; flex-direction: column; gap: 6px; }
.settings-whatsapp-field small, .settings-whatsapp-page .settings-field small { color: #9ca3af; font-size: 12px; line-height: 18px; }
.settings-webhook-value, .settings-webhook-secret { display: flex; min-width: 0; align-items: center; gap: 8px; }
.settings-webhook-value output { display: block; height: 34px; min-width: 0; flex: 1; overflow: hidden; border: 1px solid #e1e3e6; border-radius: 7px; background: #f6f7f8; padding: 8px 10px; color: #9699a1; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.settings-webhook-value button, .settings-webhook-secret button, .settings-whatsapp-section-head button { display: inline-flex; height: 32px; align-items: center; justify-content: center; gap: 5px; border: 0; border-radius: 8px; background: #f1f3f5; padding: 6px 10px; color: #4b5563; font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.settings-webhook-value button:hover, .settings-webhook-secret button:hover, .settings-whatsapp-section-head button:hover { background: #e7e8eb; }
.settings-webhook-value button svg, .settings-whatsapp-section-head button svg { width: 12px; height: 12px; }
.settings-webhook-secret input { min-width: 0; flex: 1; }
.settings-whatsapp-section:has(.settings-webhook-value) .settings-whatsapp-field { display: block; }
.settings-whatsapp-section:has(.settings-webhook-value) .settings-whatsapp-field > span { display: block; margin: 0 0 6px; font-size: 12px; line-height: 16.2px; }
.settings-whatsapp-section:has(.settings-webhook-value) .settings-whatsapp-field > small { display: block; margin-top: 4px; font-size: 12px; line-height: 16.2px; }
.settings-whatsapp-section:has(.settings-webhook-value) .settings-webhook-value output { height: 34.2px; border-radius: 6px; padding: 7px 12px; font-size: 13px; line-height: 18.2px; }
.settings-whatsapp-section:has(.settings-webhook-value) .settings-webhook-value button { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 4px; background: transparent; padding: 0; }
.settings-whatsapp-section:has(.settings-webhook-value) .settings-webhook-value button:hover { background: transparent; }
.settings-whatsapp-section:has(.settings-webhook-value) .settings-webhook-value button svg { width: 16px; height: 16px; }
.settings-whatsapp-section:has(.settings-webhook-value) .settings-webhook-secret button { height: 28px; border-radius: 4px; padding: 0 8px; font-size: 14px; font-weight: 400; line-height: 19.6px; }
.settings-whatsapp-section:has(.settings-whatsapp-lead-check) > h3 { margin: 0; }
.settings-whatsapp-section:has(.settings-whatsapp-lead-check) > p { margin: 2px 0 16px; line-height: 16.2px; }
.settings-whatsapp-lead-check { min-height: 0; align-items: flex-start; gap: 8px; font-weight: 500; line-height: 18.2px; }
.settings-whatsapp-lead-check input { margin-top: 2px; }
.settings-whatsapp-lead-check span small { display: block; margin-top: 2px; color: #6b7280; font-size: 12px; font-weight: 400; line-height: 16.2px; }
.settings-whatsapp-lead-fields { display: flex; max-width: 448px; flex-direction: column; gap: 16px; margin: 16px 0 0 24px; }
.settings-whatsapp-lead-fields .settings-field { gap: 4px; }
.settings-whatsapp-lead-fields .settings-field > span { font-size: 13px; line-height: 18.2px; }
.settings-whatsapp-lead-fields .settings-field small { line-height: 16.2px; letter-spacing: .01em; }
.settings-whatsapp-lead-fields .settings-field:first-child select { height: 28px; min-height: 28px; }
.settings-whatsapp-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.settings-whatsapp-section-head h3 { margin-bottom: 0; }
.settings-whatsapp-section-head p { margin: 2px 0 0; line-height: 16.2px; }
.settings-whatsapp-section-head > div:last-child { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.settings-whatsapp-empty { padding: 32px 12px; color: #9ca3af; font-size: 14px; text-align: center; }
.settings-whatsapp-table-wrap { width: 100%; overflow-x: auto; }
.settings-whatsapp-table { width: 100%; min-width: 700px; border-collapse: collapse; border-spacing: 2px; table-layout: auto; color: #4b5563; font-size: 13px; line-height: 18.2px; }
.settings-whatsapp-table th { padding: 1px 8px 8px 1px; border-bottom: 1px solid #e9eaed; color: #6b7280; font-size: 12px; font-weight: 500; line-height: 16.2px; letter-spacing: .045em; text-align: left; text-transform: uppercase; }
.settings-whatsapp-table td { min-width: 0; padding: 8px 8px 8px 1px; border-bottom: 1px solid #eceef0; vertical-align: middle; }
.settings-whatsapp-table th:last-child, .settings-whatsapp-table td:last-child { padding-right: 1px; }
.settings-whatsapp-table tbody tr:last-child td { border-bottom: 0; }
.settings-whatsapp-table th:nth-child(1), .settings-whatsapp-table th:nth-child(2), .settings-whatsapp-table th:nth-child(3), .settings-whatsapp-table th:nth-child(4) { width: auto; }.settings-whatsapp-table th:nth-child(5) { width: 64px; text-align: center; }.settings-whatsapp-table th:nth-child(6) { width: 40px; }
.settings-whatsapp-table:not(.settings-whatsapp-template-table) { table-layout: fixed; }
.settings-whatsapp-table:not(.settings-whatsapp-template-table) th:nth-child(1) { width: 126.461px; }
.settings-whatsapp-table:not(.settings-whatsapp-template-table) th:nth-child(2) { width: 159.078px; }
.settings-whatsapp-table:not(.settings-whatsapp-template-table) th:nth-child(3) { width: 159.078px; }
.settings-whatsapp-table:not(.settings-whatsapp-template-table) th:nth-child(4) { width: 161.133px; }
.settings-whatsapp-table:not(.settings-whatsapp-template-table) th:nth-child(5) { width: 64.25px; }
.settings-whatsapp-table:not(.settings-whatsapp-template-table) th:nth-child(6) { width: 40px; }
.settings-whatsapp-table input:not([type="checkbox"]), .settings-whatsapp-table select { width: 100%; height: 28px; min-width: 0; border: 1px solid #f1f3f5; border-radius: 6px; background: #f1f3f5; padding: 4px 7px; color: #4b5563; font: inherit; font-size: 13px; line-height: 18.2px; }
.settings-whatsapp-table input[type="checkbox"] { display: block; width: 13px; height: 13px; margin: auto; accent-color: var(--crm-primary); }
.settings-whatsapp-table td > button { display: inline-grid; width: 25px; height: 25px; place-items: center; border: 0; border-radius: 6px; background: transparent; color: #969aa2; cursor: pointer; }
.settings-whatsapp-table td > button:hover { background: #f0f1f3; color: #555a64; }
.settings-whatsapp-table td > button svg { width: 13px; height: 13px; }
.settings-whatsapp-template-table { width: 871.5px; min-width: 871.5px; table-layout: fixed; }
.settings-whatsapp-template-table th:nth-child(1) { width: 364.234px; }
.settings-whatsapp-template-table th:nth-child(2) { width: 125.273px; }
.settings-whatsapp-template-table th:nth-child(3) { width: 320px; }
.settings-whatsapp-template-table th:nth-child(4) { width: 62px; }
.settings-whatsapp-template-table td:nth-child(3) { overflow: hidden; color: #7e828b; text-overflow: ellipsis; white-space: nowrap; }
.settings-whatsapp-template-table td:last-child { display: flex; justify-content: flex-end; gap: 2px; }
.settings-whatsapp-template-table td:last-child > button { width: 28px; height: 28px; }
.settings-template-category { display: inline-flex; border-radius: 999px; background: #eaf2ff; padding: 3px 7px; color: #3973c6; font-size: 8px; font-weight: 600; }
.settings-whatsapp-template-dialog form { width: min(520px, calc(100vw - 36px)); }
.settings-whatsapp-template-dialog textarea { min-height: 110px; resize: vertical; }

@media (max-width: 850px) {
  .settings-whatsapp-enable-row, .settings-whatsapp-grid { grid-template-columns: 1fr; flex-direction: column; align-items: stretch; }
  .settings-whatsapp-section-head { flex-direction: column; }
}
.settings-integration-toggle { display: flex; min-height: 32px; align-items: center; justify-content: space-between; gap: 20px; color: #484b52; font-size: 11px; font-weight: 600; }
.settings-drive-status { display: flex; flex-wrap: wrap; gap: 8px; border-radius: 9px; background: #f7f8fa; padding: 10px; color: #858890; font-size: 9px; }
.settings-drive-status span { display: inline-flex; align-items: baseline; gap: 3px; }
.settings-drive-status strong { color: #3f4249; font-size: 12px; }
.settings-drive-status small { width: 100%; }

.settings-primary-button, .settings-secondary-button {
  width: max-content;
  min-height: 34px;
  border-radius: 8px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.settings-primary-button { align-self: flex-end; border: 1px solid #202126; background: #25262b; color: #fff; }
.settings-primary-button:hover { background: #111216; }
.settings-secondary-button { border: 1px solid #dedfe2; background: #fff; color: #4f5158; }
.settings-secondary-button:hover { background: #f6f7f8; }
.settings-primary-button:disabled, .settings-secondary-button:disabled { cursor: wait; opacity: .6; }

.settings-inline-form { display: flex; gap: 8px; max-width: 520px; margin-bottom: 22px; }
.settings-inline-form input { flex: 1; }
.settings-inline-form .settings-primary-button { align-self: stretch; }

.settings-table-wrap { overflow: auto; border: 1px solid #e5e6e8; border-radius: 10px; }
.settings-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.settings-table th { padding: 9px 12px; border-bottom: 1px solid #e5e6e8; background: #fafbfc; color: #8a8c93; font-size: 10px; font-weight: 600; text-align: left; text-transform: uppercase; }
.settings-table td { padding: 11px 12px; border-bottom: 1px solid #eff0f1; vertical-align: middle; }
.settings-table tr:last-child td { border-bottom: 0; }
.settings-table select { min-width: 150px; }
.settings-user-cell { display: flex; align-items: center; gap: 10px; }
.settings-user-cell > span { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border-radius: 50%; background: #eef2ff; color: #4f46e5; font-size: 11px; font-weight: 600; }
.settings-user-cell > div { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.settings-user-cell strong { font-size: 12px; font-weight: 600; }
.settings-user-cell small { color: #92949b; font-size: 10px; }
.settings-status { display: inline-flex; border-radius: 999px; background: #ecfdf3; color: #15803d; padding: 3px 7px; font-size: 10px; font-weight: 600; }
.settings-status.is-inactive { background: #f1f2f4; color: #8c8e95; }
.settings-link-button, .settings-danger-link { border: 0; background: transparent; padding: 5px 7px; font-size: 11px; font-weight: 600; cursor: pointer; }
.settings-link-button { color: var(--crm-primary); }
.settings-danger-link { color: #dc2626; }
.settings-danger-link:disabled { color: #bbbfc7; cursor: not-allowed; }
.settings-branch-list article > div > span { font-variant-numeric: tabular-nums; }
.settings-empty-cell { padding: 32px !important; color: #9a9ca3; text-align: center; }

.settings-card-list, .settings-integration-list { display: flex; flex-direction: column; overflow: hidden; border: 1px solid #e5e6e8; border-radius: 10px; }
.settings-card-list article, .settings-integration-list article { display: flex; min-height: 58px; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid #eff0f1; }
.settings-card-list article:last-child, .settings-integration-list article:last-child { border-bottom: 0; }
.settings-card-list article > div, .settings-integration-list article > div { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 3px; }
.settings-card-list strong, .settings-integration-list strong { font-size: 12px; font-weight: 600; }
.settings-card-list span, .settings-integration-list small { color: #92949b; font-size: 10px; }
.settings-integration-icon { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 9px; background: #f2f3f5; color: #777980; }
.settings-integration-icon svg { width: 17px; height: 17px; }
.settings-integration-list em { border-radius: 999px; background: #f2f3f5; color: #8a8c93; padding: 4px 8px; font-size: 10px; font-style: normal; font-weight: 600; }
.settings-integration-list em.is-connected { background: #ecfdf3; color: #15803d; }

.settings-role-grid, .settings-data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.settings-role-grid article { display: flex; align-items: center; gap: 11px; min-height: 64px; padding: 12px; border: 1px solid #e5e6e8; border-radius: 10px; }
.settings-role-grid article > span { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 9px; background: #f2f3f5; color: #777980; }
.settings-role-grid svg { width: 17px; height: 17px; }
.settings-role-grid article > div { display: flex; flex-direction: column; gap: 3px; }
.settings-role-grid strong { font-size: 12px; font-weight: 600; }
.settings-role-grid small { color: #92949b; font-size: 10px; }
.settings-role-manager { display: flex; min-height: 520px; height: calc(100% - 78px); margin: 0 -34px -34px; border-top: 1px solid #e5e6e8; }
.settings-role-list { width: 220px; flex: 0 0 220px; overflow-y: auto; border-right: 1px solid #e5e6e8; padding: 8px; }
.settings-role-list-title { display: flex; align-items: center; justify-content: space-between; min-height: 38px; padding: 0 9px; color: #8a8d95; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.settings-role-list button { display: flex; width: 100%; min-height: 36px; align-items: center; justify-content: space-between; gap: 8px; border: 0; border-radius: 8px; background: transparent; padding: 7px 10px; color: #53565e; font-size: 12px; font-weight: 550; text-align: left; cursor: pointer; }
.settings-role-list button:hover { background: #f3f4f6; color: #25272d; }
.settings-role-list button.is-active { background: #202126; color: #fff; }
.settings-role-list button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-role-list button small { opacity: .65; }
.settings-role-access { display: flex; min-width: 0; flex: 1; flex-direction: column; overflow: hidden; }
.settings-role-header { display: flex; min-height: 70px; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #e5e6e8; padding: 13px 24px; }
.settings-role-header h3 { margin: 0; color: #282a30; font-size: 14px; font-weight: 650; }
.settings-role-header p { margin: 3px 0 0; color: #92959d; font-size: 10px; }
.settings-role-scroll { overflow-y: auto; padding: 22px 25px 36px; }
.settings-role-scroll section { margin-bottom: 26px; }
.settings-role-scroll h4 { margin: 0; color: #34363c; font-size: 12px; font-weight: 650; }
.settings-role-scroll section > p { margin: 3px 0 12px; color: #93969e; font-size: 10px; }
.settings-role-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 12px; }
.settings-role-controls > label:first-child { display: flex; align-items: center; gap: 8px; color: #747780; font-size: 10px; }
.settings-role-controls select { min-height: 31px; border: 1px solid #dfe1e5; border-radius: 7px; background: #fff; padding: 5px 8px; color: #3f4249; font-size: 11px; }
.settings-access-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 22px; margin-top: 11px; }
.settings-access-option { display: flex; min-height: 28px; align-items: center; gap: 8px; color: #4a4d54; font-size: 11px; cursor: pointer; }
.settings-access-option input { width: 14px; height: 14px; margin: 0; accent-color: var(--crm-primary); }
.settings-access-option:has(input:disabled) { cursor: default; opacity: .7; }
.settings-surface-state { border-radius: 999px; background: #f2f3f5; color: #7f828a; padding: 4px 8px; font-size: 9px; font-style: normal; font-weight: 600; }
.settings-workflow-filters { display: flex; gap: 10px; margin-bottom: 14px; }
.settings-workflow-filters label, .settings-workflow-moves label { display: flex; flex: 1; flex-direction: column; gap: 5px; color: #74777f; font-size: 10px; font-weight: 600; }
.settings-workflow-filters select, .settings-workflow-moves input { min-height: 36px; border: 1px solid #dedfe2; border-radius: 8px; outline: none; background: #fff; padding: 7px 10px; color: #303238; font-size: 12px; }
.settings-workflow-filters select:focus, .settings-workflow-moves input:focus { border-color: #9b9da4; box-shadow: 0 0 0 2px rgba(107,114,128,.1); }
.settings-workflow-list { display: flex; max-height: 470px; flex-direction: column; gap: 9px; overflow-y: auto; padding-right: 3px; }
.settings-workflow-card { border: 1px solid #e5e6e8; border-radius: 11px; background: #fff; padding: 12px; }
.settings-workflow-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-workflow-title > div { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.settings-workflow-title strong { color: #303238; font-size: 12px; font-weight: 650; }
.settings-workflow-title span { color: #9a9ca3; font-size: 9px; }
.settings-workflow-moves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 10px; }
.settings-workflow-flags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.settings-workflow-flag { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; background: #f5f6f7; padding: 4px 8px; color: #6f7279; font-size: 10px; cursor: pointer; }
.settings-workflow-flag input { accent-color: #2563eb; }
.settings-data-grid article { display: flex; min-height: 86px; flex-direction: column; justify-content: center; padding: 14px; border: 1px solid #e5e6e8; border-radius: 10px; }
.settings-data-grid strong { color: #25262b; font-size: 24px; font-weight: 600; }
.settings-data-grid span { color: #888a91; font-size: 11px; }
.settings-reference-summary { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.settings-reference-summary strong { color: #222733; font-size: 26px; font-weight: 600; }
.settings-reference-summary span { color: #8a8e97; font-size: 11px; }
.settings-reference-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; max-height: 450px; overflow: auto; padding-right: 3px; }
.settings-reference-list article { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 48px; padding: 7px 10px; border: 1px solid #e6e7e9; border-radius: 9px; background: #fff; }
.settings-reference-list article > span { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; background: #eef3ff; color: #4564d9; font-size: 10px; font-weight: 650; }
.settings-reference-list article > strong { overflow: hidden; color: #34363c; font-size: 11px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.settings-reference-list article > small { color: #a0a3aa; font-size: 9px; }
.settings-help-copy { max-width: 620px; margin: 20px 0 0; color: #898b92; font-size: 11px; line-height: 17px; }
.settings-empty-state { padding: 28px; color: #92949b; font-size: 12px; text-align: center; }

.settings-loading { display: flex; height: 100%; align-items: center; justify-content: center; gap: 10px; color: #8b8d94; font-size: 12px; }
.settings-loading span { width: 18px; height: 18px; border: 2px solid #dedfe2; border-top-color: #6b6d75; border-radius: 50%; animation: spin 700ms linear infinite; }

@keyframes settingsContentEnter {
  from { transform: translate3d(0, 2px, 0); }
  to { transform: translate3d(0, 0, 0); }
}

.settings-content-enter {
  animation: settingsContentEnter 140ms cubic-bezier(.16, 1, .3, 1) both;
}

@media (max-width: 760px) {
  #settings-modal-overlay { padding: 0 !important; }
  #settings-modal-container { width: 100vw; }
  .settings-dialog { height: 100vh; min-height: 0; max-height: none; border: 0; border-radius: 0; }
  .settings-sidebar { width: 164px; flex-basis: 164px; }
  .settings-content { padding: 24px 18px 32px; }
  .settings-role-grid, .settings-data-grid { grid-template-columns: 1fr; }
  .settings-reference-list { grid-template-columns: 1fr; }
  .settings-workflow-moves { grid-template-columns: 1fr; }
  .settings-provider-grid, .settings-provider-columns { grid-template-columns: 1fr; }
}

/* ── Live dashboard (no sample or fabricated metrics) ───────────── */
.dashboard-live {
  height: 100%;
  min-height: 0;
  overflow: auto;
  background: var(--app-canvas);
  color: var(--ink-gray-8);
  user-select: text;
}

.dashboard-live-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  box-sizing: border-box;
  border-bottom: 1px solid var(--outline-gray-1);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.dashboard-live-header h1,
.dashboard-panel-heading h2 {
  margin: 0;
  color: #212529;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
}

.dashboard-live-header p,
.dashboard-panel-heading p {
  margin: 1px 0 0;
  color: var(--ink-gray-6);
  font-size: 12px;
  line-height: 18px;
}

.dashboard-live-body {
  display: grid;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}

.dashboard-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.dashboard-filter-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #495057;
  font-size: 12px;
  font-weight: 500;
}

.dashboard-filter-select {
  width: 210px;
  height: 36px;
  padding: 0 32px 0 11px;
  border: 1px solid var(--outline-gray-2);
  border-radius: 8px;
  outline: none;
  background: var(--surface-white);
  color: #343A40;
  font: inherit;
  font-size: 13px;
}

.dashboard-filter-select:focus-visible {
  border-color: #1473F9;
  box-shadow: 0 0 0 3px rgba(20, 115, 249, 0.14);
}

.dashboard-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-live-overview {
  display: grid;
  grid-template-columns: minmax(320px, 1.35fr) minmax(380px, 1fr);
  gap: 12px;
}

.dashboard-deals-hero {
  display: flex;
  min-height: 264px;
  align-items: stretch;
  justify-content: space-between;
  overflow: hidden;
  padding: 28px 28px 22px;
  border: 1px solid #e4e7eb;
  border-radius: 14px;
  background: linear-gradient(142deg, #ffffff 12%, #f5f8ff 100%);
  box-shadow: 0 1px 2px rgba(33, 37, 41, .04);
}

.dashboard-hero-copy { display: flex; min-width: 180px; flex-direction: column; }
.dashboard-hero-copy > span { color: #5f6878; font-size: 13px; font-weight: 550; }
.dashboard-hero-copy > strong { margin-top: 16px; color: #171d2c; font-size: clamp(46px, 5vw, 70px); font-weight: 600; letter-spacing: -3px; line-height: .98; }
.dashboard-hero-copy > small { max-width: 210px; margin-top: auto; color: #8a93a2; font-size: 11px; line-height: 17px; }
.dashboard-hero-bars { display: flex; width: 45%; align-items: flex-end; justify-content: flex-end; gap: 9px; padding-top: 30px; }
.dashboard-hero-bars i { width: min(30px, 18%); min-height: 12px; border-radius: 5px 5px 2px 2px; background: #1473f9; box-shadow: 0 5px 18px rgba(20, 115, 249, .12); }
.dashboard-hero-bars i:nth-child(2) { background: #4b94fa; }
.dashboard-hero-bars i:nth-child(3) { background: #7cb2fc; }
.dashboard-hero-bars i:nth-child(4) { background: #a7ccff; }

.dashboard-summary-card,
.dashboard-distribution {
  border: 1px solid var(--outline-gray-1);
  border-radius: 12px;
  background: var(--surface-white);
  box-shadow: 0 1px 2px rgba(33, 37, 41, 0.04);
}

.dashboard-summary-card {
  display: grid;
  min-height: 126px;
  align-content: center;
  gap: 6px;
  padding: 20px;
  box-sizing: border-box;
}

.dashboard-summary-card > span,
.dashboard-summary-card > small {
  color: var(--ink-gray-6);
  font-size: 12px;
  line-height: 17px;
}

.dashboard-summary-card > strong {
  color: #212529;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.6px;
  line-height: 34px;
}

.dashboard-distribution {
  overflow: hidden;
}

.dashboard-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--outline-gray-1);
}

.dashboard-panel-heading > span {
  color: var(--ink-gray-6);
  font-size: 12px;
}

.dashboard-stage-list {
  display: grid;
  gap: 15px;
  padding: 18px;
}

.dashboard-stage-row {
  display: grid;
  grid-template-columns: minmax(160px, 260px) minmax(120px, 1fr);
  gap: 16px;
  align-items: center;
}

.dashboard-stage-copy {
  display: flex;
  min-width: 0;
  justify-content: space-between;
  gap: 12px;
  color: #495057;
  font-size: 13px;
}

.dashboard-stage-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-stage-copy strong {
  color: #212529;
  font-weight: 600;
}

.dashboard-stage-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #E9ECEF;
}

.dashboard-stage-fill {
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: #1473F9;
}

.dashboard-live-message {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 42px 20px;
  color: var(--ink-gray-6);
  font-size: 13px;
  text-align: center;
}

.dashboard-live-message strong {
  color: #495057;
  font-size: 14px;
}

.dashboard-live-error {
  justify-items: start;
  padding: 11px 13px;
  border: 1px solid #FFC9C9;
  border-radius: 8px;
  background: #FFF5F5;
  color: #C92A2A;
  text-align: left;
}

.dashboard-skeleton {
  border-radius: 10px;
  background: linear-gradient(100deg, #E9ECEF 20%, #F8F9FA 45%, #E9ECEF 70%);
  background-size: 240% 100%;
  animation: crm-skeleton-shimmer 1.45s ease-in-out infinite;
}

.dashboard-skeleton-filters { width: 460px; max-width: 100%; height: 36px; }
.dashboard-skeleton-card { height: 126px; }
.dashboard-skeleton-hero { height: 264px; }
.dashboard-skeleton-panel { height: 330px; }

@media (max-width: 639px) {
  .dashboard-live-header {
    display: none;
  }

  .dashboard-live-body {
    gap: 14px;
    padding: 14px 12px 24px;
  }

  .dashboard-filter-bar,
  .dashboard-filter-label {
    width: 100%;
  }

  .dashboard-filter-label > span {
    width: 72px;
    flex: 0 0 72px;
  }

  .dashboard-filter-select {
    width: auto;
    min-width: 0;
    flex: 1;
  }

  .dashboard-summary-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-live-overview { grid-template-columns: 1fr; }
  .dashboard-deals-hero { min-height: 200px; }

  .dashboard-summary-card {
    min-height: 104px;
  }

  .dashboard-stage-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }
}

/* ── Line Clamping ─────────────────────────────── */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Toast Notifications ───────────────────────── */
.crm-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1F2937;
  color: white;
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  z-index: 99999;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  animation: toast-in 0.25s ease-out, toast-out 0.25s ease-in 2.5s forwards;
  pointer-events: none;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes toast-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ── Agile Fluid Responsive Sidebar ─────────────────── */
.app-sidebar {
  --sb-logo-h: 56px;
  --sb-logo-size: 32px;
  --sb-btn-size: 38px;
  --sb-icon-size: 22px;
  --sb-nav-gap: 6px;
  --sb-nav-pad-y: 6px;
  --sb-bottom-pad-b: 12px;
  --sb-bottom-gap: 6px;

  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
}

.sidebar-logo-container {
  height: var(--sb-logo-h);
}

.sidebar-logo-btn {
  width: var(--sb-btn-size);
  height: var(--sb-btn-size);
}

.sidebar-logo-btn svg {
  width: var(--sb-logo-size) !important;
  height: var(--sb-logo-size) !important;
}

.sidebar-nav {
  gap: var(--sb-nav-gap) !important;
  padding-top: var(--sb-nav-pad-y) !important;
  padding-bottom: 2px !important;
  padding-left: 8px !important;
  padding-right: 8px !important;
  overflow: hidden !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.sidebar-nav::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.sidebar-bottom {
  margin-top: auto !important;
  gap: var(--sb-bottom-gap) !important;
  padding-top: 4px !important;
  padding-bottom: var(--sb-bottom-pad-b) !important;
  padding-left: 8px !important;
  padding-right: 8px !important;
}

.sidebar-btn {
  width: var(--sb-btn-size) !important;
  height: var(--sb-btn-size) !important;
  min-width: var(--sb-btn-size) !important;
  min-height: var(--sb-btn-size) !important;
  padding: 0 !important;
}

.sidebar-btn svg {
  width: var(--sb-icon-size) !important;
  height: var(--sb-icon-size) !important;
  max-width: var(--sb-icon-size) !important;
  max-height: var(--sb-icon-size) !important;
}

.sidebar-btn .sidebar-mask-icon {
  width: var(--sb-icon-size) !important;
  height: var(--sb-icon-size) !important;
}

.sidebar-btn .sidebar-logout-icon {
  width: var(--sb-icon-size) !important;
  height: var(--sb-icon-size) !important;
}

.sidebar-notif-dot {
  width: 7px !important;
  height: 7px !important;
  top: 7px !important;
  right: 7px !important;
}

/* Height-based Fluid Responsive Scaling */
@media (max-height: 880px) {
  .app-sidebar {
    --sb-logo-h: 52px;
    --sb-logo-size: 30px;
    --sb-btn-size: 36px;
    --sb-icon-size: 21px;
    --sb-nav-gap: 5px;
    --sb-nav-pad-y: 5px;
    --sb-bottom-pad-b: 10px;
    --sb-bottom-gap: 5px;
  }
  .sidebar-notif-dot {
    width: 6px !important;
    height: 6px !important;
    top: 6px !important;
    right: 6px !important;
  }
}

@media (max-height: 770px) {
  .app-sidebar {
    --sb-logo-h: 48px;
    --sb-logo-size: 28px;
    --sb-btn-size: 34px;
    --sb-icon-size: 20px;
    --sb-nav-gap: 4px;
    --sb-nav-pad-y: 4px;
    --sb-bottom-pad-b: 8px;
    --sb-bottom-gap: 4px;
  }
  .sidebar-notif-dot {
    width: 6px !important;
    height: 6px !important;
    top: 5px !important;
    right: 5px !important;
  }
}

@media (max-height: 700px) {
  .app-sidebar {
    --sb-logo-h: 42px;
    --sb-logo-size: 26px;
    --sb-btn-size: 30px;
    --sb-icon-size: 18px;
    --sb-nav-gap: 3px;
    --sb-nav-pad-y: 3px;
    --sb-bottom-pad-b: 6px;
    --sb-bottom-gap: 3px;
  }
  .sidebar-notif-dot {
    width: 5px !important;
    height: 5px !important;
    top: 4px !important;
    right: 4px !important;
  }
}

@media (max-height: 620px) {
  .app-sidebar {
    --sb-logo-h: 36px;
    --sb-logo-size: 22px;
    --sb-btn-size: 26px;
    --sb-icon-size: 15px;
    --sb-nav-gap: 2px;
    --sb-nav-pad-y: 2px;
    --sb-bottom-pad-b: 4px;
    --sb-bottom-gap: 2px;
  }
  .sidebar-notif-dot {
    width: 5px !important;
    height: 5px !important;
    top: 3px !important;
    right: 3px !important;
  }
}

@media (max-height: 540px) {
  .app-sidebar {
    --sb-logo-h: 30px;
    --sb-logo-size: 18px;
    --sb-btn-size: 22px;
    --sb-icon-size: 13px;
    --sb-nav-gap: 1px;
    --sb-nav-pad-y: 1px;
    --sb-bottom-pad-b: 2px;
    --sb-bottom-gap: 1px;
  }
}

/* ── Sidebar Custom Mask Icons ─────────────────── */
.sidebar-mask-icon {
  width: var(--sb-icon-size, 25px);
  height: var(--sb-icon-size, 25px);
  display: inline-block;
  background-color: currentColor;
  mask-size: contain;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-position: center;
}

.sidebar-new-lead-icon {
  mask-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAxElEQVR4nO2ZQQ6CMBQF535CPJQh8VIKV1LYPzdsxECLCekH3iSzJW/SdgUYY/7lCnTAAKiwA9AC9dqIe4DxmrFZcxIKbpUT0gUYqoTPnJA+wFAlfOeEaCcmKT1QDplQeqCihmz93VkcgkNwyBIOwSE4ZAmHsMOQrZFDznq15BAcIofgEByCQ35xCAcP0UYmKT1QDplwmJA+wEglfOWEtAGGKuEjJ6QOMFQJL2TSBBirGW+spBr/nkZ4M/14nbJPwhjDFx9F72wBUalX3AAAAABJRU5ErkJggg==");
  -webkit-mask-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAxElEQVR4nO2ZQQ6CMBQF535CPJQh8VIKV1LYPzdsxECLCekH3iSzJW/SdgUYY/7lCnTAAKiwA9AC9dqIe4DxmrFZcxIKbpUT0gUYqoTPnJA+wFAlfOeEaCcmKT1QDplQeqCihmz93VkcgkNwyBIOwSE4ZAmHsMOQrZFDznq15BAcIofgEByCQ35xCAcP0UYmKT1QDplwmJA+wEglfOWEtAGGKuEjJ6QOMFQJL2TSBBirGW+spBr/nkZ4M/14nbJPwhjDFx9F72wBUalX3AAAAABJRU5ErkJggg==");
}

.sidebar-card-fields-icon {
  mask-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAABE0lEQVR4nO2YUWrCQBRFz4f0q11B7T5KaxdWXYaIG2irCxC7IOsugleGRvAjM2MIJG/iO3AhMBO4J5kJZMBxHMdxRsoHsAWOQAWo51TAH7ABZm2KT4D1AIWVyarulsVieV1JZJeNjGeWEtgaKKhMvlMCRwMFlUnY2FGG+NqoZULHKCokUUYrsAOeG+ZPgX0JAtPEPS8lCORwAXwJ/RO7YR+RCOV/SxCQsUQZuphcgJEKfAIPV/PC9bzHcXUVeGyY+9TjuLoKzBue0KLHcd3NHqgMlFOXH5oSfikPKYGNgYLK5Csl8AqcDJRUIu9kWBkoqUiW3MDEqMTy1qPFC+FV/dSbZqjD3UN9kPXWprjjOI7jUApn11dW6VzyqCAAAAAASUVORK5CYII=");
  -webkit-mask-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAABE0lEQVR4nO2YUWrCQBRFz4f0q11B7T5KaxdWXYaIG2irCxC7IOsugleGRvAjM2MIJG/iO3AhMBO4J5kJZMBxHMdxRsoHsAWOQAWo51TAH7ABZm2KT4D1AIWVyarulsVieV1JZJeNjGeWEtgaKKhMvlMCRwMFlUnY2FGG+NqoZULHKCokUUYrsAOeG+ZPgX0JAtPEPS8lCORwAXwJ/RO7YR+RCOV/SxCQsUQZuphcgJEKfAIPV/PC9bzHcXUVeGyY+9TjuLoKzBue0KLHcd3NHqgMlFOXH5oSfikPKYGNgYLK5Csl8AqcDJRUIu9kWBkoqUiW3MDEqMTy1qPFC+FV/dSbZqjD3UN9kPXWprjjOI7jUApn11dW6VzyqCAAAAAASUVORK5CYII=");
}

/* ── Uniting support request panel ───────────────── */
.support-widget-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  isolation: isolate;
  background: transparent;
  pointer-events: auto;
}

.support-widget-backdrop.hidden {
  display: none !important;
}

.support-widget-panel {
  position: fixed;
  left: 84px;
  bottom: 10px;
  display: flex;
  width: min(420px, calc(100vw - 100px));
  max-height: min(560px, calc(100vh - 26px));
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  padding: 20px;
  color: #1f2937;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18), 0 3px 10px rgba(15, 23, 42, 0.08);
  animation: supportPanelIn 180ms ease-out both;
}

.support-widget-panel::before {
  position: absolute;
  left: -7px;
  bottom: 169px;
  width: 12px;
  height: 12px;
  border-left: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
  content: '';
  transform: rotate(45deg);
}

.support-widget-header,
.support-widget-actions,
.support-widget-types {
  display: flex;
  align-items: center;
}

.support-widget-header {
  justify-content: space-between;
}

.support-widget-header p {
  margin: 0 0 2px;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.support-widget-header h2 {
  margin: 0;
  color: #111827;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.35;
}

.support-widget-icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #6b7280;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}

.support-widget-icon-button:hover { background: #f3f4f6; color: #111827; }
.support-widget-types { gap: 8px; }

.support-widget-type {
  display: flex;
  min-height: 40px;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: #6b7280;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.support-widget-type.is-active {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #111827;
  box-shadow: 0 0 0 1px #e2e8f0;
}

.support-widget-type svg,
.support-widget-hint svg,
.support-widget-submit svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.support-widget-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

.support-widget-field input,
.support-widget-field textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  outline: none;
  background: #fff;
  padding: 10px 12px;
  color: #111827;
  font: inherit;
  font-weight: 400;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.support-widget-field input:focus,
.support-widget-field textarea:focus {
  border-color: #9ca3af;
  box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.14);
}

.support-widget-field textarea { min-height: 112px; resize: vertical; }
.support-widget-field input[type='file'] { padding: 8px; color: #6b7280; font-size: 12px; }

.support-widget-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: -8px 0 0;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 450;
}

.support-widget-actions { justify-content: flex-end; }

.support-widget-submit {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  background: #111827;
  padding: 0 15px;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.support-widget-submit:hover { background: #1f2937; }
.support-widget-submit:disabled { cursor: wait; opacity: 0.65; }
.support-widget-submit .is-spinning { animation: spin 0.8s linear infinite; }

@keyframes supportPanelIn {
  from { opacity: 0; transform: translateX(-6px) scale(0.985); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@media (max-width: 639px) {
  .support-widget-backdrop { background: rgba(15, 23, 42, 0.22); }
  .support-widget-panel {
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - 24px);
  }
  .support-widget-panel::before { display: none; }
}

/* ── High-Performance Instant Sidebar Tooltip ─────── */
.crm-sidebar-tooltip {
  position: fixed;
  z-index: 99999;
  pointer-events: none;
  background-color: #101828;
  color: #FFFFFF;
  font-family: var(--font-family, 'Inter', system-ui, -apple-system, sans-serif);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  padding: 6.5px 11px;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  display: none;
  opacity: 1;
  transform: translateY(-50%);
  will-change: transform, top, left;
}

.crm-sidebar-tooltip.is-visible {
  display: flex !important;
  align-items: center;
}

.crm-sidebar-tooltip .crm-tooltip-arrow {
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 6px solid #101828;
  border-left: none;
  pointer-events: none;
}

/* ── Executive Analytics Dashboard ────────────────── */
.dash-metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
}
@media (max-width: 1280px) {
  .dash-metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
}
@media (max-width: 768px) {
  .dash-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

.dash-flat-tile {
  background-color: transparent;
  padding: 12px 18px;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.dash-card {
  background-color: #FFFFFF;
  border-radius: 16px;
  border: 1px solid #E5E7EB;
  padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 1280px) {
  .dash-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {
  .dash-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dash-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
@media (max-width: 1024px) {
  .dash-charts-grid {
    grid-template-columns: 1fr;
  }
}

.dash-card-spacer {
  min-height: 110px;
}

@keyframes modalScaleIn {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-scale-in {
  animation: modalScaleIn 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ── Uniting CRM replication layer ───────────────────────────────
   These rules intentionally sit last. They translate the authoritative
   Vue layout into this frontend's existing DOM while retaining PeopleIndex
   data, APIs, and component behaviour. */

#mobile-header,
#mobile-sidebar-backdrop,
.sidebar-mobile-label {
  display: none;
}

/* Desktop navigation rail: 72px shell, 64px logo row, 40px controls. */
.app-sidebar {
  --sb-logo-h: 64px !important;
  --sb-logo-size: 34px !important;
  --sb-btn-size: 40px !important;
  --sb-icon-size: 25px !important;
  --sb-nav-gap: 6px !important;
  --sb-nav-pad-y: 8px !important;
  --sb-bottom-pad-b: 16px !important;
  --sb-bottom-gap: 8px !important;
  width: 72px !important;
  overflow: hidden !important;
  border-right: 1px solid var(--outline-gray-1) !important;
  background: var(--surface-white) !important;
}

.sidebar-logo-container {
  height: 64px !important;
  min-height: 64px !important;
}

.sidebar-nav {
  align-items: center !important;
  gap: 6px !important;
  padding: 8px 12px 4px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.sidebar-bottom {
  align-items: center !important;
  gap: 8px !important;
  padding: 12px 12px 16px !important;
}

.sidebar-btn {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  border-radius: 12px !important;
}

.sidebar-btn:focus-visible,
.sidebar-logo-btn:focus-visible,
.mobile-header-button:focus-visible,
.btn-collapse-col:focus-visible,
.btn-filter-col:focus-visible {
  outline: 2px solid #6b7280 !important;
  outline-offset: 2px !important;
}

/* Uniting cards do not retain a visible selection/focus ring after opening. */
.kanban-card:focus-visible,
.kanban-card.card-focused {
  outline: none !important;
  outline-offset: 0 !important;
}

/* The scrollable column is keyboard-focusable, but Uniting does not draw a
   persistent browser ring around the entire lane after pointer interaction. */
.kanban-cards:focus,
.column-scroll-area:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Authoritative Uniting board geometry. */
#kanban-board-scroll {
  align-items: flex-start !important;
  gap: 10px !important;
  padding: 18px 20px 0 !important;
  box-sizing: border-box !important;
}

#kanban-board-scroll > .kanban-column:not(.kanban-column-collapsed) {
  width: 360px !important;
  min-width: 360px !important;
  max-width: 360px !important;
}

.kanban-column:not(.kanban-column-collapsed) > .kanban-column-header {
  min-height: 56px !important;
  margin-bottom: 10px !important;
  padding: 4px 8px 8px !important;
  box-sizing: border-box !important;
}

.kanban-cards {
  gap: 10px !important;
  padding: 0 8px 12px !important;
}

.lead-kanban-board .kanban-card {
  width: 344px !important;
  height: auto !important;
  min-height: 104px !important;
  padding: 30px 20px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(15, 23, 42, 0.043) !important;
  box-shadow: 0 14px 14px -11px rgba(15, 23, 42, 0.25), 0 42px 50px -42px rgba(15, 23, 42, 0.48) !important;
  box-sizing: border-box !important;
}

.deal-kanban-board .kanban-card,
.sa-kanban-board .kanban-card,
.loan-kanban-board .kanban-card {
  width: 344px !important;
  padding: 20px !important;
  border-radius: 12px !important;
  border: 1px solid #E5E7EB !important;
  box-sizing: border-box !important;
}

.deal-kanban-board .invoice-stack-card,
.sa-kanban-board .invoice-stack-card,
.loan-kanban-board .invoice-stack-card {
  padding: 20px !important;
}

.kanban-column.kanban-column-collapsed {
  width: 64px !important;
  min-width: 64px !important;
  max-width: 64px !important;
  height: 300px !important;
  min-height: 300px !important;
  max-height: 300px !important;
  margin: 0 !important;
  border: 1px solid #E5E7EB !important;
  border-radius: 12px !important;
  background: #F3F4F6 !important;
}

.kanban-column.kanban-column-collapsed .kanban-column-header {
  padding: 16px 6px 12px !important;
}

.kanban-column.kanban-column-collapsed .kanban-column-title {
  gap: 8px !important;
  margin-top: 10px !important;
}

.kanban-card:hover {
  transform: translateY(-1px);
}

.kanban-card:active:not(.is-dragging) {
  transform: translateY(0) scale(0.995);
  transition-duration: 80ms;
}

.kanban-card.is-dragging {
  opacity: 0.42 !important;
  transform: scale(0.985) !important;
  transition: opacity 120ms ease, transform 160ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}

.kanban-column.is-drag-over > .kanban-cards {
  background: rgba(20, 115, 249, 0.07);
  box-shadow: inset 0 0 0 1px rgba(20, 115, 249, 0.22);
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.kanban-column-collapsed.is-drag-over {
  border-color: rgba(20, 115, 249, 0.55) !important;
  background: rgba(20, 115, 249, 0.08) !important;
}

.kanban-load-more {
  display: flex;
  min-height: 40px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: #8a94a6;
  font-size: 12px;
  font-weight: 400;
}

.kanban-load-more.is-loading {
  background: transparent;
}

.btn-retry-load-more {
  width: calc(100% - 8px);
  cursor: pointer;
  background: #fff;
  box-shadow: inset 0 0 0 1px #e5e7eb;
}

.btn-retry-load-more:hover {
  color: #344054;
  background: #f8fafc;
}

.btn-retry-load-more strong {
  color: #2563eb;
}

.kanban-load-spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 2px solid #d9dde4;
  border-top-color: #64748b;
  border-radius: 999px;
  animation: spin 700ms linear infinite;
}

.kanban-touch-ghost {
  position: fixed !important;
  z-index: 99999 !important;
  margin: 0 !important;
  pointer-events: none !important;
  opacity: 0.94 !important;
  transform: rotate(1.5deg) scale(1.015) !important;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.22) !important;
}

/* Uniting's narrow-screen layout: fixed 48px header + 260px off-canvas menu. */
@media (max-width: 639px) {
  #app {
    width: 100vw !important;
    height: 100dvh !important;
  }

  .workspace-shell {
    width: 100% !important;
    min-width: 0 !important;
  }

  #mobile-header {
    position: relative;
    z-index: 20;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    min-height: 48px;
    padding: 0 8px;
    padding-top: env(safe-area-inset-top, 0px);
    border-bottom: 1px solid var(--outline-gray-1);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-sizing: border-box;
  }

  #mobile-view-title {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: #343A40;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
  }

  .mobile-header-button {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #495057;
    cursor: pointer;
  }

  .mobile-header-button:hover,
  .mobile-header-button:active {
    background: #F1F3F5;
  }

  .mobile-header-button[hidden] {
    display: none !important;
  }

  .mobile-header-button svg {
    width: 20px;
    height: 20px;
  }

  #main-content {
    height: calc(100dvh - 48px) !important;
  }

  #sidebar-container {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    z-index: 70 !important;
    width: 260px !important;
    height: 100dvh !important;
    transform: translateX(-100%);
    transition: transform 200ms cubic-bezier(0.2, 0, 0, 1);
    visibility: hidden;
  }

  #sidebar-container.is-open {
    transform: translateX(0);
    visibility: visible;
  }

  #mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.38);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 180ms ease, visibility 180ms ease;
  }

  #mobile-sidebar-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body.mobile-menu-open {
    touch-action: none;
  }

  .app-sidebar {
    width: 260px !important;
    max-width: 86vw !important;
    align-items: stretch !important;
    box-shadow: 12px 0 30px rgba(15, 23, 42, 0.12);
  }

  .sidebar-logo-container {
    justify-content: flex-start !important;
    padding: 0 14px !important;
    box-sizing: border-box;
  }

  .sidebar-logo-btn {
    width: 100% !important;
    height: 48px !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    padding: 0 8px !important;
  }

  .sidebar-nav,
  .sidebar-bottom {
    align-items: stretch !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .sidebar-nav {
    overflow-y: auto !important;
  }

  .sidebar-btn {
    width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
    min-height: 44px !important;
    justify-content: flex-start !important;
    gap: 14px !important;
    padding: 0 12px !important;
    text-align: left;
  }

  .sidebar-btn > svg,
  .sidebar-btn > .sidebar-mask-icon,
  .sidebar-btn > .sidebar-logout-icon {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
  }

  .sidebar-mobile-label {
    display: inline-block;
    min-width: 0;
    overflow: hidden;
    color: currentColor;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-brand-label {
    color: #343A40;
    font-size: 15px;
    font-weight: 600;
  }

  .sidebar-notif-dot {
    left: 27px !important;
    right: auto !important;
  }

  .crm-sidebar-tooltip,
  .crm-sidebar-tooltip.is-visible {
    display: none !important;
  }

  #kanban-board-scroll {
    padding: 14px 12px 0 !important;
    scroll-padding-left: 12px;
    scroll-snap-type: x proximity;
  }

  #kanban-board-scroll > .kanban-column:not(.kanban-column-collapsed) {
    width: min(310px, calc(100vw - 42px)) !important;
    min-width: min(310px, calc(100vw - 42px)) !important;
    max-width: min(310px, calc(100vw - 42px)) !important;
    scroll-snap-align: start;
  }

  #kanban-board-scroll > .kanban-column:not(.kanban-column-collapsed) .kanban-card,
  #kanban-board-scroll > .kanban-column:not(.kanban-column-collapsed) .invoice-stack-card,
  #kanban-board-scroll > .kanban-column:not(.kanban-column-collapsed) .card-next-year {
    width: 100% !important;
  }

  .kanban-column:not(.kanban-column-collapsed) > .kanban-column-header {
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  .kanban-cards {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .lead-kanban-board .kanban-card,
  .deal-kanban-board .kanban-card,
  .sa-kanban-board .kanban-card,
  .loan-kanban-board .kanban-card {
    padding: 18px !important;
  }

  #btn-open-shortcuts {
    display: none !important;
  }

  #drawer-panel {
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .drawer-single-panel {
    width: 100vw !important;
    min-width: 100vw !important;
    max-width: 100vw !important;
  }

  #notification-panel {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  #profile-modal-overlay,
  #filter-modal-overlay,
  #card-fields-overlay,
  #add-student-overlay,
  #settings-modal-overlay,
  #shortcuts-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  #profile-modal-container,
  #filter-modal-container,
  #card-fields-container,
  #add-student-container,
  #settings-modal-container,
  #shortcuts-container {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 24px) !important;
    overflow: auto;
  }

  #settings-modal-container .settings-dialog {
    height: min(720px, calc(100dvh - 24px)) !important;
    max-height: calc(100dvh - 24px) !important;
    flex-direction: column !important;
    border-radius: 16px 16px 0 0 !important;
  }

  #settings-modal-container .settings-sidebar {
    width: 100% !important;
    height: min(42dvh, 390px) !important;
    max-height: min(42dvh, 390px) !important;
    flex: 0 0 min(42dvh, 390px) !important;
    overflow-y: auto !important;
    padding: 12px !important;
    border-right: 0 !important;
    border-bottom: 1px solid #E5E7EB !important;
    box-sizing: border-box;
  }

  #settings-modal-container .settings-nav-list {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px !important;
  }

  #settings-modal-container .settings-content {
    min-height: 0 !important;
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    padding: 24px 18px 18px !important;
  }

  .crm-toast {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100vw - 32px);
    white-space: normal;
    text-align: center;
  }
}

@media (min-width: 640px) and (max-width: 768px) {
  #kanban-board-scroll > .kanban-column:not(.kanban-column-collapsed) {
    width: min(310px, calc(100vw - 42px)) !important;
    min-width: min(310px, calc(100vw - 42px)) !important;
    max-width: min(310px, calc(100vw - 42px)) !important;
  }

  #kanban-board-scroll > .kanban-column:not(.kanban-column-collapsed) .kanban-card,
  #kanban-board-scroll > .kanban-column:not(.kanban-column-collapsed) .invoice-stack-card,
  #kanban-board-scroll > .kanban-column:not(.kanban-column-collapsed) .card-next-year {
    width: 100% !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* CRM filter order and dialog dimensions from the reference board. */
#filter-modal-container{width:min(672px,calc(100vw - 32px))}
#filter-modal-container>div{width:100%;max-width:none}
#filter-modal-container .order-1{order:1}
#filter-modal-container .order-2{order:2}
#filter-modal-container .order-3{order:3}
#filter-modal-container .order-4{order:4}
#filter-modal-container .order-5{order:5}
#filter-modal-container .order-6{order:6}
#filter-modal-container .order-7{order:7}
#filter-modal-container .order-8{order:8}
#filter-modal-container .order-9{order:9}
#filter-modal-container .order-10{order:10}
#btn-reset-filters{border-radius:6px;background:#f1f2f3;padding:5px 9px}

#card-fields-container{width:min(512px,calc(100vw - 32px))}
#card-fields-container>div{width:100%;max-width:none;min-height:490px}
#card-fields-list .field-item{min-height:34px}
#add-card-field{height:28px;padding:0}
#apply-card-fields{height:28px;padding:0;margin-top:auto}
@media(max-width:640px){#card-fields-container>div{min-height:0;max-height:calc(100dvh - 24px)}}
#card-fields-container>div{padding-top:14px}
#apply-card-fields{margin-top:43px}

/* WhatsApp settings owns its internal 32px/24px reference spacing. The
   settings entrance class otherwise applies a second 32px inset. */
#settings-modal-container .settings-content.settings-content-enter:has(.settings-whatsapp-page) {
  overflow: hidden !important;
  padding: 0 !important;
}

#settings-modal-container .settings-whatsapp-header.settings-content-header {
  margin-right: 0 !important;
  margin-bottom: 0 !important;
}
