/* CA Cloud Desk — Component Styles (works without build) */
@import url('./typography.css');

:root {
  --crm-sidebar-width: 260px;
  --crm-sidebar-collapsed-width: 72px;
  --crm-header-height: 4rem;
  --crm-floating-actions-right: 1.5rem;
  --crm-floating-actions-bottom: 1.5rem;
  /* CA Cloud Desk thin pill scrollbars — match partner portal tables */
  --crm-scrollbar-size: 5px;
  --crm-scrollbar-track: transparent;
  --crm-scrollbar-track-surface: #fafbfc;
  --crm-scrollbar-thumb: #d1d5db;
  --crm-scrollbar-thumb-hover: #9ca3af;
}

html {
  scroll-behavior: smooth;
  overflow: hidden;
  height: 100%;
  max-width: 100vw;
}

body {
  background-color: #F8FAFC;
  color: #1e293b;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  overflow: hidden;
  height: 100%;
  max-width: 100vw;
}

/* ─── Global scrollbars (CA Cloud Desk — thin pill, hidden track) ─── */
*,
html,
body {
  scrollbar-width: thin;
  scrollbar-color: var(--crm-scrollbar-thumb) var(--crm-scrollbar-track);
}

::-webkit-scrollbar {
  width: var(--crm-scrollbar-size);
  height: var(--crm-scrollbar-size);
}

::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

::-webkit-scrollbar-track {
  background: var(--crm-scrollbar-track);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb {
  background: var(--crm-scrollbar-thumb);
  border-radius: 999px;
  min-height: 32px;
  min-width: 32px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--crm-scrollbar-thumb-hover);
}

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

/* Table / list horizontal bars — sit on footer surface like reference UI */
.table-scroll-container,
.crm-table-container,
.cam-table-wrap,
.cam-table-scroll,
.cam-page .overflow-x-auto,
.assign-active__table-wrap,
.ecfg-table-wrap,
.crm-table-card .table-scroll-container,
.cam-table-card .table-scroll-container {
  scrollbar-width: thin;
  scrollbar-color: var(--crm-scrollbar-thumb) var(--crm-scrollbar-track-surface);
}

.table-scroll-container::-webkit-scrollbar-track,
.crm-table-container::-webkit-scrollbar-track,
.cam-table-wrap::-webkit-scrollbar-track,
.cam-table-scroll::-webkit-scrollbar-track,
.assign-active__table-wrap::-webkit-scrollbar-track,
.ecfg-table-wrap::-webkit-scrollbar-track {
  background: var(--crm-scrollbar-track-surface);
}

.table-scroll-container::-webkit-scrollbar-thumb,
.crm-table-container::-webkit-scrollbar-thumb,
.cam-table-wrap::-webkit-scrollbar-thumb,
.cam-table-scroll::-webkit-scrollbar-thumb,
.assign-active__table-wrap::-webkit-scrollbar-thumb,
.ecfg-table-wrap::-webkit-scrollbar-thumb {
  background: var(--crm-scrollbar-thumb);
  border-radius: 999px;
}

/* Reinforce on every common scroll container in the CRM */
.crm-scroll-area,
.crm-page,
.overflow-x-auto,
.overflow-y-auto,
.ca-modal-body,
.ca-modal-footer,
.header-profile-menu,
.header-settings-menu,
.mgr-priority-list,
.mgr-activity-feed,
.mgr-dashboard .overflow-x-auto,
#kanban-board {
  scrollbar-width: thin;
  scrollbar-color: var(--crm-scrollbar-thumb) var(--crm-scrollbar-track);
}

html.crm-scroll-locked,
body.crm-scroll-locked {
  overflow: hidden !important;
}

/* ─── Fixed CRM shell (sidebar + header fixed, only content scrolls) ─── */
.crm-layout {
  display: flex;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
}

.crm-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--crm-sidebar-width);
  z-index: 1100;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.crm-sidebar .ca-sidebar-brand {
  flex: 0 0 auto;
}

.crm-sidebar .ca-sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.crm-sidebar .ca-sidebar-footer {
  flex: 0 0 auto;
  margin-top: auto;
}

.crm-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  margin-left: var(--crm-sidebar-width);
  width: calc(100% - var(--crm-sidebar-width));
  max-width: calc(100vw - var(--crm-sidebar-width));
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  min-width: 0;
  transition: margin-left 0.3s ease, width 0.3s ease, max-width 0.3s ease;
}

.crm-content.main-expanded {
  margin-left: var(--crm-sidebar-collapsed-width);
  width: calc(100% - var(--crm-sidebar-collapsed-width));
  max-width: calc(100vw - var(--crm-sidebar-collapsed-width));
}

.crm-header {
  position: sticky;
  top: 0;
  z-index: 1200;
  flex-shrink: 0;
  min-height: var(--crm-header-height);
  height: var(--crm-header-height);
  background: rgba(241, 245, 249, 0.96);
  background-clip: padding-box;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ca-top-header.crm-header {
  position: sticky;
  top: 0;
  z-index: 1200;
}

.crm-scroll-area {
  flex: 1 1 auto;
  min-height: 0;
  height: calc(100vh - var(--crm-header-height));
  height: calc(100dvh - var(--crm-header-height));
  max-height: calc(100vh - var(--crm-header-height));
  max-height: calc(100dvh - var(--crm-header-height));
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.crm-scroll-area--locked {
  overflow: hidden !important;
}

.crm-page {
  max-width: 100%;
  min-width: 0;
}

/* ─── Fixed floating actions (right edge, never scroll) ─── */
.crm-floating-actions {
  position: fixed;
  right: var(--crm-floating-actions-right);
  bottom: var(--crm-floating-actions-bottom);
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  pointer-events: none;
}

.crm-floating-actions__fab {
  pointer-events: auto;
}

.crm-fab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border: none;
  border-radius: 1rem;
  background: #4CB4D4;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 10px 24px -4px rgb(0 0 0 / 0.08);
  transition: transform 0.3s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.crm-fab-btn:hover {
  background: #1e9688;
  transform: scale(1.05);
  box-shadow: 0 0 0 3px rgba(76, 180, 212, 0.15);
}

.crm-fab-btn__icon {
  transition: transform 0.3s ease;
}

#fab.fab-active {
  transform: rotate(45deg);
  background: #2E7F96 !important;
}

#fab.fab-active .crm-fab-btn__icon {
  transform: rotate(-45deg);
}

.crm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1040;
}

/* ─── Tables: sticky header + scrollable body ─── */
.crm-table-container {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.crm-table-container--scroll-y,
.crm-table-container[class*="max-h-"] {
  overflow-y: auto;
}

.crm-table-container .ca-table {
  width: 100%;
  min-width: max-content;
  border-collapse: separate;
  border-spacing: 0;
}

.crm-table-container .ca-table thead tr:first-child th {
  position: sticky;
  top: 0;
  z-index: var(--crm-z-head-label, 35);
  background: var(--crm-sticky-head-bg, #f8fafc);
  box-shadow: inset 0 -1px 0 #e2e8f0;
}

.crm-table-container .ca-table thead tr.crm-col-filter-row th {
  position: sticky;
  top: var(--crm-table-head-row-h, 32px);
  z-index: var(--crm-z-head-filter, 25);
  background: var(--crm-sticky-head-bg, #f8fafc);
  box-shadow: inset 0 -1px 0 #e2e8f0;
}

.mgr-panel .crm-table-container .ca-table thead th,
.card .crm-table-container .ca-table thead th {
  background: #fff;
}

/* Legacy wrappers inherit table container behavior */
.overflow-x-auto:not(.crm-scroll-area):not(.ca-modal-body) {
  max-width: 100%;
}

.card > .overflow-x-auto,
.mgr-panel > .overflow-x-auto,
.card.overflow-hidden > .overflow-x-auto {
  overflow-x: auto;
  max-width: 100%;
}

.card > .overflow-x-auto[class*="max-h-"],
.mgr-panel > .overflow-x-auto[class*="max-h-"],
.card.overflow-hidden > .overflow-x-auto[class*="max-h-"],
.overflow-x-auto.max-h-\[420px\],
.overflow-x-auto.max-h-\[360px\] {
  overflow-y: auto;
}

.card > .overflow-x-auto .ca-table thead tr:first-child th,
.mgr-panel > .overflow-x-auto .ca-table thead tr:first-child th,
.card.overflow-hidden > .overflow-x-auto .ca-table thead tr:first-child th,
.overflow-x-auto .ca-table thead tr:first-child th {
  position: sticky;
  top: 0;
  z-index: var(--crm-z-head-label, 35);
  background: var(--crm-sticky-head-bg, #f8fafc);
  box-shadow: inset 0 -1px 0 #e2e8f0;
}

.card > .overflow-x-auto .ca-table thead tr.crm-col-filter-row th,
.mgr-panel > .overflow-x-auto .ca-table thead tr.crm-col-filter-row th,
.card.overflow-hidden > .overflow-x-auto .ca-table thead tr.crm-col-filter-row th,
.overflow-x-auto .ca-table thead tr.crm-col-filter-row th {
  position: sticky;
  top: var(--crm-table-head-row-h, 32px);
  z-index: var(--crm-z-head-filter, 25);
  background: var(--crm-sticky-head-bg, #f8fafc);
  box-shadow: inset 0 -1px 0 #e2e8f0;
}

/* ─── Enterprise CRM tables (Leads, CA Master, Assignment, Follow-ups) ─── */
.leads-hub {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.table-scroll-container,
.cam-table-wrap,
.cam-table-scroll,
.assign-active__table-wrap {
  position: relative;
  overflow: auto;
  max-width: 100%;
  max-height: calc(100vh - 260px);
  min-height: 360px;
  /* smooth scroll desyncs position:sticky table cells in Chromium */
  scroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  transform: none;
  will-change: auto;
  isolation: isolate;
}

.crm-table-card .table-scroll-container,
.cam-table-card .table-scroll-container {
  overflow-x: auto;
  overflow-y: auto;
}

.crm-table-card,
.cam-table-card {
  overflow: visible;
  padding: 0;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}

.crm-table-card--nested {
  border: none;
  box-shadow: none;
  background: transparent;
}

.crm-table-card--nested .table-scroll-container {
  max-height: min(52vh, 520px);
  min-height: 260px;
}

.leads-table-card .table-scroll-container {
  max-height: calc(100vh - 320px);
}

.crm-table-footer,
.cam-table-footer {
  padding: 0;
  border-top: 1px solid #e5e7eb;
  background: #fff;
  min-height: 56px;
}

.crm-table-footer--empty {
  display: none;
}

.crm-table-footer > .crm-table-pagination {
  border-top: none;
}

.bulk-assign-pagination.crm-table-footer {
  padding: 0;
  margin-top: 0.75rem;
}

.crm-table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 60px;
  padding: 0.75rem 1.25rem;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  font-size: var(--crm-font-size-body);
  font-weight: var(--crm-font-weight-pagination);
  color: #374151;
}

.crm-table-pagination__left {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.crm-table-pagination__center {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
}

.crm-table-pagination__right {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.crm-table-pagination__rows {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0;
  cursor: pointer;
}

.crm-table-pagination__rows-label {
  font-size: var(--crm-font-size-body);
  font-weight: var(--crm-font-weight-pagination);
  color: #6b7280;
  white-space: nowrap;
}

.crm-table-pagination__per-page {
  height: 2rem;
  min-width: 4.25rem;
  padding: 0 1.75rem 0 0.625rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.5rem center;
  appearance: none;
  font-size: var(--crm-font-size-body);
  font-weight: var(--crm-font-weight-pagination);
  color: #374151;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.crm-table-pagination__per-page:hover {
  border-color: #d1d5db;
}

.crm-table-pagination__per-page:focus {
  outline: none;
  border-color: #2E7F96;
  box-shadow: 0 0 0 3px rgb(46 127 150 / 0.15);
}

.crm-table-pagination__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.crm-table-pagination__nav:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #374151;
}

.crm-table-pagination__nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f9fafb;
}

.crm-table-pagination__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 2.5rem;
  width: 3rem;
  height: 2rem;
  padding: 0 0.25rem;
  border: 1px solid #2E7F96;
  border-radius: 6px;
  background: #fff;
  color: #111827;
  font-size: var(--crm-font-size-body);
  font-weight: var(--crm-font-weight-pagination);
  line-height: 1;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}

.crm-table-pagination__page::-webkit-outer-spin-button,
.crm-table-pagination__page::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.crm-table-pagination__page:focus {
  outline: none;
  border-color: #2E7F96;
  box-shadow: 0 0 0 3px rgb(46 127 150 / 0.15);
}

.crm-table-pagination__of {
  font-size: var(--crm-font-size-body);
  font-weight: var(--crm-font-weight-pagination);
  color: #6b7280;
  white-space: nowrap;
}

.crm-table-pagination__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  height: 2rem;
  padding: 0 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  font-size: var(--crm-font-size-body);
  font-weight: var(--crm-font-weight-pagination);
  color: #374151;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .crm-table-pagination {
    flex-wrap: wrap;
    justify-content: center;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
  }

  .crm-table-pagination__left {
    flex: 1 1 100%;
    justify-content: center;
  }

  .crm-table-pagination__center {
    flex: 1 1 100%;
    order: 2;
  }

  .crm-table-pagination__right {
    flex: 1 1 100%;
    justify-content: center;
    order: 3;
  }
}

.crm-table,
.ca-table.ca-table--enterprise {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.crm-table th,
.crm-table td,
.ca-table--enterprise th,
.ca-table--enterprise td {
  padding: var(--crm-table-cell-py, 5px) var(--crm-table-cell-px, 10px);
  height: var(--crm-table-row-h, 30px);
  min-height: var(--crm-table-row-h, 30px);
  max-height: var(--crm-table-row-h, 30px);
  font-size: var(--crm-font-size-table-cell);
  line-height: var(--crm-line-height-tight);
  white-space: nowrap;
  vertical-align: middle;
  border-bottom: 1px solid #eef2f7;
  overflow: hidden;
  box-sizing: border-box;
}

.crm-table tbody tr,
.ca-table--enterprise tbody tr {
  height: var(--crm-table-row-h, 30px);
}

/* Empty / loading rows need full height — compact row rules clip the message */
.crm-table tbody tr.cam-empty-row,
.crm-table tbody tr.cam-loading-row,
.crm-table tbody tr.crm-table-empty-row,
.crm-table tbody tr.crm-table-loading-row,
.ca-table--enterprise tbody tr.cam-empty-row,
.ca-table--enterprise tbody tr.cam-loading-row,
.ca-table--enterprise tbody tr.crm-table-empty-row,
.ca-table--enterprise tbody tr.crm-table-loading-row {
  height: auto;
}

.crm-table tbody tr.cam-empty-row td,
.crm-table tbody tr.cam-loading-row td,
.crm-table tbody tr.crm-table-empty-row td,
.crm-table tbody tr.crm-table-loading-row td,
.ca-table--enterprise tbody tr.cam-empty-row td,
.ca-table--enterprise tbody tr.cam-loading-row td,
.ca-table--enterprise tbody tr.crm-table-empty-row td,
.ca-table--enterprise tbody tr.crm-table-loading-row td {
  height: auto;
  min-height: 8rem;
  max-height: none;
  overflow: visible;
  white-space: normal;
  vertical-align: middle;
  text-align: center;
}

.crm-table td.crm-actions-cell,
.ca-table--enterprise td.crm-actions-cell,
.crm-table td.sticky-right.crm-actions-cell,
.ca-table--enterprise td.sticky-right.crm-actions-cell {
  overflow: hidden;
}

/* ─── Sticky header + sticky left/right columns (all enterprise CRM tables) ─── */
.crm-table,
.ca-table--enterprise {
  --crm-sticky-body-bg: #ffffff;
  --crm-sticky-head-bg: #ffffff;
  --crm-sticky-firm-width: 240px;
  --crm-sticky-ca-width: 200px;
  --crm-sticky-check-left: 0;
  --crm-sticky-firm-left: var(--crm-sticky-check-width);
  --crm-sticky-ca-left: calc(var(--crm-sticky-check-width) + var(--crm-sticky-firm-width));
  --crm-sticky-seam-fill: 3px 0 0 #ffffff;
  --crm-sticky-seam-fill-left: -3px 0 0 #ffffff;
  --crm-sticky-inner-edge: inset -1px 0 0 #e8edf3;
  --crm-sticky-frozen-edge: 4px 0 8px -2px rgba(15, 23, 42, 0.12);
  --crm-sticky-frozen-edge-left: -4px 0 8px -2px rgba(15, 23, 42, 0.12);
  --crm-col-actions-width: 90px;
  --crm-z-scroll-body: 1;
  --crm-z-sticky-body-3: 10;
  --crm-z-sticky-body-2: 11;
  --crm-z-sticky-body-1: 12;
  --crm-z-sticky-body-right: 13;
  --crm-z-head-filter-scroll: 20;
  --crm-z-head-filter: 20;
  --crm-z-head-filter-sticky-3: 30;
  --crm-z-head-filter-sticky-2: 31;
  --crm-z-head-filter-sticky-1: 32;
  --crm-z-head-filter-sticky-r: 33;
  --crm-z-head-label-scroll: 40;
  --crm-z-head-label: 40;
  --crm-z-head-label-sticky-3: 50;
  --crm-z-head-label-sticky-2: 51;
  --crm-z-head-label-sticky-1: 52;
  --crm-z-head-label-sticky-r: 53;
  --crm-z-sticky-actions-open: 60;
}

/* Scrolling body cells stay beneath sticky columns */
.crm-table tbody td:not(.sticky-left):not(.sticky-left-2):not(.sticky-left-3):not(.sticky-right),
.ca-table--enterprise tbody td:not(.sticky-left):not(.sticky-left-2):not(.sticky-left-3):not(.sticky-right) {
  position: relative;
  z-index: var(--crm-z-scroll-body);
  background-color: #ffffff;
  background-clip: border-box;
}

.crm-table-row:nth-child(even) td:not(.sticky-left):not(.sticky-left-2):not(.sticky-left-3):not(.sticky-right),
.ca-table--enterprise .cam-table-row:nth-child(even) td:not(.sticky-left):not(.sticky-left-2):not(.sticky-left-3):not(.sticky-right) {
  background-color: #fafbfc;
}

/* Scrolling header cells stay beneath frozen corners */
.crm-table thead tr:first-child th:not(.sticky-left):not(.sticky-left-2):not(.sticky-left-3):not(.sticky-right),
.ca-table--enterprise thead tr:first-child th:not(.sticky-left):not(.sticky-left-2):not(.sticky-left-3):not(.sticky-right) {
  z-index: var(--crm-z-head-label-scroll) !important;
  background: #f8fafc;
  background-clip: border-box;
}

.crm-table thead tr.crm-col-filter-row th:not(.sticky-left):not(.sticky-left-2):not(.sticky-left-3):not(.sticky-right),
.ca-table--enterprise thead tr.crm-col-filter-row th:not(.sticky-left):not(.sticky-left-2):not(.sticky-left-3):not(.sticky-right) {
  z-index: var(--crm-z-head-filter-scroll) !important;
  background: #f8fafc !important;
  background-clip: border-box;
}

/* Frozen panel — continuous opaque white surface (header, filter, body) */
.crm-table thead th.sticky-left,
.crm-table thead th.sticky-left-2,
.crm-table thead th.sticky-left-3,
.crm-table thead th.sticky-right,
.crm-table tbody td.sticky-left,
.crm-table tbody td.sticky-left-2,
.crm-table tbody td.sticky-left-3,
.crm-table tbody td.sticky-right,
.ca-table--enterprise thead th.sticky-left,
.ca-table--enterprise thead th.sticky-left-2,
.ca-table--enterprise thead th.sticky-left-3,
.ca-table--enterprise thead th.sticky-right,
.ca-table--enterprise tbody td.sticky-left,
.ca-table--enterprise tbody td.sticky-left-2,
.ca-table--enterprise tbody td.sticky-left-3,
.ca-table--enterprise tbody td.sticky-right {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-clip: border-box !important;
  -webkit-background-clip: border-box !important;
  isolation: isolate;
}

/* Label header row — stick to top while vertical scrolling */
.crm-table thead tr:first-child th,
.ca-table--enterprise thead tr:first-child th {
  position: sticky;
  top: 0;
  z-index: var(--crm-z-head-label);
  height: var(--crm-table-head-row-h, 32px);
  min-height: var(--crm-table-head-row-h, 32px);
  max-height: var(--crm-table-head-row-h, 32px);
  background: #f8fafc;
  font-size: var(--crm-font-size-table-header);
  font-weight: var(--crm-font-weight-table-header);
  text-transform: none;
  letter-spacing: var(--crm-letter-spacing);
  color: #64748b;
  box-shadow: inset 0 -1px 0 #e2e8f0;
  background-clip: border-box;
  box-sizing: border-box;
  vertical-align: middle;
}

/* Column-filter header row — directly under label row */
.crm-table thead tr.crm-col-filter-row th,
.ca-table--enterprise thead tr.crm-col-filter-row th {
  position: sticky;
  top: var(--crm-table-head-row-h);
  z-index: var(--crm-z-head-filter);
  height: var(--crm-table-head-row-h, 32px);
  min-height: var(--crm-table-head-row-h, 32px);
  max-height: var(--crm-table-head-row-h, 32px);
  background: #f8fafc;
  box-shadow: inset 0 -1px 0 #e2e8f0;
  background-clip: border-box;
  box-sizing: border-box;
  vertical-align: middle;
}

.crm-table thead tr:first-child th.sticky-left,
.crm-table thead tr:first-child th.sticky-left-2,
.crm-table thead tr:first-child th.sticky-left-3,
.crm-table thead tr:first-child th.sticky-right,
.ca-table--enterprise thead tr:first-child th.sticky-left,
.ca-table--enterprise thead tr:first-child th.sticky-left-2,
.ca-table--enterprise thead tr:first-child th.sticky-left-3,
.ca-table--enterprise thead tr:first-child th.sticky-right {
  background-color: #ffffff !important;
}

.crm-table thead tr.crm-col-filter-row th.sticky-left,
.crm-table thead tr.crm-col-filter-row th.sticky-left-2,
.crm-table thead tr.crm-col-filter-row th.sticky-left-3,
.crm-table thead tr.crm-col-filter-row th.sticky-right,
.ca-table--enterprise thead tr.crm-col-filter-row th.sticky-left,
.ca-table--enterprise thead tr.crm-col-filter-row th.sticky-left-2,
.ca-table--enterprise thead tr.crm-col-filter-row th.sticky-left-3,
.ca-table--enterprise thead tr.crm-col-filter-row th.sticky-right {
  background-color: #ffffff !important;
}

/* Inbox checkbox column */
.crm-col-check,
.crm-th-check,
.crm-td-check {
  width: var(--crm-sticky-check-width, 36px);
  min-width: var(--crm-sticky-check-width, 36px);
  max-width: var(--crm-sticky-check-width, 36px);
  height: var(--crm-table-row-h, 30px);
  min-height: var(--crm-table-row-h, 30px);
  max-height: var(--crm-table-row-h, 30px);
  text-align: center;
  padding: 0 !important;
  vertical-align: middle;
}
.crm-inbox-row-check,
.crm-inbox-check-all {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: #25B7A7;
  cursor: pointer;
}
.crm-inbox-bulk-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid #ccfbf1;
  background: #f0fdfa;
  animation: crmBulkBarIn 0.18s ease;
}
@keyframes crmBulkBarIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.crm-inbox-bulk-count {
  flex: 0 0 auto;
  min-width: 5.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f766e;
  white-space: nowrap;
}
.crm-inbox-bulk-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  margin-left: auto;
  min-width: 0;
}
.crm-bulk-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.125rem;
  height: 2.125rem;
  padding: 0;
  border: 1px solid #99f6e4;
  border-radius: 0.55rem;
  background: #fff;
  color: #0f766e;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.crm-bulk-icon-btn:hover {
  background: #ccfbf1;
  border-color: #25B7A7;
  color: #115e59;
  box-shadow: 0 2px 8px rgb(15 118 110 / 0.12);
  transform: translateY(-1px);
}
.crm-bulk-icon-btn:active,
.crm-bulk-icon-btn:focus-visible {
  background: #25B7A7;
  border-color: #25B7A7;
  color: #fff;
  outline: none;
  box-shadow: 0 0 0 3px rgb(37 183 167 / 0.22);
}
.crm-inbox-bulk-clear {
  flex: 0 0 auto;
}
.crm-table-card--inbox .crm-inbox-bulk-bar.hidden,
.crm-inbox-bulk-bar.hidden {
  display: none !important;
}
@media (max-width: 768px) {
  .crm-inbox-bulk-bar {
    flex-wrap: wrap;
  }
  .crm-inbox-bulk-toolbar {
    order: 3;
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }
}

/* Sticky left body — checkbox, firm, CA name (horizontal freeze only) */
.crm-table tbody td.sticky-left,
.ca-table--enterprise tbody td.sticky-left {
  position: sticky;
  left: var(--crm-sticky-check-left);
  top: auto !important;
  bottom: auto !important;
  z-index: var(--crm-z-sticky-body-1);
  width: var(--crm-sticky-check-width);
  min-width: var(--crm-sticky-check-width);
  max-width: var(--crm-sticky-check-width);
  height: var(--crm-table-row-h, 30px);
  min-height: var(--crm-table-row-h, 30px);
  max-height: var(--crm-table-row-h, 30px);
  overflow: hidden !important;
  box-shadow: var(--crm-sticky-inner-edge);
}

.crm-table tbody td.sticky-left-2,
.ca-table--enterprise tbody td.sticky-left-2 {
  position: sticky;
  left: var(--crm-sticky-firm-left);
  top: auto !important;
  bottom: auto !important;
  z-index: var(--crm-z-sticky-body-2);
  width: var(--crm-sticky-firm-width);
  min-width: var(--crm-sticky-firm-width);
  max-width: var(--crm-sticky-firm-width);
  height: var(--crm-table-row-h, 30px);
  min-height: var(--crm-table-row-h, 30px);
  max-height: var(--crm-table-row-h, 30px);
  overflow: hidden !important;
  box-shadow: inset -1px 0 0 #e8edf3;
}

.crm-table tbody td.sticky-left-3,
.ca-table--enterprise tbody td.sticky-left-3 {
  position: sticky;
  left: var(--crm-sticky-ca-left);
  top: auto !important;
  bottom: auto !important;
  z-index: var(--crm-z-sticky-body-3);
  height: var(--crm-table-row-h, 30px);
  min-height: var(--crm-table-row-h, 30px);
  max-height: var(--crm-table-row-h, 30px);
  box-shadow: var(--crm-sticky-seam-fill-left), var(--crm-sticky-frozen-edge);
  border-right: 1px solid #e2e8f0;
}

/* Sticky right body — Actions (horizontal freeze only) */
.crm-table tbody td.sticky-right,
.ca-table--enterprise tbody td.sticky-right {
  position: sticky;
  right: 0;
  top: auto !important;
  bottom: auto !important;
  z-index: var(--crm-z-sticky-body-right);
  width: var(--crm-col-actions-width);
  min-width: var(--crm-col-actions-width);
  max-width: var(--crm-col-actions-width);
  height: var(--crm-table-row-h, 30px);
  min-height: var(--crm-table-row-h, 30px);
  max-height: var(--crm-table-row-h, 30px);
  overflow: hidden !important;
  box-shadow: var(--crm-sticky-seam-fill-left), var(--crm-sticky-frozen-edge-left);
  border-left: 1px solid #e2e8f0;
}

/* Sticky left header corners — label row (highest layer) */
.crm-table thead tr:first-child th.sticky-left,
.ca-table--enterprise thead tr:first-child th.sticky-left {
  position: sticky;
  top: 0;
  left: var(--crm-sticky-check-left);
  z-index: var(--crm-z-head-label-sticky-1);
  width: var(--crm-sticky-check-width);
  min-width: var(--crm-sticky-check-width);
  max-width: var(--crm-sticky-check-width);
  overflow: hidden !important;
  box-shadow: var(--crm-sticky-inner-edge), inset 0 -1px 0 #e2e8f0;
}

.crm-table thead tr:first-child th.sticky-left-2,
.ca-table--enterprise thead tr:first-child th.sticky-left-2 {
  position: sticky;
  top: 0;
  left: var(--crm-sticky-firm-left);
  z-index: var(--crm-z-head-label-sticky-2);
  width: var(--crm-sticky-firm-width);
  min-width: var(--crm-sticky-firm-width);
  max-width: var(--crm-sticky-firm-width);
  overflow: hidden !important;
  box-shadow: inset -1px 0 0 #e8edf3, inset 0 -1px 0 #e2e8f0;
}

.crm-table thead tr:first-child th.sticky-left-3,
.ca-table--enterprise thead tr:first-child th.sticky-left-3 {
  position: sticky;
  top: 0;
  left: var(--crm-sticky-ca-left);
  z-index: var(--crm-z-head-label-sticky-3);
  box-shadow: var(--crm-sticky-seam-fill-left), var(--crm-sticky-frozen-edge), inset 0 -1px 0 #e2e8f0;
  border-right: 1px solid #e2e8f0;
}

/* Sticky right header corner — label row */
.crm-table thead tr:first-child th.sticky-right,
.ca-table--enterprise thead tr:first-child th.sticky-right {
  position: sticky;
  top: 0;
  right: 0;
  z-index: var(--crm-z-head-label-sticky-r);
  width: var(--crm-col-actions-width);
  min-width: var(--crm-col-actions-width);
  max-width: var(--crm-col-actions-width);
  overflow: hidden !important;
  box-shadow: var(--crm-sticky-seam-fill-left), var(--crm-sticky-frozen-edge-left), inset 0 -1px 0 #e2e8f0;
  border-left: 1px solid #e2e8f0;
}

/* Filter-row sticky corners — below label-row corners */
.crm-table thead tr.crm-col-filter-row th.sticky-left,
.ca-table--enterprise thead tr.crm-col-filter-row th.sticky-left {
  position: sticky;
  top: var(--crm-table-head-row-h);
  left: var(--crm-sticky-check-left);
  z-index: var(--crm-z-head-filter-sticky-1);
  width: var(--crm-sticky-check-width);
  min-width: var(--crm-sticky-check-width);
  max-width: var(--crm-sticky-check-width);
  overflow: hidden !important;
  box-shadow: var(--crm-sticky-inner-edge), inset 0 -1px 0 #e2e8f0;
}

.crm-table thead tr.crm-col-filter-row th.sticky-left-2,
.ca-table--enterprise thead tr.crm-col-filter-row th.sticky-left-2 {
  position: sticky;
  top: var(--crm-table-head-row-h);
  left: var(--crm-sticky-firm-left);
  z-index: var(--crm-z-head-filter-sticky-2);
  width: var(--crm-sticky-firm-width);
  min-width: var(--crm-sticky-firm-width);
  max-width: var(--crm-sticky-firm-width);
  overflow: hidden !important;
  box-shadow: inset -1px 0 0 #e8edf3, inset 0 -1px 0 #e2e8f0;
}

.crm-table thead tr.crm-col-filter-row th.sticky-left-3,
.ca-table--enterprise thead tr.crm-col-filter-row th.sticky-left-3 {
  position: sticky;
  top: var(--crm-table-head-row-h);
  left: var(--crm-sticky-ca-left);
  z-index: var(--crm-z-head-filter-sticky-3);
  box-shadow: var(--crm-sticky-seam-fill-left), var(--crm-sticky-frozen-edge), inset 0 -1px 0 #e2e8f0;
  border-right: 1px solid #e2e8f0;
}

.crm-table thead tr.crm-col-filter-row th.sticky-right,
.ca-table--enterprise thead tr.crm-col-filter-row th.sticky-right {
  position: sticky;
  top: var(--crm-table-head-row-h);
  right: 0;
  z-index: var(--crm-z-head-filter-sticky-r);
  width: var(--crm-col-actions-width);
  min-width: var(--crm-col-actions-width);
  max-width: var(--crm-col-actions-width);
  overflow: hidden !important;
  box-shadow: var(--crm-sticky-seam-fill-left), var(--crm-sticky-frozen-edge-left), inset 0 -1px 0 #e2e8f0;
  border-left: 1px solid #e2e8f0;
}

.crm-table-row,
.ca-table--enterprise .cam-table-row {
  /* content-visibility breaks sticky cells — do not re-enable */
}

.crm-table-row:nth-child(even),
.ca-table--enterprise .cam-table-row:nth-child(even) {
  background: #fafbfc;
}

/* Tables with only two left stickies — Firm Name is the frozen scroll edge */
.crm-table:not(:has(thead th.sticky-left-3)) tbody td.sticky-left-2,
.ca-table-enterprise:not(:has(thead th.sticky-left-3)) tbody td.sticky-left-2 {
    overflow: hidden !important;
    background: #ffffff !important;
    z-index: 5;
    box-shadow: 4px 0 8px -2px rgba(15, 23, 42, 0.12);
    border-right: 1px solid #e2e8f0;
}

.crm-table:not(:has(thead th.sticky-left-3)) thead tr:first-child th.sticky-left-2,
.ca-table--enterprise:not(:has(thead th.sticky-left-3)) thead tr:first-child th.sticky-left-2 {
  overflow: hidden !important;
  box-shadow: 4px 0 8px -2px rgba(15, 23, 42, 0.12), inset 0 -1px 0 #e2e8f0;
  border-right: 1px solid #e2e8f0;
}

.crm-table:not(:has(thead th.sticky-left-3)) thead tr.crm-col-filter-row th.sticky-left-2,
.ca-table--enterprise:not(:has(thead th.sticky-left-3)) thead tr.crm-col-filter-row th.sticky-left-2 {
  overflow: hidden !important;
  box-shadow: 4px 0 8px -2px rgba(15, 23, 42, 0.12), inset 0 -1px 0 #e2e8f0;
  border-right: 1px solid #e2e8f0;
}

/* Left sticky Firm/Check stay clipped; leftover sticky-left-3 (if present) can show seam */
.crm-table thead th.sticky-left-3,
.crm-table tbody td.sticky-left-3,
.ca-table--enterprise thead th.sticky-left-3,
.ca-table--enterprise tbody td.sticky-left-3 {
  overflow: visible !important;
}

/* Thead always paints above tbody when sticky panels overlap during scroll */
.crm-table.ca-table--enterprise thead,
.ca-table--enterprise thead {
  position: relative;
  z-index: 20;
}

.crm-table.ca-table--enterprise tbody,
.ca-table--enterprise tbody {
  position: relative;
  z-index: 10;
}

.crm-table thead th.sticky-left,
.crm-table tbody td.sticky-left,
.ca-table--enterprise thead th.sticky-left,
.ca-table--enterprise tbody td.sticky-left {
  overflow: hidden !important;
}

.crm-table thead th.sticky-left,
.crm-table thead th.sticky-left-2,
.crm-table thead th.sticky-left-3,
.crm-table thead th.sticky-right,
.crm-table tbody td.sticky-left,
.crm-table tbody td.sticky-left-2,
.crm-table tbody td.sticky-left-3,
.crm-table tbody td.sticky-right,
.ca-table--enterprise thead th.sticky-left,
.ca-table--enterprise thead th.sticky-left-2,
.ca-table--enterprise thead th.sticky-left-3,
.ca-table--enterprise thead th.sticky-right,
.ca-table--enterprise tbody td.sticky-left,
.ca-table--enterprise tbody td.sticky-left-2,
.ca-table--enterprise tbody td.sticky-left-3,
.ca-table--enterprise tbody td.sticky-right {
  position: sticky;
}

.crm-table thead th.sticky-left > *,
.crm-table thead th.sticky-left-2 > *,
.crm-table thead th.sticky-left-3 > *,
.crm-table thead th.sticky-right > *,
.crm-table tbody td.sticky-left > *,
.crm-table tbody td.sticky-left-2 > *,
.crm-table tbody td.sticky-left-3 > *,
.crm-table tbody td.sticky-right > *:not(.crm-actions-menu):not(.cam-actions-menu):not(.action-menu),
.ca-table--enterprise thead th.sticky-left > *,
.ca-table--enterprise thead th.sticky-left-2 > *,
.ca-table--enterprise thead th.sticky-left-3 > *,
.ca-table--enterprise thead th.sticky-right > *,
.ca-table--enterprise tbody td.sticky-left > *,
.ca-table--enterprise tbody td.sticky-left-2 > *,
.ca-table--enterprise tbody td.sticky-left-3 > *,
.ca-table--enterprise tbody td.sticky-right > *:not(.crm-actions-menu):not(.cam-actions-menu):not(.action-menu) {
  position: relative;
  z-index: 1;
}

/* Frozen cells stay opaque white — row banding/hover does not break the sticky panel */
.crm-table-row:nth-child(even) td.sticky-left,
.crm-table-row:nth-child(even) td.sticky-left-2,
.crm-table-row:nth-child(even) td.sticky-left-3,
.crm-table-row:nth-child(even) td.sticky-right,
.ca-table--enterprise .cam-table-row:nth-child(even) td.sticky-left,
.ca-table--enterprise .cam-table-row:nth-child(even) td.sticky-left-2,
.ca-table--enterprise .cam-table-row:nth-child(even) td.sticky-left-3,
.ca-table--enterprise .cam-table-row:nth-child(even) td.sticky-right,
.crm-table-row:hover td.sticky-left,
.crm-table-row:hover td.sticky-left-2,
.crm-table-row:hover td.sticky-left-3,
.crm-table-row:hover td.sticky-right,
.ca-table--enterprise .cam-table-row:hover td.sticky-left,
.ca-table--enterprise .cam-table-row:hover td.sticky-left-2,
.ca-table--enterprise .cam-table-row:hover td.sticky-left-3,
.ca-table--enterprise .cam-table-row:hover td.sticky-right,
.crm-table-row.selected td.sticky-left,
.crm-table-row.selected td.sticky-left-2,
.crm-table-row.selected td.sticky-left-3,
.crm-table-row.selected td.sticky-right,
.ca-table--enterprise .cam-table-row.selected td.sticky-left,
.ca-table--enterprise .cam-table-row.selected td.sticky-left-2,
.ca-table--enterprise .cam-table-row.selected td.sticky-left-3,
.ca-table--enterprise .cam-table-row.selected td.sticky-right {
  background-color: #ffffff !important;
}

.crm-table-row:hover,
.ca-table--enterprise .cam-table-row:hover {
  background: #f0fdfa;
}

.crm-table-row.selected,
.ca-table--enterprise .cam-table-row.selected,
.leads-hub .crm-table-row.selected,
.leads-hub .ca-table-row.selected {
  background: #EDF9FC;
  box-shadow: inset 3px 0 0 #4CB4D4;
}

.crm-table-row:nth-child(even) td.sticky-left-2.crm-td-firm,
.ca-table--enterprise .cam-table-row:nth-child(even) td.sticky-left-2.crm-td-firm,
.crm-table-row:nth-child(even) td.sticky-left-3.crm-td-ca,
.ca-table--enterprise .cam-table-row:nth-child(even) td.sticky-left-3.crm-td-ca,
.crm-table-row:hover td.sticky-left-2.crm-td-firm,
.ca-table--enterprise .cam-table-row:hover td.sticky-left-2.crm-td-firm,
.crm-table-row:hover td.sticky-left-3.crm-td-ca,
.ca-table--enterprise .cam-table-row:hover td.sticky-left-3.crm-td-ca,
.crm-table-row.selected td.sticky-left-2.crm-td-firm,
.ca-table--enterprise .cam-table-row.selected td.sticky-left-2.crm-td-firm,
.crm-table-row.selected td.sticky-left-3.crm-td-ca,
.ca-table--enterprise .cam-table-row.selected td.sticky-left-3.crm-td-ca {
  background-color: #ffffff !important;
}

.crm-col-firm,
.cam-col-firm,
.col-firm {
  width: var(--crm-sticky-firm-width);
  max-width: var(--crm-sticky-firm-width);
  min-width: var(--crm-sticky-firm-width);
}

.crm-col-ca,
.cam-col-ca,
.col-ca {
  width: var(--crm-sticky-ca-width);
  max-width: var(--crm-sticky-ca-width);
  min-width: var(--crm-sticky-ca-width);
}

.crm-col-num {
  width: 64px;
  max-width: 64px;
  min-width: 64px;
}

.crm-col-person,
.cam-col-person { width: 140px; min-width: 120px; }
.crm-col-mobile,
.cam-col-mobile { width: 118px; min-width: 110px; }
.crm-col-geo,
.cam-col-geo { width: 100px; min-width: 88px; }
.crm-col-source,
.cam-col-source { width: 110px; min-width: 96px; }
.crm-col-email,
.cam-col-email { width: 168px; min-width: 140px; max-width: 200px; }
.crm-col-remarks,
.cam-col-remarks { width: 200px; min-width: 160px; max-width: 240px; }
.crm-col-rating,
.cam-col-rating { width: 88px; min-width: 80px; }
.crm-col-status,
.cam-col-status { width: 108px; min-width: 96px; }
.crm-col-date,
.cam-col-date { width: 108px; min-width: 96px; }
.crm-col-compact { width: 72px; min-width: 64px; }
.crm-col-actions,
.cam-col-actions,
.col-actions {
  width: var(--crm-col-actions-width);
  max-width: var(--crm-col-actions-width);
  min-width: var(--crm-col-actions-width);
}
.crm-col-research,
.cam-col-research,
.crm-col-google,
.cam-col-google,
.crm-col-maps,
.cam-col-maps,
.crm-col-call-log,
.cam-col-call-log {
  width: 52px;
  max-width: 52px;
  min-width: 52px;
}
.crm-col-actions-wide { width: 52px; min-width: 52px; }

.crm-td-firm,
.crm-table tbody td.sticky-left.crm-td-firm,
.crm-table tbody td.sticky-left-2.crm-td-firm,
.ca-table--enterprise tbody td.sticky-left.crm-td-firm,
.ca-table--enterprise tbody td.sticky-left-2.crm-td-firm {
  width: var(--crm-sticky-firm-width);
  max-width: var(--crm-sticky-firm-width);
  min-width: var(--crm-sticky-firm-width);
  overflow: hidden !important;
  text-overflow: ellipsis;
}

.crm-table tbody td.sticky-left-2.crm-td-firm,
.ca-table--enterprise tbody td.sticky-left-2.crm-td-firm {
  z-index: var(--crm-z-sticky-body-2) !important;
}

.crm-table tbody td.sticky-left-3.crm-td-ca,
.ca-table--enterprise tbody td.sticky-left-3.crm-td-ca {
  z-index: var(--crm-z-sticky-body-3) !important;
}

.crm-table thead tr:first-child th.sticky-left-2.crm-th-firm,
.crm-table thead tr:first-child th.sticky-left-2.col-firm,
.ca-table--enterprise thead tr:first-child th.sticky-left-2.crm-th-firm,
.ca-table--enterprise thead tr:first-child th.sticky-left-2.col-firm {
  width: var(--crm-sticky-firm-width);
  max-width: var(--crm-sticky-firm-width);
  min-width: var(--crm-sticky-firm-width);
  z-index: var(--crm-z-head-label-sticky-2) !important;
}

.crm-table thead tr:first-child th.sticky-left-3.crm-th-ca,
.crm-table thead tr:first-child th.sticky-left-3.col-ca,
.ca-table--enterprise thead tr:first-child th.sticky-left-3.crm-th-ca,
.ca-table--enterprise thead tr:first-child th.sticky-left-3.col-ca {
  width: var(--crm-sticky-ca-width);
  max-width: var(--crm-sticky-ca-width);
  min-width: var(--crm-sticky-ca-width);
  z-index: var(--crm-z-head-label-sticky-3) !important;
}

.crm-table thead tr.crm-col-filter-row th.sticky-left-2.crm-th-firm,
.crm-table thead tr.crm-col-filter-row th.sticky-left-2.col-firm,
.ca-table--enterprise thead tr.crm-col-filter-row th.sticky-left-2.crm-th-firm,
.ca-table--enterprise thead tr.crm-col-filter-row th.sticky-left-2.col-firm {
  width: var(--crm-sticky-firm-width);
  max-width: var(--crm-sticky-firm-width);
  min-width: var(--crm-sticky-firm-width);
  z-index: var(--crm-z-head-filter-sticky-2) !important;
}

.crm-table thead tr.crm-col-filter-row th.sticky-left-3.crm-th-ca,
.crm-table thead tr.crm-col-filter-row th.sticky-left-3.col-ca,
.ca-table--enterprise thead tr.crm-col-filter-row th.sticky-left-3.crm-th-ca,
.ca-table--enterprise thead tr.crm-col-filter-row th.sticky-left-3.col-ca {
  width: var(--crm-sticky-ca-width);
  max-width: var(--crm-sticky-ca-width);
  min-width: var(--crm-sticky-ca-width);
  z-index: var(--crm-z-head-filter-sticky-3) !important;
}

.crm-table thead th.sticky-left,
.crm-table thead th.sticky-left-2,
.crm-table thead th.sticky-left-3,
.ca-table--enterprise thead th.sticky-left,
.ca-table--enterprise thead th.sticky-left-2,
.ca-table--enterprise thead th.sticky-left-3 {
  overflow: hidden;
}

.crm-col-filter-row th.sticky-left .crm-col-filter-input,
.crm-col-filter-row th.sticky-left-2 .crm-col-filter-input,
.crm-col-filter-row th.sticky-left-3 .crm-col-filter-input {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.crm-table thead th.sticky-left.crm-th-firm,
.crm-table thead th.sticky-left-2.crm-th-firm,
.crm-table thead th.sticky-left.col-firm,
.crm-table thead th.sticky-left-2.col-firm,
.ca-table--enterprise thead th.sticky-left.crm-th-firm,
.ca-table--enterprise thead th.sticky-left-2.crm-th-firm {
  width: var(--crm-sticky-firm-width);
  max-width: var(--crm-sticky-firm-width);
  min-width: var(--crm-sticky-firm-width);
}

/* Sticky name columns — ellipsis must not be overridden by module rules */
.crm-table tbody td.sticky-left-2.crm-td-person,
.crm-table tbody td.sticky-left.crm-td-num,
.ca-table--enterprise tbody td.sticky-left-2.crm-td-person,
.ca-table--enterprise tbody td.sticky-left.crm-td-num {
  overflow: hidden !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-td-ca,
.crm-table td.crm-td-ca,
.ca-table--enterprise td.crm-td-ca {
  width: var(--crm-sticky-ca-width);
  max-width: var(--crm-sticky-ca-width);
  min-width: var(--crm-sticky-ca-width);
  overflow: hidden !important;
  text-overflow: ellipsis;
}

.crm-table thead th.crm-th-ca,
.crm-table thead th.col-ca,
.ca-table--enterprise thead th.crm-th-ca,
.ca-table--enterprise thead th.col-ca {
  width: var(--crm-sticky-ca-width);
  max-width: var(--crm-sticky-ca-width);
  min-width: var(--crm-sticky-ca-width);
}

.crm-firm-cell,
.crm-ca-cell,
.truncate-cell.crm-firm-cell,
.truncate-cell.crm-ca-cell {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  box-sizing: border-box;
}

/* Actions column — sticky right body */
.crm-table tbody td.crm-actions-cell,
.ca-table--enterprise tbody td.crm-actions-cell {
  width: var(--crm-col-actions-width);
  max-width: var(--crm-col-actions-width);
  min-width: var(--crm-col-actions-width);
  height: var(--crm-table-row-h, 30px);
  min-height: var(--crm-table-row-h, 30px);
  max-height: var(--crm-table-row-h, 30px);
  text-align: center;
  padding: 0 !important;
  vertical-align: middle;
  overflow: hidden !important;
}

.crm-table tbody td.sticky-right.crm-actions-cell,
.ca-table--enterprise tbody td.sticky-right.crm-actions-cell {
  overflow: hidden !important;
}

/* Checkbox + actions — vertically centered in every row (sticky utility columns) */
.crm-table tbody td.crm-td-check,
.crm-table tbody td.crm-actions-cell,
.ca-table--enterprise tbody td.crm-td-check,
.ca-table--enterprise tbody td.crm-actions-cell {
  padding: 0 !important;
  vertical-align: middle !important;
  text-align: center;
  line-height: var(--crm-table-row-h, 30px);
  box-sizing: border-box;
}

.crm-table tbody td.crm-td-check .crm-inbox-row-check,
.crm-table tbody td.crm-td-check .crm-inbox-check-all,
.ca-table--enterprise tbody td.crm-td-check .crm-inbox-row-check,
.ca-table--enterprise tbody td.crm-td-check .crm-inbox-check-all {
  display: inline-block;
  vertical-align: middle;
  margin: 0;
  line-height: 1;
  position: static;
  top: auto;
  transform: none;
}

.crm-table tbody td.crm-actions-cell .crm-actions-menu,
.crm-table tbody td.crm-actions-cell .cam-actions-menu,
.ca-table--enterprise tbody td.crm-actions-cell .crm-actions-menu,
.ca-table--enterprise tbody td.crm-actions-cell .cam-actions-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin: 0;
  line-height: 1;
  position: relative;
  top: auto;
  transform: none;
}

.crm-table thead th.crm-th-check,
.crm-table thead th.crm-th-actions,
.ca-table--enterprise thead th.crm-th-check,
.ca-table--enterprise thead th.crm-th-actions {
  padding: 0 !important;
  vertical-align: middle !important;
  text-align: center;
  line-height: var(--crm-table-head-row-h, 32px);
  box-sizing: border-box;
}

.crm-table thead th.crm-th-check .crm-inbox-check-all,
.ca-table--enterprise thead th.crm-th-check .crm-inbox-check-all {
  display: inline-block;
  vertical-align: middle;
  margin: 0;
  line-height: 1;
}

.crm-table thead tr.crm-col-filter-row th.crm-th-check.crm-col-filter-th,
.crm-table thead tr.crm-col-filter-row th.crm-th-actions.crm-col-filter-th,
.ca-table--enterprise thead tr.crm-col-filter-row th.crm-th-check.crm-col-filter-th,
.ca-table--enterprise thead tr.crm-col-filter-row th.crm-th-actions.crm-col-filter-th {
  padding: 0 !important;
  vertical-align: middle !important;
  text-align: center;
  line-height: normal;
}

.crm-table thead tr.crm-col-filter-row th.crm-th-actions.crm-col-filter-th .crm-col-filter-reset,
.ca-table--enterprise thead tr.crm-col-filter-row th.crm-th-actions.crm-col-filter-th .crm-col-filter-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  vertical-align: middle;
}

.crm-table thead th.sticky-right.crm-th-actions,
.crm-table thead th.sticky-right.col-actions,
.ca-table--enterprise thead th.sticky-right.crm-th-actions,
.ca-table--enterprise thead th.sticky-right.col-actions {
  width: var(--crm-col-actions-width);
  max-width: var(--crm-col-actions-width);
  min-width: var(--crm-col-actions-width);
  text-align: center;
}

.crm-actions-cell,
.cam-actions-cell {
  text-align: center;
}


.crm-actions-cell--inline {
  width: 52px;
  min-width: 52px;
  max-width: 52px;
  height: var(--crm-table-row-h, 30px);
  min-height: var(--crm-table-row-h, 30px);
  max-height: var(--crm-table-row-h, 30px);
  text-align: center;
  padding: 0 !important;
  z-index: var(--crm-z-sticky-actions-open, 60);
}

.crm-td-actions--cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  flex-wrap: nowrap;
}

.crm-actions-menu,
.cam-actions-menu,
.action-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  min-width: 1.75rem;
  min-height: 1.75rem;
}

.crm-actions-trigger,
.cam-actions-trigger,
.action-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  position: relative;
  z-index: 91;
  pointer-events: auto;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.06);
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.crm-actions-trigger:hover,
.cam-actions-trigger:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #334155;
}

.crm-actions-dropdown,
.cam-actions-dropdown,
.action-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 960;
  min-width: 188px;
  padding: 0.35rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 12px 32px -8px rgb(15 23 42 / 0.22);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.crm-actions-dropdown--open,
.action-dropdown--open {
  position: fixed;
  z-index: 1300;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.crm-actions-dropdown[data-action-menu-placement="top"],
.action-dropdown[data-action-menu-placement="top"] {
  transform-origin: bottom right;
}

.crm-actions-dropdown--open[data-action-menu-placement="top"],
.action-dropdown--open[data-action-menu-placement="top"] {
  transform: translateY(0) scale(1);
}

.action-menu--align-left .crm-actions-dropdown,
.action-menu--align-left .action-dropdown {
  right: auto;
  left: 0;
}

.crm-table-row.crm-row-menu-open td.sticky-right,
.crm-table-row.crm-row-menu-open td.crm-actions-cell,
.ca-table--enterprise .crm-table-row.crm-row-menu-open td.sticky-right,
.ca-table--enterprise .crm-table-row.crm-row-menu-open td.crm-actions-cell {
  z-index: var(--crm-z-sticky-actions-open, 45);
  overflow: visible !important;
}

.crm-actions-item,
.cam-actions-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}

.crm-actions-item:hover,
.cam-actions-item:hover {
  background: #f8fafc;
}

.crm-actions-item--danger,
.cam-actions-item--danger {
  color: #dc2626;
}

.crm-actions-item--danger:hover,
.cam-actions-item--danger:hover {
  background: #fef2f2;
}

.crm-actions-divider {
  height: 1px;
  margin: 0.3rem 0.4rem;
  background: #e2e8f0;
}

.crm-actions-comm {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.3rem 0.45rem 0.35rem;
}

.crm-actions-comm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.crm-actions-comm-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgb(15 23 42 / 0.08);
}

.crm-actions-comm-btn--sms:hover {
  background: #f0fdfa;
  border-color: #99f6e4;
  color: #0f766e;
}

.crm-actions-comm-btn--email:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #2563eb;
}

.crm-actions-comm-btn--whatsapp:hover {
  background: #ecfdf5;
  border-color: #86efac;
  color: #16a34a;
}

.crm-actions-comm-btn:focus-visible {
  outline: none;
  border-color: #25b7a7;
  box-shadow: 0 0 0 2px rgb(37 183 167 / 0.2);
}

.crm-actions-comm-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.crm-inline-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.625rem;
  padding: 0 0.5rem;
  margin-left: 0.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  background: #fff;
  font-size: 11px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  vertical-align: middle;
}

.crm-inline-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.crm-inline-btn--primary {
  background: #2E7F96;
  border-color: #2E7F96;
  color: #fff;
}

.crm-inline-btn--primary:hover {
  background: #256f84;
}

.crm-inline-btn--danger {
  color: #dc2626;
  border-color: #fecaca;
}

.crm-inline-btn--danger:hover {
  background: #fef2f2;
}

.truncate-cell,
.cam-cell-text {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-table .col-firm,
.crm-table .crm-th-firm {
  text-align: left;
}

.crm-table .col-actions,
.crm-table .crm-th-actions {
  text-align: center;
}

.text-balance { text-wrap: balance; }

.card {
  border-radius: 16px; background: #fff;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.04), 0 4px 12px -2px rgb(0 0 0 / 0.06);
  border: 1px solid rgb(241 245 249 / 0.8); transition: all 0.2s;
}
.card:hover {
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 10px 24px -4px rgb(0 0 0 / 0.08);
  border-color: rgb(226 232 240 / 0.8);
}
.card-interactive {
  border-radius: 16px; background: #fff;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.04), 0 4px 12px -2px rgb(0 0 0 / 0.06);
  border: 1px solid rgb(241 245 249 / 0.8); transition: all 0.2s; cursor: pointer;
}
.card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 10px 24px -4px rgb(0 0 0 / 0.08);
}

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: var(--crm-btn-height);
  border-radius: 12px; background: #4CB4D4; padding: 0.625rem 1rem;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-button); font-weight: var(--crm-font-weight-button); color: #fff; border: none; cursor: pointer;
  letter-spacing: var(--crm-letter-spacing);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05); transition: all 0.2s;
}
.btn-primary:hover { background: #3A9DB8; }
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  border: 1px solid #dc2626;
  background: #dc2626;
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-danger:disabled { opacity: 0.6; cursor: not-allowed; }

.master-delete-guard__icon { color: #ca8a04; }
.master-delete-guard__usage-list {
  list-style: none;
  margin: 0;
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}
.master-delete-guard__usage-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  font-size: 0.875rem;
  color: #334155;
}
.master-delete-guard__usage-list li + li { border-top: 1px solid #e8edf2; }
.master-delete-guard__recommendation {
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
}
.master-delete-guard__view-usage .master-usage-nav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  text-align: left;
  font-size: 0.875rem;
  color: #0f172a;
  cursor: pointer;
}
.master-delete-guard__view-usage .master-usage-nav-btn:hover {
  border-color: #0ea5e9;
  color: #0284c7;
}
.master-status-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.45rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: middle;
}
.master-status-badge--inactive {
  background: #f1f5f9;
  color: #64748b;
}
.master-status-badge--system {
  background: #eff6ff;
  color: #1d4ed8;
}
.btn-primary:disabled,
.btn-primary[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-primary--blocked {
  box-shadow: inset 0 0 0 2px rgb(245 158 11 / 0.45);
}
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: var(--crm-btn-height);
  border-radius: 12px; border: 1px solid #e2e8f0; background: #fff;
  padding: 0.625rem 1rem;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-button); font-weight: var(--crm-font-weight-button); color: #334155; cursor: pointer; transition: all 0.2s;
  letter-spacing: var(--crm-letter-spacing);
}
.btn-secondary:hover { border-color: rgb(76 180 212 / 0.3); background: #EDF9FC; color: #2E7F96; }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border-radius: 12px; padding: 0.5rem 0.75rem;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-button); font-weight: var(--crm-font-weight-button);
  letter-spacing: var(--crm-letter-spacing);
  color: #475569; background: transparent; border: none; cursor: pointer; transition: all 0.2s;
}
.btn-ghost:hover { background: #f1f5f9; }

.badge {
  display: inline-flex; align-items: center; border-radius: 8px; padding: 2px 8px;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-badge); font-weight: var(--crm-font-weight-badge);
  letter-spacing: var(--crm-letter-spacing);
}
.badge-brand { background: #EDF9FC; color: #2E7F96; }
.badge-success { background: #ecfdf5; color: #047857; }
.badge-warning { background: #fffbeb; color: #b45309; }

.input-field {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  min-height: var(--crm-control-height);
  padding: 0.625rem 0.875rem;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-body);
  font-weight: var(--crm-font-weight-input);
  letter-spacing: var(--crm-letter-spacing);
  color: #1e293b;
  outline: none;
  transition: all 0.2s;
  box-sizing: border-box;
}

select.input-field {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  padding-right: 3.25rem !important;

  background-image:
      linear-gradient(45deg, transparent 50%, #1e293b 50%),
      linear-gradient(135deg, #1e293b 50%, transparent 50%);

  background-position:
      calc(100% - 22px) 50%,
      calc(100% - 16px) 50%;

  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

textarea.input-field,
select.input-field[multiple] {
  min-height: 0;
}
.input-field:focus { border-color: #4CB4D4; box-shadow: 0 0 0 3px rgb(76 180 212 / 0.2); }
.input-field.lead-field-locked,
.input-field:disabled.lead-field-locked {
  background: #f8fafc;
  color: #64748b;
  cursor: not-allowed;
}
.form-label .lead-field-lock-icon {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  color: #94a3b8;
  vertical-align: middle;
}

.sc-combobox { position: relative; width: 100%; }
.sc-combobox-native {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.sc-combobox-list {
  position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 240px; overflow-y: auto; margin: 0; padding: 0.25rem;
  list-style: none; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  box-shadow: 0 12px 32px rgb(15 23 42 / 0.12);
}
.sc-combobox-option {
  padding: 0.5rem 0.75rem; border-radius: 8px; cursor: pointer;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-body);
  font-weight: var(--crm-font-weight-input);
  letter-spacing: var(--crm-letter-spacing);
  color: #1e293b;
}
.sc-combobox-option:hover,
.sc-combobox-option.is-active { background: #edf9fc; color: #0f766e; }
.sc-combobox-empty { padding: 0.75rem; font-size: var(--crm-font-size-body); color: #64748b; }

.section-title {
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-section);
  line-height: var(--crm-line-height-section);
  font-weight: var(--crm-font-weight-section);
  letter-spacing: var(--crm-letter-spacing);
  color: var(--crm-color-heading);
}

.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 0.75rem; border-radius: 0;
  padding: 0.75rem 1rem;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-sidebar);
  font-weight: var(--crm-font-weight-sidebar);
  letter-spacing: var(--crm-letter-spacing);
  color: #475569;
  transition: all 0.2s; text-decoration: none; border: none; background: none; cursor: pointer; width: 100%;
}
.nav-item .sidebar-label {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
}
.nav-item:hover { background: #f8fafc; color: #334155; }
.nav-item.active {

  background: #e8f8f6; color: #25b7a7; font-weight: 600;
}
.nav-item.active::after {
  content: '';
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 3px; background: #187a6f; border-radius: 2px 0 0 2px;
}
.nav-item i { color: inherit; stroke-width: 1.75; }
.nav-sub-item {
  display: block; border-radius: 0; padding: 0.5rem 1rem 0.5rem 2.75rem;
  font-size: var(--crm-font-size-body); color: #64748b; text-decoration: none; transition: all 0.2s;
}
.nav-sub-item:hover { background: #f8fafc; color: #25b7a7; }
.nav-sub-item.active { background: #e8f8f6; color: #25b7a7; font-weight: 600; }
.sidebar-nav-group { margin: 0; }
.sidebar-submenu { overflow: hidden; }

.kanban-column {
  display: flex; min-width: 220px; flex: 1; flex-direction: column;
  border-radius: 16px; background: rgb(248 250 252 / 0.9); padding: 0.75rem;
}
.kanban-column-head {
  flex-shrink: 0;
  margin-bottom: 0.625rem;
}
.kanban-column-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
}
.kanban-column-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.kanban-column-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 999px;
  flex-shrink: 0;
}
.kanban-column-name {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kanban-column-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.625rem;
  height: 1.625rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e2e8f0;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  flex-shrink: 0;
}
.kanban-column-cards {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  -webkit-overflow-scrolling: touch;
}
.kanban-column-cards > .kanban-card {
  flex-shrink: 0;
}
.kanban-board--master {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 0.5rem;
  width: 100%;
  min-width: 880px;
  height: 100%;
  min-height: 0;
  max-height: none;
  align-items: stretch;
  align-content: stretch;
}
.kanban-board--master .kanban-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  padding: 0;
  overflow: hidden;
}
.kanban-board--master .kanban-column-head {
  flex-shrink: 0;
  padding: 0.5rem 0.625rem 0.4375rem;
  border-bottom: 1px solid rgb(15 23 42 / 0.06);
  background: #fff;
}
.kanban-board--master .kanban-column-title-row {
  margin-bottom: 0.375rem;
}
.kanban-board--master .kanban-column-name {
  font-size: 0.8125rem;
  font-weight: 600;
}
.kanban-board--master .kanban-column-count {
  min-width: 1.375rem;
  height: 1.375rem;
  padding: 0 0.35rem;
  font-size: 0.6875rem;
}
.kanban-column--new-lead { border-top: 2px solid #3b82f6; }
.kanban-column--contacted { border-top: 2px solid #f97316; }
.kanban-column--interested { border-top: 2px solid #8b5cf6; }
.kanban-column--converted { border-top: 2px solid #059669; }
.kanban-column--new-lead .kanban-column-count { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
.kanban-column--contacted .kanban-column-count { color: #c2410c; border-color: #fed7aa; background: #fff7ed; }
.kanban-column--interested .kanban-column-count { color: #6d28d9; border-color: #ddd6fe; background: #f5f3ff; }
.kanban-column--converted .kanban-column-count { color: #047857; border-color: #a7f3d0; background: #ecfdf5; }
.kanban-board--master .kanban-column-cards {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 0.375rem 0.5rem 0.5rem;
  gap: 0.5rem;
}
.kanban-board--master .kanban-stage-search__input {
  height: 2.125rem;
  min-height: 2.125rem;
  padding: 0 1.5rem 0 1.625rem;
  font-size: 0.6875rem;
  border-radius: 8px;
}
.kanban-board--master .kanban-stage-search__icon {
  left: 0.5rem;
  width: 0.875rem;
  height: 0.875rem;
}
.kanban-board--master .kanban-stage-search__clear {
  width: 1.375rem;
  height: 1.375rem;
  right: 0.2rem;
}
.kanban-board--master .kanban-stage-search__clear i {
  width: 0.875rem;
  height: 0.875rem;
}
.kanban-card--master,
.kanban-board--master .kanban-card {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 0.5rem 0.625rem;
  border-radius: 10px;
  gap: 0.125rem;
  margin-bottom: 0;
}
.kanban-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.375rem;
}
.kanban-card-firm {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.25;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kanban-card-meta {
  margin: 0;
  font-size: 0.6875rem;
  color: #64748b;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kanban-card-city,
.kanban-card-employee,
.kanban-card-activity {
  margin: 0;
  font-size: 0.625rem;
  color: #94a3b8;
  line-height: 1.3;
}
.kanban-board--master .kanban-card-priority {
  display: inline-flex;
  align-self: flex-start;
  flex-shrink: 0;
  margin-top: 0;
  padding: 0.0625rem 0.375rem;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.kanban-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 7rem;
  padding: 1rem;
  border: 1px dashed #e2e8f0;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.65);
  color: #94a3b8;
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
}
.kanban-empty--compact {
  min-height: 4.5rem;
  max-height: 5rem;
  padding: 0.375rem 0.5rem;
  gap: 0.25rem;
  border: none;
  background: transparent;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #94a3b8;
}
.kanban-empty--compact .kanban-empty__icon {
  width: 1rem;
  height: 1rem;
  color: #cbd5e1;
}
.kanban-empty__icon { color: #cbd5e1; }
.cam-pipeline-scroll {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.cam-hub--compact .cam-pipeline-card--master {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0.375rem;
  overflow: hidden;
}
.cam-hub--compact .cam-pipeline-card--master .cam-pipeline-scroll {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.cam-hub--compact .cam-pipeline-card--master .kanban-board--master {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: none;
}
#cam-hub.cam-hub--compact .ca-tab-panel[data-panel="pipeline"].active {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
#cam-hub.cam-hub--compact .cam-primary-views:has(.ca-tab-panel[data-panel="pipeline"].active) {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
@media (max-width: 1280px) {
  .kanban-board--master {
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    min-width: 880px;
  }
}
@media (max-width: 768px) {
  .kanban-board--master {
    grid-template-columns: repeat(4, minmax(240px, 1fr));
    min-width: 960px;
  }
}
@media (max-height: 820px) {
  .crm-scroll-area:has(#cam-hub) > .crm-page {
    padding-top: 0.75rem !important;
    padding-bottom: 0.25rem !important;
  }
  #cam-hub.cam-hub--compact {
    gap: 0.4rem;
  }
  .cam-hub--compact .cam-pipeline-card--master {
    padding: 0.25rem;
  }
}
@media (max-height: 700px) {
  .crm-scroll-area:has(#cam-hub) > .crm-page {
    padding-top: 0.5rem !important;
    padding-bottom: 0.125rem !important;
  }
  #cam-hub .cam-hub-top {
    gap: 0.4rem;
  }
  #cam-hub .cam-control-row {
    padding: 0.3rem 0.5rem;
  }
}
.kanban-stage-search {
  position: relative;
  display: block;
}
.kanban-stage-search__icon {
  position: absolute;
  left: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}
.kanban-stage-search__input {
  width: 100%;
  height: 2rem;
  min-height: 2rem;
  padding: 0 1.75rem 0 1.85rem;
  font-size: 0.75rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
}
.kanban-stage-search__input:focus {
  outline: none;
  border-color: #25b7a7;
  box-shadow: 0 0 0 2px rgb(37 183 167 / 0.12);
}
.kanban-stage-search__clear {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}
.kanban-stage-search__clear:hover { background: #f1f5f9; color: #0f172a; }
.kanban-stage-search__meta {
  margin: 0.375rem 0 0;
  font-size: 0.6875rem;
  color: #64748b;
}
.kanban-card {
  border-radius: 12px; border: 1px solid #f1f5f9; background: #fff;
  padding: 0.75rem; box-shadow: 0 1px 2px rgb(0 0 0 / 0.05); transition: all 0.2s;
}
.kanban-card:hover { box-shadow: 0 4px 6px rgb(0 0 0 / 0.07); border-color: rgb(76 180 212 / 0.2); }
.kanban-card-selected {
  border-color: #25b7a7 !important;
  box-shadow: 0 0 0 2px rgb(37 183 167 / 0.25);
  background: #f0fdfa;
}
.kanban-card-hot { border-left: 3px solid #f59e0b; }

/* ─── Leads Hub (unified) ─── */
.leads-kpi-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}
.leads-kpi-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-width: 0;
}
.leads-kpi-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.625rem;
  margin-left: auto;
  flex: 0 0 auto;
}
.crm-toolbar-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.125rem;
  height: 2.125rem;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 0.55rem;
  background: #fff;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.crm-toolbar-icon-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
  box-shadow: 0 2px 8px rgb(15 23 42 / 0.08);
  transform: translateY(-1px);
}
.crm-toolbar-icon-btn:focus-visible {
  outline: 2px solid rgb(37 183 167 / 0.4);
  outline-offset: 2px;
}
.crm-toolbar-icon-btn--primary {
  background: #25B7A7;
  border-color: #25B7A7;
  color: #fff;
}
.crm-toolbar-icon-btn--primary:hover {
  background: #1fa396;
  border-color: #1fa396;
  color: #fff;
  box-shadow: 0 2px 8px rgb(37 183 167 / 0.25);
}
.crm-toolbar-icon-btn--danger {
  color: #be123c;
  border-color: #fecdd3;
  background: #fff;
}
.crm-toolbar-icon-btn--danger:hover {
  background: #fff1f2;
  border-color: #fda4af;
  color: #9f1239;
  box-shadow: 0 2px 8px rgb(190 18 60 / 0.12);
}
.crm-toolbar-icon-btn:disabled,
.crm-toolbar-icon-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.crm-toolbar-icon-btn .h-4,
.crm-toolbar-icon-btn [data-lucide] {
  width: 16px;
  height: 16px;
  pointer-events: none;
}
.leads-kpi-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 13px;
  color: #64748b;
  transition: all 0.2s;
  cursor: pointer;
}
.leads-kpi-chip:hover { border-color: #25b7a7; color: #187a6f; background: #f8fafc; }
.leads-kpi-chip.active {
  border-color: #25b7a7;
  background: #e8f8f6;
  color: #187a6f;
  font-weight: 600;
}
.leads-kpi-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.35rem;
  border-radius: 9999px;
  background: rgb(37 183 167 / 0.12);
  color: #187a6f;
  font-size: 12px;
  font-weight: 700;
}
.leads-selected-bar {
  position: sticky;
  bottom: 1rem;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  border-radius: 16px;
  border: 1px solid rgb(37 183 167 / 0.25);
  background: linear-gradient(180deg, #fff 0%, #f0fdfa 100%);
  box-shadow: 0 8px 24px rgb(15 23 42 / 0.08);
}
.leads-selected-info { min-width: 0; }
.leads-hub .cam-hub-title.text-page-title {
  font-size: 22px !important;
  line-height: 1.25 !important;
  margin-bottom: 0.5rem !important;
}
.leads-selected-info #leads-selected-name,
.leads-selected-info strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: #0f172a;
}
.leads-selected-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #25b7a7;
}
.leads-selected-meta {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}
.leads-selected-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}
.leads-hub .ca-table-row.selected { background: #EDF9FC; }

.stat-pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 9999px; padding: 2px 8px; font-size: var(--crm-font-size-badge); font-weight: var(--crm-font-weight-badge); }
.skeleton { animation: pulse 2s infinite; border-radius: 8px; background: #e2e8f0; }
.glass-minimal { background: rgb(255 255 255 / 0.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

/* ─── Header (CA Cloud Desk top bar) ─── */
.ca-top-header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 4rem;
  padding: 0 1rem;
}
@media (min-width: 1024px) {
  .ca-top-header-inner { padding: 0 1.5rem; }
}
.header-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  max-width: 420px;
  min-width: 0;
}
@media (min-width: 768px) {
  .header-search-wrap { max-width: 480px; }
}
.header-search-field {
  width: 100%;
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  background: #fff;
  padding: 0.625rem 2.75rem 0.625rem 1.125rem;
  font-size: 14px;
  color: #1e293b;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.header-search-field::placeholder { color: #94a3b8; }
.header-search-field:focus {
  border-color: #25b7a7;
  box-shadow: 0 0 0 3px rgb(37 183 167 / 0.15);
}
.header-search-field::-webkit-search-cancel-button { cursor: pointer; }
.header-search-calendar-btn {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  z-index: 2;
  transition: background 0.15s ease, color 0.15s ease;
}
.header-search-calendar-btn:hover {
  background: #f1f5f9;
  color: #0f766e;
}
.header-search-wrap:focus-within .header-search-calendar-btn {
  color: #0f766e;
}
.header-actions { margin-left: auto; }
.header-checkin-btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 8px; background: #25b7a7;
  padding: 0.5rem 1rem; font-size: 14px; font-weight: 600; color: #fff;
  cursor: pointer; transition: background 0.2s; white-space: nowrap;
}
.header-checkin-btn:hover { background: #1e9688; }
.header-checkin-btn.checked-in { background: #64748b; }
.header-time {
  font-size: 15px; font-weight: 600; color: #25b7a7;
  font-variant-numeric: tabular-nums; min-width: 2.75rem;
}
.header-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; border: none; border-radius: 8px;
  background: transparent; color: #25b7a7; cursor: pointer; transition: background 0.2s;
}
.header-icon-btn:hover { background: #e8f8f6; }
.header-icon-btn--interactive {
  position: relative;
  transition: background 0.2s, transform 0.2s ease, box-shadow 0.2s ease, color 0.2s;
}
.header-icon-btn--interactive:hover {
  background: #e8f8f6;
  transform: scale(1.08);
  box-shadow: 0 2px 10px rgb(37 183 167 / 0.22);
}
.header-icon-btn--interactive:active { transform: scale(0.96); }
.header-icon-btn--interactive.active,
.header-icon-btn--interactive[aria-expanded="true"] {
  background: #25b7a7;
  color: #fff;
  box-shadow: 0 2px 12px rgb(37 183 167 / 0.35);
}
.header-settings-icon { transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.header-icon-btn--interactive:hover .header-settings-icon,
.header-icon-btn--interactive.active .header-settings-icon,
.header-icon-btn--interactive[aria-expanded="true"] .header-settings-icon {
  transform: rotate(90deg);
}
.header-settings-wrap { position: relative; }
.header-settings-menu {
  position: absolute; top: calc(100% + 0.5rem); right: 0; z-index: 50;
  min-width: 12.5rem; padding: 0.375rem;
  border: 1px solid #e2e8f0; border-radius: 12px;
  background: #fff; box-shadow: 0 8px 24px rgb(15 23 42 / 0.12);
  animation: headerMenuIn 0.18s ease-out;
}
.header-settings-menu.hidden { display: none; }
@keyframes headerMenuIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.header-settings-item {
  display: flex; align-items: center; gap: 0.625rem; width: 100%;
  padding: 0.625rem 0.75rem; border: none; border-radius: 8px;
  background: transparent; color: #334155; font-size: 13px; font-weight: 500;
  text-align: left; cursor: pointer; transition: background 0.15s, color 0.15s, transform 0.15s;
}
.header-settings-item:hover {
  background: #e8f8f6; color: #0f766e; transform: translateX(2px);
}
.header-settings-item i { color: #25b7a7; flex-shrink: 0; }
.header-settings-divider { height: 1px; margin: 0.25rem 0.5rem; background: #e2e8f0; }
.header-badge {
  position: absolute; top: -2px; right: -2px;
  display: flex; align-items: center; justify-content: center;
  min-width: 1.125rem; height: 1.125rem; padding: 0 4px;
  border-radius: 9999px; background: #ef4444; color: #fff;
  font-size: 9px; font-weight: 700; line-height: 1;
}
.header-badge.is-hidden { display: none; }
.notif-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: flex-start;
  width: 100%;
  padding: 0.875rem 1rem;
  text-align: left;
  cursor: pointer;
  position: relative;
  border-bottom: 1px solid #f1f5f9;
  transition: opacity 0.2s, background 0.2s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #f8fffe; }
.notif-item__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: #e8f8f6;
  color: #25b7a7;
  flex-shrink: 0;
}
.notif-item__icon--info { background: #eff6ff; color: #2563eb; }
.notif-item__icon--success { background: #ecfdf5; color: #059669; }
.notif-item__icon--warning { background: #fffbeb; color: #b45309; }
.notif-item__icon--error { background: #fef2f2; color: #dc2626; }
.notif-item__body { min-width: 0; }
.notif-item__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.35;
}
.notif-item__message {
  margin: 0.25rem 0 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.4;
}
.notif-item__time {
  margin: 0.375rem 0 0;
  font-size: 11px;
  color: #94a3b8;
}
.notif-item--read { opacity: 0.72; }
.notif-item--read .notif-unread-dot { display: none; }
.notif-unread-dot {
  position: absolute; top: 1rem; right: 1rem;
  width: 0.5rem; height: 0.5rem; border-radius: 9999px; background: #25b7a7;
}
.notif-empty {
  padding: 1.5rem; text-align: center; color: #64748b; font-size: 14px;
}
[data-action="mark-all-read"]:disabled { opacity: 0.5; cursor: not-allowed; }
.header-user-wrap { position: relative; }
.header-user-pill {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.25rem 0.375rem 0.25rem 0.625rem;
  border: 1px solid #d1d5db; border-radius: 9999px;
  background: #fff; max-width: 260px; min-width: 0;
  cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s;
}
.header-user-pill:hover { border-color: #25b7a7; box-shadow: 0 2px 8px rgb(37 183 167 / 0.12); }
.header-profile-menu {
  position: absolute; top: calc(100% + 0.5rem); right: 0; min-width: 220px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  box-shadow: 0 10px 40px rgb(15 23 42 / 0.12); padding: 0.375rem; z-index: 60;
}
.header-profile-item {
  display: flex; align-items: center; gap: 0.625rem; width: 100%;
  padding: 0.625rem 0.75rem; border: none; background: transparent;
  border-radius: 8px;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-body);
  font-weight: var(--crm-font-weight-input);
  letter-spacing: var(--crm-letter-spacing);
  color: #334155; cursor: pointer; text-align: left;
}
.header-profile-item:hover { background: #f8fafc; color: #25b7a7; }
.header-profile-item-danger { color: #dc2626; }
.header-profile-item-danger:hover { background: #fef2f2; color: #b91c1c; }
.header-user-pill-logo-img {
  width: 1.75rem; height: 1.75rem; border-radius: 9999px;
  object-fit: contain; object-position: center; flex-shrink: 0;
}
.header-user-pill-logo {
  display: flex; align-items: center; justify-content: center;
  width: 1.75rem; height: 1.75rem; border-radius: 9999px;
  background: #25b7a7; color: #fff; font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.header-user-pill-text {
  flex: 1; min-width: 0;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-body);
  font-weight: var(--crm-font-weight-label);
  letter-spacing: var(--crm-letter-spacing);
  color: #1e293b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.header-user-pill-avatar {
  display: flex; align-items: center; justify-content: center;
  width: 2.125rem; height: 2.125rem; border-radius: 9999px; border: none;
  background: #166534; color: #fff; cursor: pointer; flex-shrink: 0;
  transition: background 0.2s;
}
.header-user-pill-avatar:hover { background: #14532d; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
@media (max-width: 767px) {
  .header-checkin-btn { padding: 0.5rem 0.75rem; font-size: 13px; }
  .header-user-pill-text { display: none; }
  .header-user-pill { padding-left: 0.375rem; }
}

/* ─── Manager dashboard (Enterprise CRM) ─── */
.mgr-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
}
.dash-section { display: flex; flex-direction: column; gap: 1rem; }
.dash-toolbar-row {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 1024px) {
  .dash-toolbar-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    align-items: stretch;
  }
}
.dash-quick-actions-panel,
.dash-activity-panel { min-height: 0; }
.dash-activity-panel .dash-activity-feed { max-height: 280px; }
.dash-productivity-panel { margin-bottom: 0; }
.dashboard-load-error {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1rem; margin-bottom: 0.5rem;
  border-radius: 0.5rem; background: #fef2f2; color: #b91c1c;
  font-size: 0.875rem;
}
.dashboard-load-error.hidden { display: none; }
.dash-chart-loading { min-height: 6rem; }
.mgr-top {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem 1.5rem;
  padding: 1.5rem 1.75rem !important;
  background: linear-gradient(135deg, #e8f8f6 0%, #ffffff 42%, #f8fafc 100%) !important;
  border: 1px solid #d4f0ec !important;
  border-radius: 14px !important;
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.04), 0 8px 24px rgb(37 183 167 / 0.06);
}
.mgr-top-left { flex: 1 1 280px; min-width: 0; }
.mgr-top-center { flex: 0 0 auto; align-self: center; }
.mgr-top-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.mgr-top-filters {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  flex: 0 1 auto;
  margin-left: auto;
  align-self: center;
}
.mgr-top-filters .mgr-dash-filters__controls {
  margin-left: 0;
  gap: 0.4rem;
  align-items: center;
}
.mgr-attendance-header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
  background: #ffffff;
  color: #0f766e;
  font-family: var(--crm-font-family);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: var(--crm-letter-spacing, 0);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.mgr-attendance-header-btn:hover {
  background: #e8f8f6;
  border-color: #99e0d7;
  color: #0f766e;
}
.mgr-attendance-header-btn:focus-visible {
  outline: 2px solid rgb(37 183 167 / 0.45);
  outline-offset: 1px;
}
.mgr-attendance-header-btn .h-3\.5,
.mgr-attendance-header-btn [data-lucide] {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}
.mgr-employee-combobox__control {
  position: relative;
  width: 100%;
}
.mgr-employee-clear-btn {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  margin: 0;
  transform: translateY(-50%);
  flex-shrink: 0;
  border: none;
  border-radius: 9999px;
  background: #e2e8f0;
  color: #475569;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.mgr-employee-clear-btn:hover {
  background: #fecdd3;
  color: #be123c;
  box-shadow: 0 1px 4px rgb(190 18 60 / 0.15);
}
.mgr-employee-clear-btn:focus-visible {
  outline: 2px solid rgb(37 183 167 / 0.4);
  outline-offset: 1px;
}
.mgr-employee-clear-btn.hidden {
  display: none !important;
}
.mgr-employee-clear-btn .h-4,
.mgr-employee-clear-btn [data-lucide] {
  width: 12px;
  height: 12px;
}
.mgr-employee-clear-btn__fallback {
  display: none;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.mgr-employee-clear-btn:not(:has(svg)) .mgr-employee-clear-btn__fallback {
  display: inline;
}
.mgr-employee-combobox.has-employee-filter .mgr-employee-combobox__trigger {
  padding-right: 4rem;
}
.mgr-employee-avatar--clear {
  background: #fff1f2 !important;
  color: #be123c !important;
  font-size: 0.85rem !important;
  font-weight: 700;
}
.mgr-employee-option--clear {
  border-bottom: 1px solid #f1f5f9;
  background: #fffafb;
}
.mgr-employee-option--clear:hover {
  background: #fff1f2 !important;
}
.mgr-filter-sm.mgr-employee-combobox {
  width: 12.5rem;
  min-width: 10.5rem;
}
.mgr-top-filters__hint {
  margin: 0;
  font-size: 10px;
  color: #94a3b8;
  text-align: right;
  line-height: 1.2;
}
.mgr-filter-sm {
  width: 11.5rem;
  min-width: 10rem;
}
.mgr-filter-sm .mgr-employee-combobox__trigger {
  padding: 0.3rem 0.5rem;
  border-radius: 0.55rem;
  gap: 0.4rem;
  min-height: 2rem;
}
.mgr-filter-sm .mgr-employee-avatar {
  width: 1.35rem;
  height: 1.35rem;
  font-size: 0.58rem;
}
.mgr-filter-sm .mgr-employee-combobox__text {
  font-size: 0.75rem;
  font-weight: 600;
}
.mgr-filter-sm .mgr-employee-combobox__panel {
  border-radius: 0.65rem;
  min-width: 14rem;
  right: 0;
  left: auto;
}
.mgr-filter-sm .mgr-employee-combobox__search {
  padding: 0.45rem 0.55rem;
}
.mgr-filter-sm .mgr-employee-combobox__input {
  font-size: 0.75rem;
}
.mgr-filter-sm .mgr-employee-option {
  padding: 0.4rem 0.55rem;
  gap: 0.45rem;
}
.mgr-filter-sm .mgr-employee-option__name {
  font-size: 0.75rem;
}
.mgr-filter-sm .mgr-employee-option__sub {
  font-size: 0.65rem;
}
.mgr-filter-sm .mgr-date-custom {
  padding: 0.55rem;
}
.mgr-filter-sm .mgr-date-custom__field {
  font-size: 0.65rem;
}
.mgr-filter-sm .mgr-date-custom__field .input-field {
  font-size: 0.72rem;
  padding: 0.3rem 0.4rem;
  min-height: 1.85rem;
}
@media (max-width: 768px) {
  .mgr-top-filters {
    width: 100%;
    align-items: stretch;
  }
  .mgr-top-filters .mgr-dash-filters__controls {
    width: 100%;
    flex-wrap: wrap;
  }
  .mgr-attendance-header-btn {
    width: 100%;
    min-height: 2.25rem;
  }
  .mgr-filter-sm,
  .mgr-filter-sm.mgr-employee-combobox {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }
  .mgr-top-filters__hint { text-align: left; }
}
.mgr-greeting {
  text-transform: none;
}
.mgr-stat-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.mgr-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.25rem 0.625rem; border-radius: 9999px;
  background: #fff; border: 1px solid #e2e8f0; font-size: 12px; font-weight: 500; color: #475569;
}
.mgr-chip-hot { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
.mgr-period-tabs {
  display: inline-flex; padding: 0.25rem; border-radius: 10px;
  background: #fff; border: 1px solid #e2e8f0;
}
.mgr-period-tab {
  padding: 0.375rem 0.875rem; border: none; border-radius: 8px;
  background: transparent;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-body);
  font-weight: var(--crm-font-weight-button);
  letter-spacing: var(--crm-letter-spacing);
  color: #64748b;
  cursor: pointer; transition: background 0.2s, color 0.2s;
}
.mgr-period-tab:hover { color: #25b7a7; }
.mgr-period-tab.active { background: #25b7a7; color: #fff; }
.btn-sm { padding: 0.375rem 0.75rem !important; min-height: var(--crm-btn-height-sm) !important; font-size: var(--crm-font-size-helper) !important; font-weight: var(--crm-font-weight-button) !important; }
.btn-xs { padding: 0.2rem 0.45rem !important; min-height: 1.6rem !important; font-size: 0.7rem !important; font-weight: 600 !important; border-radius: 0.4rem !important; gap: 0.25rem !important; line-height: 1.2 !important; }

.mgr-kpi-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.875rem;
}
.dash-kpi-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  align-content: start;
  grid-auto-rows: auto;
}
@media (min-width: 640px) {
  .dash-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .dash-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1440px) {
  .dash-kpi-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 1920px) {
  .dash-kpi-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.dash-kpi-grid .mgr-kpi-card {
  padding: 0.55rem 0.7rem 0.55rem 0.75rem;
  min-height: 5.35rem;
  border: 1px solid #e8edf2;
  border-left: 4px solid #14b8a6;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.04), 0 2px 8px rgb(20 184 166 / 0.06);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease,
    background-color 0.18s ease;
}
.dash-kpi-grid .mgr-kpi-card:hover {
  border-color: #e2e8f0;
  border-left-color: #14b8a6;
  box-shadow: 0 6px 18px rgb(15 23 42 / 0.08), 0 2px 8px rgb(20 184 166 / 0.12);
  transform: translateY(-2px);
  background: #ffffff;
}
.dash-kpi-card--nav,
.mgr-emp-prod-card--nav,
.dash-prod-stat--nav,
.dash-fu-kpi--nav {
  cursor: pointer;
}
.dash-kpi-grid .mgr-kpi-card.dash-kpi-card--nav:hover {
  border-color: #cbd5e1;
  box-shadow: 0 6px 18px rgb(15 23 42 / 0.08), 0 2px 8px rgb(20 184 166 / 0.12);
  transform: translateY(-2px);
}
.mgr-emp-prod-card--nav:hover,
.dash-prod-stat--nav:hover,
.dash-fu-kpi--nav:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgb(15 23 42 / 0.08);
  transform: translateY(-1px);
}
.dash-kpi-card--nav:focus-visible,
.mgr-emp-prod-card--nav:focus-visible,
.dash-prod-stat--nav:focus-visible,
.dash-fu-kpi--nav:focus-visible,
.mgr-funnel-row:focus-visible {
  outline: 2px solid #14b8a6;
  outline-offset: 2px;
}
.dash-prod-stat--nav {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.mgr-emp-prod-card--nav {
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.dash-fu-kpi--nav {
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}
.assign-section--focus {
  outline: 2px solid #14b8a6;
  outline-offset: 4px;
  transition: outline-color 0.2s ease;
}
.dash-nav-loading {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  background: rgb(15 23 42 / 0.92);
  color: #f8fafc;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgb(15 23 42 / 0.25);
  pointer-events: none;
}
.dash-nav-loading__spinner {
  width: 0.85rem;
  height: 0.85rem;
  border: 2px solid rgb(248 250 252 / 0.35);
  border-top-color: #5eead4;
  border-radius: 50%;
  animation: dash-nav-spin 0.7s linear infinite;
}
@keyframes dash-nav-spin {
  to { transform: rotate(360deg); }
}
.dash-kpi-card--premium {
  position: relative;
  overflow: hidden;
}
.dash-kpi-card--premium::before {
  display: none;
}

/* Unified enterprise accent — same teal left border on every KPI card */
.dash-kpi-card--premium[data-accent],
.dash-kpi-grid .dash-kpi-card--premium {
  border-left-color: #14b8a6;
}

.dash-kpi-grid .mgr-kpi-top {
  margin-bottom: 0.35rem;
  align-items: center;
}
.dash-kpi-grid .mgr-kpi-icon {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 7px;
  background: #eefbf9;
  color: #0f766e;
}
.dash-kpi-grid .mgr-kpi-icon i,
.dash-kpi-grid .mgr-kpi-icon svg {
  width: 0.8rem;
  height: 0.8rem;
}
.dash-kpi-grid .mgr-kpi-trend {
  font-size: 10px;
  padding: 2px 6px;
  gap: 0.2rem;
}
.dash-kpi-grid .mgr-kpi-value {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 750;
  line-height: 1.05;
  color: #0f172a;
  letter-spacing: -0.01em;
}
.dash-kpi-grid .mgr-kpi-label {
  margin: 0.15rem 0 0;
  font-size: 0.7rem;
  line-height: 1.2;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-kpi-grid .mgr-kpi-desc,
.dash-kpi-grid .mgr-kpi-footer {
  display: none !important;
}
.mgr-kpi-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0;
}
.mgr-kpi-updated {
  font-size: 11px;
  color: #cbd5e1;
  letter-spacing: 0.01em;
}
.dash-kpi-sections {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 0 0 auto;
}
.dash-kpi-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 0 0 auto;
}
.dash-kpi-section-title {
  margin: 0;
  padding: 0 0.1rem;
  font-family: var(--crm-font-family);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  color: #334155;
}
.dash-kpi-section-grid { margin-bottom: 0; }
.dash-kpi-section-grid > [role="listitem"] {
  display: flex;
  min-width: 0;
  height: 100%;
}
.dash-kpi-section-grid > [role="listitem"] > .mgr-kpi-card {
  width: 100%;
  flex: 1 1 auto;
}
.dash-kpi-section-grid .mgr-kpi-card {
  min-height: 5.5rem;
  height: 100%;
}

@media (max-width: 639px) {
  .dash-kpi-grid .mgr-kpi-card {
    min-height: 5rem;
    padding: 0.5rem 0.6rem 0.5rem 0.65rem;
  }
  .dash-kpi-grid .mgr-kpi-value { font-size: 1.1rem; }
  .dash-kpi-grid .mgr-kpi-label { font-size: 0.66rem; }
}
@media (min-width: 768px) { .mgr-kpi-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1280px) { .mgr-kpi-grid:not(.dash-kpi-grid) { grid-template-columns: repeat(8, 1fr); } }
.mgr-kpi-card {
  display: flex; flex-direction: column; text-align: left;
  padding: 0.875rem; border-radius: 12px;
  border: 1px solid #e8edf2;
  border-left: 4px solid #14b8a6;
  background: #fff; cursor: pointer;
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.04), 0 2px 8px rgb(20 184 166 / 0.06);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.mgr-kpi-card:hover {
  border-color: #e2e8f0;
  border-left-color: #14b8a6;
  box-shadow: 0 6px 18px rgb(15 23 42 / 0.08), 0 2px 8px rgb(20 184 166 / 0.12);
  transform: translateY(-2px);
}
.mgr-kpi-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.5rem; }
.mgr-kpi-icon {
  display: flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 8px; background: #e8f8f6; color: #25b7a7;
  flex-shrink: 0;
}
.mgr-kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--crm-font-family);
  font-size: 11px;
  font-weight: var(--crm-font-weight-badge);
  letter-spacing: var(--crm-letter-spacing);
  padding: 3px 8px;
  border-radius: 9999px;
  white-space: nowrap;
}
.mgr-kpi-trend.up { background: #ecfdf5; color: #059669; }
.mgr-kpi-trend.down { background: #fef2f2; color: #dc2626; }
.mgr-kpi-trend--warning.up { background: #fffbeb; color: #b45309; }
.mgr-kpi-trend--warning.down { background: #fffbeb; color: #b45309; }
.mgr-kpi-trend--muted { background: #f8fafc; color: #94a3b8; }
.mgr-kpi-trend--success.up { background: #ecfdf5; color: #059669; }
.mgr-kpi-trend--danger.down { background: #fef2f2; color: #dc2626; }
.mgr-kpi-value {
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-kpi-value);
  font-weight: var(--crm-font-weight-kpi-value);
  letter-spacing: var(--crm-letter-spacing);
  color: #0f172a;
  line-height: var(--crm-line-height-kpi-value);
}
.mgr-kpi-label {
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-stat-label);
  font-weight: var(--crm-font-weight-stat-label);
  letter-spacing: var(--crm-letter-spacing);
  color: #64748b;
  margin-top: 0.125rem;
}
.mgr-sparkline {
  display: flex; align-items: flex-end; gap: 2px; height: 28px; margin-top: 0.5rem;
}
.mgr-spark-bar {
  flex: 1; min-height: 4px; border-radius: 2px 2px 0 0;
  background: #25b7a7; opacity: 0.45; transition: opacity 0.2s;
}
.mgr-kpi-card:hover .mgr-spark-bar { opacity: 0.85; }

.mgr-grid-3 { display: grid; gap: 1rem; }
@media (min-width: 1024px) { .mgr-grid-3 { grid-template-columns: repeat(3, 1fr); } }
.mgr-grid-2 { display: grid; gap: 1rem; }
@media (min-width: 1024px) { .mgr-grid-2 { grid-template-columns: repeat(2, 1fr); } }
.mgr-panel { padding: 1.25rem 1.375rem !important; }
.mgr-panel-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem;
  margin-bottom: 1rem;
}
.mgr-panel-title {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-card-title);
  font-weight: var(--crm-font-weight-card-title);
  letter-spacing: var(--crm-letter-spacing);
  color: #1e293b; margin: 0;
}
.mgr-panel-subtitle {
  margin: 0.25rem 0 0;
  font-size: 12px;
  color: #94a3b8;
  font-weight: 400;
  line-height: 1.35;
}
.mgr-link-btn {
  border: none; background: none;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-body);
  font-weight: var(--crm-font-weight-button);
  letter-spacing: var(--crm-letter-spacing);
  color: #25b7a7;
  cursor: pointer; padding: 0.25rem 0.5rem; border-radius: 6px;
}
.mgr-link-btn:hover { background: #e8f8f6; }

.mgr-funnel-row {
  display: grid; grid-template-columns: 7.5rem 1fr 1.75rem; align-items: center; gap: 0.625rem;
  width: 100%; padding: 0.375rem 0; border: none; background: transparent; cursor: pointer;
  text-align: left; border-radius: 6px; transition: background 0.15s;
}
.mgr-funnel-row:hover { background: #f8fafc; }
.mgr-funnel-label { font-size: 12px; color: #475569; font-weight: 500; }
.mgr-funnel-track { height: 8px; border-radius: 9999px; background: #f1f5f9; overflow: hidden; }
.mgr-funnel-fill { height: 100%; border-radius: 9999px; transition: width 0.4s ease; }
.mgr-funnel-count { font-size: 13px; font-weight: 700; color: #1e293b; text-align: right; }

.mgr-priority-list { display: flex; flex-direction: column; gap: 0.375rem; max-height: 220px; overflow-y: auto; }
.mgr-priority-item {
  display: flex; align-items: center; gap: 0.625rem; width: 100%;
  padding: 0.625rem 0.75rem; border: 1px solid #f1f5f9; border-radius: 10px;
  background: #fff; cursor: pointer; text-align: left; transition: border-color 0.2s, background 0.2s;
}
.mgr-priority-item:hover { border-color: #ccf0ec; background: #f8fffe; }
.mgr-priority-icon {
  display: flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 8px; background: #e8f8f6; color: #25b7a7; flex-shrink: 0;
}
.mgr-priority-body { flex: 1; min-width: 0; }
.mgr-priority-firm { display: block; font-size: 13px; font-weight: 600; color: #1e293b; }
.mgr-priority-meta { display: block; font-size: 11px; color: #94a3b8; margin-top: 2px; }

.mgr-team-scroll {
  display: flex; gap: 0.625rem; overflow-x: auto; padding-bottom: 0.25rem;
}
.mgr-team-card {
  flex: 0 0 108px; display: flex; flex-direction: column; align-items: center;
  padding: 0.875rem 0.625rem; border: 1px solid #e2e8f0; border-radius: 12px;
  background: #fff; cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s;
}
.mgr-team-card:hover { border-color: #25b7a7; box-shadow: 0 2px 10px rgb(37 183 167 / 0.1); }
.mgr-team-avatar {
  width: 2.5rem; height: 2.5rem; border-radius: 9999px;
  background: #25b7a7; color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.mgr-team-name { font-size: 13px; font-weight: 600; color: #1e293b; margin-top: 0.5rem; }
.mgr-team-city { font-size: 11px; color: #94a3b8; }
.mgr-team-card .ca-progress { width: 100%; margin-top: 0.5rem; }
.mgr-team-pct { font-size: 10px; color: #64748b; margin-top: 0.25rem; }

.mgr-bar-chart { display: flex; flex-direction: column; gap: 0.75rem; min-height: 10rem; }
.dash-bar-chart { padding-top: 0.25rem; }
.mgr-bar-row { display: grid; grid-template-columns: 6rem 1fr 2rem; align-items: center; gap: 0.625rem; }
.dash-bar-row { padding: 0.125rem 0; border-radius: 6px; transition: background 0.15s; }
.dash-bar-row:hover { background: #f8fffe; }
.mgr-bar-label { font-size: 12px; color: #475569; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mgr-bar-track { height: 10px; border-radius: 9999px; background: #f1f5f9; overflow: hidden; }
.mgr-bar-fill { height: 100%; border-radius: 9999px; background: linear-gradient(90deg, #25b7a7, #4CB4D4); transition: width 0.45s ease; }
.mgr-bar-fill-alt { background: linear-gradient(90deg, #1e9688, #25b7a7); }
.mgr-bar-val { font-size: 12px; font-weight: 700; color: #1e293b; text-align: right; }

.mgr-dashboard .dash-table-scroll {
  max-height: 320px;
  overflow: auto;
}
.mgr-dashboard .dash-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  box-shadow: 0 1px 0 #e2e8f0;
  font-size: var(--crm-font-size-table-header);
  font-weight: var(--crm-font-weight-table-header);
}
.mgr-dashboard .dash-table tbody tr:nth-child(even) { background: #fafbfc; }
.mgr-dashboard .dash-table tbody tr:hover { background: #f0fdfa; }
.mgr-dashboard .dash-table td,
.mgr-dashboard .dash-table th {
  padding: var(--crm-table-cell-py) var(--crm-table-cell-px);
  font-size: var(--crm-font-size-table-cell);
  line-height: var(--crm-line-height-tight);
}

.mgr-table .mgr-table-name { display: block; font-weight: 600; font-size: 13px; color: #1e293b; }
.mgr-table .mgr-table-sub { display: block; font-size: 11px; color: #94a3b8; }
.mgr-table-row { cursor: pointer; }
.mgr-table-row:hover { background: #f8fffe; }

.mgr-activity-feed { display: flex; flex-direction: column; gap: 0; max-height: 260px; overflow-y: auto; }
.mgr-activity-item {
  display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.625rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.mgr-activity-item:last-child { border-bottom: none; }
.mgr-activity-dot {
  width: 8px; height: 8px; border-radius: 9999px; background: #25b7a7;
  margin-top: 6px; flex-shrink: 0;
}
.mgr-activity-body { flex: 1; min-width: 0; }
.mgr-activity-title { font-size: 13px; font-weight: 600; color: #334155; margin: 0; }
.mgr-activity-detail { font-size: 12px; color: #94a3b8; margin: 2px 0 0; }
.mgr-activity-time { font-size: 11px; color: #cbd5e1; flex-shrink: 0; }
.mgr-empty { font-size: 13px; color: #94a3b8; text-align: center; padding: 2rem 1rem; }

.manager-role-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.25rem 0.625rem; border-radius: 9999px;
  background: #25b7a7; color: #fff; font-size: 11px; font-weight: 600;
  letter-spacing: 0.01em; text-transform: none;
}
.mgr-top-meta {
  color: #64748b;
  margin-top: 0.25rem;
  text-transform: none;
}
.form-label {
  display: block;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-label);
  font-weight: var(--crm-font-weight-label);
  letter-spacing: var(--crm-letter-spacing);
  color: var(--crm-color-label);
  margin-bottom: 0.375rem;
}
.mgr-dash-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.75rem 1rem;
}
.mgr-dash-filters__left {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.mgr-dash-filters__title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a;
}
.mgr-dash-filters__hint {
  font-size: 0.75rem;
  color: #64748b;
}
.mgr-dash-filters__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-left: auto;
}
.mgr-dash-filters__loading {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: #0f766e;
  font-weight: 600;
}
.mgr-dash-spinner {
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid #99f6e4;
  border-top-color: #0f766e;
  border-radius: 9999px;
  animation: mgr-spin 0.7s linear infinite;
}
@keyframes mgr-spin { to { transform: rotate(360deg); } }
.mgr-employee-combobox,
.mgr-date-combobox {
  position: relative;
  min-width: min(100%, 15rem);
  width: 15.5rem;
}
.mgr-employee-avatar--date {
  background: #eff6ff;
  color: #2563eb;
}
.mgr-employee-combobox__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.mgr-employee-combobox__trigger:hover,
.mgr-employee-combobox.is-open .mgr-employee-combobox__trigger {
  border-color: #4CB4D4;
  box-shadow: 0 0 0 3px rgb(76 180 212 / 0.15);
}
.mgr-employee-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  background: #edf9fc;
  color: #0f766e;
  font-size: 0.7rem;
  font-weight: 700;
  flex: 0 0 auto;
}
.mgr-employee-combobox__text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mgr-employee-combobox__panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  box-shadow: 0 12px 30px rgb(15 23 42 / 0.12);
  overflow: hidden;
}
.mgr-employee-combobox__search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}
.mgr-employee-combobox__input {
  width: 100%;
  border: 0;
  outline: none;
  font-size: 0.875rem;
  color: #0f172a;
  background: transparent;
}
.mgr-employee-combobox__list {
  max-height: 16rem;
  overflow: auto;
}
.mgr-employee-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.mgr-employee-option:hover,
.mgr-employee-option.is-active {
  background: #f0fdfa;
}
.mgr-employee-option__meta {
  min-width: 0;
}
.mgr-employee-option__name {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
}
.mgr-employee-option__sub {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
}

/* Compact employee productivity cards */
.mgr-emp-prod-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

/* Tablet */
@media (min-width: 640px) {
  .mgr-emp-prod-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Laptop */
@media (min-width: 900px) {
  .mgr-emp-prod-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Desktop */
@media (min-width: 1200px) {
  .mgr-emp-prod-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

.mgr-emp-prod-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 4.25rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid #dce7ee;
  background: linear-gradient(145deg, #ffffff 0%, #f4fbfc 100%);
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgb(15 23 42 / 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.mgr-emp-prod-card:hover {
  transform: translateY(-2px);
  border-color: #9edbd5;
  box-shadow: 0 6px 16px rgb(15 23 42 / 0.09);
}

  .mgr-emp-prod-card__label {
    margin: 0;
    font-size: 0.68rem;
    line-height: 1.25;
    font-weight: 600;
    color: #5f7489;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mgr-emp-prod-card__value {
    margin: 0.2rem 0 0;
    min-width: 0;
    font-size: 1rem;
    line-height: 1.15;
    font-weight: 800;
    color: #123447;
    overflow-wrap: anywhere;
  }
.mgr-emp-prod-card--wide {
  grid-column: span 2;
}

.mgr-emp-prod-card--wide .mgr-emp-prod-card__label {
  white-space: normal;
}

.mgr-emp-prod-card--wide .mgr-emp-prod-card__value {
  font-size: 0.82rem;
  line-height: 1.3;
}
.mgr-emp-prod-card--wide .mgr-emp-prod-card__value {
  font-size: 0.82rem;
  line-height: 1.3;
}

/* Different colors for each section */

.mgr-emp-prod-section:nth-of-type(1) .mgr-emp-prod-card {
  background: linear-gradient(145deg, #ffffff 0%, #eef9ff 100%);
  border-color: #d5edf8;
}

.mgr-emp-prod-section:nth-of-type(2) .mgr-emp-prod-card {
  background: linear-gradient(145deg, #ffffff 0%, #f0fbf7 100%);
  border-color: #d7f0e6;
}

.mgr-emp-prod-section:nth-of-type(3) .mgr-emp-prod-card {
  background: linear-gradient(145deg, #ffffff 0%, #fff8ec 100%);
  border-color: #f3e4c8;
}

.mgr-emp-prod-section:nth-of-type(4) .mgr-emp-prod-card {
  background: linear-gradient(145deg, #ffffff 0%, #f6f3ff 100%);
  border-color: #e6ddfb;
}

.mgr-emp-prod-section:nth-of-type(5) .mgr-emp-prod-card {
  background: linear-gradient(145deg, #ffffff 0%, #eefcf8 100%);
  border-color: #d5f2e8;
}

.mgr-emp-prod-section:nth-of-type(6) .mgr-emp-prod-card {
  background: linear-gradient(145deg, #ffffff 0%, #fff2f5 100%);
  border-color: #f6dbe3;
}

.mgr-emp-prod-section + .mgr-emp-prod-section {
  margin-top: 0.65rem;
}

.mgr-emp-prod-section + .mgr-emp-prod-section {
  margin-top: 0.65rem;
}

.mgr-emp-prod-section__title {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  line-height: 1.2;
  font-weight: 800;
  color: #2e6f7e;
  text-transform: uppercase;
  letter-spacing: 0.045em;
}
.mgr-emp-prod-section__title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 0.85rem;
  margin-right: 0.4rem;
  border-radius: 999px;
  background: #25b7a7;
  vertical-align: -1px;
}
#mgr-employee-productivity-panel {
  padding: 1rem;
}

#mgr-employee-productivity-panel > .flex:first-child {
  margin-bottom: 0.65rem !important;
}

#mgr-employee-productivity-panel .text-card-heading {
  font-size: 1rem;
  line-height: 1.3;
}
.mgr-dashboard.is-loading-employee #mgr-kpi-sections,
.mgr-dashboard.is-loading-employee #mgr-employee-productivity-panel {
  opacity: 0.55;
  pointer-events: none;
}

/* Lead Collection Productivity — premium KPI hub */
.mgr-productivity-slot {
  min-width: 0;
}

.mgr-productivity-hub {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mgr-productivity-hub__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.mgr-productivity-hub__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.mgr-productivity-hub__sub {
  margin: 0.2rem 0 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.mgr-productivity-hub__sub strong {
  color: #2E7F96;
  font-weight: 700;
}

.mgr-productivity-hub__stamp {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 9999px;
  background: #f8fafc;
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}

.mgr-productivity-hub__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.875rem;
}

@media (min-width: 640px) {
  .mgr-productivity-hub__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .mgr-productivity-hub__grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.mgr-prod-kpi {
  display: flex;
  flex-direction: column;
  min-height: 22rem;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.05), 0 8px 24px rgb(15 23 42 / 0.04);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  overflow: hidden;
}

.mgr-prod-kpi--enter {
  animation: mgrProdFadeIn 0.45s ease both;
  animation-delay: calc(var(--prod-i, 0) * 70ms);
}

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

.mgr-prod-kpi:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgb(15 23 42 / 0.08), 0 16px 32px rgb(46 127 150 / 0.1);
}

.mgr-prod-kpi__head {
  padding: 0.9rem 0.95rem 0.65rem;
  border-bottom: 1px solid #f1f5f9;
}

.mgr-prod-kpi__title-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.mgr-prod-kpi__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  flex-shrink: 0;
}

.mgr-prod-kpi__icon--excellent { background: #ecfdf5; color: #059669; }
.mgr-prod-kpi__icon--good { background: #eff6ff; color: #2563eb; }
.mgr-prod-kpi__icon--average { background: #fff7ed; color: #ea580c; }
.mgr-prod-kpi__icon--needs { background: #fff1f2; color: #e11d48; }

.mgr-prod-kpi__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}

.mgr-prod-kpi__updated {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.68rem;
  font-weight: 500;
  color: #94a3b8;
  font-style: normal;
}
/* Hide Updated time from KPI cards */
.mgr-kpi-updated,
.mgr-prod-kpi__updated {
    display: none !important;
}
.mgr-prod-kpi__body {
  flex: 1;
  padding: 0.55rem 0.75rem 0.35rem;
  min-height: 0;
}

.mgr-prod-kpi__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.mgr-prod-kpi__row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.35rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.mgr-prod-kpi__row:hover {
  background: #f8fafc;
}

.mgr-prod-kpi__rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.65rem;
  height: 1.35rem;
  padding: 0 0.3rem;
  border-radius: 9999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.mgr-prod-kpi__rank--excellent { background: #d1fae5; color: #047857; }
.mgr-prod-kpi__rank--good { background: #dbeafe; color: #1d4ed8; }
.mgr-prod-kpi__rank--average { background: #ffedd5; color: #c2410c; }
.mgr-prod-kpi__rank--needs { background: #ffe4e6; color: #be123c; }

.mgr-prod-kpi__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #e8f8f6, #d9f1f8);
  color: #2E7F96;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.mgr-prod-kpi__meta {
  min-width: 0;
}

.mgr-prod-kpi__name {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

.mgr-prod-kpi__metric {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.mgr-prod-kpi__bar {
  flex: 1;
  height: 5px;
  border-radius: 9999px;
  background: #e2e8f0;
  overflow: hidden;
  min-width: 2.5rem;
}

.mgr-prod-kpi__bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.mgr-prod-kpi__bar-fill--excellent { background: linear-gradient(90deg, #34d399, #10b981); }
.mgr-prod-kpi__bar-fill--good { background: linear-gradient(90deg, #60a5fa, #3b82f6); }
.mgr-prod-kpi__bar-fill--average { background: linear-gradient(90deg, #fdba74, #f97316); }
.mgr-prod-kpi__bar-fill--needs { background: linear-gradient(90deg, #fb7185, #e11d48); }

.mgr-prod-kpi__value {
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  min-width: 2rem;
  text-align: right;
}

.mgr-prod-kpi__value--excellent { color: #059669; }
.mgr-prod-kpi__value--good { color: #2563eb; }
.mgr-prod-kpi__value--average { color: #ea580c; }
.mgr-prod-kpi__value--needs { color: #e11d48; }

.mgr-prod-kpi__foot {
  padding: 0.55rem 0.85rem 0.8rem;
  margin-top: auto;
}

.mgr-prod-kpi__details {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 0.72rem;
  font-weight: 700;
  color: #2E7F96;
  cursor: pointer;
  transition: color 0.15s ease, gap 0.15s ease;
}

.mgr-prod-kpi__details:hover {
  color: #1d6b80;
  gap: 0.45rem;
}

.mgr-prod-kpi__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.45rem;
  min-height: 11rem;
  padding: 1rem 0.75rem;
  color: #94a3b8;
}

.mgr-prod-kpi__empty--hub {
  min-height: 14rem;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.05), 0 8px 24px rgb(15 23 42 / 0.04);
  padding: 2rem 1.25rem;
}

.mgr-prod-kpi__empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  background: #f1f5f9;
  color: #94a3b8;
}

.mgr-prod-kpi__empty p {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
}

.mgr-date-custom {
  border-top: 1px solid #f1f5f9;
  padding: 0.75rem;
}
.mgr-date-custom__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.mgr-date-custom__field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
}
.mgr-date-custom__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.65rem;
}
@media (max-width: 768px) {
  .mgr-dash-filters__controls { width: 100%; }
  .mgr-employee-combobox,
  .mgr-date-combobox { width: 100%; min-width: 0; }
}
.ca-field { margin: 0; }
.ca-field-error {
  margin: 0.35rem 0 0;
  font-size: 12px;
  line-height: 1.35;
  color: #e11d48;
}
.ca-field-error.hidden { display: none !important; }
.input-field.is-invalid {
  border-color: #fb7185;
  box-shadow: 0 0 0 3px rgb(251 113 133 / 0.15);
}
.ca-progress {
  height: 6px; border-radius: 9999px; background: #e2e8f0; overflow: hidden; margin-bottom: 2px; min-width: 4rem;
}
.ca-progress-bar { height: 100%; border-radius: 9999px; background: #25b7a7; transition: width 0.3s ease; }

#activity-timeline {
  position: relative;
  isolation: isolate;
  padding-top: 0.25rem;
}
.timeline-item {
  position: relative;
  display: flex;
  gap: 1rem;
  padding: 0 0 1.5rem 2rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-icon {
  position: absolute;
  left: 0;
  top: 0.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  color: #fff;
  flex-shrink: 0;
  z-index: 1;
}
.timeline-item::before {
  content: ''; position: absolute; left: 11px; top: 1.75rem;
  height: calc(100% - 12px); width: 2px; background: #e2e8f0;
}
.timeline-item:last-child::before { display: none; }

.followup-history-card {
  min-height: 0;
}
.followup-history-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 0;
}
.followup-history-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  flex-shrink: 0;
  padding-bottom: 0.5rem;
}
.followup-history-panel__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.followup-history-panel__filters-wrap {
  position: sticky;
  top: 0;
  z-index: 2;
  flex-shrink: 0;
  padding: 0.25rem 0 0.5rem;
  margin: 0 0 0.25rem;
  background: #fff;
  border-bottom: 1px solid #eef2f6;
}
.followup-history-panel__scroll {
  position: relative;
  flex: 1 1 auto;
  height: 360px;
  max-height: 420px;
  min-height: 10rem;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.followup-history-panel__scroll.is-loading {
  pointer-events: none;
}
.followup-history-panel__scroll.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgb(255 255 255 / 0.55);
  z-index: 1;
  pointer-events: none;
}
.followup-history-panel__footer {
  flex-shrink: 0;
  margin-top: 0;
  padding: 0;
  border-top: 1px solid #e5e7eb;
  background: #fff;
  min-height: 2.75rem;
}
.followup-history-panel__footer.is-loading .crm-table-pagination__nav,
.followup-history-panel__footer.is-loading .crm-table-pagination__per-page {
  opacity: 0.55;
  pointer-events: none;
}
.followup-history-card > .followup-activity-timeline--compact {
  margin-top: 0;
}
.followup-history-panel__scroll .followup-activity-timeline--compact {
  margin-top: 0;
}
.followup-history-count {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.followup-history-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.followup-history-card__toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.followup-history-card__filters {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem;
  border-radius: 0.625rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.followup-history-filter {
  border: 0;
  background: transparent;
  color: #64748b;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-helper);
  font-weight: var(--crm-font-weight-button);
  line-height: 1;
  padding: 0.4rem 0.65rem;
  border-radius: 0.45rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.followup-history-filter:hover {
  color: #334155;
  background: rgb(255 255 255 / 0.7);
}
.followup-history-filter.is-active {
  background: #fff;
  color: #0f766e;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.06);
}
.followup-history-page-size {
  display: inline-flex;
  align-items: center;
}
.followup-history-page-size__select {
  appearance: none;
  border: 1px solid #e2e8f0;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.45rem center;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.38rem 1.35rem 0.38rem 0.55rem;
  border-radius: 0.45rem;
  cursor: pointer;
}
.followup-activity-timeline {
  position: relative;
  isolation: isolate;
}
.followup-activity-timeline--compact {
  min-height: 0;
  overflow: visible;
  padding-right: 0.15rem;
}
.fu-activity-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem 0.5rem;
  min-height: 4rem;
  color: #64748b;
  font-size: 0.75rem;
}
.fu-activity-period-empty {
  margin: 0;
  padding: 1.25rem 0.75rem;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #64748b;
}
.fu-activity-demo-banner {
  margin: 0 0 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 0.45rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.35;
}
.followup-history-panel__filters-wrap.is-loading {
  opacity: 0.72;
  pointer-events: none;
}
.fu-activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.fu-activity-day-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.fu-activity-day-label {
  margin: 0;
  padding: 0 0.15rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}
.fu-activity-day-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.fu-activity-row {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  gap: 0.5rem;
  align-items: start;
  padding: 0.375rem 0.5rem;
  border: 1px solid #e8edf3;
  border-radius: 0.5rem;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.fu-activity-row:hover {
  border-color: #cbd5e1;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}
.fu-activity-row__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  color: #fff;
  flex-shrink: 0;
  margin-top: 0.05rem;
}
.fu-activity-row__body {
  min-width: 0;
}
.fu-activity-row__line1,
.fu-activity-row__line2 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  min-width: 0;
}
.fu-activity-row__line2 {
  margin-top: 0.1rem;
}
.fu-activity-row__type {
  font-size: 0.75rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
  flex-shrink: 0;
}
.fu-activity-row__meta {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.25;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fu-activity-row__employee {
  font-size: 0.625rem;
  color: #64748b;
  line-height: 1.2;
  flex-shrink: 0;
}
.fu-activity-row__when {
  font-size: 0.625rem;
  font-weight: 500;
  color: #94a3b8;
  white-space: nowrap;
  margin-left: auto;
}
.fu-activity-row__badge-inline {
  margin-left: auto;
  flex-shrink: 0;
}
.fu-activity-row__note {
  margin: 0.15rem 0 0;
  font-size: 0.6875rem;
  line-height: 1.25;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  cursor: default;
}
.fu-activity-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  font-size: 0.5625rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.fu-activity-badge--success { background: #ecfdf5; color: #047857; }
.fu-activity-badge--brand { background: #ecfeff; color: #0e7490; }
.fu-activity-badge--warning { background: #fffbeb; color: #b45309; }
.fu-activity-badge--danger { background: #fef2f2; color: #b91c1c; }
.fu-activity-badge--neutral { background: #f1f5f9; color: #475569; }
.fu-activity-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.75rem 0.75rem;
  min-height: 4.5rem;
  border: 1px dashed #e2e8f0;
  border-radius: 0.625rem;
  background: #f8fafc;
}
.fu-activity-empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #94a3b8;
  margin-bottom: 0.35rem;
}
.fu-activity-empty__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #334155;
}
.fu-activity-empty__text {
  margin: 0.2rem 0 0.55rem;
  max-width: 18rem;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: #64748b;
}
.followup-history-card .crm-table-footer {
  margin-top: 0;
  padding: 0;
  border-top: none;
}
.followup-history-card .crm-table-pagination {
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  border-top: none;
}
.followup-history-card .crm-table-footer--empty {
  display: none;
}
.fu-activity-footer__status {
  margin: 0;
  font-size: 0.6875rem;
  color: #64748b;
  line-height: 1.35;
}
.fu-activity-footer__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
.fu-activity-footer__more,
.fu-activity-footer__less {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
@media (max-width: 640px) {
  .followup-history-panel__header {
    flex-direction: column;
    align-items: stretch;
  }
  .followup-history-panel__actions {
    justify-content: flex-end;
  }
  .followup-history-panel__scroll {
    height: 300px;
    max-height: 360px;
  }
  .followup-history-card__toolbar {
    width: 100%;
    justify-content: flex-start;
  }
  .fu-activity-row__line1,
  .fu-activity-row__line2 {
    align-items: flex-start;
  }
  .fu-activity-row__when,
  .fu-activity-row__badge-inline {
    margin-left: 0;
  }
  .fu-activity-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .fu-activity-footer__actions {
    margin-left: 0;
    justify-content: flex-end;
  }
}
.followup-activity-timeline--compact .timeline-item {
  padding-left: 1.75rem;
  padding-bottom: 1rem;
}
.followup-timeline-card {
  border: 1px solid #e2e8f0;
  box-shadow: none;
}
.followup-timeline-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 500;
}
.followup-timeline-status {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 12px;
  font-weight: 600;
}
.followup-timeline-notes {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #475569;
}
.followup-timeline-action,
.followup-timeline-followup-date {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 12px;
  color: #64748b;
}

.kpi-sparkline { height: 32px; width: 100%; display: block; }
.scrollbar-thin {
  scrollbar-width: thin;
  scrollbar-color: var(--crm-scrollbar-thumb) var(--crm-scrollbar-track-surface);
}

.scrollbar-thin::-webkit-scrollbar {
  width: var(--crm-scrollbar-size);
  height: var(--crm-scrollbar-size);
}

.scrollbar-thin::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.scrollbar-thin::-webkit-scrollbar-track {
  background: var(--crm-scrollbar-track-surface);
  border-radius: 999px;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
  background: var(--crm-scrollbar-thumb);
  border-radius: 999px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background: var(--crm-scrollbar-thumb-hover);
}

.bg-brand { background-color: #4CB4D4 !important; }
.bg-brand-50 { background-color: #EDF9FC !important; }
.text-brand { color: #4CB4D4 !important; }
.shadow-soft { box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.04), 0 4px 12px -2px rgb(0 0 0 / 0.06); }
.shadow-soft-lg { box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 10px 24px -4px rgb(0 0 0 / 0.08); }
.shadow-glow { box-shadow: 0 0 0 3px rgba(76, 180, 212, 0.15); }
.rounded-card { border-radius: 16px; }
.hidden { display: none !important; }
.scroll-mt-20 { scroll-margin-top: 5rem; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulseSoft { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
.animate-fade-in { animation: fadeIn 0.3s ease-out; }
.animate-slide-up { animation: slideUp 0.3s ease-out both; }
.animate-pulse-soft { animation: pulseSoft 2s ease-in-out infinite; }

html:not(.crm-sidebar-ready) #sidebar,
html:not(.crm-sidebar-ready) #main-content,
html:not(.crm-sidebar-ready) .crm-content {
  transition: none !important;
}

#sidebar { width: var(--crm-sidebar-width); transition: width 0.3s ease, transform 0.3s ease; }
#sidebar.sidebar-collapsed,
html[data-sidebar-collapsed="1"] #sidebar { width: var(--crm-sidebar-collapsed-width); }
#sidebar.sidebar-collapsed .sidebar-label,
#sidebar.sidebar-collapsed .ca-sidebar-toolbar,
#sidebar.sidebar-collapsed .nav-sub-item,
#sidebar.sidebar-collapsed .sidebar-submenu,
html[data-sidebar-collapsed="1"] #sidebar .sidebar-label,
html[data-sidebar-collapsed="1"] #sidebar .ca-sidebar-toolbar,
html[data-sidebar-collapsed="1"] #sidebar .nav-sub-item,
html[data-sidebar-collapsed="1"] #sidebar .sidebar-submenu { display: none; }
#sidebar.sidebar-collapsed .ca-sidebar-logo-link,
html[data-sidebar-collapsed="1"] #sidebar .ca-sidebar-logo-link { display: none; }
#sidebar.sidebar-collapsed .ca-sidebar-brand-pill,
html[data-sidebar-collapsed="1"] #sidebar .ca-sidebar-brand-pill { padding: 0.375rem; }
#sidebar.sidebar-collapsed .ca-brand-icon,
html[data-sidebar-collapsed="1"] #sidebar .ca-brand-icon { width: 2rem; height: 2rem; }
#sidebar.sidebar-collapsed .ca-sidebar-brand,
html[data-sidebar-collapsed="1"] #sidebar .ca-sidebar-brand {
  justify-content: center;
  padding: 0.75rem 0.5rem;
}
#sidebar.sidebar-collapsed .ca-sidebar-collapse,
html[data-sidebar-collapsed="1"] #sidebar .ca-sidebar-collapse {
  display: flex !important;
  margin-inline: auto;
}
#sidebar.sidebar-collapsed .nav-item,
html[data-sidebar-collapsed="1"] #sidebar .nav-item { justify-content: center; padding: 0.75rem; }
#sidebar.sidebar-collapsed .nav-item.active::after,
html[data-sidebar-collapsed="1"] #sidebar .nav-item.active::after { display: none; }
#main-content.main-expanded,
html[data-sidebar-collapsed="1"] #main-content,
html[data-sidebar-collapsed="1"] .crm-content {
  margin-left: var(--crm-sidebar-collapsed-width);
  width: calc(100% - var(--crm-sidebar-collapsed-width));
  max-width: calc(100vw - var(--crm-sidebar-collapsed-width));
}

/* ─── CA Cloud Desk Sidebar (reference design) ─── */
.ca-sidebar { box-shadow: 1px 0 0 #e2e8f0; }
.ca-sidebar-brand {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 1rem 0.875rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}
.ca-sidebar-collapse {
  display: none;
  align-items: center; justify-content: center;
  width: 2rem; height: 2rem; flex-shrink: 0;
  border: none; border-radius: 8px; background: transparent;
  color: #25b7a7; cursor: pointer; transition: background 0.2s, color 0.2s;
}
@media (min-width: 1024px) {
  .ca-sidebar-collapse {
    display: flex;
  }
}
.ca-sidebar-collapse:hover { background: #e8f8f6; color: #1e9688; }
.ca-sidebar-logo-link {
  display: flex; align-items: center; flex: 1; min-width: 0;
  text-decoration: none;
}
.ca-sidebar-brand-pill {
  gap: 0.5rem;
  padding: 0.375rem 0.5rem 0.375rem 0.625rem;
  border: 1px solid #d1d5db; border-radius: 9999px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}
.ca-brand-icon {
  width: 1.75rem; height: 1.75rem; border-radius: 9999px;
  flex-shrink: 0; object-fit: contain;
}
.ca-brand-text {
  flex: 1; min-width: 0;
  font-size: 13px; font-weight: 500; color: #1e293b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ca-brand-people {
  width: 2rem; height: 1.75rem; flex-shrink: 0; object-fit: contain;
}
.ca-sidebar-logo {
  display: block; width: 100%; max-width: 200px; height: auto;
  max-height: 52px; object-fit: contain; object-position: left center;
}
.ca-sidebar-toolbar {
  display: flex; align-items: center;
  margin: 0.75rem 0.875rem;
  border: 1px solid #d1d5db; border-radius: 10px;
  background: #fff; overflow: hidden;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}
.ca-sidebar-search-btn,
.ca-sidebar-create-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  border: none; background: transparent; cursor: pointer;
  font-size: 14px; font-weight: 500; color: #334155;
  transition: background 0.2s, color 0.2s;
}
.ca-sidebar-search-btn {
  flex: 0 0 2.75rem; height: 2.5rem; color: #25b7a7;
}
.ca-sidebar-search-btn:hover { background: #e8f8f6; }
.ca-sidebar-create-btn {
  flex: 1; height: 2.5rem; padding: 0 0.75rem; justify-content: flex-start;
}
.ca-sidebar-create-btn:hover { background: #f8fafc; color: #25b7a7; }
.ca-sidebar-search-btn:disabled,
.ca-sidebar-create-btn:disabled {
  cursor: default;
  pointer-events: none;
  opacity: 0.85;
}
.ca-sidebar-search-btn:disabled:hover { background: transparent; }
.ca-sidebar-create-btn:disabled:hover { background: transparent; color: #334155; }
.ca-sidebar-toolbar-divider {
  width: 1px; align-self: stretch; background: #e2e8f0; flex-shrink: 0;
}
.ca-sidebar-nav { padding: 0.25rem 0; }
.ca-sidebar-nav .nav-item { border-radius: 0; }
.ca-sidebar-footer {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
  gap: 0.5rem;
  flex-shrink: 0;
  padding: 0.875rem 1rem;
  background: #25b7a7;
  border-top: 1px solid rgb(255 255 255 / 0.12);
}
#sidebar.sidebar-collapsed .ca-sidebar-footer,
html[data-sidebar-collapsed="1"] #sidebar .ca-sidebar-footer {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.5rem;
}
.ca-sidebar-footer-btn {
  display: flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; flex-shrink: 0;
  border: none; border-radius: 10px;
  background: transparent; color: #fff; cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
#sidebar.sidebar-collapsed .ca-sidebar-footer-btn,
html[data-sidebar-collapsed="1"] #sidebar .ca-sidebar-footer-btn {
  width: 2.25rem;
  height: 2.25rem;
}
.ca-sidebar-footer-btn:hover {
  background: rgb(255 255 255 / 0.15);
  transform: translateY(-1px);
}
.ca-sidebar-footer-btn.active {
  background: rgb(255 255 255 / 0.22);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.28);
}

#overlay,
.crm-overlay {
  position: fixed; inset: 0; z-index: 1040;
  background: rgb(15 23 42 / 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity 0.1s ease;
}
#overlay.active,
.crm-overlay.active { opacity: 1; pointer-events: auto; }
body:has(#modal-dcp-detail.open) #overlay.active {
  background: rgb(148 163 184 / 0.28);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* ─── CA Cloud Desk Centered Modals (global) ─── */
/* Shared dialog chrome: top inset, horizontal center, 80vh cap, sticky header/footer, body scroll */
.ca-modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(3rem, env(safe-area-inset-top, 0px)) 1rem max(1.5rem, env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  overscroll-behavior: contain;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.1s ease, visibility 0.1s ease;
}
/* visibility:hidden blocks hit-testing on children even when they set pointer-events:auto
   (e.g. flatpickr date triggers inside closed modals were opening calendars on any click). */
.ca-modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.ca-modal:not(.open),
.ca-modal:not(.open) * {
  pointer-events: none !important;
}

/* Inline backdrop nodes (if present) must not participate in flex centering */
.ca-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
}

.ca-modal-panel {
  width: 100%;
  max-width: 480px;
  max-height: min(80vh, calc(100dvh - 6rem));
  margin: 0;
  background: #fff;
  border-radius: 14px;
  box-shadow:
    0 24px 48px -12px rgb(15 23 42 / 0.22),
    0 0 0 1px rgb(76 180 212 / 0.08);
  display: flex;
  flex-direction: column;
  transform: scale(0.98) translateY(4px);
  transition: transform 0.12s ease-out;
  overflow: hidden;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.ca-modal.open .ca-modal-panel {
  transform: scale(1) translateY(0);
}
.ca-modal-panel-sm { max-width: 420px; }
.ca-modal-panel-md { max-width: 520px; }

.ca-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid #eef2f7;
  background: linear-gradient(to right, rgb(76 180 212 / 0.12), #fff 55%);
}
.ca-modal-title {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-card-title);
  font-weight: var(--crm-font-weight-card-title);
  letter-spacing: var(--crm-letter-spacing);
  line-height: var(--crm-line-height-card-title);
  color: #0f172a; margin: 0;
}
.ca-modal-icon {
  display: flex; align-items: center; justify-content: center;
  width: 1.875rem; height: 1.875rem; border-radius: 9px;
  background: #EDF9FC; color: #4CB4D4;
  flex-shrink: 0;
}
.ca-modal-close {
  display: flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 10px;
  border: none; background: transparent; color: #64748b;
  cursor: pointer; transition: all 0.2s;
  flex-shrink: 0;
}
.ca-modal-close:hover { background: #f1f5f9; color: #0f172a; }

/* Form wrappers that contain body + footer (e.g. Edit Firm) */
.ca-modal-panel > form:not(.ca-modal-body) {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.ca-modal-body,
.ca-modal-panel > form.ca-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0.875rem 1.25rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--crm-scrollbar-thumb) var(--crm-scrollbar-track-surface);
}
.ca-modal-body::-webkit-scrollbar,
.ca-modal-panel > form.ca-modal-body::-webkit-scrollbar {
  width: var(--crm-scrollbar-size);
  height: var(--crm-scrollbar-size);
}
.ca-modal-body::-webkit-scrollbar-track,
.ca-modal-panel > form.ca-modal-body::-webkit-scrollbar-track {
  background: var(--crm-scrollbar-track-surface);
  border-radius: 999px;
}
.ca-modal-body::-webkit-scrollbar-thumb,
.ca-modal-panel > form.ca-modal-body::-webkit-scrollbar-thumb {
  background: var(--crm-scrollbar-thumb);
  border-radius: 999px;
}
.ca-modal-body::-webkit-scrollbar-thumb:hover,
.ca-modal-panel > form.ca-modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--crm-scrollbar-thumb-hover);
}

.filter-time-section {
  padding: 1rem 1.125rem;
  border: 1px solid #ccf0ec;
  border-radius: 12px;
  background: linear-gradient(135deg, #f0fdfa 0%, #fff 55%, #f8fafc 100%);
}
.filter-time-heading {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.875rem;
  font-size: 13px; font-weight: 600; color: #334155;
}
.filter-time-tabs { width: 100%; justify-content: stretch; }
.filter-time-tabs .mgr-period-tab { flex: 1; text-align: center; }
.filter-time-hint {
  margin-top: 0.75rem; font-size: 12px; font-weight: 500; color: #64748b;
}
.filter-date-fields.is-custom .input-field:not(:disabled) {
  border-color: #25b7a7;
  box-shadow: 0 0 0 2px rgb(37 183 167 / 0.12);
}
.filter-date-fields .input-field:disabled {
  background: #f8fafc; color: #94a3b8; cursor: not-allowed;
}
.ca-modal-footer {
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 50;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid #eef2f7;
  background: #fafbfc;
  box-shadow: 0 -6px 16px rgb(15 23 42 / 0.05);
  scroll-padding-inline: 1.25rem;
  text-align: right;
}
.ca-modal-footer-buttons {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0.625rem;
  min-width: max-content;
  align-items: center;
  text-align: left;
  vertical-align: top;
  padding-right: 0.25rem;
  padding-bottom: 0.25rem;
}
.ca-modal-footer-buttons > button,
.ca-modal-footer-buttons > .btn-primary,
.ca-modal-footer-buttons > .btn-secondary {
  flex: 0 0 auto;
  flex-shrink: 0;
  white-space: nowrap;
}
.ca-modal-footer-buttons > .flex-1 {
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .ca-modal:not(.ra-drawer):not(.attendance-modal):not(.detail-drawer) {
    align-items: flex-end;
    padding: max(1.5rem, env(safe-area-inset-top, 0px)) 0.75rem max(0.75rem, env(safe-area-inset-bottom, 0px));
  }
  .ca-modal:not(.ra-drawer):not(.attendance-modal):not(.detail-drawer) .ca-modal-panel {
    max-width: 100%;
    max-height: min(86vh, calc(100dvh - 2.5rem));
    border-radius: 14px 14px 10px 10px;
  }
  .ca-modal:not(.ra-drawer):not(.attendance-modal):not(.detail-drawer) .ca-modal-header,
  .ca-modal:not(.ra-drawer):not(.attendance-modal):not(.detail-drawer) .ca-modal-body,
  .ca-modal:not(.ra-drawer):not(.attendance-modal):not(.detail-drawer) .ca-modal-footer,
  .ca-modal:not(.ra-drawer):not(.attendance-modal):not(.detail-drawer) .ca-modal-panel > form.ca-modal-body {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (max-height: 720px) {
  .ca-modal:not(.ra-drawer):not(.attendance-modal):not(.detail-drawer) {
    padding-top: max(2.5rem, env(safe-area-inset-top, 0px));
  }
  .ca-modal:not(.ra-drawer):not(.attendance-modal):not(.detail-drawer) .ca-modal-panel {
    max-height: min(80vh, calc(100dvh - 4.5rem));
  }
  .ca-modal:not(.ra-drawer):not(.attendance-modal):not(.detail-drawer) .ca-modal-header {
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
  }
}

#add-campaign-footer {
  overflow-x: auto;
  padding-right: 1.5rem;
  padding-bottom: 0.75rem;
  position: relative;
  z-index: 40;
}

#add-campaign-footer .ca-modal-footer-buttons > button {
  position: relative;
  z-index: 41;
  pointer-events: auto;
}

#modal-add-campaign .ca-modal-panel {
  max-width: 720px;
}

#modal-followup .ca-modal-panel {
  max-width: 34rem;
}

#modal-followup .followup-lead-context,
#modal-lead-call-log .followup-lead-context {
  padding: 1rem 1.125rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
#modal-followup .followup-lead-context__title,
#modal-lead-call-log .followup-lead-context__title {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}
#modal-followup .followup-lead-context__grid,
#modal-lead-call-log .followup-lead-context__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  margin: 0;
}
#modal-followup .followup-lead-context__item,
#modal-lead-call-log .followup-lead-context__item {
  min-width: 0;
}
#modal-followup .followup-lead-context__item--full,
#modal-lead-call-log .followup-lead-context__item--full {
  grid-column: 1 / -1;
}
#modal-followup .followup-lead-context__item dt,
#modal-lead-call-log .followup-lead-context__item dt {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #94a3b8;
}
#modal-followup .followup-lead-context__item dd,
#modal-lead-call-log .followup-lead-context__item dd {
  margin: 0.125rem 0 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #0f172a;
  word-break: break-word;
}
@media (max-width: 639px) {
  #modal-followup .followup-lead-context__grid,
#modal-lead-call-log .followup-lead-context__grid {
    grid-template-columns: 1fr;
  }
}

#modal-followup .followup-lead-picker {
  margin-bottom: 0.25rem;
}

#modal-followup .followup-lead-picker .campaign-lead-picker__list-wrap {
  max-height: 14rem;
}

#modal-followup .followup-lead-picker.is-invalid .campaign-lead-picker__search-wrap {
  border-color: #ef4444;
}

#modal-followup #followup-lead-error.ca-field-error {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: #dc2626;
}

#modal-followup .campaign-lead-picker__item:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: -2px;
}

/* Edit Firm / Add Lead — wider panel + compact field spacing (layout comes from global .ca-modal) */
#modal-add-lead .ca-modal-panel {
  width: min(920px, calc(100vw - 2rem));
  max-width: 920px;
}

#modal-add-lead .ca-modal-body > .grid {
  gap: 0.7rem 0.85rem;
}

#modal-add-lead .ca-modal-body .sc-location-pair {
  gap: 0.7rem 0.85rem;
}

#modal-add-lead .ca-modal-body .form-label {
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  line-height: 1.25;
}

#modal-add-lead .ca-modal-body .input-field {
  min-height: 2.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  font-size: 0.875rem;
}

#modal-add-lead .ca-modal-body #form-lead-google-section {
  padding: 0.75rem 0.875rem;
  margin-top: 0.15rem;
}

#modal-add-lead .ca-modal-body #form-lead-google-section .text-card-heading {
  margin-bottom: 0.5rem;
}

#modal-add-lead .ca-modal-body #form-lead-duplicate-warning {
  margin-top: 0.4rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
}

@media (max-width: 900px) {
  #modal-add-lead .ca-modal-panel {
    width: min(850px, calc(100vw - 1.5rem));
    max-width: 850px;
  }
}

@media (max-height: 720px) {
  #modal-add-lead .ca-modal-body > .grid {
    gap: 0.55rem 0.75rem;
  }
}

/* Campaign lead picker */
.campaign-lead-picker {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.875rem;
  background: #fff;
}

.campaign-lead-picker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.campaign-lead-picker__title {
  margin: 0;
}

.campaign-lead-picker__selected-count {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #2E7F96;
  white-space: nowrap;
}

.campaign-lead-picker__stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 12px;
  color: #64748b;
}

.campaign-lead-picker__stats strong {
  color: #0f172a;
  font-weight: 600;
}

.campaign-lead-picker__stat-sep {
  color: #cbd5e1;
}

.campaign-lead-picker__search-wrap {
  position: relative;
}

.campaign-lead-picker__search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.campaign-lead-picker__search {
  padding-left: 2.25rem;
  padding-right: 2.25rem;
}

.campaign-lead-picker__search.has-value {
  padding-right: 2.5rem;
}

.campaign-lead-picker__search-clear {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: #94a3b8;
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
}

.campaign-lead-picker__search-clear:hover {
  background: #f1f5f9;
  color: #64748b;
}

.campaign-lead-picker__search-clear.hidden {
  display: none;
}

.campaign-lead-picker__bulk {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 2rem;
}

.campaign-lead-picker__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 0;
  max-height: 88px;
  overflow-y: auto;
}

.campaign-lead-picker__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  padding: 0.25rem 0.5rem 0.25rem 0.65rem;
  border-radius: 9999px;
  background: #EDF9FC;
  border: 1px solid rgb(76 180 212 / 0.25);
  font-size: 12px;
  font-weight: 500;
  color: #0f4c5c;
  line-height: 1.3;
}

.campaign-lead-picker__chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.campaign-lead-picker__chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  border: none;
  border-radius: 9999px;
  background: rgb(76 180 212 / 0.15);
  color: #2E7F96;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}

.campaign-lead-picker__chip-remove:hover {
  background: rgb(76 180 212 / 0.3);
}

.campaign-lead-picker__bulk .btn-secondary.btn-sm {
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.campaign-lead-picker__bulk .btn-secondary.btn-sm:hover {
  border-color: #4CB4D4;
  color: #0f4c5c;
}

.campaign-lead-picker__bulk .btn-secondary.btn-sm:active {
  transform: translateY(1px);
}

.campaign-lead-picker__list-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  overflow: hidden;
}

.campaign-lead-picker__list {
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.campaign-lead-picker__item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
  width: 100%;
}

.campaign-lead-picker__item:last-child {
  border-bottom: none;
}

.campaign-lead-picker__item:hover {
  background: #EDF9FC;
}

.campaign-lead-picker__item.is-selected {
  background: rgb(237 249 252 / 0.85);
  border-left: 3px solid #4CB4D4;
  padding-left: calc(0.875rem - 3px);
}

.campaign-lead-picker__checkbox {
  margin-top: 0.2rem;
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  accent-color: #4CB4D4;
  cursor: pointer;
}

.campaign-lead-picker__item-body {
  flex: 1;
  min-width: 0;
}

.campaign-lead-picker__firm {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 0.25rem;
  line-height: 1.3;
  word-break: break-word;
}

.campaign-lead-picker__meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

.campaign-lead-picker__meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
}

.campaign-lead-picker__assignment {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  margin-top: 0.35rem;
  width: fit-content;
}

.campaign-lead-picker__assignment.is-assigned {
  background: #ecfdf5;
  color: #047857;
}

.campaign-lead-picker__assignment.is-unassigned {
  background: #fef3c7;
  color: #b45309;
}

.campaign-lead-picker__empty,
.campaign-lead-picker__loading {
  padding: 2rem 1rem;
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
}

.campaign-lead-picker__list-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

@media (max-width: 640px) {
  #modal-add-campaign .ca-modal-panel,
  #modal-followup .ca-modal-panel {
    max-width: 100%;
  }

  .campaign-lead-picker__bulk {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .campaign-lead-picker__bulk .campaign-lead-picker__clear-all {
    grid-column: 1 / -1;
  }

  .campaign-lead-picker__chip-label {
    max-width: 120px;
  }
}

.crm-entity-lookup {
  position: relative;
  width: 100%;
}

.crm-entity-lookup-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  margin: 0;
  padding: 0;
  border: 0;
}

.crm-entity-lookup__control {
  position: relative;
}

.crm-entity-lookup__search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.crm-entity-lookup__search-icon {
  position: absolute;
  left: 0.75rem;
  color: #94a3b8;
  pointer-events: none;
  z-index: 1;
}

.crm-entity-lookup__input {
  width: 100%;
  padding-left: 2.25rem !important;
  padding-right: 2.25rem !important;
}

.crm-entity-lookup__clear {
  position: absolute;
  right: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
}

.crm-entity-lookup__clear:hover {
  background: #f1f5f9;
  color: #475569;
}

.crm-entity-lookup__panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 120;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 12px 30px rgb(15 23 42 / 0.12);
  overflow: hidden;
}

.crm-entity-lookup.is-open .crm-entity-lookup__input {
  border-color: rgb(76 180 212 / 0.55);
  box-shadow: 0 0 0 3px rgb(76 180 212 / 0.12);
}

.crm-entity-lookup__list {
  max-height: 16rem;
  overflow: auto;
}

.crm-entity-lookup--compact .crm-entity-lookup__list {
  max-height: 12rem;
}

.crm-entity-lookup__option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  cursor: pointer;
}

.crm-entity-lookup__option:last-child {
  border-bottom: 0;
}

.crm-entity-lookup__option:hover,
.crm-entity-lookup__option.is-active {
  background: #edf9fc;
}

.crm-entity-lookup__option-title {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
}

.crm-entity-lookup__option-meta {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.35;
}

.crm-entity-lookup__empty {
  padding: 0.85rem;
  font-size: 0.8125rem;
  color: #64748b;
}

.crm-entity-lookup__footer {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
}


.ca-modal-item {
  padding: 1rem; border-radius: 12px;
  background: #f8fafc; border: 1px solid #f1f5f9;
  border-left-width: 4px; border-left-style: solid;
  transition: background 0.2s;
}
.ca-modal-item:hover { background: #EDF9FC; }

.ca-modal-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; padding: 1rem;
}
.ca-action-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 1.25rem 0.75rem; border-radius: 12px;
  border: 1px solid #f1f5f9; background: #fff;
  font-size: 13px; font-weight: 500; color: #334155;
  cursor: pointer; transition: all 0.2s;
}
.ca-action-btn:hover {
  border-color: rgb(76 180 212 / 0.3);
  background: #EDF9FC; color: #2E7F96;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgb(76 180 212 / 0.15);
}

.ca-kbd {
  display: inline-flex; align-items: center;
  border-radius: 8px; border: 1px solid #e2e8f0;
  background: #f8fafc; padding: 2px 8px;
  font-size: 12px; font-family: inherit; color: #475569;
}

@media (max-height: 720px) {
  .ca-sidebar-nav .nav-item {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
  .ca-sidebar-brand {
    padding-top: 0.75rem;
    padding-bottom: 0.5rem;
  }
}

.sms-settings-panel {
  max-height: min(85vh, 720px);
}
.sms-settings-panel-body {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.sms-settings-actions {
  display: block;
  position: sticky;
  bottom: 0;
  z-index: 25;
  box-shadow: 0 -8px 24px rgb(15 23 42 / 0.06);
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  flex-shrink: 0;
  padding: 1rem 1.5rem 0.75rem;
  border-top: 1px solid #f1f5f9;
  background: #fff;
  scroll-padding-inline: 1rem;
  text-align: right;
}
.sms-settings-actions .ca-modal-footer-buttons {
  text-align: left;
}
@media (max-width: 768px) {
  .sms-settings-panel {
    max-height: calc(100vh - 7rem);
    margin-bottom: 4.5rem;
  }
  .sms-settings-actions {
    position: sticky;
    bottom: 0;
  }
  body.sms-settings-open #crm-floating-actions {
    display: none !important;
  }
}

/* ─── Multi-page Router ─── */
.page-enter { animation: pageEnter 0.1s ease-out both; }
.page-exit { animation: pageExit 0.08s ease-in both; }
@keyframes pageEnter { from { opacity: 0.85; } to { opacity: 1; } }
@keyframes pageExit { from { opacity: 1; } to { opacity: 0.85; } }

.page-hero {
  overflow: visible;
}

/* Unified page heading container — no per-page padding or background differences */
.page-hero--standard {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}
.page-hero-actions,
.followup-header-actions {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.page-hero-actions .crm-toolbar-icon-btn.is-active,
.page-hero-actions .crm-toolbar-icon-btn[aria-expanded="true"],
.page-hero-actions .page-hero-tab-btn.active,
.followup-header-actions .crm-toolbar-icon-btn.is-active,
.followup-header-actions .crm-toolbar-icon-btn[aria-expanded="true"] {
  background: #e8f8f6;
  border-color: #25B7A7;
  color: #0f766e;
  box-shadow: 0 0 0 2px rgb(37 183 167 / 0.18);
}
.page-hero-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.page-hero-actions .page-hero-toolbar {
  margin-left: auto;
}
.page-hero-toolbar__sep {
  width: 1px;
  height: 1.625rem;
  background: #e2e8f0;
  margin: 0 0.1rem;
  flex-shrink: 0;
}
.page-hero-icon-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem;
  background: #f1f5f9;
  border-radius: 10px;
}
.page-hero-icon-tabs .page-hero-tab-btn {
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  min-height: 2rem;
  padding: 0;
  gap: 0;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  position: relative;
}
.page-hero-icon-tabs .page-hero-tab-btn:hover {
  background: rgb(255 255 255 / 0.8);
  border-color: #e2e8f0;
  transform: none;
  box-shadow: none;
}
.page-hero-icon-tabs .page-hero-tab-btn.active,
.page-hero-icon-tabs .page-hero-tab-btn.is-active {
  background: #fff;
  border-color: #e2e8f0;
  color: #2E7F96;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.08);
}
.page-hero-icon-tabs .page-hero-tab-btn .h-4,
.page-hero-icon-tabs .page-hero-tab-btn [data-lucide],
.page-hero-icon-tabs .page-hero-tab-btn svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
  flex-shrink: 0;
}
.page-hero-icon-tabs .page-hero-tab-btn .ca-tab-count {
  position: absolute;
  top: -0.2rem;
  right: -0.2rem;
  min-width: 1rem;
  padding: 0 0.2rem;
  font-size: 0.625rem;
  line-height: 1rem;
}
.followup-cal-popover {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 50;
  width: min(22rem, calc(100vw - 2rem));
  padding: 1rem 1.1rem 1.1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  box-shadow: 0 16px 40px rgb(15 23 42 / 0.14);
}
.followup-cal-popover__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.followup-cal-popover__title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}
.followup-cal-popover__close {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.45rem;
}

/* Shared report page chrome inside #page-container (CRM shell stays visible) */
.crm-report-page {
  display: flex;
  flex-direction: column;
  gap: 0;
}

#page-container > .crm-report-page#ra-root,
#page-container > .crm-report-page {
  width: 100%;
  min-width: 0;
}

.crm-report-page .crm-report-filter-toolbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 1rem;
  border-radius: 0 0 0.75rem 0.75rem;
}

.crm-report-page .crm-report-page__body {
  padding-top: 0;
}

.crm-report-page__body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.crm-report-shell.ra-lc-header {
  margin-bottom: 0;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.65rem 0.85rem;
  background: #fff;
  border-radius: 0.75rem 0.75rem 0 0;
}

.crm-report-page .crm-report-filter-toolbar.card {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: none;
}

.crm-report-page > .crm-report-filter-toolbar.card:only-of-type,
.crm-report-page > .crm-report-shell + .crm-report-filter-toolbar.card {
  border-radius: 0 0 0.75rem 0.75rem;
}

.crm-report-page > .crm-report-shell:only-child {
  border-radius: 0.75rem;
}

.crm-report-filter-toolbar {
  padding: 0.55rem 0.75rem;
}

.crm-report-filter-toolbar.ra-lc-toolbar {
  padding: 0.45rem 0.85rem;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.crm-report-filter-toolbar__row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 0.45rem;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.crm-report-filter {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}
.crm-report-filter--date {
  width: 9.25rem;
  min-width: 8.5rem;
}
.crm-report-filter--grow {
  flex: 1 1 140px;
  min-width: 120px;
}
.crm-report-filter__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #64748b;
  line-height: 1;
  white-space: nowrap;
}
.crm-report-filter__control-wrap {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}
.crm-report-filter__leading-icon {
  flex-shrink: 0;
  color: #64748b;
}
.crm-report-filter__control,
.crm-report-filter .crm-datetime-field {
  width: 100%;
  min-width: 0;
}
.crm-report-filter .input-field-sm,
.crm-report-filter .crm-datetime-field__trigger {
  min-height: 34px;
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
  font-size: 13px;
  border-radius: 999px;
  background: #fff;
}
.crm-report-filter select.input-field-sm,
.crm-report-filter input.input-field-sm {
  width: 100%;
  min-width: 7.5rem;
}
.crm-report-filter .crm-datetime-field {
  min-width: 8.5rem;
}
.crm-report-filter__apply {
  min-height: 34px;
  border-radius: 999px;
  padding-left: 1rem;
  padding-right: 1rem;
  flex-shrink: 0;
  align-self: flex-end;
}
.crm-report-filter__reset {
  width: 2.125rem;
  height: 2.125rem;
  border-radius: 0.55rem;
  flex-shrink: 0;
  align-self: flex-end;
}
.crm-report-filter__error {
  margin: 0.35rem 0 0;
  font-size: 12px;
  font-weight: 600;
  color: #dc2626;
}
@media (max-width: 1024px) {
  .crm-report-filter-toolbar__row {
    flex-wrap: wrap;
  }
}
@media (max-width: 640px) {
  .crm-report-filter--date,
  .crm-report-filter--select {
    flex: 1 1 calc(50% - 0.45rem);
    width: auto;
  }
  .crm-report-filter--grow {
    flex: 1 1 100%;
  }
  .crm-report-filter__apply,
  .crm-report-filter__reset {
    align-self: center;
  }
}

/* Legacy alias — Duplicate Attempts uses shared toolbar */
.dup-attempts-filter-bar {
  padding: 0.55rem 0.75rem;
}
.dup-attempts-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.dup-attempts-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #64748b;
  min-width: 0;
}
.dup-attempts-filter--grow {
  flex: 1 1 140px;
  min-width: 140px;
}
.dup-attempts-filter .input-field-sm {
  min-height: 34px;
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
  font-size: 13px;
  border-radius: 999px;
  background: #fff;
}
.dup-attempts-filter select.input-field-sm,
.dup-attempts-filter input.input-field-sm {
  width: 100%;
  min-width: 7.5rem;
}
.dup-attempts-filter .crm-datetime-field {
  min-width: 8.5rem;
}
.dup-attempts-filter .crm-datetime-field__trigger {
  min-height: 34px;
  border-radius: 999px;
  font-size: 13px;
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
}
.dup-attempts-apply {
  min-height: 34px;
  border-radius: 999px;
  padding-left: 1rem;
  padding-right: 1rem;
  flex-shrink: 0;
}
.dup-attempts-filters .crm-toolbar-icon-btn {
  width: 2.125rem;
  height: 2.125rem;
  border-radius: 0.55rem;
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .dup-attempts-filter {
    flex: 1 1 calc(50% - 0.45rem);
  }
  .dup-attempts-filter--grow {
    flex: 1 1 100%;
  }
}

.followups-table-card {
  width: 100%;
}
.followups-table-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--crm-space-4);
  margin-bottom: var(--crm-space-4);
}
.followups-table-card #followups-table-wrap,
.followups-table-card .crm-table-card--nested {
  width: 100%;
}

/* Follow-ups hub — align table density with Master Data tokens */
.followups-table-card #followups-main-table-wrap {
  --fu-table-head-row-h: var(--crm-table-head-row-h);
  --fu-table-filter-row-h: 34px;
  --fu-table-row-h: var(--crm-table-row-h);
  --fu-table-cell-py: var(--crm-table-cell-py);
  --fu-table-filter-cell-py: 4px;
  --fu-table-cell-px: var(--crm-table-cell-px);
  --fu-table-header-font-size: var(--crm-font-size-table-header);
  --fu-table-data-font-size: var(--crm-font-size-table-cell);
  --fu-table-secondary-font-size: var(--crm-font-size-helper);
  --fu-table-badge-font-size: var(--crm-font-size-badge);
}

.followups-table-card #followups-main-table-wrap .crm-table {
  --crm-table-head-row-h: var(--fu-table-head-row-h);
  --crm-table-row-h: var(--fu-table-row-h);
  --crm-table-cell-py: var(--fu-table-cell-py);
  --crm-table-cell-px: var(--fu-table-cell-px);
  --crm-col-actions-width: 52px;
  --crm-sticky-check-width: 40px;
}

.followups-table-card #followups-main-table-wrap .crm-table thead th,
.followups-table-card #followups-main-table-wrap .crm-table tbody td {
  height: var(--fu-table-row-h);
  min-height: var(--fu-table-row-h);
  max-height: var(--fu-table-row-h);
  padding: var(--fu-table-cell-py) var(--fu-table-cell-px);
  box-sizing: border-box;
  vertical-align: middle;
}

.followups-table-card #followups-main-table-wrap .crm-table tbody tr {
  height: var(--fu-table-row-h);
}

.followups-table-card #followups-main-table-wrap .crm-table thead tr:first-child th {
  height: var(--fu-table-head-row-h);
  min-height: var(--fu-table-head-row-h);
  max-height: var(--fu-table-head-row-h);
  padding: var(--fu-table-cell-py) var(--fu-table-cell-px);
  font-size: var(--fu-table-header-font-size);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: normal;
}

.followups-table-card #followups-main-table-wrap .crm-table thead tr.crm-col-filter-row th,
.followups-table-card #followups-main-table-wrap .crm-col-filter-th {
  top: var(--fu-table-head-row-h);
  height: var(--fu-table-filter-row-h);
  min-height: var(--fu-table-filter-row-h);
  max-height: var(--fu-table-filter-row-h);
  padding: var(--fu-table-filter-cell-py) var(--fu-table-cell-px) !important;
  vertical-align: middle;
}

.followups-table-card #followups-main-table-wrap .crm-table tbody td {
  font-size: var(--fu-table-data-font-size);
  line-height: 1.25;
}

.followups-table-card #followups-main-table-wrap .cam-cell-text,
.followups-table-card #followups-main-table-wrap .crm-td-firm .cam-cell-text,
.followups-table-card #followups-main-table-wrap .crm-td-person .cam-cell-text,
.followups-table-card #followups-main-table-wrap .crm-td-remarks .cam-cell-text {
  font-size: var(--fu-table-data-font-size);
  line-height: 1.25;
}

.followups-table-card #followups-main-table-wrap .crm-td-date .cam-cell-text,
.followups-table-card #followups-main-table-wrap .cam-cell-text.cam-cell-mono {
  font-size: var(--fu-table-secondary-font-size);
}

.followups-table-card #followups-main-table-wrap .crm-td-mobile .cam-cell-text,
.followups-table-card #followups-main-table-wrap .crm-td-mobile a.cam-cell-text {
  white-space: nowrap;
  font-size: var(--fu-table-data-font-size);
  line-height: 1.25;
  vertical-align: middle;
}

.followups-table-card #followups-main-table-wrap .crm-td-status {
  gap: 0.2rem;
}

.followups-table-card #followups-main-table-wrap .crm-td-status .cam-cell-text {
  display: inline-block;
  max-width: calc(100% - 0.25rem);
  vertical-align: middle;
}

.followups-table-card #followups-main-table-wrap .badge,
.followups-table-card #followups-main-table-wrap .cam-cell-badge .badge,
.followups-table-card #followups-main-table-wrap .crm-td-status .badge {
  font-size: var(--fu-table-badge-font-size);
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 5px;
  line-height: 1.2;
  letter-spacing: normal;
  vertical-align: middle;
}

.followups-table-card #followups-main-table-wrap .crm-th-check,
.followups-table-card #followups-main-table-wrap .crm-td-check,
.followups-table-card #followups-main-table-wrap .crm-th-actions,
.followups-table-card #followups-main-table-wrap .crm-table tbody td.crm-actions-cell,
.followups-table-card #followups-main-table-wrap .crm-table tbody td.sticky-right.crm-actions-cell,
.followups-table-card #followups-main-table-wrap .crm-actions-cell--inline {
  padding: 0 !important;
  vertical-align: middle !important;
  text-align: center;
  line-height: var(--fu-table-row-h);
  height: var(--fu-table-row-h);
  min-height: var(--fu-table-row-h);
  max-height: var(--fu-table-row-h);
}

.followups-table-card #followups-main-table-wrap .crm-th-check.crm-col-filter-th,
.followups-table-card #followups-main-table-wrap .crm-th-actions.crm-col-filter-th {
  line-height: normal;
  vertical-align: middle !important;
}

.followups-table-card #followups-main-table-wrap .crm-td-check input[type="checkbox"],
.followups-table-card #followups-main-table-wrap .crm-th-check input[type="checkbox"] {
  width: 0.9rem;
  height: 0.9rem;
  margin: 0;
  vertical-align: middle;
}

.followups-table-card #followups-main-table-wrap .crm-actions-trigger,
.followups-table-card #followups-main-table-wrap .cam-actions-trigger {
  width: 1.5rem;
  height: 1.5rem;
  min-width: 1.5rem;
  min-height: 1.5rem;
  border-radius: 5px;
}

.followups-table-card #followups-main-table-wrap .crm-actions-trigger .h-4,
.followups-table-card #followups-main-table-wrap .cam-actions-trigger .h-4,
.followups-table-card #followups-main-table-wrap .crm-actions-trigger .h-3\.5,
.followups-table-card #followups-main-table-wrap .cam-actions-trigger .h-3\.5 {
  width: 0.875rem;
  height: 0.875rem;
}

.followups-table-card #followups-main-table-wrap .crm-col-filter-input {
  display: block;
  width: 100%;
  height: 1.625rem;
  min-height: 1.625rem;
  max-height: 1.625rem;
  padding: 0.15rem 0.45rem;
  font-size: var(--fu-table-header-font-size);
  line-height: 1.2;
  border-radius: 5px;
  box-sizing: border-box;
}

.followups-table-card #followups-main-table-wrap .crm-col-filter-select {
  height: 1.625rem;
  min-height: 1.625rem;
  max-height: 1.625rem;
  padding-top: 0.1rem;
  padding-bottom: 0.1rem;
  font-size: var(--fu-table-header-font-size);
}

.followups-table-card #followups-main-table-wrap .crm-inbox-bulk-bar {
  padding: 0.45rem 0.75rem;
  font-size: var(--fu-table-data-font-size);
}

.followups-table-card #followups-main-table-wrap .crm-table-footer {
  padding: 0;
}

.followups-table-card #followups-main-table-wrap .crm-table-pagination {
  gap: 0.55rem;
  padding: 0.5rem 0.75rem;
  min-height: 2.5rem;
  font-size: var(--fu-table-data-font-size);
}

.followups-table-card #followups-main-table-wrap .crm-table-pagination__rows-label,
.followups-table-card #followups-main-table-wrap .crm-table-pagination__of,
.followups-table-card #followups-main-table-wrap .crm-table-pagination__count,
.followups-table-card #followups-main-table-wrap .crm-table-pagination__page {
  font-size: var(--fu-table-data-font-size);
}

.followups-table-card #followups-main-table-wrap .crm-table-pagination__per-page,
.followups-table-card #followups-main-table-wrap .crm-table-pagination__nav,
.followups-table-card #followups-main-table-wrap .crm-table-pagination__page,
.followups-table-card #followups-main-table-wrap .crm-table-pagination__count {
  height: 1.65rem;
  min-height: 1.65rem;
}

.followups-table-card #followups-main-table-wrap .crm-table-pagination__nav {
  width: 1.65rem;
  min-width: 1.65rem;
  border-radius: 6px;
}

.followups-table-card #followups-main-table-wrap .crm-table-pagination__page {
  width: 2.35rem;
  min-width: 2.35rem;
  border-radius: 6px;
}

.followups-table-card #followups-main-table-wrap .crm-table-pagination__per-page {
  min-width: 3.1rem;
  padding: 0 1.25rem 0 0.45rem;
  font-size: var(--fu-table-data-font-size);
  border-radius: 6px;
}

.followups-table-card #followups-main-table-wrap .crm-table-pagination__count {
  min-width: 3.35rem;
  padding: 0 0.45rem;
  border-radius: 6px;
}

.followups-table-card #followups-main-table-wrap .crm-table thead th.sticky-left,
.followups-table-card #followups-main-table-wrap .crm-table tbody td.sticky-left {
  width: var(--crm-sticky-check-width) !important;
  min-width: var(--crm-sticky-check-width) !important;
  max-width: var(--crm-sticky-check-width) !important;
}

.followups-table-card #followups-main-table-wrap .crm-table tbody td.sticky-left-2,
.followups-table-card #followups-main-table-wrap .crm-table thead th.sticky-left-2 {
  overflow: hidden;
}

.followups-table-card #followups-main-table-wrap .crm-table tbody td.sticky-left-2 .cam-cell-text {
  max-width: 100%;
}

@media (max-width: 1024px) {
  .followups-table-card #followups-main-table-wrap {
    --fu-table-cell-px: 8px;
  }
}

/* Tabs */
.ca-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.25rem; background: #f1f5f9; border-radius: 12px; }
.ca-tab {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem; border-radius: 10px; border: none; background: transparent;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-body);
  font-weight: var(--crm-font-weight-button);
  letter-spacing: var(--crm-letter-spacing);
  color: #64748b; cursor: pointer; transition: all 0.2s;
}
.ca-tab:hover { color: #334155; background: rgb(255 255 255 / 0.6); }
.ca-tab.active { background: #fff; color: #2E7F96; box-shadow: 0 1px 3px rgb(0 0 0 / 0.08); }
.ca-tab-count {
  font-family: var(--crm-font-family);
  background: #EDF9FC;
  color: #2E7F96;
  font-size: var(--crm-font-size-badge);
  font-weight: var(--crm-font-weight-badge);
  letter-spacing: var(--crm-letter-spacing);
  padding: 1px 6px;
  border-radius: 6px;
}

/* Chips / Filters */
.ca-chip {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.375rem 0.875rem; border-radius: 9999px;
  border: 1px solid #e2e8f0; background: #fff;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-helper); font-weight: var(--crm-font-weight-subheading);
  color: #475569; cursor: pointer; transition: all 0.2s;
}
.ca-chip:hover, .ca-chip.active { border-color: #4CB4D4; background: #EDF9FC; color: #2E7F96; }
.ca-chip-action.active { background: #4CB4D4; color: #fff; border-color: #4CB4D4; }

/* Data Table — compact density (all CRM modules) */
.ca-table {
  border-collapse: collapse;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-table-cell);
}
.ca-table th {
  padding: var(--crm-table-cell-py) var(--crm-table-cell-px);
  text-align: left;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-table-header);
  font-weight: var(--crm-font-weight-table-header);
  letter-spacing: var(--crm-letter-spacing);
  line-height: var(--crm-line-height-tight);
  text-transform: none;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}
.ca-table td {
  padding: var(--crm-table-cell-py) var(--crm-table-cell-px);
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-table-cell);
  font-weight: var(--crm-font-weight-table-data);
  letter-spacing: var(--crm-letter-spacing);
  line-height: var(--crm-line-height-tight);
  vertical-align: middle;
}
.ca-table-row { cursor: pointer; transition: background 0.15s; }
.ca-table-row:hover { background: #f8fafc; }
.ca-table-row.selected { background: #EDF9FC; box-shadow: inset 3px 0 0 #4CB4D4; }

/* Chart bars */
.ca-chart-bar { background: linear-gradient(to top, #4CB4D4cc, #4CB4D44d); transition: height 0.5s ease; }
.ca-chart-bar:hover { background: linear-gradient(to top, #4CB4D4, #4CB4D480); }

.badge-danger { background: #fef2f2; color: #b91c1c; }
.inline { display: inline; }

/* Global Search */
.search-dropdown {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  z-index: 60; max-height: 360px; overflow-y: auto;
  background: #fff; border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 12px 32px -8px rgb(0 0 0 / 0.15);
  padding: 0.5rem;
}
.search-dropdown.hidden { display: none; }
.search-group-label {
  padding: 0.375rem 0.75rem;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-badge);
  font-weight: var(--crm-font-weight-label);
  text-transform: none;
  letter-spacing: var(--crm-letter-spacing);
  color: #94a3b8;
}
.search-result {
  display: flex; align-items: center; gap: 0.75rem;
  width: 100%; padding: 0.625rem 0.75rem; border: none; background: transparent;
  border-radius: 10px; text-align: left; cursor: pointer; transition: background 0.15s;
}
.search-result:hover, .search-result.active { background: #e8f8f6; }
.search-result-icon {
  display: flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 8px; background: #f1f5f9; color: #4CB4D4; flex-shrink: 0;
}
.search-result-body { flex: 1; min-width: 0; }
.search-result-title {
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-body);
  font-weight: var(--crm-font-weight-label);
  letter-spacing: var(--crm-letter-spacing);
  color: #1e293b;
}
.search-result-meta {
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-badge);
  font-weight: var(--crm-font-weight-badge);
  letter-spacing: var(--crm-letter-spacing);
  color: #64748b;
  margin-top: 2px;
}
.search-empty { padding: 1.5rem; text-align: center; font-size: var(--crm-font-size-body); color: #94a3b8; }
#global-search:focus { border-color: #4CB4D4; box-shadow: 0 0 0 3px rgb(76 180 212 / 0.2); }

[data-lucide] { display: inline-block; vertical-align: middle; stroke: currentColor; }
.h-3, [data-lucide].h-3, .h-3 svg { width: 12px; height: 12px; }
.h-4, .w-4, [data-lucide].h-4, .h-4 svg, .w-4 svg { width: 16px; height: 16px; }
.h-5, [data-lucide].h-5, .h-5 svg { width: 20px; height: 20px; }
.h-6, [data-lucide].h-6, .h-6 svg { width: 24px; height: 24px; }
.h-8, [data-lucide].h-8, .h-8 svg { width: 32px; height: 32px; }

@media (max-width: 1023px) {
  :root {
    --crm-floating-actions-right: 1rem;
    --crm-floating-actions-bottom: 1rem;
  }

  #sidebar,
  .crm-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1100;
    height: 100%;
    height: 100dvh;
    transform: translateX(-100%);
    width: var(--crm-sidebar-width) !important;
  }
  #sidebar.sidebar-mobile-open,
  .crm-sidebar.sidebar-mobile-open { transform: translateX(0); }
  #main-content,
  #main-content.main-expanded,
  .crm-content,
  .crm-content.main-expanded,
  html[data-sidebar-collapsed="1"] #main-content,
  html[data-sidebar-collapsed="1"] .crm-content {
    margin-left: 0;
    width: 100%;
    max-width: 100vw;
  }
  html[data-sidebar-collapsed="1"] #sidebar {
    width: var(--crm-sidebar-width) !important;
  }
  html[data-sidebar-collapsed="1"] #sidebar .sidebar-label {
    display: inline;
  }
  html[data-sidebar-collapsed="1"] #sidebar .ca-sidebar-logo-link {
    display: flex;
  }
  html[data-sidebar-collapsed="1"] #sidebar .ca-sidebar-footer {
    flex-direction: row;
    justify-content: space-around;
    padding: 0.875rem 1rem;
  }
}

/* Tailwind-like utility fallbacks for file:// mode */
.min-h-screen { min-height: 100vh; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.flex-wrap { flex-wrap: wrap; }
.ml-1 { margin-left: 0.25rem; }
.items-center { align-items: center; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.grid { display: grid; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-8 > * + * { margin-top: 2rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.mb-0\.5 { margin-bottom: 0.125rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.w-full { width: 100%; }
.w-px { width: 1px; }
.h-2 { height: 0.5rem; }
.h-2\.5 { height: 0.625rem; }
.h-3 { height: 0.75rem; }
.h-8 { height: 2rem; }
.h-9 { height: 2.25rem; }
.h-10 { height: 2.5rem; }
.h-14 { height: 3.5rem; }
.h-16 { height: 4rem; }
.h-40 { height: 10rem; }
.h-48 { height: 12rem; }
.h-screen { height: 100vh; }
.w-2\.5 { width: 0.625rem; }
.w-8 { width: 2rem; }
.w-9 { width: 2.25rem; }
.w-10 { width: 2.5rem; }
.w-14 { width: 3.5rem; }
.w-28 { width: 7rem; }
.max-w-md { max-width: 28rem; }
.max-w-sm { max-width: 24rem; }
.max-w-xl { max-width: 36rem; }
.min-w-0 { min-width: 0; }
.min-w-max { min-width: max-content; }
.shrink-0 { flex-shrink: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whitespace-nowrap { white-space: nowrap; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-xl {
  font-size: var(--crm-font-size-section);
  line-height: var(--crm-line-height-section);
  font-weight: var(--crm-font-weight-section);
}
.text-2xl {
  font-size: var(--crm-font-size-stat-number);
  line-height: var(--crm-line-height-page-title);
  font-weight: var(--crm-font-weight-stat-number);
}
.text-3xl {
  font-size: var(--crm-font-size-page-title);
  line-height: var(--crm-line-height-page-title);
  font-weight: var(--crm-font-weight-page-title);
}
.text-lg {
  font-size: var(--crm-font-size-card-title);
  line-height: var(--crm-line-height-card-title);
  font-weight: var(--crm-font-weight-card-title);
}
.text-subheading {
  font-size: var(--crm-font-size-subheading);
  line-height: var(--crm-line-height-subheading);
  font-weight: var(--crm-font-weight-subheading);
}
.text-sm {
  font-size: var(--crm-font-size-body);
  line-height: var(--crm-line-height-body);
  font-weight: var(--crm-font-weight-table-data);
}
.text-\[10px\] { font-size: var(--crm-font-size-badge); }
.font-bold { font-weight: var(--crm-font-weight-section); }
.font-semibold { font-weight: var(--crm-font-weight-section); }
.font-medium { font-weight: var(--crm-font-weight-label); }
.text-white { color: #fff; }
.text-slate-300 { color: #cbd5e1; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.text-slate-600 { color: #475569; }
.text-slate-700 { color: #334155; }
.text-slate-800 { color: #1e293b; }
.text-slate-900 { color: #0f172a; }
.text-emerald-600 { color: #059669; }
.text-emerald-700 { color: #047857; }
.text-red-500 { color: #ef4444; }
.text-red-600 { color: #dc2626; }
.text-amber-500 { color: #f59e0b; }
.text-amber-600 { color: #d97706; }
.text-amber-700 { color: #b45309; }
.text-green-600 { color: #16a34a; }
.text-sky-600 { color: #0284c7; }
.text-indigo-600 { color: #4f46e5; }
.text-violet-600 { color: #7c3aed; }
.text-pink-600 { color: #db2777; }
.bg-white { background-color: #fff; }
.bg-slate-50 { background-color: #f8fafc; }
.bg-slate-100 { background-color: #f1f5f9; }
.bg-slate-200 { background-color: #e2e8f0; }
.bg-emerald-50 { background-color: #ecfdf5; }
.bg-emerald-500 { background-color: #10b981; }
.bg-emerald-600 { background-color: #059669; }
.bg-red-50 { background-color: #fef2f2; }
.bg-red-400 { background-color: #f87171; }
.bg-amber-50 { background-color: #fffbeb; }
.bg-amber-400 { background-color: #fbbf24; }
.bg-blue-400 { background-color: #60a5fa; }
.bg-blue-500 { background-color: #3b82f6; }
.bg-indigo-400 { background-color: #818cf8; }
.bg-indigo-500 { background-color: #6366f1; }
.bg-indigo-50 { background-color: #eef2ff; }
.bg-violet-500 { background-color: #8b5cf6; }
.bg-violet-50 { background-color: #f5f3ff; }
.bg-green-50 { background-color: #f0fdf4; }
.bg-green-500 { background-color: #22c55e; }
.bg-sky-50 { background-color: #f0f9ff; }
.bg-sky-500 { background-color: #0ea5e9; }
.bg-pink-50 { background-color: #fdf2f8; }
.bg-slate-400 { background-color: #94a3b8; }
.bg-slate-500 { background-color: #64748b; }
.border { border-width: 1px; border-style: solid; }
.border-b { border-bottom-width: 1px; border-style: solid; }
.border-t { border-top-width: 1px; border-style: solid; }
.border-y { border-top-width: 1px; border-bottom-width: 1px; border-style: solid; }
.border-slate-50 { border-color: #f8fafc; }
.border-slate-100 { border-color: #f1f5f9; }
.border-slate-200 { border-color: #e2e8f0; }
.border-red-100 { border-color: #fee2e2; }
.border-amber-100 { border-color: #fef3c7; }
.border-l-4 { border-left-width: 4px; }
.border-l-brand { border-left-color: #4CB4D4; }
.border-l-emerald-500 { border-left-color: #10b981; }
.border-l-amber-500 { border-left-color: #f59e0b; }
.rounded-full { border-radius: 9999px; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-t-md { border-top-left-radius: 0.375rem; border-top-right-radius: 0.375rem; }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.fixed { position: fixed; }
.absolute { position: absolute; }
.relative { position: relative; }
.sticky { position: sticky; }
.inset-0 { inset: 0; }
.top-0 { top: 0; }
.top-16 { top: 4rem; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.bottom-6 { bottom: 1.5rem; }
.right-6 { right: 1.5rem; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.cursor-pointer { cursor: pointer; }
.transition-all { transition: all 0.2s; }
.transition-colors { transition: color 0.2s, background-color 0.2s; }
.transition-transform { transition: transform 0.2s; }
.duration-200 { transition-duration: 0.2s; }
.duration-300 { transition-duration: 0.3s; }
.rotate-180 { transform: rotate(180deg); }
.hover\:underline:hover { text-decoration: underline; }
.hover\:bg-slate-50:hover { background-color: #f8fafc; }
.hover\:bg-brand-50:hover { background-color: #EDF9FC; }
.hover\:text-brand:hover { color: #4CB4D4; }
.hover\:scale-105:hover { transform: scale(1.05); }
.hover\:shadow-glow:hover { box-shadow: 0 0 0 3px rgba(76, 180, 212, 0.15); }
.from-brand.to-brand-600 { background: linear-gradient(to bottom right, #4CB4D4, #2E7F96); }
.bg-gradient-to-br { background-image: linear-gradient(to bottom right, #4CB4D4, #2E7F96); }
.bg-gradient-to-r { background-image: linear-gradient(to right, rgb(76 180 212 / 0.1), #fff, #EDF9FC); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.col-span-2 { grid-column: span 2 / span 2; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-3 { padding-bottom: 0.75rem; }
.pb-6 { padding-bottom: 1.5rem; }
.pb-24 { padding-bottom: 6rem; }
.pr-4 { padding-right: 1rem; }
.pl-8 { padding-left: 2rem; }
.-mx-4 { margin-left: -1rem; margin-right: -1rem; }
.top-1 { top: 0.25rem; }
.-right-0\.5 { right: -0.125rem; }
.-top-0\.5 { top: -0.125rem; }

@media (min-width: 640px) {
  .sm\:flex { display: flex; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sm\:flex-row { flex-direction: row; }
  .sm\:items-center { align-items: center; }
  .sm\:justify-between { justify-content: space-between; }
  .sm\:w-auto { width: auto; }
  .sm\:inline { display: inline; }
  .sm\:inline-flex { display: inline-flex; }
  .sm\:gap-2 { gap: 0.5rem; }
}
@media (min-width: 768px) {
  .md\:flex { display: flex; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .md\:col-span-2 { grid-column: span 2 / span 2; }
  .md\:block { display: block; }
}
@media (min-width: 1024px) {
  .lg\:flex { display: flex !important; }
  .lg\:hidden { display: none !important; }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .lg\:col-span-1 { grid-column: span 1 / span 1; }
  .lg\:col-span-2 { grid-column: span 2 / span 2; }
  .lg\:col-span-3 { grid-column: span 3 / span 3; }
  .lg\:-mx-6 { margin-left: -1.5rem; margin-right: -1.5rem; }
  .lg\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
  .lg\:p-6 { padding: 1.5rem; }
  .lg\:block { display: block; }
}
@media (min-width: 1280px) {
  .xl\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .xl\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .xl\:col-span-3 { grid-column: span 3 / span 3; }
  .xl\:inline { display: inline; }
}
@media (min-width: 1536px) {
  .\32xl\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* ─── Tab Panels (interactive content switch) ─── */
.ca-tab-panel { display: none; animation: fadeIn 0.25s ease-out; }
.ca-tab-panel.active { display: block; }

/* ─── Record Detail Modal (compact classic layout) ─── */
/* Scoped size so global form-modal (80vh / wide panels) does not stretch this popup */
#detail-drawer.detail-drawer.ca-modal {
  align-items: center;
  justify-content: center;
  padding: max(1.5rem, env(safe-area-inset-top, 0px)) 1rem max(1.5rem, env(safe-area-inset-bottom, 0px));
}

#detail-drawer.detail-drawer .detail-drawer__panel,
#detail-drawer .detail-drawer__panel {
  width: min(520px, calc(100vw - 2rem));
  max-width: 520px;
  height: auto;
  max-height: min(70vh, calc(100dvh - 3rem));
}

#detail-drawer .detail-drawer__header {
  align-items: flex-start;
  flex-shrink: 0;
}

#detail-drawer .detail-drawer__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: #fff;
}

#detail-drawer .detail-drawer__footer {
  flex-shrink: 0;
  text-align: right;
}

#detail-drawer .detail-drawer__actions {
  display: inline-flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-left: auto;
}

.detail-field {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid #f8fafc;
  font-size: 13px;
}

.detail-field:last-child {
  border-bottom: none;
}

.detail-field-label {
  color: #64748b;
  font-weight: 500;
  flex-shrink: 0;
}

.detail-field-value {
  color: #0f172a;
  font-weight: 600;
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}

.detail-field-value .detail-sales-remarks {
  display: block;
  text-align: left;
  white-space: pre-wrap;
  font-weight: 500;
  line-height: 1.45;
  max-width: 100%;
}

.detail-field-value a {
  color: #2E7F96;
  text-decoration: none;
}

.detail-field-value a:hover {
  text-decoration: underline;
}

/* Flatten redesigned chrome if nested extraHtml still uses those classes */
#detail-drawer .detail-fields-card,
#detail-drawer .detail-fields-grid {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
}

#detail-drawer .detail-pill,
#detail-drawer .detail-pill--status,
#detail-drawer .detail-pill--priority,
#detail-drawer .detail-pill--date,
#detail-drawer .detail-pill--person {
  display: inline;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  white-space: normal;
}

#detail-drawer .detail-section {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
}

#detail-drawer .detail-section__title,
#detail-drawer .detail-section__subtitle {
  margin: 0 0 0.5rem;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  color: #475569;
}

#detail-drawer .detail-section__empty {
  margin: 0;
  font-size: 13px;
  color: #94a3b8;
}

#detail-drawer .detail-section .detail-fields-card {
  padding: 0;
}

#detail-drawer .detail-section__timeline {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
}

#detail-drawer .detail-timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

#detail-drawer .detail-timeline-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: #4CB4D4;
  color: #fff;
  flex-shrink: 0;
}

#detail-drawer .detail-timeline-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

#detail-drawer .detail-timeline-desc,
#detail-drawer .detail-timeline-meta {
  margin: 0.1rem 0 0;
  font-size: 12px;
  color: #64748b;
}

#detail-drawer .crm-inline-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 0.5rem;
  color: #64748b;
  font-size: 13px;
}

#detail-drawer .followup-activity-timeline--compact,
#detail-drawer #lead-demo-confirmation-section,
#detail-drawer #lead-email-communications-section,
#detail-drawer #lead-ocr-panel-host {
  margin-top: 1rem;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

@media (max-width: 640px) {
  #detail-drawer.detail-drawer.ca-modal {
    align-items: center;
    padding: max(1rem, env(safe-area-inset-top, 0px)) 0.75rem max(1rem, env(safe-area-inset-bottom, 0px));
  }

  #detail-drawer .detail-drawer__panel {
    width: min(520px, calc(100vw - 1.5rem));
    max-width: min(520px, calc(100vw - 1.5rem));
    max-height: min(72vh, calc(100dvh - 2rem));
  }

  .detail-field {
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.5rem 0;
  }

  .detail-field-value {
    text-align: left;
    max-width: 100%;
  }
}

/* ─── Toast Notifications ─── */
#toast-container {
  position: fixed;
  bottom: calc(var(--crm-floating-actions-bottom) + 4.5rem);
  right: var(--crm-floating-actions-right);
  z-index: 1060;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.ca-toast {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.875rem 1.125rem; border-radius: 12px;
  background: #fff; border: 1px solid #e2e8f0;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
  font-size: 13px; font-weight: 500; color: #334155;
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto; max-width: 360px;
}
.ca-toast.success { border-left: 4px solid #10b981; }
.ca-toast.info { border-left: 4px solid #4CB4D4; }
.ca-toast.warning { border-left: 4px solid #f59e0b; }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px) scale(0.95); } to { opacity: 1; transform: translateX(0) scale(1); } }

/* ─── Communications Module (CA Cloud Desk #25b7a7) ─── */
.comm-page {
  --comm-brand: #25b7a7;
  --comm-brand-dark: #1e9688;
  --comm-brand-light: #e8f8f6;
  width: 100%;
  max-width: 100%;
}
.comm-grid {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr;
  gap: 0.75rem; /* match reports hub */
  margin-bottom: 1.25rem;
  align-items: stretch;
}
.comm-page .comm-grid.gap-4,
.comm-grid.gap-4 {
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .comm-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }
}
@media (min-width: 960px) {
  .comm-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
  }
}

/* Communication hub cards — identical spacing/alignment to Reports hub cards */
.comm-page .communication-card.card-interactive,
.comm-page .communication-card.report-card,
.comm-card.communication-card,
.communication-card.card-interactive,
.communication-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem; /* same as reports gap-3 */
  width: 100%;
  min-width: 0;
  min-height: 4.75rem;
  height: auto;
  max-height: none;
  padding: 0.875rem 1rem; /* same as reports-hub-page .report-card */
  margin: 0;
  border: 1px solid rgb(241 245 249 / 0.8);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.04), 0 4px 12px -2px rgb(0 0 0 / 0.06);
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.communication-card:focus { outline: none; }
.communication-card:hover,
.communication-card.comm-card-live,
.communication-card.card-interactive:hover {
  transform: translateY(-2px);
  border-color: rgb(226 232 240 / 0.9);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 10px 24px -4px rgb(0 0 0 / 0.08);
}
.communication-card:focus-visible {
  border-color: var(--comm-brand);
  box-shadow: 0 0 0 3px rgb(37 183 167 / 0.22), 0 4px 12px -2px rgb(0 0 0 / 0.06);
}
.communication-card:active {
  transform: translateY(0);
}

.comm-page .communication-card__icon,
.comm-page .communication-card .report-card__icon,
.communication-card__icon,
.communication-card .report-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 2.5rem;
  flex-shrink: 0;
  border-radius: 0.75rem;
  background: #e8f8f6 !important;
  color: #25b7a7 !important;
  margin: 0;
}
.communication-card__icon i,
.communication-card__icon svg,
.communication-card .report-card__icon i,
.communication-card .report-card__icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.comm-page .communication-card__content,
.comm-page .communication-card .report-card__content,
.communication-card__content,
.communication-card .report-card__content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0.15rem; /* same as reports-hub-page .report-card__content */
}

.comm-page .communication-card__title,
.comm-page .communication-card .report-card__title,
.communication-card__title,
.communication-card .report-card__title {
  display: block;
  margin: 0;
  padding: 0;
  font-family: var(--crm-font-family);
  font-size: 0.9375rem !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  letter-spacing: var(--crm-letter-spacing);
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.comm-page .communication-card__desc,
.comm-page .communication-card .report-card-meta,
.communication-card__desc,
.communication-card .report-card-meta {
  display: block;
  margin: 0;
  padding: 0;
  font-family: var(--crm-font-family);
  font-size: 11px !important;
  font-weight: 400 !important;
  line-height: 1.25 !important;
  letter-spacing: var(--crm-letter-spacing);
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.communication-card__action {
  display: none;
}

.communication-card .comm-card-ripple,
.comm-card-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgb(37 183 167 / 0.2);
  transform: scale(0);
  animation: commRipple 0.55s ease-out forwards;
  pointer-events: none;
  z-index: 1;
}
@keyframes commRipple {
  to { transform: scale(2.8); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .communication-card,
  .communication-card.card-interactive:hover {
    transition: none;
    transform: none;
  }
  .comm-card-ripple { display: none; }
}
@media (max-width: 639px) {
  .comm-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .communication-card {
    min-height: 4.75rem;
    padding: 0.875rem 1rem;
    gap: 0.75rem;
  }
}

.comm-footer {
  margin-top: 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
}
.comm-footer-links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.25rem;
  margin-bottom: 0.75rem;
}
.comm-footer-links a,
.comm-footer-link {
  font-size: 0.8125rem; color: #64748b; text-decoration: none;
  background: none; border: none; padding: 0; cursor: pointer;
}
.comm-footer-links a:hover,
.comm-footer-link:hover { color: var(--comm-brand); }
.comm-footer-copy {
  text-align: center; font-size: 0.75rem; color: #94a3b8;
}
.perm-matrix { font-size: 12px; border-collapse: collapse; width: 100%; }
.perm-matrix th, .perm-matrix td { padding: 0.5rem 0.625rem; text-align: center; border: 1px solid #f1f5f9; }
.perm-matrix th { background: #f8fafc; font-weight: 600; color: #64748b; }
.perm-matrix td:first-child { text-align: left; font-weight: 500; color: #334155; }
.perm-check { display: inline-flex; width: 1.25rem; height: 1.25rem; border-radius: 6px; align-items: center; justify-content: center; cursor: pointer; transition: all 0.15s; }
.perm-check.on { background: #4CB4D4; color: #fff; }
.perm-check.off { background: #f1f5f9; color: #cbd5e1; }
.perm-check:hover { transform: scale(1.1); }

/* ─── Master sub-tabs ─── */
.ca-sub-tabs { display: flex; gap: 0.375rem; margin-bottom: 1rem; flex-wrap: wrap; }
.ca-sub-tab {
  padding: 0.375rem 0.875rem; border-radius: 8px; border: 1px solid #e2e8f0;
  background: #fff; font-size: 12px; font-weight: 500; color: #64748b; cursor: pointer; transition: all 0.2s;
}
.ca-sub-tab:hover, .ca-sub-tab.active { border-color: #4CB4D4; background: #EDF9FC; color: #2E7F96; }

/* Calendar footer */
.crm-cal-footer {
  text-align: center;
}
.crm-cal-footer__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0f172a;
}
.crm-cal-footer__month {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: #64748b;
}
.crm-cal-footer__badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
}
.crm-cal-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
}
.crm-cal-badge--pending {
  background: #eff6ff;
  color: #1d4ed8;
}
.crm-cal-badge--completed {
  background: #ecfdf5;
  color: #047857;
}
.crm-cal-badge--overdue {
  background: #fff1f2;
  color: #be123c;
}

/* ─── Calendar widget ─── */
.ca-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.ca-cal-day {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2rem;
  padding: 0.5rem;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-size: 12px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
  appearance: none;
  -webkit-appearance: none;
  pointer-events: auto;
  position: relative;
  z-index: 1;
}
.ca-cal-day:hover { background: #f1f5f9; }
.ca-cal-day:focus-visible { outline: 2px solid #4CB4D4; outline-offset: 1px; }
.ca-cal-day.today { background: #4CB4D4; color: #fff; font-weight: 600; }
.ca-cal-day.is-selected { background: #2E7F96; color: #fff; font-weight: 600; box-shadow: 0 0 0 2px rgba(46, 127, 150, 0.25); }
.ca-cal-day.has-event { position: relative; font-weight: 600; color: #2E7F96; }
.ca-cal-day.today.has-event,
.ca-cal-day.is-selected.has-event { color: #fff; }
.ca-cal-day.has-event::after { content: ''; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: #4CB4D4; pointer-events: none; }
.ca-cal-day.today.has-event::after,
.ca-cal-day.is-selected.has-event::after { background: #fff; }

/* ─── Toggle switch ─── */
.ca-toggle { position: relative; width: 44px; height: 24px; cursor: pointer; }
.ca-toggle input { opacity: 0; width: 0; height: 0; }
.ca-toggle-slider {
  position: absolute; inset: 0; border-radius: 9999px; background: #e2e8f0; transition: 0.25s;
}
.ca-toggle-slider::before {
  content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: 0.25s; box-shadow: 0 1px 3px rgb(0 0 0 / 0.15);
}
.ca-toggle input:checked + .ca-toggle-slider { background: #4CB4D4; }
.ca-toggle input:checked + .ca-toggle-slider::before { transform: translateX(20px); }

/* ─── Range dual slider visual ─── */
.range-display { display: flex; align-items: center; gap: 0.75rem; }
.range-track { flex: 1; height: 6px; border-radius: 9999px; background: #e2e8f0; position: relative; }
.range-fill { position: absolute; height: 100%; border-radius: 9999px; background: linear-gradient(to right, #4CB4D4, #2E7F96); }

/* ─── Security drill cards — match Assignment summary KPI cards ─── */
#security-nav .crm-summary-nav-card {
  text-align: left;
  min-height: 8.5rem;
  display: flex;
  flex-direction: column;
}
.crm-summary-nav-card__title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 600;
  color: #0f172a;
}
.crm-summary-nav-card__metric {
  margin: 0.25rem 0 0;
  min-height: 1.25rem;
  line-height: 1.35;
}
.crm-summary-nav-card--static {
  cursor: default;
}
.crm-summary-nav-card--static:hover {
  border-color: #e2e8f0;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
  transform: none;
}
.security-card.active,
.security-card.is-active {
  border-color: #25B7A7;
  background: #f0fdfa;
  box-shadow: 0 0 0 2px rgb(37 183 167 / 0.15);
}

#security-rbac-matrix td {
  padding: 0.45rem 0.75rem;
  font-size: 0.8125rem;
  vertical-align: middle;
}
#security-rbac-matrix thead th {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
}
#security-rbac-matrix .perm-check:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
#security-rbac-matrix .perm-check:disabled:hover {
  transform: none;
}

/* ─── Kanban drag hint ─── */
.kanban-card { cursor: grab; }
.kanban-card:active { cursor: grabbing; transform: scale(1.02); box-shadow: 0 8px 20px rgb(76 180 212 / 0.2); }

/* ─── Modal sizes ─── */
.ca-modal-panel-lg { max-width: 640px; }
.ca-modal-panel-xl { max-width: 800px; }

/* ─── ER badge ─── */
.er-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: #f1f5f9; font-size: 10px; font-weight: 600; color: #64748b; font-family: monospace; }

/* ─── Stat row ─── */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; }
.stat-box { padding: 0.75rem; border-radius: 10px; background: #f8fafc; border: 1px solid #f1f5f9; }
.stat-box-label { font-size: var(--crm-font-size-stat-label); color: #94a3b8; font-weight: var(--crm-font-weight-stat-label); }
.stat-box-value { font-size: var(--crm-font-size-stat-number); font-weight: var(--crm-font-weight-stat-number); color: #0f172a; margin-top: 2px; }

/* ─── Upload zone ─── */
.upload-zone {
  border: 2px dashed #e2e8f0;
  border-radius: var(--crm-card-radius);
  padding: var(--crm-space-8) var(--crm-space-6);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafbfc;
}
.upload-zone:hover, .upload-zone.drag-over { border-color: #4CB4D4; background: #EDF9FC; }

.bulk-wizard-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--crm-space-2);
}
.bulk-wizard-step {
  display: inline-flex;
  align-items: center;
  gap: var(--crm-space-2);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: #f8fafc;
  color: var(--crm-color-muted);
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-stepper);
  font-weight: 500;
  line-height: 1.3;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
}
.bulk-wizard-step-label {
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}
.bulk-wizard-step-no {
  width: 1.375rem;
  height: 1.375rem;
  flex: 0 0 1.375rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.bulk-wizard-step.active {
  background: #e8f8f6;
  color: #187a6f;
  border-color: #99e6dc;
  font-weight: 600;
}
.bulk-wizard-step.active .bulk-wizard-step-no {
  background: #25b7a7;
  color: #fff;
}
.bulk-wizard-step.done {
  background: #f0fdf4;
  color: #15803d;
  border-color: #bbf7d0;
  font-weight: 500;
}
.bulk-wizard-step.done .bulk-wizard-step-no {
  background: #22c55e;
  color: #fff;
}
@media (max-width: 900px) {
  .bulk-wizard-steps {
    width: 100%;
  }
  .bulk-wizard-step {
    flex: 1 1 calc(50% - var(--crm-space-2));
    justify-content: flex-start;
  }
}
@media (max-width: 520px) {
  .bulk-wizard-step {
    flex: 1 1 100%;
  }
}

.bulk-export-progress {
  height: 0.5rem;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.bulk-export-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #25b7a7, #2E7F96);
  transition: width 0.25s ease;
}

.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-brand-600 { color: #2E7F96; }
.border-l-red-400 { border-left-color: #f87171; }
.border-l-amber-400 { border-left-color: #fbbf24; }
.lg\:flex-row { flex-direction: row; }
.lg\:items-center { align-items: center; }
.lg\:justify-between { justify-content: space-between; }
.lg\:p-8 { padding: 2rem; }
.pl-10 { padding-left: 2.5rem; }
.pr-20 { padding-right: 5rem; }
.antialiased { -webkit-font-smoothing: antialiased; }
.bg-surface { background-color: #F8FAFC; }
.from-brand-50 { --tw-gradient-from: #EDF9FC; }
.to-white { --tw-gradient-to: #fff; }
.to-brand-600 { --tw-gradient-to: #2E7F96; }
.h-10 { height: 2.5rem; }
.w-10 { width: 2.5rem; }
.h-12 { height: 3rem; }
.w-12 { width: 3rem; }
.h-5 { height: 1.25rem; }
.w-5 { width: 1.25rem; }
.h-6 { height: 1.5rem; }
.w-6 { width: 1.5rem; }
.left-3\.5 { left: 0.875rem; }
.top-1\/2 { top: 50%; }
.-translate-y-1\/2 { transform: translateY(-50%); }
.pointer-events-none { pointer-events: none; }
.z-10 { z-index: 10; }
.border-0 { border-width: 0; }
.border-r { border-right-width: 1px; border-style: solid; }
.sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gap-1\.5 { gap: 0.375rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.pt-1 { padding-top: 0.25rem; }
.block { display: block; }
.inline { display: inline; }
.inline-flex { display: inline-flex; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.col-span-1 { grid-column: span 1; }
.mb-1\.5 { margin-bottom: 0.375rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.badge-warning { background: #fffbeb; color: #b45309; }
.gap-1 { gap: 0.25rem; }

.db-health-row-empty { background: #fffbeb; }
.db-health-row-empty:hover { background: #fef3c7; }
.db-health-row-alert { background: #fef2f2; }

/* Enterprise Dashboard */
.dash-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.625rem;
}
@media (min-width: 640px) { .dash-quick-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.dash-quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 4.5rem;
  padding: 0.875rem 0.75rem;
  border: 1px solid #e8edf2;
  border-radius: 12px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.15s;
}
.dash-quick-action-btn__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: #e8f8f6;
  color: #25b7a7;
}
.dash-quick-action-btn__label { line-height: 1.25; }
.dash-quick-action-btn:hover {
  border-color: #25b7a7;
  background: #f8fffe;
  color: #0f766e;
  box-shadow: 0 4px 14px rgb(37 183 167 / 0.08);
  transform: translateY(-1px);
}
.dash-quick-action-btn:hover .dash-quick-action-btn__icon {
  background: #25b7a7;
  color: #fff;
}
.dash-filter-chips {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
}
.dash-filter-chip {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.5rem 0.875rem; border-radius: 9999px; border: 1px solid #e8edf2;
  background: #fff; font-size: 12px; font-weight: 600; color: #475569; cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}
.dash-filter-chip:hover {
  border-color: #25b7a7;
  background: #e8f8f6;
  color: #0f766e;
  box-shadow: 0 2px 8px rgb(37 183 167 / 0.08);
}
.dash-charts-grid {
  display: grid; gap: 1rem; grid-template-columns: 1fr;
}
@media (min-width: 768px) { .dash-charts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .dash-charts-grid { grid-template-columns: repeat(3, 1fr); } }
.dash-chart-panel { min-height: 16rem; }
.dash-chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}
.dash-chart-legend__swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 3px;
  background: linear-gradient(90deg, #25b7a7, #4CB4D4);
}
.dash-chart-legend__swatch--alt {
  background: linear-gradient(90deg, #1e9688, #25b7a7);
}
.dash-chart-empty {
  padding: 2rem 1rem;
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
}
.dash-column-chart { display: flex; flex-direction: column; min-height: 11rem; }
.dash-column-chart__inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
  height: 100%;
  min-height: 10rem;
  padding: 0.5rem 0.25rem 0;
}
.dash-column-chart__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  height: 100%;
  gap: 0.25rem;
}
.dash-column-chart__value {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  line-height: 1;
}
.dash-column-chart__bar {
  width: 100%;
  min-height: 4px;
  border-radius: 6px 6px 0 0;
}
.dash-column-chart__label {
  font-size: 10px;
  color: #94a3b8;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-sms-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
@media (min-width: 768px) { .dash-sms-kpi-grid { grid-template-columns: repeat(4, 1fr); } }
.dash-sms-kpi {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.125rem;
  border: 1px solid #e8edf2;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.03);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.dash-sms-kpi:hover {
  border-color: #ccf0ec;
  box-shadow: 0 4px 14px rgb(37 183 167 / 0.06);
}
.dash-sms-kpi__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: #e8f8f6;
  color: #25b7a7;
  flex-shrink: 0;
}
.dash-sms-kpi__icon--warn,
.dash-sms-kpi__icon--info,
.dash-sms-kpi__icon--success {
  background: #e8f8f6;
  color: #25b7a7;
}
.dash-sms-kpi__body { min-width: 0; }
.dash-sms-kpi__label {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}
.dash-sms-kpi__value {
  margin: 0.25rem 0 0;
  font-size: var(--crm-font-size-kpi-value);
  font-weight: var(--crm-font-weight-kpi-value);
  color: #0f172a;
  line-height: var(--crm-line-height-kpi-value);
}
.dash-fu-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.625rem;
  margin-bottom: 1rem;
}
@media (min-width: 640px) { .dash-fu-kpi-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1024px) { .dash-fu-kpi-grid { grid-template-columns: repeat(7, 1fr); } }
.dash-fu-kpi,
.dash-workflow-counts .mgr-fu-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.875rem 1rem;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  background: #fafbfc;
}
.dash-workflow-counts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.625rem;
  margin-bottom: 1rem;
}
@media (min-width: 640px) { .dash-workflow-counts { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .dash-workflow-counts { grid-template-columns: repeat(6, 1fr); } }
.dash-fu-kpi__label,
.dash-workflow-counts .mgr-fu-stat .text-caption {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}
.dash-fu-kpi__value,
.dash-workflow-counts .mgr-fu-stat strong {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e293b;
}
.dash-fu-kpi--danger .dash-fu-kpi__value { color: #dc2626; }
.dash-activity-item {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.dash-activity-item:hover {
  border-color: #ccf0ec;
  background: #f8fffe;
  box-shadow: 0 2px 8px rgb(37 183 167 / 0.06);
}
.dash-activity-avatar {
  display: flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 9999px; background: #166534; color: #fff;
  font-size: 11px; font-weight: 700;
}
.dash-activity-icon {
  display: flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 8px; background: #e8f8f6; color: #25b7a7;
}
.dash-activity-body { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.dash-activity-action { font-size: 13px; font-weight: 600; color: #1e293b; }
.dash-activity-detail { font-size: 12px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-activity-time { font-size: 11px; color: #94a3b8; white-space: nowrap; }
.mgr-activity-feed,
.dash-activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 420px;
  overflow-y: auto;
}

.password-input-row { display: flex; gap: 0.5rem; align-items: center; }
.password-input-row .input-field { flex: 1 1 auto; }
.password-toggle-btn { flex: 0 0 auto; padding: 0.5rem !important; }
.login-status-active { background: #ecfdf5; color: #059669; }
.login-status-none { background: #f8fafc; color: #64748b; }
.login-status-inactive { background: #fef2f2; color: #dc2626; }

.mgr-dup-top-list { display: flex; flex-direction: column; gap: 0.5rem; }
.mgr-dup-top-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.75rem; background: #f8fafc; border-radius: 0.5rem; }
.mgr-dup-rank { width: 1.5rem; height: 1.5rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 9999px; background: #fee2e2; color: #dc2626; font-size: 11px; font-weight: 700; }
.mgr-dup-trend { display: flex; align-items: flex-end; gap: 0.5rem; min-height: 5rem; padding: 0.5rem 0; }
.mgr-dup-trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 5rem; }
.mgr-dup-trend-bar { width: 100%; max-width: 2rem; background: linear-gradient(180deg, #f87171, #dc2626); border-radius: 0.25rem 0.25rem 0 0; min-height: 4px; }
.mgr-dup-trend-label { font-size: 10px; color: #64748b; margin-top: 0.25rem; }

/* Employee Dashboard — shares mgr-dashboard / mgr-kpi-card layout */
.emp-dashboard { display: flex; flex-direction: column; gap: 1.5rem; }
.emp-grid-2 { display: grid; gap: 1rem; }
@media (min-width: 1024px) { .emp-grid-2 { grid-template-columns: repeat(2, 1fr); } }
.emp-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.875rem; }
.emp-panel-title {
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-card-title);
  font-weight: var(--crm-font-weight-card-title);
  color: #1e293b;
  margin: 0;
}
.emp-list { display: flex; flex-direction: column; gap: 0.5rem; max-height: 320px; overflow-y: auto; }
.emp-list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  width: 100%; padding: 0.75rem; border: 1px solid #f1f5f9; border-radius: 10px; background: #fff;
  cursor: pointer; text-align: left;
}
.emp-list-item:hover { border-color: #ccf0ec; background: #f8fffe; }
.emp-list-main { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.emp-list-meta { font-size: 11px; color: #94a3b8; white-space: nowrap; }
.emp-tabs { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-bottom: 0.75rem; }
.emp-tab {
  padding: 0.375rem 0.75rem; border-radius: 9999px; border: 1px solid #e2e8f0; background: #fff;
  font-size: 12px; font-weight: 600; color: #475569; cursor: pointer;
}
.emp-tab.active { background: #e8f8f6; border-color: #25b7a7; color: #0f766e; }
.emp-quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
@media (min-width: 640px) { .emp-quick-actions { grid-template-columns: repeat(3, 1fr); } }
.emp-quick-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff;
  font-size: 12px; font-weight: 600; color: #334155; cursor: pointer;
}
.emp-quick-btn:hover { border-color: #25b7a7; background: #f8fffe; color: #0f766e; }
.db-health-row-alert:hover { background: #fee2e2; }

/* Bulk Tools — compact action cards (matches Follow-ups KPI strip) */
.bulk-tools-grid,
.assign-kpi-grid {
  align-items: stretch;
}
.bulk-tools-grid .bulk-action-card,
.assign-kpi-grid .crm-kpi-card--compact {
  min-height: 4.75rem;
  height: 100%;
}
.crm-kpi-card--action .crm-kpi-card__body {
  display: flex;
  align-items: center;
}
.crm-kpi-card--action .crm-kpi-card__label {
  margin: 0;
}
.bulk-assign-panel { position: relative; }
.bulk-assign-card {
  border: 1px solid #e2e8f0; border-radius: 12px; padding: 1rem; background: #fafbfc;
  display: flex; flex-direction: column; min-height: 420px;
}
.bulk-assign-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem;
}
.bulk-assign-card-title {
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-card-title);
  font-weight: var(--crm-font-weight-card-title);
  line-height: var(--crm-line-height-card-title);
  color: var(--crm-color-heading);
  margin: 0;
}
.bulk-assign-scroll-list {
  flex: 1; overflow-y: auto; max-height: 340px; display: flex; flex-direction: column; gap: 0.5rem;
  padding-right: 0.25rem;
}
.bulk-assign-lead-card {
  display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.75rem; border: 1px solid #e2e8f0;
  border-radius: 10px; background: #fff; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s;
}
.bulk-assign-lead-card.is-selected { border-color: #25b7a7; box-shadow: 0 0 0 1px #25b7a7; background: #f0fdfa; }
.bulk-assign-lead-card input { margin-top: 0.2rem; flex-shrink: 0; }
.bulk-assign-lead-firm { font-weight: 600; font-size: 13px; color: #0f172a; margin: 0 0 0.15rem; }
.bulk-assign-lead-sub { font-size: 12px; color: #475569; margin: 0 0 0.15rem; }
.bulk-assign-lead-meta { font-size: 11px; color: #64748b; margin: 0 0 0.35rem; }
.bulk-assign-lead-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.bulk-assign-emp-card {
  display: flex; gap: 0.75rem; align-items: flex-start; width: 100%; text-align: left; padding: 0.75rem; border: 1px solid #e2e8f0;
  border-radius: 10px; background: #fff; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.bulk-assign-emp-card.is-selected { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25); background: #eff6ff; }
.bulk-assign-emp-card.bulk-assign-emp-disabled { opacity: 0.55; cursor: not-allowed; }
.bulk-assign-emp-card input.bulk-assign-emp-check { margin-top: 0.35rem; flex-shrink: 0; width: 1rem; height: 1rem; accent-color: #2563eb; cursor: pointer; }
.bulk-assign-selection-summary strong { color: #0f172a; font-weight: 700; }
.bulk-assign-batch-card {
  display: flex; flex-direction: column; gap: 0.75rem; padding: 0.9rem; border: 1px solid #e2e8f0;
  border-radius: 10px; background: #fff; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.bulk-assign-batch-card.is-selected { border-color: #25b7a7; box-shadow: 0 0 0 2px rgba(37, 183, 167, 0.25); background: #f0fdfa; }
.bulk-assign-batch-name { font-weight: 700; font-size: 14px; color: #0f172a; margin: 0 0 0.5rem; word-break: break-word; }
.bulk-assign-batch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem 1rem; margin-bottom: 0.5rem; }
.bulk-assign-batch-grid strong { display: block; font-size: 15px; color: #0f172a; }
.bulk-assign-batch-label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; margin-bottom: 0.1rem; }
.bulk-assign-batch-meta { font-size: 12px; color: #475569; margin: 0.1rem 0; }
.bulk-assign-batch-select-btn { align-self: flex-start; }
.bulk-assign-emp-avatar {
  width: 2.5rem; height: 2.5rem; border-radius: 999px; background: linear-gradient(135deg, #25b7a7, #2e7f96);
  color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.bulk-assign-emp-name { font-weight: 600; font-size: 13px; color: #0f172a; margin: 0 0 0.1rem; display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.bulk-assign-emp-name-text { min-width: 0; }

/* Employee presence indicator (Assignment) */
.crm-presence {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  margin-right: 0.35rem;
  vertical-align: middle;
  flex: 0 0 auto;
  line-height: 1;
}
.crm-presence__dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex: 0 0 9px;
  display: inline-block;
}
.crm-presence__label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #64748b;
}
.crm-presence.is-online .crm-presence__dot {
  background: #22c55e;
}
.crm-presence.is-online .crm-presence__label {
  color: #16a34a;
}
.crm-presence.is-offline .crm-presence__dot {
  background: #ef4444;
}
.crm-presence.is-offline .crm-presence__label {
  color: #b91c1c;
  opacity: 0.85;
}
.crm-entity-lookup__option-title .crm-presence {
  margin-right: 0.4rem;
}

/* Manual attendance management (dashboard + compact centered modal) */
.dash-attendance-panel .mgr-panel-head {
  margin-bottom: 0.75rem;
}

/* Overlay stays a dimmed backdrop; panel is a compact centered popup. */
#modal-manage-attendance.attendance-modal {
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
#modal-manage-attendance .attendance-modal__panel,
#modal-manage-attendance .ca-modal-panel.attendance-modal__panel {
  display: flex !important;
  flex-direction: column !important;
  width: min(700px, calc(100vw - 32px)) !important;
  max-width: min(700px, calc(100vw - 32px)) !important;
  height: min(620px, 80vh) !important;
  max-height: 80vh !important;
  margin: auto !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 50px -12px rgb(15 23 42 / 0.28), 0 0 0 1px rgb(15 23 42 / 0.06) !important;
  overflow: hidden;
  inset: auto !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
}
#modal-manage-attendance .attendance-modal__header {
  flex: 0 0 auto;
  padding: 0.85rem 1rem !important;
}
#modal-manage-attendance .attendance-modal__body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 0.625rem 1rem 0.5rem !important;
}
#modal-manage-attendance .attendance-modal__footer {
  flex: 0 0 auto;
  padding: 0.5rem 1rem !important;
  margin-top: 0;
}
#modal-manage-attendance .attendance-modal__footer .ca-modal-footer-buttons {
  justify-content: flex-end;
  width: 100%;
}
.attendance-summary-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0;
  flex: 0 0 auto;
  padding: 0.45rem 0.65rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  background: #f8fafc;
  font-size: 0.75rem;
  color: #475569;
  line-height: 1.3;
}
.attendance-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0 0.5rem;
  white-space: nowrap;
}
.attendance-chip + .attendance-chip {
  border-left: 1px solid #e2e8f0;
}
.attendance-chip strong {
  font-weight: 700;
  color: #0f172a;
}
.attendance-chip--present,
.attendance-chip--present strong { color: #15803d; }
.attendance-chip--half-day,
.attendance-chip--half-day strong { color: #b45309; }
.attendance-chip--absent,
.attendance-chip--absent strong { color: #b91c1c; }
.attendance-chip--neutral,
.attendance-chip--neutral strong { color: #64748b; }
#modal-manage-attendance .attendance-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 30%) minmax(0, 70%);
  gap: 16px;
  align-items: end;
  flex: 0 0 auto;
  margin: 0;
}
#modal-manage-attendance .attendance-toolbar > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
#modal-manage-attendance .attendance-toolbar .form-label {
  display: block;
  margin: 0;
  padding: 0;
  height: 1rem;
  line-height: 1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #64748b;
}
#modal-manage-attendance .attendance-toolbar .input-field,
#modal-manage-attendance .attendance-toolbar .crm-datetime-field__trigger {
  width: 100%;
  height: 44px;
  min-height: 44px;
  box-sizing: border-box;
  font-size: 0.8125rem;
  border-radius: 0.5rem;
}
#modal-manage-attendance .attendance-toolbar .crm-datetime-field {
  width: 100%;
}
#modal-manage-attendance .attendance-toolbar .crm-datetime-field__input-wrap {
  min-height: 44px;
}
#modal-manage-attendance .attendance-toolbar .crm-datetime-field__preview {
  display: none !important;
}
#modal-manage-attendance .attendance-toolbar__search {
  width: 100%;
}
#modal-manage-attendance .attendance-summary-strip {
  margin-top: 2px;
}
#modal-manage-attendance .attendance-table-wrap {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  background: #fff;
}
#modal-manage-attendance .attendance-table-wrap .ca-table {
  min-width: 100%;
}
.attendance-table {
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  width: 100%;
}
.attendance-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #64748b;
  padding: 0.45rem 0.55rem;
  white-space: nowrap;
}
.attendance-table tbody td {
  padding: 0.45rem 0.55rem;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  height: 2.75rem;
}
.attendance-table tbody tr:last-child td {
  border-bottom: none;
}
.attendance-table tbody tr:hover td {
  background: #f8fafc;
}
.attendance-col-check {
  width: 2.1rem;
  text-align: center;
}
.attendance-col-status {
  width: 7.5rem;
  min-width: 7.5rem;
}
.attendance-col-mark {
  width: 8.25rem;
  min-width: 8.25rem;
  text-align: right;
}
.attendance-employee-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.25;
}
.attendance-employee-meta {
  margin-top: 0.12rem;
  font-size: 0.7rem;
  color: #94a3b8;
  line-height: 1.25;
}
.attendance-mark-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #fff;
}
.attendance-mark-btn {
  border: none;
  border-right: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  border-radius: 0;
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 1.9rem;
  padding: 0.32rem 0.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.attendance-mark-btn:last-child {
  border-right: none;
}
.attendance-mark-btn:hover:not(:disabled) {
  background: #f1f5f9;
  color: #0f172a;
}
.attendance-mark-btn:focus-visible {
  outline: 2px solid rgb(37 183 167 / 0.45);
  outline-offset: -2px;
  z-index: 1;
}
.attendance-mark-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.attendance-mark-btn.is-selected.is-present {
  background: #dcfce7;
  color: #166534;
}
.attendance-mark-btn.is-selected.is-absent {
  background: #fee2e2;
  color: #991b1b;
}
.attendance-mark-btn.is-selected.is-half-day {
  background: #fef3c7;
  color: #92400e;
}
.attendance-status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.16rem 0.5rem;
  background: #f1f5f9;
  color: #64748b;
  white-space: nowrap;
}
.attendance-status-pill.is-present {
  background: #dcfce7;
  color: #166534;
}
.attendance-status-pill.is-absent {
  background: #fee2e2;
  color: #991b1b;
}
.attendance-status-pill.is-half-day {
  background: #fef3c7;
  color: #92400e;
}
.attendance-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex: 0 0 auto;
  min-height: 0;
  font-size: 0.72rem;
  color: #64748b;
}
#modal-manage-attendance .attendance-pagination[hidden] {
  display: none;
}
.attendance-pagination .btn-secondary {
  min-height: 1.75rem !important;
  padding: 0.2rem 0.55rem !important;
  font-size: 0.7rem !important;
}
@media (max-width: 720px) {
  #modal-manage-attendance.attendance-modal {
    padding: 0.75rem;
  }
  #modal-manage-attendance .attendance-modal__panel,
  #modal-manage-attendance .ca-modal-panel.attendance-modal__panel {
    width: min(700px, calc(100vw - 24px)) !important;
    max-width: min(700px, calc(100vw - 24px)) !important;
    height: min(85vh, 640px) !important;
    max-height: 85vh !important;
  }
  #modal-manage-attendance .attendance-toolbar {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .attendance-col-mark {
    width: 7.25rem;
  }
}

.bulk-assign-emp-role { font-size: 11px; color: #64748b; margin: 0 0 0.35rem; }
.bulk-assign-emp-stats { display: flex; flex-wrap: wrap; gap: 0.65rem; font-size: 11px; color: #475569; margin-bottom: 0.35rem; }
.bulk-assign-emp-footer { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.bulk-assign-workload {
  flex: 1; height: 6px; background: #e2e8f0; border-radius: 999px; overflow: hidden; max-width: 120px;
}
.bulk-assign-workload span { display: block; height: 100%; background: linear-gradient(90deg, #25b7a7, #f59e0b); border-radius: 999px; }
.bulk-assign-avail { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.bulk-assign-avail-available { color: #059669; }
.bulk-assign-avail-busy { color: #d97706; }
.bulk-assign-avail-on-leave { color: #64748b; }
.bulk-assign-avail-unavailable { color: #dc2626; }
.bulk-assign-pagination {
  display: flex; align-items: center; justify-content: center; gap: 0.75rem; margin-top: 0.75rem; padding-top: 0.5rem;
  border-top: 1px solid #e2e8f0;
}
.bulk-assign-skeleton, .bulk-assign-empty {
  padding: 2rem 1rem; text-align: center; color: #64748b; font-size: 13px;
}
.bulk-assign-skeleton { animation: bulk-assign-pulse 1.2s ease-in-out infinite; }
@keyframes bulk-assign-pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
.bulk-assign-preview-table .bulk-preview-changed td:nth-child(2),
.bulk-assign-preview-table .bulk-preview-changed td:nth-child(3) { font-weight: 600; }
.bulk-assign-preview-table .bulk-preview-failed { background: #fef2f2; }
.bulk-assign-preview-table .bulk-preview-dup { background: #fffbeb; }
.bulk-assign-preview-table .bulk-preview-ok { background: #f0fdf4; }
.bulk-assign-loading {
  position: absolute; inset: 0; background: rgba(255,255,255,0.85); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.75rem; z-index: 20; border-radius: 12px;
}
.bulk-assign-spinner {
  width: 2rem; height: 2rem; border: 3px solid #e2e8f0; border-top-color: #25b7a7;
  border-radius: 999px; animation: bulk-assign-spin 0.7s linear infinite;
}
@keyframes bulk-assign-spin { to { transform: rotate(360deg); } }

#bulk-actions-table .bulk-history-cell {
  width: 3rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  vertical-align: middle;
}

#bulk-actions-table .bulk-history-cell--view {
  padding-left: 1rem;
}

#bulk-actions-table .bulk-history-cell--delete {
  padding-right: 1rem;
  text-align: right;
}

#bulk-actions-table .bulk-history-cell .crm-toolbar-icon-btn {
  width: 2rem;
  height: 2rem;
}

#modal-bulk-import-detail {
  z-index: 1050;
}

#modal-bulk-import-detail.bulk-import-detail--loading .ca-modal-footer-buttons button:not([data-close-bulk-import-detail]) {
  opacity: 0.55;
  pointer-events: none;
}

.bulk-import-detail-skeleton__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.bulk-import-detail-skeleton__card {
  min-height: 5.5rem;
  border-radius: var(--crm-card-radius);
  background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
  background-size: 200% 100%;
  animation: bulk-import-detail-shimmer 1.2s ease-in-out infinite;
}

.bulk-import-detail-skeleton__text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem 0 0;
  color: #64748b;
  font-size: var(--crm-font-size-helper);
}

.bulk-import-detail-skeleton__spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid #e2e8f0;
  border-top-color: #25b7a7;
  border-radius: 999px;
  animation: bulk-assign-spin 0.7s linear infinite;
}

@keyframes bulk-import-detail-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@media (max-width: 639px) {
  .bulk-import-detail-skeleton__grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Lead Quick Actions (Research Lead) ─── */
.lead-quick-cell {
  width: 52px;
  max-width: 52px;
  min-width: 52px;
  padding: 0 6px !important;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.crm-table thead th.crm-th-research,
.crm-table thead th.crm-th-google,
.crm-table thead th.crm-th-maps,
.crm-table thead th.crm-th-call-log,
.ca-table--enterprise thead th.crm-th-research,
.ca-table--enterprise thead th.crm-th-google,
.ca-table--enterprise thead th.crm-th-maps,
.ca-table--enterprise thead th.crm-th-call-log {
  text-align: center;
  padding-left: 6px !important;
  padding-right: 6px !important;
  font-size: 0.625rem;
}

.lead-quick-actions-cell {
  min-width: 6.5rem;
  vertical-align: middle;
  white-space: nowrap;
  position: relative;
  z-index: 2;
}
.lead-quick-actions--bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
}
.lead-quick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.lead-quick-icon {
  width: 1.125rem;
  height: 1.125rem;
  display: block;
  pointer-events: none;
}
.lead-quick-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgb(15 23 42 / 0.08);
  transform: translateY(-1px);
}
.lead-quick-btn:focus-visible {
  outline: 2px solid rgb(76 180 212 / 0.45);
  outline-offset: 2px;
}
.lead-quick-btn--google:hover,
.lead-quick-btn--research:hover,
.lead-quick-btn--call-log:hover {
  border-color: rgb(37 183 167 / 0.45);
  background: #f0fdfa;
}
.lead-quick-btn--call-log {
  color: #0f766e;
}
.lead-quick-btn--call-log .lead-quick-icon,
.lead-quick-btn--call-log [data-lucide] {
  width: 1.125rem;
  height: 1.125rem;
  stroke-width: 2.25;
}
.lead-quick-btn--maps:hover {
  border-color: rgb(234 67 53 / 0.35);
}

/* ─── Research Workspace (full-screen) ─── */
html.rw-open,
body.rw-open {
  overflow: hidden;
}

.rw-host {
  position: fixed;
  inset: 0;
  z-index: 9200;
  display: none;
}

.rw-host--open {
  display: block;
}

.rw-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25vh 1.25vw;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.rw-host--visible .rw-overlay {
  opacity: 1;
}

.rw-modal {
  width: min(95vw, 1280px);
  height: min(92vh, 92dvh);
  max-height: 92dvh;
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.04),
    0 24px 64px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(10px) scale(0.985);
  transition: transform 0.22s ease;
}

.rw-host--visible .rw-modal {
  transform: translateY(0) scale(1);
}

/* Research workspace — sales-executive compact layout */
.rw-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.rw-body__content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.rw-body__map {
  flex: 0 0 220px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.rw-saved-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  color: #166534;
  background: #f0fdf4;
  border-bottom: 1px solid #dcfce7;
}

.rw-saved-banner__meta {
  margin-left: auto;
  font-size: 0.68rem;
  color: #15803d;
}

.rw-empty-note {
  margin: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  color: #64748b;
}

.rw-match-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.rw-match-badge--excellent { background: #dcfce7; color: #166534; }
.rw-match-badge--good { background: #dbeafe; color: #1d4ed8; }
.rw-match-badge--possible { background: #fef3c7; color: #b45309; }
.rw-match-badge--low { background: #f1f5f9; color: #64748b; }

.rw-selected {
  padding: 0.55rem 0.75rem;
  background: #fff;
  border-top: 1px solid #e2e8f0;
}

.rw-selected--empty {
  background: #f8fafc;
}

.rw-selected__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.rw-selected__title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
}

.rw-selected__subtitle {
  margin: 0.1rem 0 0;
  font-size: 0.72rem;
  color: #64748b;
}

.rw-selected__badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
}

.rw-selected__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem 0.65rem;
  margin-bottom: 0.45rem;
}

.rw-selected__field {
  min-width: 0;
}

.rw-selected__label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 0.05rem;
}

.rw-selected__value {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rw-selected__value--empty { color: #94a3b8; }

.rw-selected__link {
  font-size: 0.78rem;
  color: #2E7F96;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rw-advanced {
  margin-bottom: 0.45rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.rw-advanced__toggle {
  cursor: pointer;
  padding: 0.35rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #475569;
  list-style: none;
}

.rw-advanced__toggle::-webkit-details-marker { display: none; }

.rw-advanced__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.3rem 0.65rem;
  padding: 0 0.55rem 0.45rem;
}

.rw-save-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.45rem;
}

.rw-save-option {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: #334155;
  cursor: pointer;
}

.rw-save-option--disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.rw-save-option__hint {
  font-size: 0.68rem;
  color: #94a3b8;
  font-style: normal;
}

.rw-save-option input {
  width: 0.85rem;
  height: 0.85rem;
  margin: 0;
}

.rw-preview {
  margin-bottom: 0.45rem;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: 0.75rem;
  color: #1e3a8a;
}

.rw-preview__hidden {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  color: #475569;
}

.rw-selected__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.rw-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  flex-shrink: 0;
}

.rw-header__identity {
  min-width: 0;
  flex: 1;
}

.rw-header__title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.rw-header__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 8px;
  background: #ecfeff;
  color: #0f766e;
  flex-shrink: 0;
}

.rw-header__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.rw-header__subtitle {
  margin: 0.1rem 0 0;
  font-size: 0.72rem;
  color: #64748b;
}

.rw-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-top: 0.45rem;
}

.rw-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  max-width: 11rem;
}

.rw-meta-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}

.rw-meta-value {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rw-toolbar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding: 0.2rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.rw-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.rw-toolbar-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.rw-toolbar-btn[data-rw-action="close"]:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.rw-toolbar-btn[data-rw-action="import"]:hover {
  background: #ecfeff;
  color: #0f766e;
}

.rw-import-wrap {
  flex-shrink: 0;
  background: #fff;
}

.rw-saved-wrap {
  flex-shrink: 0;
}

.rw-saved {
  padding: 0.75rem 1rem;
}

.rw-saved__head {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  color: #166534;
}

.rw-saved__title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #14532d;
}

.rw-saved__subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: #15803d;
}

.rw-saved__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 1rem;
}

.rw-saved__row {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.rw-saved__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #166534;
}

.rw-saved__value,
.rw-saved__link {
  font-size: 0.8125rem;
  line-height: 1.35;
  color: #14532d;
  word-break: break-word;
}

.rw-saved__link {
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 768px) {
  .rw-saved__grid {
    grid-template-columns: 1fr;
  }
}

.rw-import {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  flex-wrap: wrap;
}

.rw-import--empty {
  justify-content: flex-start;
}

.rw-api-error {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid #fecaca;
  border-radius: 0.5rem;
  background: #fef2f2;
}

.rw-api-error__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  color: #b91c1c;
  font-size: 0.875rem;
}

.rw-api-error__message {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #7f1d1d;
}

.rw-api-error__recommendation {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.375rem;
  background: #fff;
  border: 1px solid #fecaca;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #334155;
}

.rw-api-error__label {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.rw-api-error__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.rw-api-error__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
}

.rw-results--empty .rw-api-error {
  margin: 0.75rem 1rem;
}

.rw-import__meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 7rem;
}

.rw-import__label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.rw-import__source,
.rw-import__empty-text {
  font-size: 0.75rem;
  color: #64748b;
}

.rw-import__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}

.rw-import-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 18rem;
  padding: 0.28rem 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  font-size: 0.72rem;
  color: #334155;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rw-import-chip--info,
.rw-import-chip--disabled {
  cursor: default;
  background: #f8fafc;
  color: #64748b;
}

.rw-import-chip input {
  margin: 0;
}

.rw-import__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.rw-split {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 0;
  overflow: hidden;
}

.rw-split--compact {
  grid-template-columns: 1fr;
  max-height: 280px;
}

.rw-results-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0.45rem 0.75rem 0;
}

.rw-results {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  padding: 0;
}

.rw-results__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  flex-shrink: 0;
}

.rw-results__title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
}

.rw-results__count {
  font-size: 0.72rem;
  color: #64748b;
}

.rw-results__list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow-y: auto;
  min-height: 0;
  flex: 1 1 auto;
  max-height: none;
  padding-bottom: 0.35rem;
}

.rw-result-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.rw-result-card--best {
  border-color: #93c5fd;
  background: linear-gradient(to right, #eff6ff, #fff 40%);
  box-shadow: inset 3px 0 0 #3b82f6;
}

.rw-result-card--selected {
  border-color: #4CB4D4;
  background: #f0fdfa;
  box-shadow: inset 3px 0 0 #2E7F96;
}

.rw-result-card__main {
  flex: 1 1 auto;
  min-width: 0;
}

.rw-result-card__top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem 0.45rem;
  margin-bottom: 0.2rem;
}

.rw-result-card__title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.rw-result-card__best-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #1d4ed8;
}

.rw-result-card__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.65rem;
  align-items: center;
}

.rw-result-card__item {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  color: #475569;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rw-result-card__item--web {
  max-width: 14rem;
}

.rw-result-card__link {
  color: #2E7F96;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rw-result-card__muted {
  color: #94a3b8;
}

.rw-result-card__select {
  flex-shrink: 0;
  min-width: 4.5rem;
  padding: 0.3rem 0.55rem !important;
  font-size: 0.72rem !important;
}

.rw-panel--compact .rw-panel__head--compact {
  padding: 0.3rem 0.65rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.rw-panel--compact .rw-panel__title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
}

.rw-panel--compact .rw-panel__body--compact {
  height: calc(220px - 2rem);
  min-height: calc(220px - 2rem);
  max-height: calc(220px - 2rem);
}

.rw-panel--compact .rw-panel__iframe,
.rw-panel--compact .rw-panel__map-canvas {
  height: 100%;
  min-height: 100%;
}

.rw-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #fff;
}

.rw-panel--google {
  border-right: 1px solid #e2e8f0;
}

.rw-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  flex-shrink: 0;
}

.rw-panel__head-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.rw-panel__badge {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.rw-panel__badge--google {
  background: #4285f4;
}

.rw-panel__badge--maps {
  background: #ea4335;
}

.rw-panel__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #0f172a;
}

.rw-panel__hint {
  font-size: 0.68rem;
  color: #94a3b8;
  white-space: nowrap;
}

.rw-panel__body {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #f8fafc;
}

.rw-panel__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #f8fafc;
}

.rw-panel__map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 280px;
  background: #e2e8f0;
}

.rw-panel__loading,
.rw-panel__blocked {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 1rem;
  background: rgba(248, 250, 252, 0.96);
  color: #64748b;
  font-size: 0.8125rem;
  text-align: center;
}

.rw-panel__loading.hidden,
.rw-panel__blocked.hidden {
  display: none;
}

.rw-panel--blocked .rw-panel__iframe {
  opacity: 0.28;
}

@media (max-width: 1024px) {
  .rw-selected__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rw-header {
    flex-direction: column;
  }

  .rw-toolbar {
    align-self: flex-end;
  }

  .rw-meta-item {
    max-width: 9rem;
  }
}

@media (max-width: 768px) {
  .rw-overlay {
    padding: 0;
  }

  .rw-modal {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .rw-body__map {
    flex-basis: 180px;
  }

  .rw-panel--compact .rw-panel__body--compact {
    height: calc(180px - 2rem);
    min-height: calc(180px - 2rem);
    max-height: calc(180px - 2rem);
  }

  .rw-selected__grid,
  .rw-advanced__grid {
    grid-template-columns: 1fr;
  }

  .rw-result-card {
    flex-direction: column;
    align-items: stretch;
  }

  .rw-result-card__select {
    width: 100%;
  }

  .rw-header__meta {
    gap: 0.4rem 0.75rem;
  }
}
.followup-row-overdue { background: #fef2f2 !important; }
.followup-row-overdue td { color: #991b1b; }
.emp-list-item-overdue { border-color: #fecaca !important; background: #fff1f2 !important; }
.mgr-fu-stat { padding: 0.65rem 0.75rem; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; }
.mgr-fu-stat strong { display: block; font-size: 1.15rem; margin-top: 0.15rem; color: #0f172a; }
.mgr-fu-employee-list { display: grid; gap: 0.5rem; }
.mgr-fu-emp-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; padding: 0.65rem 0.75rem; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 12px; }
.mgr-fu-emp-row strong { margin-right: auto; font-size: 13px; }

/* ─── CA Master (enterprise page) ─── */
.cam-page {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  max-width: 100%;
}


.cam-page--table-first {
  gap: 0.5rem;
}

/* Master Data / Lead Management: title above tabs, full-height data grid */
.crm-scroll-area:has(#cam-hub),
.crm-scroll-area:has(#leads-hub) {
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
}

.crm-scroll-area:has(#cam-hub) > .crm-page,
.crm-scroll-area:has(#leads-hub) > .crm-page {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem 0.25rem !important;
}

@media (min-width: 1024px) {
  .crm-scroll-area:has(#cam-hub) > .crm-page,
  .crm-scroll-area:has(#leads-hub) > .crm-page {
    padding-top: 1rem !important;
  }
}

.cam-hub--compact,
#cam-hub.cam-hub--compact,
#leads-hub.cam-hub--compact {
  --cam-hub-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 0;
}

.cam-hub-top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.3rem;
  flex: 0 0 auto;
  width: 100%;
}

.cam-hub-title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  width: 100%;
}

.cam-hub--compact .cam-hub-title {
  display: block;
}

.cam-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
  flex: 0 0 auto;
  padding: 0.25rem 0.35rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}

.cam-control-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
}

.cam-hub--compact .cam-control-chip {
  min-height: 1.85rem;
  padding: 0.18rem 0.6rem;
  font-size: 0.76rem;
  gap: 0.28rem;
}

.cam-hub--compact .cam-control-chip .leads-kpi-count {
  display: none;
}

.cam-hub--compact .cam-primary-views {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.cam-hub--compact .cam-primary-views.hidden {
  display: none;
}

.cam-hub--compact .ca-tab-panel {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
}

.cam-hub--compact .ca-tab-panel.active {
  display: flex;
}

.cam-hub--compact .cam-pipeline-card {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0.5rem;
  overflow: hidden;
}

.cam-hub--compact .cam-pipeline-card:not(.cam-pipeline-card--master) {
  overflow: auto;
}

.cam-hub--compact .cam-firms-stack {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cam-hub--compact .cam-filter-bar {
  flex-shrink: 0;
}

.cam-hub--compact .crm-table-card {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cam-hub--compact .crm-inbox-bulk-bar {
  flex-shrink: 0;
  padding: 0.3rem 0.55rem;
  min-height: 0;
}

.cam-hub--compact .crm-table-card .table-scroll-container,
.cam-hub--compact .leads-table-card .table-scroll-container {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none !important;
  overflow: auto;
}

.cam-hub--compact .crm-table thead th {
  padding: var(--crm-table-cell-py, 8px) var(--crm-table-cell-px, 12px);
  font-size: var(--crm-font-size-body);
  line-height: var(--crm-line-height-tight);
  background: #f8fafc;
  height: var(--crm-table-head-row-h, 32px);
  min-height: var(--crm-table-head-row-h, 32px);
  max-height: var(--crm-table-head-row-h, 32px);
  box-sizing: border-box;
  vertical-align: middle;
}

.cam-hub--compact .crm-table thead tr:first-child th {
  top: 0;
  z-index: var(--crm-z-head-label, 40);
}

.cam-hub--compact .crm-table thead tr:first-child th.sticky-left,
.cam-hub--compact .crm-table thead tr:first-child th.sticky-left-2,
.cam-hub--compact .crm-table thead tr:first-child th.sticky-left-3 {
  z-index: var(--crm-z-head-label-sticky-1, 52);
}

.cam-hub--compact .crm-table thead tr:first-child th.sticky-left-2 {
  z-index: var(--crm-z-head-label-sticky-2, 51);
}

.cam-hub--compact .crm-table thead tr:first-child th.sticky-left-3 {
  z-index: var(--crm-z-head-label-sticky-3, 50);
}

.cam-hub--compact .crm-table thead tr:first-child th.sticky-right {
  position: sticky;
  top: 0;
  right: 0;
  z-index: var(--crm-z-head-label-sticky-r, 53);
}

.cam-hub--compact .crm-table thead tr.crm-col-filter-row th,
.cam-hub--compact .crm-col-filter-th {
  top: var(--crm-table-head-row-h, 32px);
  z-index: var(--crm-z-head-filter, 20);
  padding: var(--crm-table-cell-py, 8px) var(--crm-table-cell-px, 12px) !important;
  background: #f8fafc !important;
  height: var(--crm-table-head-row-h, 32px);
  min-height: var(--crm-table-head-row-h, 32px);
  max-height: var(--crm-table-head-row-h, 32px);
  vertical-align: middle;
}

.cam-hub--compact .crm-table thead tr.crm-col-filter-row th.sticky-left,
.cam-hub--compact .crm-table thead tr.crm-col-filter-row th.sticky-left-2,
.cam-hub--compact .crm-table thead tr.crm-col-filter-row th.sticky-left-3 {
  z-index: var(--crm-z-head-filter-sticky-1, 32);
}

.cam-hub--compact .crm-table thead tr.crm-col-filter-row th.sticky-left-2 {
  z-index: var(--crm-z-head-filter-sticky-2, 31);
}

.cam-hub--compact .crm-table thead tr.crm-col-filter-row th.sticky-left-3 {
  z-index: var(--crm-z-head-filter-sticky-3, 30);
}

.cam-hub--compact .crm-table thead tr.crm-col-filter-row th.sticky-right {
  position: sticky;
  top: var(--crm-table-head-row-h, 32px);
  right: 0;
  z-index: var(--crm-z-head-filter-sticky-r, 33);
}

.cam-hub--compact .crm-col-filter-input {
  height: 1.75rem;
  min-height: 1.75rem;
  max-height: 1.75rem;
  padding: 0.15rem 0.4rem;
  font-size: var(--crm-font-size-body);
  border-radius: 4px;
  box-sizing: border-box;
}

.cam-hub--compact .crm-table tbody td {
  padding: var(--crm-table-cell-py, 8px) var(--crm-table-cell-px, 12px);
  font-size: var(--crm-font-size-body);
  line-height: var(--crm-line-height-tight);
  height: var(--crm-table-row-h, 30px);
  min-height: var(--crm-table-row-h, 30px);
  max-height: var(--crm-table-row-h, 30px);
  box-sizing: border-box;
  vertical-align: middle;
}

.cam-hub--compact .crm-table-footer {
  flex-shrink: 0;
  padding: 0;
  min-height: 0;
  background: #fff;
  border-top: 1px solid #e2e8f0;
}

.cam-hub--compact .crm-table-pagination {
  min-height: 0;
  gap: 0.5rem;
  padding: 0.28rem 0.65rem;
  font-size: 12px;
  border-top: none;
  box-shadow: none;
}

.cam-hub--compact .crm-table-pagination__center {
  gap: 0.35rem;
}

.cam-hub--compact .crm-table-pagination__rows {
  gap: 0.35rem;
}

.cam-hub--compact .crm-table-pagination__rows-label,
.cam-hub--compact .crm-table-pagination__of,
.cam-hub--compact .crm-table-pagination__count,
.cam-hub--compact .crm-table-pagination__per-page,
.cam-hub--compact .crm-table-pagination__page {
  font-size: 12px;
}

.cam-hub--compact .crm-table-pagination__per-page,
.cam-hub--compact .crm-table-pagination__nav,
.cam-hub--compact .crm-table-pagination__page,
.cam-hub--compact .crm-table-pagination__count {
  height: 1.55rem;
  min-height: 1.55rem;
}

.cam-hub--compact .crm-table-pagination__nav {
  width: 1.55rem;
  min-width: 1.55rem;
}

.cam-hub--compact .crm-table-pagination__page {
  width: 2.25rem;
  min-width: 2.25rem;
}

.cam-hub--compact .crm-table-pagination__per-page {
  min-width: 3.25rem;
  padding: 0 1.35rem 0 0.4rem;
  border-radius: 4px;
}

.cam-hub--compact .crm-table-pagination__count {
  min-width: 3.5rem;
  padding: 0 0.45rem;
  border-radius: 4px;
}

.cam-hub--compact .crm-table-pagination__nav,
.cam-hub--compact .crm-table-pagination__page {
  border-radius: 4px;
}

.cam-hub--compact .cam-secondary-views {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

/* Master Data — spacing & alignment polish (table-first, compact-readable) */
#cam-hub.cam-hub--compact {
  gap: 0.625rem;
}

#cam-hub .cam-hub-top {
  gap: 0.625rem;
}

#cam-hub .cam-control-row {
  padding: 0.45rem 0.6rem;
  gap: 0.75rem;
  align-items: center;
  border-radius: 12px;
}

#cam-hub .cam-control-chips,
#cam-hub .leads-kpi-chips.cam-control-chips {
  gap: 0.4rem;
  align-items: center;
}

#cam-hub.cam-hub--compact .cam-control-chip,
#cam-hub.cam-hub--compact .leads-kpi-chip.cam-control-chip {
  min-height: 2.125rem;
  height: 2.125rem;
  padding: 0 0.85rem;
  font-size: 0.8125rem;
  gap: 0.4rem;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

#cam-hub .cam-control-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  flex: 1 1 auto;
  min-width: 0;
}

#cam-hub .cam-stage-filter-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  flex: 0 0 auto;
}

#cam-hub .cam-stage-filter-toolbar.hidden {
  display: none;
}

#cam-hub .cam-stage-filter-toolbar--active .cam-filter-pipeline-stage {
  border-color: #5eead4;
  background: #f0fdfa;
}

#cam-hub .cam-stage-filter-toolbar .cam-filter-pipeline-stage {
  min-width: 8.75rem;
  max-width: 10.5rem;
  height: 2.125rem;
  min-height: 2.125rem;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 0.8125rem;
  line-height: 1;
}

#cam-hub .cam-stage-filter-toolbar .cam-filter-reset-btn.crm-toolbar-icon-btn {
  width: 2.125rem;
  height: 2.125rem;
  min-width: 2.125rem;
  min-height: 2.125rem;
}

/* Manage Columns picker (Master Data + Lead Management) */
#cam-hub [data-column].cam-col-is-hidden,
#cam-hub [data-column][hidden],
#leads-hub [data-column].cam-col-is-hidden,
#leads-hub [data-column][hidden] {
  display: none !important;
}

.cam-columns-popover {
  max-height: min(70vh, 28rem);
  overflow: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.625rem;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  padding: 0.625rem 0.75rem 0.75rem;
}

.cam-columns-popover.hidden,
.cam-columns-popover[hidden] {
  display: none !important;
}

.cam-columns-popover__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.cam-columns-popover__title {
  font-size: 0.8125rem;
  font-weight: 650;
  color: #0f172a;
}

.cam-columns-popover__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}

.cam-columns-popover__close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.cam-columns-popover__close:focus-visible,
.cam-columns-popover__label:focus-within,
.cam-columns-select-all:focus-within,
#cam-columns-restore-default:focus-visible {
  outline: 2px solid #14b8a6;
  outline-offset: 2px;
}

.cam-columns-popover__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.cam-columns-select-all {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 550;
  color: #334155;
  cursor: pointer;
}

.cam-columns-popover__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.cam-columns-popover__item {
  margin: 0;
}

.cam-columns-popover__label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.4rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  color: #1e293b;
  cursor: pointer;
}

.cam-columns-popover__label:hover {
  background: #f8fafc;
}

.cam-columns-popover__item.is-required .cam-columns-popover__label {
  cursor: default;
  opacity: 0.92;
}

.cam-columns-popover__name {
  flex: 1 1 auto;
  min-width: 0;
}

.cam-columns-popover__required {
  font-size: 0.625rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 0.25rem;
  padding: 0.1rem 0.35rem;
}

#cam-columns-btn.is-active,
#cam-columns-btn[aria-expanded="true"] {
  border-color: #5eead4;
  background: #f0fdfa;
  color: #0f766e;
}

#leads-hub .cam-control-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  flex: 1 1 auto;
  min-width: 0;
}

#leads-hub .leads-status-filter-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  flex: 0 0 auto;
}

#leads-hub .leads-status-filter-toolbar--active .cam-filter-pipeline-stage {
  border-color: #5eead4;
  background: #f0fdfa;
}

#leads-hub .leads-status-filter-toolbar .cam-filter-pipeline-stage {
  min-width: 8.75rem;
  max-width: 10.5rem;
  height: 2.125rem;
  min-height: 2.125rem;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 0.8125rem;
  line-height: 1;
}

#cam-hub .leads-kpi-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex: 0 0 auto;
}

#cam-hub .leads-kpi-actions .crm-toolbar-icon-btn {
  width: 2.125rem;
  height: 2.125rem;
  min-width: 2.125rem;
  min-height: 2.125rem;
}

#cam-hub.cam-hub--compact .cam-primary-views {
  margin-top: 0.1rem;
}

#cam-hub.cam-hub--compact .cam-firms-stack {
  gap: 0.5rem;
}

#cam-hub.cam-hub--compact .crm-table-card {
  border-radius: 12px;
}

#cam-hub.cam-hub--compact .crm-inbox-bulk-bar {
  padding: 0.45rem 0.75rem;
}

#cam-hub.cam-hub--compact .crm-table {
  --crm-table-head-row-h: 34px;
  --crm-table-row-h: 32px;
  --crm-table-cell-py: 4px;
  --crm-table-cell-px: 10px;
  --crm-col-actions-width: 68px;
  --crm-col-google-width: 72px;
  --crm-master-table-font-size: 13px;
  --crm-master-table-header-font-size: 13px;
  --crm-master-table-secondary-font-size: 11px;
}

#cam-hub.cam-hub--compact .crm-table thead th,
#cam-hub.cam-hub--compact .crm-table tbody td {
  height: var(--crm-table-row-h);
  min-height: var(--crm-table-row-h);
  max-height: var(--crm-table-row-h);
  box-sizing: border-box;
  vertical-align: middle;
}

/* Empty / loading rows must win over the compact 32px body-cell clamp above */
#cam-hub.cam-hub--compact .crm-table tbody tr.cam-empty-row,
#cam-hub.cam-hub--compact .crm-table tbody tr.cam-loading-row,
#cam-hub.cam-hub--compact .ca-table--enterprise tbody tr.cam-empty-row,
#cam-hub.cam-hub--compact .ca-table--enterprise tbody tr.cam-loading-row {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

#cam-hub.cam-hub--compact .crm-table tbody tr.cam-empty-row td,
#cam-hub.cam-hub--compact .crm-table tbody tr.cam-loading-row td,
#cam-hub.cam-hub--compact .ca-table--enterprise tbody tr.cam-empty-row td,
#cam-hub.cam-hub--compact .ca-table--enterprise tbody tr.cam-loading-row td {
  height: auto !important;
  min-height: 8rem !important;
  max-height: none !important;
  overflow: visible !important;
  white-space: normal !important;
  vertical-align: middle !important;
  text-align: center !important;
}

#cam-hub.cam-hub--compact .crm-table thead tr:first-child th {
  padding: var(--crm-table-cell-py) var(--crm-table-cell-px);
  font-size: var(--crm-master-table-header-font-size, 13px);
  font-weight: 600;
  letter-spacing: var(--crm-letter-spacing);
  line-height: 1.2;
  vertical-align: middle;
}

#cam-hub.cam-hub--compact .crm-table thead tr.crm-col-filter-row th,
#cam-hub.cam-hub--compact .crm-col-filter-th {
  top: var(--crm-table-head-row-h);
  padding: var(--crm-table-cell-py) var(--crm-table-cell-px) !important;
  vertical-align: middle;
}

#cam-hub.cam-hub--compact .crm-col-filter-input {
  display: block;
  width: 100%;
  height: 2.125rem;
  min-height: 2.125rem;
  max-height: 2.125rem;
  padding: 0.25rem 0.5rem;
  font-size: var(--crm-master-table-font-size, 13px);
  line-height: 1.2;
  border-radius: 5px;
  box-sizing: border-box;
}

#cam-hub.cam-hub--compact .crm-table tbody td {
  padding: var(--crm-table-cell-py) var(--crm-table-cell-px);
  font-size: var(--crm-master-table-font-size, 13px);
  line-height: 1.25;
}

#cam-hub.cam-hub--compact .crm-th-check,
#cam-hub.cam-hub--compact .crm-td-check,
#cam-hub.cam-hub--compact .crm-th-actions,
#cam-hub.cam-hub--compact .crm-table tbody td.crm-actions-cell,
#cam-hub.cam-hub--compact .crm-table tbody td.sticky-right.crm-actions-cell {
  padding: 0 !important;
  vertical-align: middle !important;
  text-align: center;
  line-height: var(--crm-table-row-h, 32px);
}

#cam-hub.cam-hub--compact .crm-th-check.crm-col-filter-th,
#cam-hub.cam-hub--compact .crm-th-actions.crm-col-filter-th {
  line-height: normal;
  vertical-align: middle !important;
}

/* Master Data — reinforce frozen panel opacity while scrolling */
#cam-hub.cam-hub--compact .crm-table thead th.sticky-left,
#cam-hub.cam-hub--compact .crm-table thead th.sticky-left-2,
#cam-hub.cam-hub--compact .crm-table thead th.sticky-right,
#cam-hub.cam-hub--compact .crm-table tbody td.sticky-left,
#cam-hub.cam-hub--compact .crm-table tbody td.sticky-left-2,
#cam-hub.cam-hub--compact .crm-table tbody td.sticky-right {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-clip: border-box !important;
}

#cam-hub.cam-hub--compact .crm-table thead th.sticky-left,
#cam-hub.cam-hub--compact .crm-table tbody td.sticky-left {
  left: 0 !important;
  width: var(--crm-sticky-check-width) !important;
  min-width: var(--crm-sticky-check-width) !important;
  max-width: var(--crm-sticky-check-width) !important;
  z-index: var(--crm-z-sticky-body-1) !important;
  overflow: hidden !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

#cam-hub.cam-hub--compact .crm-table thead tr:first-child th.sticky-left {
  z-index: var(--crm-z-head-label-sticky-1) !important;
}

#cam-hub.cam-hub--compact .crm-table thead tr.crm-col-filter-row th.sticky-left {
  z-index: var(--crm-z-head-filter-sticky-1) !important;
}

#cam-hub.cam-hub--compact .crm-table thead th.sticky-left-2,
#cam-hub.cam-hub--compact .crm-table tbody td.sticky-left-2 {
  left: var(--crm-sticky-firm-left) !important;
  width: var(--crm-sticky-firm-width) !important;
  min-width: var(--crm-sticky-firm-width) !important;
  max-width: var(--crm-sticky-firm-width) !important;
  overflow: hidden !important;
  border-right: 1px solid #e2e8f0 !important;
  /* right-only shadow so Firm Name never paints over the inbox checkbox */
  box-shadow: 4px 0 8px -2px rgba(15, 23, 42, 0.12) !important;
}

#cam-hub.cam-hub--compact .crm-table thead th.sticky-right,
#cam-hub.cam-hub--compact .crm-table tbody td.sticky-right {
  position: sticky !important;
  right: 0 !important;
  width: var(--crm-col-actions-width) !important;
  min-width: var(--crm-col-actions-width) !important;
  max-width: var(--crm-col-actions-width) !important;
  overflow: hidden !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-clip: border-box !important;
  border-left: none !important;
  box-shadow: none !important;
}

#cam-hub.cam-hub--compact .crm-table thead tr:first-child th.sticky-right {
  top: 0 !important;
  z-index: var(--crm-z-head-label-sticky-r) !important;
  box-shadow: inset 0 -1px 0 #e2e8f0 !important;
}

#cam-hub.cam-hub--compact .crm-table thead tr.crm-col-filter-row th.sticky-right {
  top: var(--crm-table-head-row-h) !important;
  z-index: var(--crm-z-head-filter-sticky-r) !important;
  box-shadow: inset 0 -1px 0 #e2e8f0 !important;
}

#cam-hub.cam-hub--compact .crm-table tbody td.sticky-right {
  z-index: var(--crm-z-sticky-body-right) !important;
}

#cam-hub.cam-hub--compact .crm-table-footer {
  padding: 0;
}

#cam-hub.cam-hub--compact .crm-table-pagination {
  gap: 0.65rem;
  padding: 0.55rem 0.85rem;
  min-height: 2.75rem;
}

#cam-hub.cam-hub--compact .crm-table-pagination__center {
  gap: 0.5rem;
}

#cam-hub.cam-hub--compact .crm-table-pagination__rows {
  gap: 0.45rem;
}

#cam-hub.cam-hub--compact .crm-table-pagination__per-page,
#cam-hub.cam-hub--compact .crm-table-pagination__nav,
#cam-hub.cam-hub--compact .crm-table-pagination__page,
#cam-hub.cam-hub--compact .crm-table-pagination__count {
  height: 1.75rem;
  min-height: 1.75rem;
}

#cam-hub.cam-hub--compact .crm-table-pagination__nav {
  width: 1.75rem;
  min-width: 1.75rem;
  border-radius: 6px;
}

#cam-hub.cam-hub--compact .crm-table-pagination__page {
  width: 2.5rem;
  min-width: 2.5rem;
  border-radius: 6px;
}

#cam-hub.cam-hub--compact .crm-table-pagination__per-page {
  min-width: 3.35rem;
  padding: 0 1.4rem 0 0.5rem;
  border-radius: 6px;
}

#cam-hub.cam-hub--compact .crm-table-pagination__count {
  min-width: 3.65rem;
  padding: 0 0.5rem;
  border-radius: 6px;
}

@media (max-width: 900px) {
  .cam-control-row {
    width: 100%;
  }
}

.cam-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.15rem 0 0.35rem;
}

.cam-page-title {
  margin: 0;
}

.cam-toolbar {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
  padding: 0.2rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.cam-toolbar-divider {
  width: 1px;
  height: 1.35rem;
  background: #e2e8f0;
  margin: 0 0.15rem;
}

.cam-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.cam-toolbar-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.cam-toolbar-btn.active,
.cam-toolbar-btn.is-active {
  background: #ecfeff;
  color: #0f766e;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.18);
}

.cam-toolbar-btn--primary {
  background: #25b7a7;
  color: #fff;
}

.cam-toolbar-btn--primary:hover,
.cam-toolbar-btn--primary.active {
  background: #1f9f91;
  color: #fff;
  box-shadow: none;
}

.cam-page--table-first .cam-filter-bar {
  margin-bottom: 0.25rem;
  padding: 0.65rem 0.75rem;
}

.cam-page--table-first .cam-filter-bar.hidden {
  display: none;
}

.cam-page--table-first .cam-table-card {
  margin-top: 0;
}

.cam-page--table-first .crm-table thead th {
  padding-top: 0.45rem;
  padding-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: #334155;
  background: #f8fafc;
  white-space: nowrap;
}

.crm-col-filter-row th:not(.crm-th-check):not(.crm-th-actions),
.crm-col-filter-th:not(.crm-th-check):not(.crm-th-actions) {
  padding: 0.3rem 0.4rem 0.45rem !important;
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.crm-col-filter-input {
  display: block;
  width: 100%;
  min-width: 4.5rem;
  max-width: 100%;
  height: 1.45rem;
  padding: 0.1rem 0.35rem;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #fff;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-table-cell);
  font-weight: var(--crm-font-weight-input);
  font-style: normal;
  letter-spacing: var(--crm-letter-spacing);
  color: #0f172a;
  line-height: var(--crm-line-height-tight);
}

.crm-col-filter-input::placeholder {
  color: #94a3b8;
  font-style: normal;
}

.crm-col-filter-input:focus {
  outline: none;
  border-color: #25b7a7;
  box-shadow: 0 0 0 2px rgba(37, 183, 167, 0.15);
  font-style: normal;
}

.crm-col-filter-select {
  font-style: normal;
  padding-right: 1.35rem;
  cursor: pointer;
  appearance: auto;
}

.crm-col-filter-range {
  display: flex;
  gap: 0.2rem;
  width: 100%;
  min-width: 0;
}

.crm-col-filter-range .crm-col-filter-input {
  flex: 1 1 0;
  min-width: 0;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.crm-col-filter-reset.crm-toolbar-icon-btn {
  width: 1.45rem;
  height: 1.45rem;
  min-width: 1.45rem;
  min-height: 1.45rem;
  margin: 0 auto;
  padding: 0;
}

.crm-listing-filter-bar {
  padding: 0.75rem 1.25rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.crm-listing-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.5rem 0.75rem;
  align-items: end;
}

.crm-listing-filter-cell {
  min-width: 0;
}

.crm-listing-filter-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.crm-listing-filter-input {
  width: 100%;
}

.crm-listing-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid #e2e8f0;
}

.crm-listing-filter-inline-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.7rem;
}

.crm-listing-filter-cell--actions {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.crm-th-check.crm-col-filter-th,
.crm-th-actions.crm-col-filter-th,
.crm-th-research.crm-col-filter-th,
.crm-th-call-log.crm-col-filter-th,
.crm-th-rating.crm-col-filter-th,
.crm-th-date.crm-col-filter-th {
  background: #f8fafc;
}

.cam-page--table-first .crm-table tbody td {
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.cam-firms-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.cam-page .ca-tabs {
  margin-bottom: 0;
  padding: 0.25rem;
  background: #f1f5f9;
  border-radius: 12px;
  box-shadow: inset 0 1px 2px rgb(15 23 42 / 0.04);
}

.cam-page .ca-tab {
  padding: 0.45rem 0.875rem;
  font-size: 13px;
}

.cam-page .ca-tab.active {
  color: #2E7F96;
  font-weight: 600;
  box-shadow: 0 2px 8px rgb(46 127 150 / 0.12);
}

.cam-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0;
}

@media (max-width: 1280px) {
  .cam-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .cam-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.cam-summary-card {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.03);
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}

.cam-summary-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgb(15 23 42 / 0.05);
}

.cam-summary-card--clickable {
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.cam-summary-card--clickable:hover {
  border-color: #25B7A7;
  box-shadow: 0 4px 12px rgb(37 183 167 / 0.12);
  transform: translateY(-1px);
}
.cam-summary-card--clickable:focus-visible {
  outline: 2px solid rgb(37 183 167 / 0.45);
  outline-offset: 2px;
}
.cam-summary-card--clickable.is-active {
  border-color: #25B7A7;
  background: #f0fdfa;
  box-shadow: 0 0 0 2px rgb(37 183 167 / 0.15);
}

.employee-import-status-card {
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.employee-import-status-card.is-active {
  border-color: #25B7A7;
  background: #f0fdfa;
  box-shadow: 0 0 0 2px rgb(37 183 167 / 0.15);
}

.ei-review-modal-panel {
  max-width: min(1180px, 96vw);
}

.ei-review-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1rem;
}

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

.ei-candidate-rail {
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
  padding: 0.85rem;
  background: #fff;
  max-height: 32rem;
  overflow: auto;
}

.ei-candidate-item {
  width: 100%;
  display: flex;
  gap: 0.65rem;
  text-align: left;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.ei-candidate-item:hover {
  border-color: #99f6e4;
}

.ei-candidate-item.is-active {
  border-color: #14b8a6;
  background: #f0fdfa;
}

.ei-candidate-item__rank {
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 700;
  color: #0f766e;
  margin-top: 0.1rem;
}

.ei-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

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

.ei-compare-card {
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
  padding: 1rem;
  background: #fff;
}

.ei-compare-card--sales {
  background: #f8fafc;
}

.ei-field-list {
  display: grid;
  gap: 0.45rem;
}

.ei-field-row {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 0.5rem;
  font-size: 0.875rem;
  padding: 0.35rem 0.45rem;
  border-radius: 0.45rem;
}

.ei-field-row dt {
  color: #64748b;
}

.ei-field-row dd {
  color: #0f172a;
  word-break: break-word;
}

.ei-field--matched {
  background: #ecfdf5;
}

.ei-field--different {
  background: #fef9c3;
}

.ei-confidence-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #0f766e;
  background: #ccfbf1;
}

.ei-compare-summary {
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
  padding: 1rem;
  background: #fff;
}

.ei-compare-summary__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.ei-compare-confidence {
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f766e;
}

.ei-compare-summary__body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 700px) {
  .ei-compare-summary__body {
    grid-template-columns: 1fr;
  }
}

.ei-compare-section-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 0.45rem;
}

.ei-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ei-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.ei-chip--matched {
  background: #dcfce7;
  color: #166534;
}

.ei-chip--different {
  background: #fef08a;
  color: #854d0e;
}

.ei-chip--muted {
  background: #f1f5f9;
  color: #64748b;
}

.ei-mapped-to {
  min-width: 12rem;
  max-width: 18rem;
}

.ei-mapped-to__text {
  font-size: 0.8125rem;
  color: #0f172a;
  line-height: 1.35;
}

.ei-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
  min-width: 12rem;
}

.crm-kpi-card--clickable {
  cursor: pointer;
}
.crm-kpi-card--clickable:hover {
  border-color: #25B7A7;
  box-shadow: 0 4px 12px rgb(37 183 167 / 0.12);
}
.crm-kpi-card--clickable:focus-visible {
  outline: 2px solid rgb(37 183 167 / 0.45);
  outline-offset: 2px;
}
.crm-kpi-card--clickable.is-active {
  border-color: #25B7A7;
  background: #f0fdfa;
  box-shadow: 0 0 0 2px rgb(37 183 167 / 0.15);
}

/* Compact KPI strip (Follow-ups) — keeps the table above the fold */
.crm-kpi-grid--compact {
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.crm-kpi-card--compact {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 0;
  padding: 0.45rem 0.65rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  background: #fff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}
.crm-kpi-card--compact .crm-kpi-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  border-radius: 0.45rem;
  background: #edf9fc;
  color: #2e7f96;
}
.crm-kpi-card--compact .crm-kpi-card__icon .h-4,
.crm-kpi-card--compact .crm-kpi-card__icon [data-lucide] {
  width: 14px;
  height: 14px;
}
.crm-kpi-card--compact .crm-kpi-card__body {
  min-width: 0;
  flex: 1 1 auto;
}
.crm-kpi-card--compact .crm-kpi-card__label {
  margin: 0;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-stat-label);
  line-height: 1.2;
  font-weight: var(--crm-font-weight-stat-label);
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crm-kpi-card--compact .crm-kpi-card__value {
  margin: 0.05rem 0 0;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-card-title);
  line-height: var(--crm-line-height-card-title);
  font-weight: var(--crm-font-weight-stat-number);
  color: #0f172a;
}
.crm-kpi-card--compact .crm-kpi-card__pill,
.crm-kpi-card--compact .stat-pill {
  flex-shrink: 0;
  padding: 0.1rem 0.4rem;
  font-size: var(--crm-font-size-badge);
  line-height: 1.2;
}

.followups-table-card .table-scroll-container {
  max-height: calc(100vh - 200px);
  min-height: 420px;
}

.cam-summary-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  flex-shrink: 0;
}

.cam-summary-icon .h-5 { width: 1rem; height: 1rem; }

.cam-summary-card--brand .cam-summary-icon { background: #EDF9FC; color: #2E7F96; }
.cam-summary-card--amber .cam-summary-icon { background: #fffbeb; color: #d97706; }
.cam-summary-card--emerald .cam-summary-icon { background: #ecfdf5; color: #059669; }
.cam-summary-card--rose .cam-summary-icon { background: #fff1f2; color: #e11d48; }
.cam-summary-card--slate .cam-summary-icon { background: #f1f5f9; color: #64748b; }
.cam-summary-card--teal .cam-summary-icon { background: #e8f8f6; color: #2E7F96; }

.cam-summary-label {
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  margin: 0;
  line-height: 1.2;
}

.cam-summary-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0.1rem 0 0;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.cam-filter-bar {
  padding: 0.5rem 0.625rem;
  margin-bottom: 0;
  border: 1px solid #e2e8f0;
  box-shadow: none;
}

.cam-filter-bar--stage-active {
  border-color: #99f6e4;
  background: linear-gradient(to right, #f0fdfa, #fff 55%);
}

.cam-filter-pipeline-stage {
  flex: 0 0 auto;
  min-width: 9.5rem;
  max-width: 11rem;
}

.cam-filter-reset-btn.crm-toolbar-icon-btn {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  min-height: 2.25rem;
  border-radius: 0.55rem;
  color: #64748b;
}

.cam-filter-reset-btn.crm-toolbar-icon-btn:hover {
  color: #0f172a;
  border-color: #cbd5e1;
  background: #f8fafc;
}

.cam-filter-reset-btn.crm-toolbar-icon-btn:active {
  transform: none;
  background: #f1f5f9;
  border-color: #94a3b8;
  box-shadow: none;
}

.cam-filter-reset-btn.crm-toolbar-icon-btn:focus-visible {
  outline: 2px solid rgb(37 183 167 / 0.45);
  outline-offset: 2px;
}

.cam-filter-reset-btn.crm-toolbar-icon-btn:disabled,
.cam-filter-reset-btn.crm-toolbar-icon-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

.cam-filter-reset-btn.crm-toolbar-icon-btn .h-4,
.cam-filter-reset-btn.crm-toolbar-icon-btn [data-lucide] {
  width: 16px;
  height: 16px;
}

.cam-firms-stack {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  flex: 1 1 auto;
  min-height: 0;
}

.kanban-board--master .kanban-column-title {
  gap: 0.375rem;
}

.kanban-column-icon {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
  stroke-width: 2;
}

.kanban-column-icon--new-lead { color: #3b82f6; }
.kanban-column-icon--contacted { color: #f97316; }
.kanban-column-icon--interested { color: #8b5cf6; }
.kanban-column-icon--converted { color: #059669; }

.kanban-board--master .kanban-column-name {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
}

.kanban-board--master .kanban-stage-search__input {
  background: #fff;
  border-color: #e2e8f0;
  color: #334155;
}

.kanban-board--master .kanban-stage-search__input::placeholder {
  color: #94a3b8;
}

.cam-filter-bar--segment-active {
  border-color: #99f6e4;
  background: linear-gradient(to right, #f0fdfa, #fff 55%);
}

.cam-filter-firm-type {
  flex: 0 0 auto;
  min-width: 9.5rem;
  max-width: 11rem;
}

.cam-hub--compact .cam-filter-bar:not(.hidden) {
  flex-shrink: 0;
}

.cam-table-card--filter-attached {
  margin-top: 0;
}

.cam-filter-bar .input-field {
  height: 32px;
  min-height: 32px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 12px;
  line-height: 32px;
}

.cam-filter-bar .btn-sm {
  height: 32px;
  padding: 0 0.625rem;
  font-size: 12px;
}

.cam-filter-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.375rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cam-search-wrap {
  position: relative;
  flex: 1 1 200px;
  min-width: 160px;
}

.cam-search-icon {
  position: absolute;
  left: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.875rem;
  height: 0.875rem;
  color: #94a3b8;
  pointer-events: none;
}

.cam-search-input {
  width: 100%;
  padding-left: 2rem !important;
}

.cam-filter-select {
  flex: 0 0 auto;
  width: 118px;
  min-width: 100px;
  font-size: 12px;
}

.cam-filter-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-left: auto;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .cam-filter-row { flex-wrap: wrap; }
  .cam-filter-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }
}

.cam-table-card {
  overflow: visible;
  padding: 0;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}

.cam-table-wrap,
.cam-table-scroll {
  max-height: calc(100vh - 260px);
  min-height: 420px;
  overflow: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.cam-table-footer {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid #e2e8f0;
  background: #fafbfc;
}

.cam-pagination {
  margin: 0;
  padding: 0;
}

.cam-pagination--enterprise {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem 1rem;
}

.cam-pagination-summary {
  margin: 0;
  margin-right: auto;
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
}

.cam-pagination-summary strong {
  font-weight: 600;
  color: #334155;
}

.cam-pagination-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}

.cam-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.cam-page-btn:hover:not(:disabled):not(.cam-page-btn--active) {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.cam-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cam-page-btn--active {
  background: #2E7F96;
  border-color: #2E7F96;
  color: #fff;
  cursor: default;
}

.cam-page-btn--nav {
  min-width: auto;
  padding: 0 0.625rem;
}

.cam-page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 2rem;
  font-size: 12px;
  color: #94a3b8;
  user-select: none;
}

/* Column widths — legacy cam-* aliases align with enterprise sticky tokens */
.cam-col-firm { width: var(--crm-sticky-firm-width, 240px); min-width: var(--crm-sticky-firm-width, 240px); }
.cam-col-ca { width: var(--crm-sticky-ca-width, 200px); min-width: var(--crm-sticky-ca-width, 200px); }
.cam-col-mobile { width: 118px; min-width: 110px; }
.cam-col-geo { width: 100px; min-width: 88px; }
.cam-col-source { width: 110px; min-width: 96px; }
.cam-col-email { width: 168px; min-width: 140px; max-width: 200px; }
.cam-col-remarks { width: 200px; min-width: 160px; max-width: 240px; }
.cam-col-rating { width: 88px; min-width: 80px; }
.cam-col-status { width: 108px; min-width: 96px; }
.cam-col-person { width: 128px; min-width: 110px; }
.cam-col-date { width: 108px; min-width: 96px; }
.cam-col-actions { width: 52px; min-width: 52px; }

.cam-enterprise-table {
  table-layout: fixed;
}

.ca-table--enterprise:not(.crm-table) thead th {
  position: sticky;
  top: 0;
  z-index: 25;
  height: 36px;
  padding: 0 0.5rem;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-body);
  font-weight: var(--crm-font-weight-table-header);
  text-transform: none;
  letter-spacing: var(--crm-letter-spacing);
  color: #64748b;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
  vertical-align: middle;
  box-shadow: inset 0 -1px 0 #e2e8f0;
}

.ca-table--enterprise td {
  height: 44px;
  max-height: 44px;
  padding: 0 0.5rem;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-body);
  font-weight: var(--crm-font-weight-table-data);
  line-height: var(--crm-line-height-tight);
  letter-spacing: var(--crm-letter-spacing);
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
}

.ca-table--enterprise .cam-table-row {
  /* content-visibility breaks position:sticky on checkbox/firm columns */
  content-visibility: visible;
}

.ca-table--enterprise .cam-table-row:nth-child(even) {
  background: #fafbfc;
}

.ca-table--enterprise .cam-table-row:nth-child(even) .cam-col-sticky-start,
.ca-table--enterprise .cam-table-row:nth-child(even) .cam-col-sticky-end {
  background: #fafbfc;
}

.ca-table--enterprise .cam-table-row:hover {
  background: #f0fdfa;
}

.ca-table--enterprise .cam-table-row:hover .cam-col-sticky-start,
.ca-table--enterprise .cam-table-row:hover .cam-col-sticky-end {
  background: #f0fdfa;
}

.ca-table--enterprise .cam-table-row.selected {
  background: #EDF9FC;
  box-shadow: inset 3px 0 0 #4CB4D4;
}

.ca-table--enterprise .cam-table-row.selected .cam-col-sticky-start,
.ca-table--enterprise .cam-table-row.selected .cam-col-sticky-end {
  background: #EDF9FC;
}

/* Legacy cam-col-sticky aliases — inherit enterprise sticky layering */
.ca-table--enterprise .cam-col-sticky-start {
  position: sticky;
  left: 0;
  z-index: 40;
  background: #fff;
  box-shadow: 4px 0 8px rgba(0, 0, 0, 0.08);
}

.ca-table--enterprise thead .cam-col-sticky-start {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 80;
  background: #f8fafc;
}

.ca-table--enterprise .cam-col-sticky-end {
  position: sticky;
  right: 0;
  z-index: 50;
  background: #fff;
  box-shadow: -4px 0 8px rgba(0, 0, 0, 0.08);
}

.ca-table--enterprise thead .cam-col-sticky-end {
  position: sticky;
  top: 0;
  right: 0;
  z-index: 90;
  background: #f8fafc;
}

.cam-cell-text {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cam-cell-empty {
  color: #94a3b8;
}

.cam-cell-mono {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.cam-cell-rating {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  letter-spacing: -0.02em;
  color: #d97706;
}

.cam-cell-badge {
  display: block;
  max-width: 100%;
  overflow: hidden;
}

.cam-cell-badge .badge {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  font-size: 11px;
  padding: 0.1rem 0.35rem;
  line-height: 1.2;
  border-radius: 5px;
}

.cam-actions-cell {
  width: 78px;
  max-width: 78px;
  min-width: 78px;
  text-align: center;
  padding: 0 0.25rem !important;
}

.cam-actions-menu {
  position: relative;
  display: inline-flex;
}

.cam-actions-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.cam-actions-trigger:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #334155;
}

.cam-actions-trigger .h-4 {
  width: 1rem;
  height: 1rem;
}

.cam-actions-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 50;
  min-width: 148px;
  padding: 0.35rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 12px 32px -8px rgb(15 23 42 / 0.18);
}

.cam-actions-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.cam-actions-item:hover {
  background: #f8fafc;
}

.cam-actions-item--danger {
  color: #dc2626;
}

.cam-actions-item--danger:hover {
  background: #fef2f2;
}

.cam-empty-state,
.cam-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem 1rem;
  text-align: center;
}

.cam-empty-title {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin: 0.35rem 0 0;
}

.cam-empty-sub {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
}

.cam-loading-state {
  flex-direction: row;
  color: #64748b;
  font-size: 13px;
}

.crm-inline-loading {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 1rem 0;
  color: #64748b;
  font-size: 0.875rem;
}

.crm-form-loading {
  position: relative;
  pointer-events: none;
}

.crm-form-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgb(255 255 255 / 0.55);
  backdrop-filter: blur(1px);
}

.crm-form-loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: 1.5rem;
  height: 1.5rem;
  margin: -0.75rem 0 0 -0.75rem;
  border: 2px solid #cbd5e1;
  border-top-color: #0d9488;
  border-radius: 9999px;
  animation: crm-spin 0.65s linear infinite;
}

.crm-row-busy {
  opacity: 0.55;
  pointer-events: none;
}

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

.cam-panel-note {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.cam-master-panels .cam-master-subtable {
  margin-top: 0;
}

.cam-page .page-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

@media (max-width: 768px) {
  .cam-table-wrap,
  .cam-table-scroll {
    max-height: calc(100vh - 220px);
    min-height: 320px;
  }

  .cam-pagination--enterprise {
    flex-direction: column;
    align-items: stretch;
  }

  .cam-pagination-summary {
    margin-right: 0;
    text-align: center;
  }

  .cam-pagination-nav {
    justify-content: center;
  }
}

.cam-phone-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-start;
}

.login-email-status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.125rem 0.625rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.login-email-status-badge--verified { background: #ecfdf5; color: #047857; }
.login-email-status-badge--pending { background: #fffbeb; color: #b45309; }
.login-email-status-badge--expired { background: #f8fafc; color: #64748b; }
.login-email-status-badge--failed { background: #fef2f2; color: #b91c1c; }

/* ─── Email Configuration page ─── */
.email-config-page .ecfg-card {
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.04);
}
.ecfg-settings-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

/* ─── Settings hub layout ─── */
.settings-hub-layout {
  display: grid;
  grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.settings-hub-aside {
  position: sticky;
  top: 1rem;
}
.settings-hub-nav__title {
  margin: 0;
  padding: 0.5rem 0.75rem 0.375rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}
.settings-hub-nav__item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: #475569;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.settings-hub-nav__item:hover {
  background: #f8fafc;
  color: #0f172a;
}
.settings-hub-nav__item.active {
  background: #ecfdf5;
  color: #047857;
}
.settings-hub-nav__label {
  flex: 1;
  min-width: 0;
}
.settings-hub-nav__group {
  margin: 0.75rem 0.5rem 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e2e8f0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}
.settings-hub-nav__group:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 0.25rem;
}

/* Template Management */
.crm-template-mgmt .crm-tm-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.crm-template-mgmt .crm-tm-hero-actions {
  flex-shrink: 0;
}
.crm-template-mgmt .crm-table-card .table-scroll-container {
  min-height: 0;
}
.crm-template-mgmt .crm-table-card .ca-table thead th:first-child,
.crm-template-mgmt .crm-table-card .ca-table tbody td:first-child {
  padding-left: 1.25rem;
}
.crm-template-mgmt .crm-table-card .ca-table thead th:last-child,
.crm-template-mgmt .crm-table-card .ca-table tbody td:last-child {
  padding-right: 1.25rem;
}
.crm-template-mgmt .crm-tm-editor-card {
  padding: 1.5rem;
}
.crm-template-mgmt .crm-tm-editor-head {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}
.crm-template-mgmt .crm-tm-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1.5rem;
}
.crm-template-mgmt .crm-tm-field--full {
  grid-column: 1 / -1;
}
.crm-template-mgmt .crm-tm-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  margin-bottom: 0.375rem;
}
.crm-template-mgmt .crm-tm-req {
  color: #dc2626;
}
.crm-template-mgmt .crm-tm-hint,
.crm-template-mgmt .crm-tm-help {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.375rem;
}
.crm-template-mgmt .crm-tm-var-group {
  margin-bottom: 0.75rem;
}
.crm-template-mgmt .crm-tm-var-group-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 0.375rem;
}
.crm-template-mgmt .crm-tm-var-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.crm-template-mgmt .crm-tm-var-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.crm-template-mgmt .crm-tm-var-chip:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}
.crm-template-mgmt .crm-tm-rich-editor {
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #fff;
}
.crm-template-mgmt .crm-tm-rich-toolbar {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.crm-template-mgmt .crm-tm-rich-btn {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  cursor: pointer;
}
.crm-template-mgmt .crm-tm-rich-btn:hover {
  background: #fff;
  border-color: #e2e8f0;
}
.crm-template-mgmt .crm-tm-rich-area {
  min-height: 12rem;
  padding: 0.875rem 1rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: #0f172a;
  outline: none;
}
.crm-template-mgmt .crm-tm-rich-area:focus {
  box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.25);
}
.crm-template-mgmt .crm-tm-rich-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid #e2e8f0;
  font-size: 0.75rem;
  color: #64748b;
}
.crm-template-mgmt .crm-tm-format-hints {
  color: #94a3b8;
}
.crm-template-mgmt .crm-tm-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
}
.crm-template-mgmt .crm-tm-preview-body {
  padding: 1rem;
  border-radius: 0.5rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #334155;
  white-space: pre-wrap;
}
@media (max-width: 767px) {
  .crm-template-mgmt .crm-tm-editor-grid {
    grid-template-columns: 1fr;
  }
  .crm-template-mgmt .crm-tm-hero {
    flex-direction: column;
  }
}
.settings-dev-placeholder__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  margin: 0 auto;
  border-radius: 9999px;
  background: #f8fafc;
}
.settings-hub-content {
  min-width: 0;
}

/* ─── Sales List (full-width module) ─── */
.sales-list-module {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.sales-list-module .page-hero--standard {
  margin-bottom: 1rem;
}

.sales-list-hero-search {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 20rem;
  flex: 1 1 16rem;
}

.sales-list-hero-search__icon {
  position: absolute;
  left: 0.7rem;
  width: 0.95rem;
  height: 0.95rem;
  color: #94a3b8;
  pointer-events: none;
  z-index: 1;
}

.sales-list-hero-search__input {
  width: 100%;
  min-width: 0;
  height: 2.125rem;
  padding: 0.35rem 0.75rem 0.35rem 2.1rem;
  border: 1px solid #dbe3ee;
  border-radius: 0.5rem;
  background: #fff;
  font-size: 0.8125rem;
  color: #0f172a;
  box-shadow: 0 1px 1px rgb(15 23 42 / 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sales-list-hero-search__input::placeholder {
  color: #94a3b8;
}

.sales-list-hero-search__input:hover {
  border-color: #cbd5e1;
}

.sales-list-hero-search__input:focus {
  outline: none;
  border-color: #25b7a7;
  box-shadow: 0 0 0 3px rgba(37, 183, 167, 0.16);
}

.sales-list-module .page-hero-actions {
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.sales-list-module .page-hero-actions .crm-toolbar-icon-btn {
  width: 2.125rem;
  height: 2.125rem;
  min-width: 2.125rem;
  min-height: 2.125rem;
  border-radius: 0.5rem;
  border-color: #dbe3ee;
  background: #fff;
  color: #475569;
  box-shadow: 0 1px 1px rgb(15 23 42 / 0.03);
}

.sales-list-module .page-hero-actions .crm-toolbar-icon-btn:hover {
  border-color: #25b7a7;
  color: #0f766e;
  background: #f0fdfa;
}

.sales-list-table-card {
  margin-bottom: 0;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  box-shadow:
    0 1px 2px rgb(15 23 42 / 0.04),
    0 8px 24px -12px rgb(15 23 42 / 0.1);
  overflow: hidden;
  background: #fff;
  --sl-table-head-row-h: 36px;
  --sl-table-filter-row-h: 40px;
  --sl-table-row-h: 40px;
  --sl-table-cell-py: 0.5rem;
  --sl-table-filter-cell-py: 0.35rem;
  --sl-table-cell-px: 0.7rem;
  --sl-filter-h: 1.75rem;
  --crm-sticky-check-width: 88px;
  --crm-sticky-firm-width: 168px;
  --crm-sticky-firm-left: var(--crm-sticky-check-width);
  --crm-sticky-ca-left: calc(var(--crm-sticky-check-width) + var(--crm-sticky-firm-width));
  --crm-col-actions-width: 88px;
}

.sales-list-table-card .table-scroll-container {
  max-height: calc(100vh - 260px);
  min-height: 420px;
  background: #fff;
}

.sales-list-table-card .crm-table {
  --crm-table-head-row-h: var(--sl-table-head-row-h);
  --crm-table-row-h: var(--sl-table-row-h);
  --crm-table-cell-py: var(--sl-table-cell-py);
  --crm-table-cell-px: var(--sl-table-cell-px);
  --crm-col-actions-width: 88px;
}

.sales-list-table-card .crm-table thead tr:first-child th {
  height: var(--sl-table-head-row-h);
  min-height: var(--sl-table-head-row-h);
  max-height: var(--sl-table-head-row-h);
  padding: 0.45rem var(--sl-table-cell-px);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: none;
}

.sales-list-table-card .crm-table thead tr:first-child th.sticky-left,
.sales-list-table-card .crm-table thead tr:first-child th.sticky-left-2,
.sales-list-table-card .crm-table thead tr:first-child th.sticky-right {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
}

.sales-list-table-card .crm-table thead tr.crm-col-filter-row th.sticky-left,
.sales-list-table-card .crm-table thead tr.crm-col-filter-row th.sticky-left-2,
.sales-list-table-card .crm-table thead tr.crm-col-filter-row th.sticky-right {
  background: #f8fafc !important;
}

.sales-list-table-card .crm-table thead tr.crm-col-filter-row th,
.sales-list-table-card .crm-col-filter-th {
  top: var(--sl-table-head-row-h);
  height: var(--sl-table-filter-row-h);
  min-height: var(--sl-table-filter-row-h);
  max-height: var(--sl-table-filter-row-h);
  padding: var(--sl-table-filter-cell-py) var(--sl-table-cell-px) !important;
  vertical-align: middle;
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0;
}

.sales-list-table-card .crm-col-filter-input {
  display: block;
  width: 100%;
  height: var(--sl-filter-h);
  min-height: var(--sl-filter-h);
  max-height: var(--sl-filter-h);
  padding: 0.2rem 0.5rem;
  border: 1px solid #dbe3ee;
  border-radius: 0.375rem;
  background: #fff;
  font-size: 0.75rem;
  line-height: 1.25;
  color: #0f172a;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sales-list-table-card .crm-col-filter-input:hover {
  border-color: #cbd5e1;
}

.sales-list-table-card .crm-col-filter-input:focus {
  outline: none;
  border-color: #25b7a7;
  box-shadow: 0 0 0 2px rgba(37, 183, 167, 0.16);
}

.sales-list-table-card .crm-col-filter-select {
  height: var(--sl-filter-h);
  min-height: var(--sl-filter-h);
  max-height: var(--sl-filter-h);
  padding-top: 0.15rem;
  padding-bottom: 0.15rem;
  padding-right: 1.4rem;
  font-size: 0.75rem;
}

.sales-list-table-card .crm-col-filter-range {
  display: flex;
  gap: 0.3rem;
  width: 100%;
  min-width: 0;
  align-items: center;
}

.sales-list-table-card .crm-col-filter-range .crm-col-filter-input {
  flex: 1 1 0;
  min-width: 0;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  text-align: center;
}

.sales-list-table-card .crm-col-filter-reset.crm-toolbar-icon-btn {
  width: var(--sl-filter-h);
  height: var(--sl-filter-h);
  min-width: var(--sl-filter-h);
  min-height: var(--sl-filter-h);
  margin: 0 auto;
  border-radius: 0.375rem;
  border-color: #dbe3ee;
  background: #fff;
  color: #64748b;
}

.sales-list-table-card .crm-col-filter-reset.crm-toolbar-icon-btn:hover {
  border-color: #25b7a7;
  color: #0f766e;
  background: #f0fdfa;
}

.sales-list-table-card .crm-th-actions.crm-col-filter-th {
  text-align: center;
}

.sales-list-table-card .crm-th-actions.crm-col-filter-th .crm-col-filter-reset {
  margin: 0 auto;
}

.sales-list-table-card .crm-table tbody td {
  height: var(--sl-table-row-h);
  min-height: var(--sl-table-row-h);
  max-height: none;
  padding-top: var(--sl-table-cell-py);
  padding-bottom: var(--sl-table-cell-py);
  padding-left: var(--sl-table-cell-px);
  padding-right: var(--sl-table-cell-px);
  font-size: 0.8125rem;
  color: #334155;
  border-bottom: 1px solid #eef2f7;
}

.sales-list-table-card .crm-table tbody tr.crm-table-row:hover td {
  background-color: #f0fdfa !important;
}

.sales-list-table-card .crm-table tbody tr.crm-table-row:hover td.sticky-left,
.sales-list-table-card .crm-table tbody tr.crm-table-row:hover td.sticky-left-2,
.sales-list-table-card .crm-table tbody tr.crm-table-row:hover td.sticky-right {
  background-color: #f0fdfa !important;
}

.sales-list-table-card .crm-table tbody td.crm-td-person.font-medium,
.sales-list-table-card .crm-table tbody td.sticky-left-2 {
  color: #0f172a;
  font-weight: 600;
}

.sales-list-table-card .crm-td-actions--cluster {
  gap: 0.35rem;
}

.sales-list-table-card .crm-row-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border-radius: 0.375rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.sales-list-table-card .crm-row-action-btn:hover {
  border-color: #25b7a7;
  color: #0f766e;
  background: #f0fdfa;
}

.sales-list-table-card .crm-col-num,
.sales-list-table-card .crm-td-num {
  width: 96px;
  min-width: 84px;
}

.sales-list-table-card .crm-col-mono,
.sales-list-table-card .crm-td-mono {
  width: 148px;
  min-width: 128px;
}

.sales-list-table-card .crm-col-firm,
.sales-list-table-card .crm-col-person.sticky-left-2,
.sales-list-table-card .crm-td-person.sticky-left-2,
.sales-list-table-card thead th.sticky-left-2.crm-th-person {
  width: var(--crm-sticky-firm-width);
  max-width: var(--crm-sticky-firm-width);
  min-width: var(--crm-sticky-firm-width);
  overflow: hidden !important;
  text-overflow: ellipsis;
}

.sales-list-table-card .crm-td-firm,
.sales-list-table-card thead th.crm-th-firm {
  width: 240px;
  max-width: 280px;
  min-width: 200px;
}

.sales-list-table-card .crm-col-person,
.sales-list-table-card .crm-td-person {
  width: 156px;
  min-width: 132px;
}

.sales-list-table-card .crm-col-source,
.sales-list-table-card .crm-td-source {
  width: 140px;
  min-width: 120px;
}

.sales-list-table-card .crm-td-firm:not(.sticky-left):not(.sticky-left-2):not(.sticky-left-3),
.sales-list-table-card .crm-td-person:not(.sticky-left):not(.sticky-left-2):not(.sticky-left-3),
.sales-list-table-card .crm-td-mono,
.sales-list-table-card .crm-td-source {
  overflow: visible !important;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
}

.sales-list-table-card .crm-table tbody tr.crm-table-empty-row,
.sales-list-table-card .crm-table tbody tr.crm-table-loading-row {
  height: auto !important;
}

.sales-list-table-card .crm-table tbody tr.crm-table-empty-row td,
.sales-list-table-card .crm-table tbody tr.crm-table-loading-row td {
  height: auto !important;
  min-height: 14rem;
  max-height: none !important;
  padding: 0 !important;
  overflow: visible !important;
  white-space: normal !important;
  vertical-align: middle !important;
  text-align: center !important;
  border-bottom: none;
  background: #fff !important;
}

.sales-list-table-card .crm-table-empty-row .cam-empty-state {
  position: sticky;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: min(36rem, calc(100vw - 8rem));
  max-width: calc(100vw - 8rem);
  margin: 0 auto;
  padding: 2.75rem 1.5rem;
  box-sizing: border-box;
}

.sales-list-table-card .crm-table-empty-row .cam-empty-state [data-lucide] {
  color: #cbd5e1;
}

.sales-list-table-card .crm-table-footer {
  border-top: 1px solid #e2e8f0;
  background: #fafbfc;
}

@media (max-width: 1023px) {
  .sales-list-hero-search {
    flex: 1 1 100%;
    max-width: none;
  }

  .sales-list-table-card .table-scroll-container {
    max-height: calc(100vh - 300px);
    min-height: 320px;
  }

  .sales-list-table-card .crm-table-empty-row .cam-empty-state {
    width: min(28rem, calc(100vw - 3rem));
    max-width: calc(100vw - 3rem);
  }
}
@media (max-width: 1023px) {
  .settings-hub-layout {
    grid-template-columns: 1fr;
  }
  .settings-hub-aside {
    position: static;
  }
  .settings-hub-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    padding: 0.75rem;
  }
  .settings-hub-nav__title {
    width: 100%;
    padding: 0 0.25rem 0.25rem;
  }
  .settings-hub-nav__item {
    width: auto;
    flex: 1 1 auto;
    min-width: calc(50% - 0.375rem);
  }
}

.roles-perm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.roles-perm-scope {
  display: inline-flex;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #fff;
}
.roles-perm-scope-btn {
  border: 0;
  background: transparent;
  padding: 0.45rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
}
.roles-perm-scope-btn.is-active {
  background: #0f172a;
  color: #fff;
}
.roles-perm-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.roles-perm-role-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
}
.roles-perm-role-select {
  min-width: 11rem;
}
.roles-perm-user-meta {
  padding: 0.65rem 0.85rem;
  border-radius: 0.65rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.roles-perm-source {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #64748b;
}
.roles-perm-source-allow { color: #047857; }
.roles-perm-source-deny { color: #b91c1c; }
.roles-perm-source-role { color: #1d4ed8; }
.roles-perm-source-default { color: #94a3b8; }
.roles-perm-status {
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
}
.roles-perm-status.is-success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.roles-perm-status.is-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.roles-perm-status.is-info {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.roles-perm-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
@media (min-width: 768px) {
  .roles-perm-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.roles-perm-stat {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
}
.roles-perm-stat-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.25rem;
}
.roles-perm-stat strong {
  font-size: 1.25rem;
  color: #0f172a;
}
.roles-perm-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.roles-perm-search-wrap {
  position: relative;
  flex: 1 1 16rem;
  max-width: 24rem;
}
.roles-perm-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}
.roles-perm-search {
  padding-left: 2.25rem;
}
.roles-perm-matrix-card {
  border: 1px solid #e2e8f0;
}
.roles-perm-matrix-wrap {
  max-height: min(70vh, 640px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.roles-perm-matrix {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 720px;
  width: 100%;
}
.roles-perm-matrix thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 0 #e2e8f0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #475569;
  padding: 0.7rem 0.65rem;
  white-space: nowrap;
}
.roles-perm-matrix thead th.roles-perm-sticky-col {
  z-index: 6;
  left: 0;
  padding-left: 1.5rem !important;
  padding-right: 1rem !important;
}
.roles-perm-matrix th,
.roles-perm-matrix td {
  white-space: nowrap;
  vertical-align: middle;
}
.roles-perm-matrix th.roles-perm-module-col,
.roles-perm-matrix th.roles-perm-sticky-col,
.roles-perm-module-col,
.roles-perm-sticky-col {
  min-width: 12.5rem;
  max-width: 16rem;
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
  box-shadow: 1px 0 0 #e2e8f0;
  text-align: left;
  padding: 0.75rem 1rem 0.75rem 1.5rem !important;
}
.roles-perm-action-col {
  min-width: 4.75rem;
  width: 4.75rem;
  font-size: 0.75rem;
  text-align: center;
  padding: 0.45rem 0.35rem;
}
.roles-perm-section-row .roles-perm-section-cell {
  position: sticky;
  left: 0;
  top: auto;
  z-index: 2;
  background: #f1f5f9;
  padding: 0 !important;
  border-bottom: 1px solid #e2e8f0;
  border-top: 1px solid #e2e8f0;
}
.roles-perm-section-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 1.5rem;
  background: transparent;
  border: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
}
.roles-perm-section-toggle:hover {
  background: #e2e8f0;
}
.roles-perm-section-count {
  margin-left: auto;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #64748b;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}
.roles-perm-module-row:hover td,
.roles-perm-module-row:hover th {
  background: #f8fafc;
}
.roles-perm-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.roles-perm-toggle.is-disabled,
.roles-perm-toggle input:disabled + .roles-perm-toggle-ui {
  cursor: not-allowed;
  opacity: 0.55;
}
.roles-perm-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.roles-perm-toggle-ui {
  width: 2rem;
  height: 1.125rem;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  transition: background 0.15s ease;
}
.roles-perm-toggle-ui::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 999px;
  background: #fff;
  transition: transform 0.15s ease;
}
.roles-perm-toggle input:checked + .roles-perm-toggle-ui {
  background: #25b7a7;
}
.roles-perm-toggle input:checked + .roles-perm-toggle-ui::after {
  transform: translateX(0.875rem);
}
.roles-perm-toggle input:focus-visible + .roles-perm-toggle-ui {
  outline: 2px solid #99f6e4;
  outline-offset: 2px;
}
.roles-perm-mobile {
  display: none;
  padding: 0.75rem;
}
.roles-perm-mobile-section + .roles-perm-mobile-section {
  margin-top: 0.75rem;
}
.roles-perm-module-card {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  padding: 0.85rem;
  margin-top: 0.65rem;
}
.roles-perm-module-card-title {
  margin: 0 0 0.65rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #0f172a;
}
.roles-perm-module-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}
.roles-perm-module-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.8125rem;
  color: #334155;
}
.roles-perm-module-card-item:last-child {
  border-bottom: 0;
}
.roles-perm-empty {
  padding: 1.5rem;
  text-align: center;
  color: #64748b;
  font-size: 0.875rem;
}
@media (max-width: 767px) {
  .roles-perm-matrix-wrap {
    display: none;
  }
  .roles-perm-mobile {
    display: block;
  }
  .roles-perm-filter-hint {
    display: none;
  }
}
@media (min-width: 768px) {
  .roles-perm-mobile {
    display: none;
  }
}

.ecfg-card-head {
  padding: 1.25rem 1.5rem 0;
}
.ecfg-card-head--tabs {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 0;
}
.ecfg-card-body {
  padding: 1.25rem 1.5rem 1.5rem;
}
.ecfg-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-card-title);
  font-weight: var(--crm-font-weight-card-title);
  line-height: var(--crm-line-height-card-title);
  color: var(--crm-color-heading);
  margin: 0;
  letter-spacing: var(--crm-letter-spacing);
}
.ecfg-section-sub {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.5;
}
.ecfg-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}
.ecfg-meta-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 0.25rem;
}
.ecfg-meta-value {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0f172a;
  word-break: break-word;
}
.ecfg-form-row {
  display: grid;
  grid-template-columns: minmax(8rem, 11rem) minmax(0, 1fr);
  gap: 0.75rem 1.25rem;
  align-items: start;
}
.ecfg-form-label {
  padding-top: 0.625rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.4;
}
.ecfg-required {
  color: #dc2626;
  margin-left: 0.15rem;
}
.ecfg-form-field .input-field,
.ecfg-form-field select.input-field {
  width: 100%;
}
.ecfg-hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.45;
}
.ecfg-hint--block {
  margin-top: 0;
  margin-bottom: 0.5rem;
}
.ecfg-form-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.ecfg-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding-top: 0.5rem;
  font-size: 0.875rem;
  color: #475569;
  line-height: 1.45;
}
.ecfg-password-wrap .password-input-row {
  display: flex;
  gap: 0.5rem;
}
.ecfg-password-wrap .password-input-row .input-field {
  flex: 1;
}
.ecfg-test-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}
.ecfg-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}
.ecfg-form-actions--bordered {
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}
.ecfg-imap-fields {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed #e2e8f0;
}
.ecfg-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.ecfg-subform {
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #f8fafc;
}
.ecfg-status-card {
  border-radius: 0.75rem;
  padding: 1rem 1.125rem;
  border: 1px solid transparent;
}
.ecfg-status-card--pending {
  background: #fffbeb;
  border-color: #fde68a;
}
.ecfg-status-card--muted {
  background: #f8fafc;
  border-color: #e2e8f0;
}
.ecfg-status-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  color: #92400e;
}
.ecfg-status-card--muted .ecfg-status-card-head {
  color: #475569;
}
.ecfg-status-card-head h3 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
}
.ecfg-status-line {
  margin: 0.25rem 0;
  font-size: 0.875rem;
  color: #78350f;
  line-height: 1.5;
}
.ecfg-status-card--muted .ecfg-status-line {
  color: #475569;
}
.ecfg-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.ecfg-table-wrap {
  overflow-x: auto;
}
.ecfg-table th {
  white-space: nowrap;
  font-size: 0.75rem;
}
.ecfg-table td {
  font-size: 0.875rem;
  vertical-align: middle;
}
.ecfg-table .ecfg-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}
.ecfg-tabs {
  margin: 0;
}
@media (max-width: 767px) {
  .ecfg-form-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  .ecfg-form-label {
    padding-top: 0;
  }
  .ecfg-meta-grid {
    grid-template-columns: 1fr;
  }
  .ecfg-card-head--tabs {
    padding-bottom: 0.5rem;
  }
}

/* ─── Reusable guide / info cards ─── */
.ca-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.ca-guide-card {
  border-radius: 0.875rem;
  border: 1px solid transparent;
  padding: 1.125rem 1.25rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.ca-guide-card--info {
  background: linear-gradient(180deg, #f0f9ff 0%, #f8fafc 100%);
  border-color: #bae6fd;
}
.ca-guide-card--warning {
  background: linear-gradient(180deg, #fffbeb 0%, #fffef8 100%);
  border-color: #fde68a;
}
.ca-guide-card--success {
  background: linear-gradient(180deg, #ecfdf5 0%, #f8fffc 100%);
  border-color: #a7f3d0;
}
.ca-guide-card-head {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.875rem;
}
.ca-guide-card-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.75);
  flex-shrink: 0;
}
.ca-guide-card--info .ca-guide-card-icon { color: #0284c7; }
.ca-guide-card--warning .ca-guide-card-icon { color: #d97706; }
.ca-guide-card--success .ca-guide-card-icon { color: #059669; }
.ca-guide-card-icon {
  width: 1.125rem;
  height: 1.125rem;
}
.ca-guide-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}
.ca-guide-card-body {
  font-size: 0.875rem;
  color: #475569;
  line-height: 1.55;
}
.ca-guide-intro {
  margin: 0 0 1rem;
  color: #64748b;
}
.ca-guide-field + .ca-guide-field {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}
.ca-guide-field-title {
  margin: 0 0 0.35rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #1e293b;
}
.ca-guide-field-text {
  margin: 0;
}
.ca-guide-field-label {
  margin: 0.5rem 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
}
.ca-guide-list {
  margin: 0.25rem 0 0;
  padding-left: 1.15rem;
}
.ca-guide-list--bullets {
  list-style: disc;
}
.ca-guide-list code {
  font-size: 0.8125rem;
  background: rgba(255, 255, 255, 0.7);
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
}
.ca-guide-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
.ca-guide-step {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.ca-guide-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: #0ea5e9;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.ca-guide-step-title {
  margin: 0;
  font-weight: 700;
  color: #1e293b;
}
.ca-guide-list--checks {
  list-style: none;
  padding-left: 0;
}
.ca-guide-list--checks li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.ca-guide-check-icon {
  width: 1rem;
  height: 1rem;
  color: #059669;
  flex-shrink: 0;
  margin-top: 0.15rem;
}
@media (max-width: 1023px) {
  .ca-guide-grid {
    grid-template-columns: 1fr;
  }
}

/* Date/time picker — see public/crm-ui/src/components/crm-datetime-picker.css */

/* Unified Campaign Hub */
.cam-unified-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cam-channel-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cam-channel-email { background: #dbeafe; color: #1d4ed8; }
.cam-channel-sms { background: #fef3c7; color: #b45309; }
.cam-channel-whatsapp { background: #d1fae5; color: #047857; }

.cam-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: #64748b;
  margin: 0.5rem 0;
}

.cam-stats-row--detail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.5rem;
}

.cam-stat-pill {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.5rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cam-stat-pill strong {
  font-size: 1rem;
  color: #0f172a;
}

.cam-progress {
  height: 6px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 0.35rem;
}

.cam-progress__bar {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.cam-progress__bar--brand { background: #2563eb; }
.cam-progress__bar--success { background: #16a34a; }
.cam-progress__bar--danger { background: #dc2626; }

.ca-modal-panel-xl {
  max-width: min(1100px, 96vw);
}

/* Assignment page */
.assign-page {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.assign-widgets-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 1100px) {
  .assign-widgets-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.assign-widget {
  padding: 1.15rem 1.25rem 1.25rem;
}

.assign-widget__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.assign-widget__meta {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}

.assign-widget__empty {
  margin: 0;
  padding: 1rem 0;
  text-align: center;
  font-size: 0.875rem;
  color: #94a3b8;
}

.assign-capacity-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.assign-capacity-edit {
  margin-bottom: 1rem;
  padding: 0.875rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #f8fafc;
}

.assign-capacity-edit__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.5rem;
}

.assign-capacity-edit__row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.assign-capacity-edit__input {
  width: 6rem;
}

.assign-capacity-edit__hint {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
}

.assign-capacity-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.assign-capacity-item__name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0f172a;
}

.assign-capacity-item__badge {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
}

.assign-capacity-item__label {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 0.2rem;
}

.assign-capacity-item__stats {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.assign-capacity-item__ratio {
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
}

.assign-capacity-item__remaining {
  font-size: 0.75rem;
  color: #64748b;
}

.assign-capacity-item__pct {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #475569;
}

.assign-capacity-bar,
.assign-heatmap-bar {
  width: 100%;
  height: 0.55rem;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.assign-capacity-bar__fill,
.assign-heatmap-bar__fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.25s ease;
}

.assign-capacity-bar__fill--green,
.assign-heatmap-bar__fill--green { background: #16a34a; }
.assign-capacity-bar__fill--yellow,
.assign-heatmap-bar__fill--yellow { background: #ca8a04; }
.assign-capacity-bar__fill--red,
.assign-heatmap-bar__fill--red { background: #dc2626; }

.assign-heatmap-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
  .assign-heatmap-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.assign-heatmap-custom {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.assign-heatmap-custom__sep {
  font-size: 0.8125rem;
  color: #64748b;
}

.assign-heatmap-summary {
  font-size: 0.8125rem;
  color: #64748b;
  margin-bottom: 0.75rem;
}

.assign-heatmap-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.assign-heatmap-row {
  display: grid;
  grid-template-columns: minmax(88px, 120px) minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
}

.assign-heatmap-row__city {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.assign-heatmap-row__city:hover {
  color: #0ea5e9;
  text-decoration: underline;
}

.assign-heatmap-row__meta {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}

.assign-section {
  overflow: hidden;
}

.assign-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.assign-section__head--rotation {
  padding-bottom: 0.85rem;
}

.assign-section__subtitle {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #64748b;
}

.assign-rotation-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  padding: 0.85rem 1.25rem 1.15rem;
}

@media (min-width: 640px) {
  .assign-rotation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .assign-rotation-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.assign-rotation-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #e8edf2;
  border-radius: 12px;
  background: #fafbfc;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.assign-rotation-item:hover {
  border-color: #c9e8f0;
  background: #f8fdff;
}

.assign-rotation-item__text {
  flex: 1;
  min-width: 0;
}

.assign-rotation-item__label-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.assign-rotation-item__label {
  font-weight: 600;
  font-size: 0.875rem;
  color: #0f172a;
  cursor: pointer;
  line-height: 1.3;
}

.assign-rotation-item__toggle {
  margin-top: 0.1rem;
  cursor: pointer;
}

.assign-rotation-item__help {
  margin: 0.2rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #64748b;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 768px) {
  .assign-rotation-item__help {
    -webkit-line-clamp: 1;
    white-space: nowrap;
    text-overflow: ellipsis;
    display: block;
  }
}

.assign-rotation-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  color: #94a3b8;
  cursor: help;
  border-radius: 999px;
  outline: none;
}

.assign-rotation-info__icon {
  width: 0.875rem;
  height: 0.875rem;
}

.assign-rotation-info:hover,
.assign-rotation-info:focus-visible {
  color: #4CB4D4;
  background: #edf9fc;
}

.assign-rotation-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  z-index: 20;
  width: max-content;
  max-width: min(240px, 72vw);
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0ms ease, visibility 0ms ease;
}

.assign-rotation-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #0f172a;
}

.assign-rotation-info:hover .assign-rotation-tooltip,
.assign-rotation-info:focus-visible .assign-rotation-tooltip {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 639px) {
  .assign-rotation-tooltip {
    left: auto;
    right: -0.25rem;
    transform: none;
  }

  .assign-rotation-tooltip::after {
    left: auto;
    right: 0.65rem;
    transform: none;
  }
}

.assign-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.assign-toolbar__search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: min(240px, 100%);
  max-width: 300px;
}

.assign-toolbar__search > i,
.assign-toolbar__search > svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: #94a3b8;
  pointer-events: none;
  z-index: 1;
}

.assign-toolbar__search .input-field {
  width: 100%;
  height: 2.375rem;
  min-height: 2.375rem;
  padding: 0 0.75rem 0 2.25rem;
  box-sizing: border-box;
}

.assign-toolbar__filter {
  min-width: 140px;
  max-width: 180px;
}

.assign-section .assign-table-card {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.assign-section .assign-table-card .table-scroll-container {
  max-height: none;
  min-height: 0;
}

.assign-section .assign-table-card .crm-table-footer {
  padding: 0;
  min-height: 0;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

.assign-section .assign-table-card .crm-table-pagination {
  min-height: 2.5rem;
  padding: 0.5rem 1.25rem;
  gap: 0.55rem;
  border-top: none;
}

/* Match section-head / Active Assignments left inset — first col was flush to the card edge */
.assign-section .assign-table-card .ca-table thead th:first-child,
.assign-section .assign-table-card .ca-table tbody td:first-child {
  padding-left: 1.25rem;
}

.assign-section .assign-table-card .ca-table thead th:last-child,
.assign-section .assign-table-card .ca-table tbody td:last-child {
  padding-right: 1.25rem;
}

.assign-table-row {
  height: 34px;
}

.assign-table-row td {
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
  vertical-align: middle;
  font-size: 13px;
}

.assign-col-lead { width: var(--crm-sticky-firm-width, 240px); min-width: var(--crm-sticky-firm-width, 240px); max-width: var(--crm-sticky-firm-width, 240px); }
.assign-col-exec { width: 16%; min-width: 110px; }
.assign-col-num { width: 8%; min-width: 72px; }
.assign-col-status { width: 10%; min-width: 88px; }
.assign-col-date { width: 12%; min-width: 100px; }
.assign-col-person { width: 14%; min-width: 100px; }
.assign-col-reason { width: 18%; min-width: 120px; }

.assign-section .crm-col-actions,
.assign-section .col-actions {
  width: 120px;
  min-width: 120px;
}

@media (max-width: 768px) {
  .assign-section__head {
    flex-direction: column;
    align-items: stretch;
  }

  .assign-toolbar,
  .assign-toolbar__search {
    width: 100%;
    max-width: none;
  }

  .assign-toolbar__filter {
    width: 100%;
    max-width: none;
  }
}

/* Active Assignments — enterprise grid */
.assign-active {
  overflow: hidden;
}

.assign-active__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
}

.assign-active__header-main {
  flex: 1;
  min-width: min(100%, 280px);
}

.assign-active__count {
  margin: 0.45rem 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
}

.assign-active__new {
  flex-shrink: 0;
}

.assign-active__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  background: #fafbfc;
}

.assign-active__toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.assign-active__search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 220px;
  min-width: min(100%, 200px);
  max-width: 360px;
}

.assign-active__search > i,
.assign-active__search > svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: #94a3b8;
  pointer-events: none;
  z-index: 1;
}

.assign-active__search .input-field {
  width: 100%;
  height: 2.375rem;
  min-height: 2.375rem;
  padding: 0 0.75rem 0 2.25rem;
  font-size: 0.8125rem;
  line-height: 1.25;
  box-sizing: border-box;
}

.assign-active__select {
  flex: 0 1 150px;
  min-width: 120px;
  height: 2.375rem;
  min-height: 2.375rem;
  padding: 0 2rem 0 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.25;
  box-sizing: border-box;
}

.assign-active__toolbar-filters > .btn-sm,
.assign-active__toolbar-filters > #assignment-filters-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.375rem;
  min-height: 2.375rem;
  padding: 0 0.875rem !important;
  box-sizing: border-box;
  flex-shrink: 0;
}

.assign-active__export {
  flex-shrink: 0;
}

.assign-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  background: #edf9fc;
  border-bottom: 1px solid #c9e8f0;
}

.assign-bulk-bar__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0f4c5c;
}

.assign-bulk-bar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.assign-bulk-bar__title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-right: 0.25rem;
}

.assign-active__table-wrap.crm-table-container {
  isolation: isolate;
  min-height: 480px;
}

.assign-active-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  --crm-table-head-row-h: 36px;
  --crm-table-row-h: 34px;
  --crm-sticky-body-bg: #ffffff;
  --crm-sticky-head-bg: #ffffff;
  --crm-sticky-check-width: 40px;
  --crm-sticky-firm-width: 240px;
  --crm-sticky-check-left: 0;
  --crm-sticky-firm-left: var(--crm-sticky-check-width);
  --crm-sticky-seam-fill: -1px 0 0 #ffffff;
  --crm-sticky-seam-fill-left: -3px 0 0 #ffffff;
  --crm-sticky-inner-edge: inset -1px 0 0 #eef2f7;
  --crm-sticky-frozen-edge: 2px 0 4px -1px rgba(15, 23, 42, 0.08);
  --crm-sticky-frozen-edge-left: -2px 0 4px -1px rgba(15, 23, 42, 0.08);
  --crm-sticky-actions-width: 70px;
  --crm-z-scroll-body: 1;
  --crm-z-sticky-body-1: 10;
  --crm-z-sticky-body-2: 11;
  --crm-z-sticky-body-right: 13;
  --crm-z-head-filter-scroll: 20;
  --crm-z-head-filter: 20;
  --crm-z-head-filter-sticky-1: 30;
  --crm-z-head-filter-sticky-2: 31;
  --crm-z-head-filter-sticky-r: 33;
  --crm-z-head-label-scroll: 40;
  --crm-z-head-label: 40;
  --crm-z-head-label-sticky-1: 50;
  --crm-z-head-label-sticky-2: 51;
  --crm-z-head-label-sticky-r: 53;
}

.assign-active-table col.assign-col-check { width: 40px; }
.assign-active-table col.assign-col-lead { width: 240px; }
.assign-active-table col.assign-col-exec { width: 170px; }
.assign-active-table col.assign-col-num { width: 90px; }
.assign-active-table col.assign-col-status { width: 110px; }
.assign-active-table col.assign-col-date { width: 130px; }
.assign-active-table col.assign-col-more { width: 70px; }

.assign-active-table thead th,
.assign-active-table tbody td {
  box-sizing: border-box;
  height: var(--crm-table-row-h);
  max-height: var(--crm-table-row-h);
  padding: 0 8px;
  margin: 0;
  vertical-align: middle;
  overflow: hidden;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  line-height: 1.25;
  position: static;
  min-width: 0;
  max-width: none;
  width: auto;
  white-space: nowrap;
}

.assign-active-table tbody td:not(.sticky-left):not(.sticky-left-2):not(.sticky-right) {
  position: static;
  z-index: auto;
}

.assign-active-table thead th.sticky-left,
.assign-active-table thead th.sticky-left-2,
.assign-active-table thead th.sticky-right,
.assign-active-table tbody td.sticky-left,
.assign-active-table tbody td.sticky-left-2,
.assign-active-table tbody td.sticky-right {
  background-color: #ffffff !important;
  background-clip: border-box;
  isolation: isolate;
}

/* Thead always paints above tbody when sticky panels overlap during scroll */
.assign-active-table thead {
  position: relative;
  z-index: 20;
}

.assign-active-table tbody {
  position: relative;
  z-index: 10;
}

.assign-active-table thead th {
  position: sticky;
  top: 0;
  z-index: var(--crm-z-head-label);
  background-color: #f8fafc;
  height: var(--crm-table-head-row-h);
  max-height: var(--crm-table-head-row-h);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
  box-shadow: inset 0 -1px 0 #e2e8f0;
  background-clip: padding-box;
}

.assign-active-table thead th.sticky-left,
.assign-active-table thead th.sticky-left-2,
.assign-active-table thead th.sticky-right {
  background-color: #ffffff !important;
}

.assign-active__table-wrap.crm-table-container .assign-active-table thead tr.crm-col-filter-row th {
  position: sticky;
  top: var(--crm-table-head-row-h);
  z-index: var(--crm-z-head-filter);
  height: auto;
  max-height: none;
  padding: 0.2rem 0.35rem 0.28rem !important;
  background: #f8fafc !important;
  box-shadow: inset 0 -1px 0 #e2e8f0;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: none;
  color: inherit;
}

.assign-active-table thead tr.crm-col-filter-row th {
  vertical-align: middle;
  height: auto !important;
  max-height: none !important;
}

.assign-active-table thead tr:first-child th {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  background-color: var(--crm-sticky-head-bg);
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: var(--crm-z-head-label);
}

/* Assignment table — sticky checkbox, lead, and actions columns */
.assign-active-table tbody td.sticky-left {
  position: sticky;
  left: var(--crm-sticky-check-left);
  z-index: var(--crm-z-sticky-body-1);
  width: var(--crm-sticky-check-width);
  min-width: var(--crm-sticky-check-width);
  max-width: var(--crm-sticky-check-width);
  box-shadow: var(--crm-sticky-inner-edge);
  overflow: hidden !important;
}

.assign-active-table tbody td.sticky-left-2 {
  position: sticky;
  left: var(--crm-sticky-firm-left);
  z-index: var(--crm-z-sticky-body-2);
  width: var(--crm-sticky-firm-width);
  min-width: var(--crm-sticky-firm-width);
  max-width: var(--crm-sticky-firm-width);
  box-shadow: var(--crm-sticky-seam-fill), var(--crm-sticky-frozen-edge);
  border-right: 1px solid #e2e8f0;
  overflow: hidden !important;
}

.assign-active-table tbody td.sticky-right {
  position: sticky;
  right: 0;
  z-index: var(--crm-z-sticky-body-right);
  width: var(--crm-sticky-actions-width);
  min-width: var(--crm-sticky-actions-width);
  max-width: var(--crm-sticky-actions-width);
  box-shadow: var(--crm-sticky-seam-fill-left), var(--crm-sticky-frozen-edge-left);
  border-left: 1px solid #e2e8f0;
  overflow: hidden !important;
}

.assign-active-table thead tr:first-child th.sticky-left {
  left: var(--crm-sticky-check-left);
  z-index: var(--crm-z-head-label-sticky-1);
  width: var(--crm-sticky-check-width);
  min-width: var(--crm-sticky-check-width);
  max-width: var(--crm-sticky-check-width);
  box-shadow: var(--crm-sticky-inner-edge), inset 0 -1px 0 #e2e8f0;
}

.assign-active-table thead tr:first-child th.sticky-left-2 {
  left: var(--crm-sticky-firm-left);
  z-index: var(--crm-z-head-label-sticky-2);
  width: var(--crm-sticky-firm-width);
  min-width: var(--crm-sticky-firm-width);
  max-width: var(--crm-sticky-firm-width);
  overflow: hidden !important;
  box-shadow: var(--crm-sticky-seam-fill), var(--crm-sticky-frozen-edge), inset 0 -1px 0 #e2e8f0;
  border-right: 1px solid #e2e8f0;
}

.assign-active-table thead tr:first-child th.sticky-right {
  right: 0;
  z-index: var(--crm-z-head-label-sticky-r);
  width: var(--crm-sticky-actions-width);
  min-width: var(--crm-sticky-actions-width);
  max-width: var(--crm-sticky-actions-width);
  overflow: hidden !important;
  box-shadow: var(--crm-sticky-seam-fill-left), var(--crm-sticky-frozen-edge-left), inset 0 -1px 0 #e2e8f0;
  border-left: 1px solid #e2e8f0;
}

.assign-active-table thead tr.crm-col-filter-row th.sticky-left {
  top: var(--crm-table-head-row-h);
  left: var(--crm-sticky-check-left);
  z-index: var(--crm-z-head-filter-sticky-1);
  width: var(--crm-sticky-check-width);
  min-width: var(--crm-sticky-check-width);
  max-width: var(--crm-sticky-check-width);
  box-shadow: var(--crm-sticky-inner-edge), inset 0 -1px 0 #e2e8f0;
}

.assign-active-table thead tr.crm-col-filter-row th.sticky-left-2 {
  top: var(--crm-table-head-row-h);
  left: var(--crm-sticky-firm-left);
  z-index: var(--crm-z-head-filter-sticky-2);
  width: var(--crm-sticky-firm-width);
  min-width: var(--crm-sticky-firm-width);
  max-width: var(--crm-sticky-firm-width);
  overflow: hidden !important;
  box-shadow: var(--crm-sticky-seam-fill), var(--crm-sticky-frozen-edge), inset 0 -1px 0 #e2e8f0;
  border-right: 1px solid #e2e8f0;
}

.assign-active-table thead tr.crm-col-filter-row th.sticky-right {
  top: var(--crm-table-head-row-h);
  right: 0;
  z-index: var(--crm-z-head-filter-sticky-r);
  width: var(--crm-sticky-actions-width);
  min-width: var(--crm-sticky-actions-width);
  max-width: var(--crm-sticky-actions-width);
  overflow: hidden !important;
  box-shadow: var(--crm-sticky-seam-fill-left), var(--crm-sticky-frozen-edge-left), inset 0 -1px 0 #e2e8f0;
  border-left: 1px solid #e2e8f0;
}

.assign-active-table .crm-table-row.crm-row-menu-open td.sticky-right,
.assign-active-table .crm-table-row.crm-row-menu-open td.assign-col-more,
.assign-active-table .assign-table-row.crm-row-menu-open td.sticky-right,
.assign-active-table .assign-table-row.crm-row-menu-open td.assign-col-more {
  z-index: var(--crm-z-sticky-actions-open, 60);
  overflow: visible !important;
}

.assign-active .assign-table-row:nth-child(even) td.sticky-left,
.assign-active .assign-table-row:nth-child(even) td.sticky-left-2,
.assign-active .assign-table-row:nth-child(even) td.sticky-right,
.assign-active .assign-table-row:hover td.sticky-left,
.assign-active .assign-table-row:hover td.sticky-left-2,
.assign-active .assign-table-row:hover td.sticky-right {
  background-color: #ffffff !important;
}

.assign-active .assign-table-row {
  height: var(--crm-table-row-h);
  transition: background 0.12s ease;
}

.assign-active .assign-table-row:hover {
  background: #f8fdff;
}

.assign-active-table .assign-col-check {
  width: var(--crm-sticky-check-width);
  max-width: var(--crm-sticky-check-width);
  padding: 0 !important;
  text-align: center;
  vertical-align: middle !important;
  line-height: var(--crm-table-row-h);
}

.assign-active-table .assign-col-check input[type="checkbox"] {
  display: inline-block;
  vertical-align: middle;
  margin: 0;
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.assign-active-table th.assign-col-lead,
.assign-active-table td.assign-col-lead {
  text-align: left;
  padding-left: 6px;
  padding-right: 8px;
  width: var(--crm-sticky-firm-width);
  min-width: var(--crm-sticky-firm-width);
  max-width: var(--crm-sticky-firm-width);
}

.assign-lead-name {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.assign-active-table th.assign-col-exec,
.assign-active-table td.assign-col-exec {
  text-align: left;
  width: 170px;
  min-width: 170px;
  max-width: 170px;
  padding-left: 6px;
  padding-right: 6px;
}

.assign-active-table th.assign-col-num,
.assign-active-table td.assign-col-num {
  text-align: center;
  font-variant-numeric: tabular-nums;
  width: 90px;
  min-width: 90px;
  max-width: 90px;
  padding-left: 4px;
  padding-right: 4px;
}

.assign-active-table th.assign-col-status,
.assign-active-table td.assign-col-status {
  text-align: center;
  width: 110px;
  min-width: 110px;
  max-width: 110px;
  padding-left: 4px;
  padding-right: 4px;
}

.assign-active-table th.assign-col-date,
.assign-active-table td.assign-col-date {
  text-align: center;
  font-variant-numeric: tabular-nums;
  width: 130px;
  min-width: 130px;
  max-width: 130px;
  padding-left: 4px;
  padding-right: 4px;
  font-size: 12px;
}

.assign-active-table td.assign-col-date {
  color: #475569;
}

.assign-active-table th.assign-col-more,
.assign-active-table td.assign-col-more {
  width: var(--crm-sticky-actions-width);
  min-width: var(--crm-sticky-actions-width);
  max-width: var(--crm-sticky-actions-width);
  padding: 0 !important;
  text-align: center;
  vertical-align: middle !important;
  line-height: var(--crm-table-row-h);
  overflow: hidden;
}

.assign-active-table td.assign-col-more .crm-actions-menu,
.assign-active-table td.assign-col-more .cam-actions-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  line-height: 1;
}

.assign-lead-name,
.assign-active-table .assign-cell-text {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assign-lead-name {
  font-weight: 600;
  color: #0f172a;
  font-size: 13px;
}

.assign-active-table .assign-cell-text {
  font-size: 13px;
}

.assign-cell-empty {
  color: #94a3b8;
  font-size: 13px;
}

.assign-active-table .assign-col-status .badge {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  min-height: 0;
}

.assign-active-table thead .crm-col-filter-input {
  height: 1.45rem;
  min-height: 1.45rem;
  padding: 0.1rem 0.35rem;
  font-size: 12px;
  border-radius: 4px;
}

.assign-active-table thead .crm-col-filter-select {
  padding-right: 1.1rem;
}

.assign-active-table thead .crm-col-filter-reset.crm-toolbar-icon-btn {
  width: 1.45rem;
  height: 1.45rem;
  min-width: 1.45rem;
  min-height: 1.45rem;
  padding: 0 !important;
}

.assign-active-table thead .crm-col-filter-reset.crm-toolbar-icon-btn .h-4,
.assign-active-table thead .crm-col-filter-reset.crm-toolbar-icon-btn svg {
  width: 0.8rem;
  height: 0.8rem;
}

.assign-active .crm-actions-menu,
.assign-active .cam-actions-menu {
  min-width: 1.5rem;
  min-height: 1.5rem;
}

.assign-active .crm-actions-trigger,
.assign-active .cam-actions-trigger {
  width: 1.625rem;
  height: 1.625rem;
  min-width: 1.625rem;
  min-height: 1.625rem;
  border-radius: 6px;
}

.assign-active .crm-actions-trigger .h-4,
.assign-active .cam-actions-trigger .h-4,
.assign-active .crm-actions-trigger svg,
.assign-active .cam-actions-trigger svg {
  width: 0.875rem;
  height: 0.875rem;
}

.assign-active-table .assign-row-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.assign-active-table td.assign-col-more .crm-actions-dropdown {
  position: fixed;
}

.assign-active__footer {
  padding: 0;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

.assign-active__pagination.cam-pagination,
.assign-active__pagination.listing-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}

.assign-active__pagination .cam-pagination-summary {
  margin: 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.assign-active__pagination .cam-pagination-nav {
  margin-left: auto;
}

.assign-active__cards {
  display: none;
  padding: 0.75rem;
  gap: 0.65rem;
}

.assign-mobile-card {
  border: 1px solid #e8edf2;
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
  background: #fff;
}

.assign-mobile-card__top {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.assign-mobile-card__check {
  padding-top: 0.15rem;
}

.assign-mobile-card__title {
  flex: 1;
  min-width: 0;
}

.assign-mobile-card__exec {
  margin: 0.15rem 0 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.assign-mobile-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid #f1f5f9;
  font-size: 0.75rem;
  color: #64748b;
}

.assign-mobile-card__meta strong {
  color: #0f172a;
}

.assign-mobile-card__date {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.assign-mobile-empty {
  text-align: center;
  color: #94a3b8;
  padding: 1.5rem;
  font-size: 0.875rem;
}

@media (max-width: 900px) {
  .assign-active__toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .assign-active__toolbar-filters {
    width: 100%;
  }

  .assign-active__search {
    max-width: none;
    flex-basis: 100%;
  }

  .assign-active__select {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 0;
  }

  .assign-active__export {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .assign-active__table-wrap {
    display: none;
  }

  .assign-active__cards {
    display: flex;
    flex-direction: column;
  }

  .assign-active__header {
    flex-direction: column;
    align-items: stretch;
  }

  .assign-active__new {
    align-self: flex-end;
  }

  .assign-active__pagination {
    flex-direction: column;
    align-items: stretch !important;
  }

  .assign-active__pagination .cam-pagination-nav {
    margin-left: 0;
    justify-content: center;
  }
}

/* ─── Instant CRM tooltips (replaces delayed native title) ─── */
#crm-instant-tooltip {
  position: fixed;
  z-index: 10050;
  max-width: min(280px, 90vw);
  padding: 0.375rem 0.625rem;
  border-radius: 8px;
  background: #0f172a;
  color: #f8fafc;
  font-family: var(--crm-font-family);
  font-size: var(--crm-font-size-tooltip);
  font-weight: var(--crm-font-weight-tooltip);
  line-height: var(--crm-line-height-body);
  letter-spacing: var(--crm-letter-spacing);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: none;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  white-space: pre-wrap;
  word-break: break-word;
}

#crm-instant-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
}

#crm-instant-tooltip::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
}

#crm-instant-tooltip[data-placement='top']::after {
  top: 100%;
  border-top-color: #0f172a;
}

#crm-instant-tooltip[data-placement='bottom']::after {
  bottom: 100%;
  border-bottom-color: #0f172a;
}

/* Daily Employee Targets */
.assign-daily-targets-card { padding: 0.85rem 1rem; }
.assign-productivity-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  background: #f8fafc;
}
.assign-productivity-summary__title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.45rem;
}
.assign-productivity-summary__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 0.75rem;
  margin: 0;
}
.assign-productivity-summary__grid dt {
  font-size: 0.72rem;
  color: #64748b;
}
.assign-productivity-summary__grid dd {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.assign-productivity-summary__note {
  margin-top: 0.5rem;
  font-size: 0.72rem;
  color: #b45309;
}
.assign-yearly-target-preview {
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  background: #f8fafc;
  padding: 0.75rem 0.85rem;
}
.assign-yearly-target-preview__title {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #0f172a;
}
.assign-yearly-target-preview__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.75rem;
}
.assign-yearly-target-preview__grid dt {
  font-size: 0.68rem;
  color: #64748b;
  font-weight: 600;
}
.assign-yearly-target-preview__grid dd {
  margin: 0.1rem 0 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
}
.assign-daily-targets-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.assign-daily-targets-actions { display: flex; gap: 0.4rem; align-items: center; }
.assign-daily-targets-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}
.assign-daily-targets-kpi {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: #fff;
  font-size: 0.72rem;
  color: #64748b;
}
.assign-daily-targets-kpi__value { font-weight: 700; color: #0f172a; font-size: 0.78rem; }
.assign-daily-targets-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}
.assign-daily-targets-toolbar .input-field-sm { min-width: 7rem; max-width: 9rem; padding-top: 0.3rem; padding-bottom: 0.3rem; font-size: 0.78rem; }
.assign-daily-targets-table-wrap { max-height: 16rem; overflow: auto; }
.assign-daily-targets-table--compact th,
.assign-daily-targets-table--compact td { padding: 0.35rem 0.45rem; font-size: 0.78rem; vertical-align: middle; }
.assign-daily-target-metric-compact { white-space: nowrap; color: #334155; font-variant-numeric: tabular-nums; }
.assign-daily-target-metric-compact--empty { color: #94a3b8; }
.assign-daily-target-progress { min-width: 4.5rem; }
.assign-daily-target-progress__pct { font-size: 0.72rem; font-weight: 600; color: #0f172a; }
.assign-daily-target-bar {
  height: 0.25rem;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-top: 0.15rem;
}
.assign-daily-target-bar__fill { height: 100%; border-radius: inherit; background: #2563eb; }
.assign-daily-target-status {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}
.assign-daily-target-status--not_started { background: #f1f5f9; color: #64748b; }
.assign-daily-target-status--in_progress { background: #dbeafe; color: #1d4ed8; }
.assign-daily-target-status--completed { background: #dcfce7; color: #15803d; }
.assign-daily-target-status--exceeded { background: #ccfbf1; color: #0f766e; }
.assign-daily-target-status--missed { background: #fee2e2; color: #b91c1c; }
.assign-daily-target-status--no_target { background: #f8fafc; color: #94a3b8; }

.demo-calendar-card { overflow: hidden; }
.demo-cal-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.demo-cal-head__actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.demo-cal-view-tabs { display: inline-flex; gap: 0.25rem; background: #f1f5f9; padding: 0.2rem; border-radius: 9999px; }
.demo-cal-view-tab { border: 0; background: transparent; padding: 0.35rem 0.75rem; border-radius: 9999px; font-size: 0.78rem; color: #64748b; cursor: pointer; }
.demo-cal-view-tab.active { background: #fff; color: #0f172a; box-shadow: 0 1px 2px rgb(15 23 42 / 0.08); }
.demo-cal-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: 0.5rem; margin-bottom: 1rem; }
.demo-cal-kpi { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.75rem; padding: 0.55rem 0.7rem; display: flex; flex-direction: column; gap: 0.15rem; }
.demo-cal-kpi span { font-size: 0.72rem; color: #64748b; }
.demo-cal-kpi strong { font-size: 1rem; color: #0f172a; }
.demo-cal-kpi--warn strong { color: #b45309; }
.demo-cal-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.demo-cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 14rem; gap: 1rem; }
.demo-cal-week { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.75rem; }
.demo-cal-day-col { border: 1px solid #e2e8f0; border-radius: 0.75rem; padding: 0.65rem; background: #fff; min-height: 8rem; }
.demo-cal-day-title { font-size: 0.78rem; font-weight: 700; color: #334155; margin-bottom: 0.5rem; }
.demo-cal-event { border: 1px solid #dbeafe; background: #eff6ff; border-radius: 0.65rem; padding: 0.55rem 0.65rem; margin-bottom: 0.5rem; }
.demo-cal-event__head { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.72rem; }
.demo-cal-event__firm { font-weight: 600; font-size: 0.82rem; margin-top: 0.25rem; }
.demo-cal-event__meta { font-size: 0.72rem; color: #64748b; }
.demo-cal-event__actions { display: flex; gap: 0.35rem; margin-top: 0.45rem; }
.demo-cal-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 9999px; border: 1px solid #cbd5e1; background: #fff; color: #334155; }
.demo-cal-slot--available, .demo-cal-event.demo-cal-slot--available { background: #ecfdf5; border-color: #a7f3d0; }
.demo-cal-slot--scheduled, .demo-cal-event.demo-cal-slot--scheduled { background: #eff6ff; border-color: #93c5fd; }
.demo-cal-slot--completed, .demo-cal-event.demo-cal-slot--completed { background: #f5f3ff; border-color: #c4b5fd; }
.demo-cal-slot--rescheduled, .demo-cal-event.demo-cal-slot--rescheduled { background: #fff7ed; border-color: #fdba74; }
.demo-cal-slot--cancelled, .demo-cal-event.demo-cal-slot--cancelled,
.demo-cal-slot--missed, .demo-cal-event.demo-cal-slot--missed { background: #fef2f2; border-color: #fca5a5; }
.demo-cal-slot--break { background: #f1f5f9; border-color: #cbd5e1; }
.demo-cal-side { border: 1px solid #e2e8f0; border-radius: 0.75rem; padding: 0.75rem; background: #f8fafc; }
.demo-cal-slots-list { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.5rem; }
.demo-cal-slot-btn { border: 1px solid #bbf7d0; background: #ecfdf5; color: #047857; border-radius: 0.5rem; padding: 0.4rem 0.55rem; font-size: 0.78rem; text-align: left; }
.demo-provider-settings-card { border: 1px solid #e2e8f0; border-radius: 0.75rem; padding: 1rem; margin-bottom: 1rem; }
.demo-provider-settings-card__head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
@media (max-width: 900px) {
  .demo-cal-layout { grid-template-columns: 1fr; }
}
.assign-daily-targets-history-toggle summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  user-select: none;
}
.assign-daily-targets-history-toggle summary:hover { color: #0f172a; }
.emp-daily-target-card { padding: 0; }
#emp-daily-targets-panel.emp-daily-targets-panel--empty,
#emp-daily-targets-panel.emp-daily-targets-panel--compact {
  padding: 0.7rem 0.95rem !important;
  border: 1px solid #99f6e4;
  border-left: 3px solid #0d9488;
  box-shadow: none;
}
.emp-daily-target-card--empty {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
}
.emp-daily-target-empty__title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 650;
  color: #1e293b;
  white-space: nowrap;
}
.emp-daily-target-empty__msg {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: #64748b;
}

/* Compact Daily Target (filled) */
.emp-dt { display: flex; flex-direction: column; gap: 0.65rem; }
.emp-dt__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
}
.emp-dt__title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 650;
  color: #0f172a;
}
.emp-dt__meta {
  margin: 0;
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.3;
}
.emp-dt__section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0.55rem;
  border-top: 1px solid #eef2f7;
}
.emp-dt__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.emp-dt__section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}
.emp-dt__stats {
  display: grid;
  gap: 0.4rem 0.65rem;
}
.emp-dt__stats--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.emp-dt__stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.emp-dt__stat {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.emp-dt__k {
  font-size: 0.68rem;
  color: #94a3b8;
  line-height: 1.2;
}
.emp-dt__v {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.emp-dt__stat--progress .emp-dt__bar { margin-top: 0.25rem; }
.emp-dt__bar {
  height: 4px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.emp-dt__bar-fill {
  height: 100%;
  border-radius: inherit;
  background: #0d9488;
}
.emp-dt__metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem 0.65rem;
  margin-top: 0.15rem;
}
.emp-dt__metric {
  min-width: 0;
  padding: 0.35rem 0.45rem;
  border-radius: 0.45rem;
  background: #f8fafc;
}
.emp-dt__metric-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}
.emp-dt__metric-label {
  font-size: 0.68rem;
  color: #64748b;
  font-weight: 600;
}
.emp-dt__metric-value {
  font-size: 0.75rem;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .emp-dt__stats--4,
  .emp-dt__stats--3,
  .emp-dt__metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ─── CRM Typography System — see typography.css ─── */
@import url('./typography-enforcement.css');

/* ─── Master Data: Team Size column ─── */
.crm-col-team-size { width: 9.5rem; min-width: 9.5rem; }
.cam-td-team-size { vertical-align: middle; }
.cam-team-size-cell {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.125rem 0.45rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}
.cam-team-size-cell__label,
.cam-team-size-cell__full,
.cam-team-size-cell__compact {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cam-team-size-cell__compact { display: none; }
.cam-inline-team-size-btn {
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
}
.cam-inline-team-size-btn:hover { background: #f1f5f9; border-radius: 0.3rem; }
.cam-inline-team-size-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.cam-inline-team-size-input {
  width: 4.5rem;
  min-height: 1.75rem !important;
  font-size: 0.75rem !important;
  padding: 0.15rem 0.35rem !important;
}
.cam-inline-team-size-btn.is-loading { opacity: 0.55; pointer-events: none; }

/* ─── Master Data: Team Members drawer (assignment detail modal) ─── */
.crm-col-team-members { width: 9.5rem; min-width: 9.5rem; }
.cam-td-team-members { vertical-align: middle; }
.cam-team-members-btn {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.25rem 0.625rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.cam-team-members-btn:hover,
.cam-team-members-btn:focus-visible {
  border-color: #99f6e4;
  background: #f0fdfa;
  box-shadow: 0 0 0 3px rgb(37 183 167 / 0.12);
  outline: none;
}
.cam-team-members-btn--empty { color: #64748b; background: #f8fafc; }
.cam-team-members-btn--single,
.cam-team-members-btn--multi { color: #0f766e; }
.cam-team-members-btn__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cam-team-drawer-list { min-height: 4rem; }
.cam-team-drawer-loading,
.cam-team-drawer-empty {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 5rem; padding: 1rem; text-align: center; color: #64748b; font-size: 13px;
}
.cam-team-member-card { border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; padding: 0.875rem 1rem; }
.cam-team-member-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.375rem; }
.cam-team-member-name { font-size: 14px; font-weight: 700; color: #0f172a; }
.cam-team-owner-badge {
  display: inline-flex; padding: 0.125rem 0.5rem; border-radius: 999px;
  background: #ecfdf5; color: #047857; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.cam-team-member-role { display: block; margin-bottom: 0.375rem; color: #64748b; font-size: 12px; }
.cam-team-member-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.cam-team-member-date { color: #94a3b8; font-size: 11px; }
.cam-team-member-note { display: block; margin-top: 0.375rem; color: #b45309; font-size: 11px; }
.cam-team-avail {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.cam-team-avail--available { color: #059669; }
.cam-team-avail--busy { color: #d97706; }
.cam-team-avail--leave { color: #dc2626; }
.cam-team-avail--offline { color: #64748b; }

/* ─── Master Data: Last Activity column ─── */
.crm-col-last-activity { width: 7.5rem; min-width: 7.5rem; }
.cam-td-last-activity { vertical-align: middle; }
.cam-last-activity {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0;
  max-width: 100%; padding: 0.1rem 0.35rem; border: 0; border-radius: 6px;
  background: transparent; text-align: left; cursor: pointer;
}
.cam-last-activity:hover,
.cam-last-activity:focus-visible {
  background: #f8fafc; outline: none; box-shadow: inset 0 0 0 1px #e2e8f0;
}
.cam-last-activity--none { color: #94a3b8; font-size: 11px; font-weight: 600; cursor: default; }
.cam-last-activity__badge { font-size: 11px; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.cam-last-activity__time { font-size: 11px; font-weight: 600; color: #64748b; line-height: 1.1; margin-top: 1px; }
.cam-last-activity--today .cam-last-activity__badge { color: #059669; }
.cam-last-activity--yesterday .cam-last-activity__badge { color: #2563eb; }
.cam-last-activity--recent .cam-last-activity__badge { color: #d97706; }
.cam-last-activity--old .cam-last-activity__badge { color: #dc2626; }
.cam-activity-timeline-list { display: flex; flex-direction: column; gap: 0.625rem; max-height: 28rem; overflow-y: auto; }
.cam-activity-timeline-loading,
.cam-activity-timeline-empty {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 5rem; color: #64748b; font-size: 13px;
}
.cam-activity-timeline-group {
  margin-top: 0.375rem; font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: #94a3b8;
}
.cam-activity-timeline-item {
  display: grid; grid-template-columns: auto 1fr; gap: 0.75rem; align-items: start;
  padding: 0.75rem; border: 1px solid #f1f5f9; border-radius: 12px; background: #fff;
}
.cam-activity-timeline-icon { font-size: 1.125rem; line-height: 1; padding-top: 0.125rem; }
.cam-activity-timeline-title { font-size: 13px; font-weight: 700; color: #0f172a; }
.cam-activity-timeline-meta { font-size: 12px; color: #64748b; margin-top: 0.125rem; }
.cam-activity-timeline-note { font-size: 12px; color: #475569; margin-top: 0.375rem; max-width: 100%; }

/* ─── Master Data hub: enterprise compact table density ─── */
#cam-hub.cam-hub--compact .cam-cell-text.cam-cell-mono.text-slate-500,
#cam-hub.cam-hub--compact .crm-td-date .cam-cell-text {
  font-size: var(--crm-master-table-secondary-font-size, 11px);
}

#cam-hub.cam-hub--compact .lead-quick-cell {
  width: 46px;
  max-width: 46px;
  min-width: 46px;
  padding: 0 4px !important;
}

#cam-hub.cam-hub--compact .lead-quick-btn {
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 5px;
}

#cam-hub.cam-hub--compact .lead-quick-btn .h-4,
#cam-hub.cam-hub--compact .cam-actions-trigger .h-4,
#cam-hub.cam-hub--compact .cam-actions-trigger .h-3\.5 {
  width: 0.875rem;
  height: 0.875rem;
}

#cam-hub.cam-hub--compact .crm-actions-trigger,
#cam-hub.cam-hub--compact .cam-actions-trigger {
  width: 1.5rem;
  height: 1.5rem;
  min-width: 1.5rem;
  min-height: 1.5rem;
  border-radius: 5px;
}

#cam-hub.cam-hub--compact .crm-td-actions--cluster {
  gap: 0.15rem;
}

#cam-hub.cam-hub--compact .cam-cell-badge .badge,
#cam-hub.cam-hub--compact .crm-td-status .badge {
  font-size: 11px;
  padding: 0.1rem 0.35rem;
  border-radius: 5px;
  line-height: 1.2;
}

#cam-hub.cam-hub--compact .crm-col-filter-select {
  height: 2.125rem;
  min-height: 2.125rem;
  max-height: 2.125rem;
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
  font-size: var(--crm-master-table-font-size, 13px);
}

/* Master Data — enterprise display-only data grid */
#cam-hub .cam-master-data-row {
  cursor: default;
}

#cam-hub .cam-master-data-row:hover {
  background: #f8fafc;
}

#cam-hub .cam-master-data-row:nth-child(even) {
  background: #fafbfc;
}

#cam-hub .cam-master-data-row:nth-child(even):hover {
  background: #f1f5f9;
}

#cam-hub .cam-master-data-row:hover td.sticky-left,
#cam-hub .cam-master-data-row:hover td.sticky-left-2,
#cam-hub .cam-master-data-row:hover td.sticky-left-3,
#cam-hub .cam-master-data-row:hover td.cam-col-google,
#cam-hub .cam-master-data-row:hover td.sticky-right {
  background-color: #f8fafc !important;
}

#cam-hub .cam-master-data-row:nth-child(even):hover td.sticky-left,
#cam-hub .cam-master-data-row:nth-child(even):hover td.sticky-left-2,
#cam-hub .cam-master-data-row:nth-child(even):hover td.sticky-left-3,
#cam-hub .cam-master-data-row:nth-child(even):hover td.cam-col-google,
#cam-hub .cam-master-data-row:nth-child(even):hover td.sticky-right {
  background-color: #f1f5f9 !important;
}

#cam-hub .cam-master-data-row:nth-child(even) td.sticky-left,
#cam-hub .cam-master-data-row:nth-child(even) td.sticky-left-2,
#cam-hub .cam-master-data-row:nth-child(even) td.sticky-left-3,
#cam-hub .cam-master-data-row:nth-child(even) td.cam-col-google,
#cam-hub .cam-master-data-row:nth-child(even) td.sticky-right {
  background-color: #fafbfc !important;
}

#cam-hub .cam-master-data-row td.cam-master-data-cell {
  cursor: default;
  color: #334155;
  font-weight: 400;
}

#cam-hub .cam-master-data-row td.cam-master-data-cell a {
  color: inherit;
  text-decoration: none;
  pointer-events: none;
  cursor: default;
}

#cam-hub .cam-master-data-row .cam-master-display-text,
#cam-hub .cam-master-data-row .cam-cell-text,
#cam-hub .cam-master-data-row .truncate-cell {
  color: #334155;
  text-decoration: none;
}

#cam-hub .cam-master-data-row .cam-master-display-text:hover,
#cam-hub .cam-master-data-row .cam-cell-text:hover,
#cam-hub .cam-master-data-row .truncate-cell:hover {
  text-decoration: none;
  color: #334155;
}

#cam-hub .cam-master-data-row .cam-team-size-cell,
#cam-hub .cam-master-data-row .cam-inline-team-size-btn {
  border: 0;
  background: transparent;
  padding: 0;
  font-weight: 500;
  color: #475569;
}
#cam-hub .cam-master-data-row .cam-inline-team-size-btn { cursor: pointer; }
#cam-hub .cam-master-data-row .cam-inline-team-size-btn:hover {
  background: #f1f5f9;
  border-radius: 0.3rem;
}

#cam-hub .cam-master-data-row .cam-last-activity--static {
  cursor: default;
  pointer-events: auto;
  padding: 0;
}

#cam-hub .cam-master-data-row .cam-last-activity--static:hover,
#cam-hub .cam-master-data-row .cam-last-activity--static:focus-visible {
  background: transparent;
  box-shadow: none;
}

#cam-hub .cam-master-data-row .cam-cell-badge .badge {
  cursor: default;
  pointer-events: none;
}

#cam-hub .cam-master-data-row .cam-cell-rating {
  cursor: default;
  color: #64748b;
  letter-spacing: 0.02em;
}

#cam-hub .cam-master-data-row.selected {
  background: #fafbfc;
  box-shadow: none;
}

#cam-hub .cam-master-data-row.selected td.sticky-left,
#cam-hub .cam-master-data-row.selected td.sticky-left-2,
#cam-hub .cam-master-data-row.selected td.sticky-left-3,
#cam-hub .cam-master-data-row.selected td.cam-col-google,
#cam-hub .cam-master-data-row.selected td.sticky-right {
  background-color: inherit !important;
}

/* Master Data — compact sticky Google + Actions utility columns */
#cam-hub .crm-table col.cam-col-google {
  width: var(--crm-col-google-width, 72px);
}

#cam-hub .crm-table thead th.cam-col-google,
#cam-hub .crm-table tbody td.cam-col-google,
#cam-hub .ca-table--enterprise thead th.cam-col-google,
#cam-hub .ca-table--enterprise tbody td.cam-col-google {
  width: var(--crm-col-google-width, 72px) !important;
  min-width: var(--crm-col-google-width, 72px) !important;
  max-width: var(--crm-col-google-width, 72px) !important;
  padding: 0 !important;
  text-align: center;
  vertical-align: middle;
  overflow: hidden !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-clip: border-box !important;
  border-left: none;
}

#cam-hub .crm-table thead th.cam-col-google.crm-th-research,
#cam-hub .crm-table thead th.cam-col-google.crm-th-google {
  font-size: var(--crm-master-table-header-font-size, 13px);
  font-weight: 600;
  letter-spacing: var(--crm-letter-spacing);
  line-height: 1.2;
  white-space: nowrap;
}

#cam-hub td.cam-col-google.lead-quick-cell {
  width: var(--crm-col-google-width, 72px) !important;
  min-width: var(--crm-col-google-width, 72px) !important;
  max-width: var(--crm-col-google-width, 72px) !important;
  padding: 0 !important;
}

#cam-hub td.cam-col-google .lead-quick-btn {
  width: 1.75rem;
  height: 1.75rem;
  margin: 0 auto;
}

#cam-hub .crm-table-row.crm-row-menu-open td.cam-col-google,
#cam-hub .crm-table-row.crm-row-menu-open td.sticky-right {
  z-index: var(--crm-z-sticky-actions-open) !important;
}

@media (min-width: 1101px) {
  #cam-hub .crm-table thead th.cam-col-google,
  #cam-hub .crm-table tbody td.cam-col-google,
  #cam-hub .ca-table--enterprise thead th.cam-col-google,
  #cam-hub .ca-table--enterprise tbody td.cam-col-google {
    position: sticky;
    right: var(--crm-col-actions-width);
    z-index: calc(var(--crm-z-sticky-body-right) - 1);
    box-shadow: -5px 0 12px -8px rgba(15, 23, 42, 0.14);
  }

  #cam-hub .crm-table thead tr:first-child th.cam-col-google,
  #cam-hub .ca-table--enterprise thead tr:first-child th.cam-col-google {
    top: 0;
    z-index: calc(var(--crm-z-head-label-sticky-r) - 1);
    background: #ffffff !important;
    box-shadow: -5px 0 12px -8px rgba(15, 23, 42, 0.14), inset 0 -1px 0 #e2e8f0;
  }

  #cam-hub .crm-table thead tr.crm-col-filter-row th.cam-col-google,
  #cam-hub .ca-table--enterprise thead tr.crm-col-filter-row th.cam-col-google {
    top: var(--crm-table-head-row-h);
    z-index: calc(var(--crm-z-head-filter-sticky-r) - 1);
    background: #ffffff !important;
    box-shadow: -5px 0 12px -8px rgba(15, 23, 42, 0.14), inset 0 -1px 0 #e2e8f0;
  }
}

@media (max-width: 1100px) {
  #cam-hub .crm-table thead th.cam-col-google,
  #cam-hub .crm-table tbody td.cam-col-google,
  #cam-hub .ca-table--enterprise thead th.cam-col-google,
  #cam-hub .ca-table--enterprise tbody td.cam-col-google {
    position: static;
    right: auto;
    z-index: auto;
    box-shadow: none;
  }

  #cam-hub.cam-hub--compact .crm-table thead th.sticky-right,
  #cam-hub.cam-hub--compact .crm-table tbody td.sticky-right {
    box-shadow: -5px 0 12px -8px rgba(15, 23, 42, 0.14) !important;
  }

  #cam-hub.cam-hub--compact .crm-table thead tr:first-child th.sticky-right {
    box-shadow: -5px 0 12px -8px rgba(15, 23, 42, 0.14), inset 0 -1px 0 #e2e8f0 !important;
  }

  #cam-hub.cam-hub--compact .crm-table thead tr.crm-col-filter-row th.sticky-right {
    box-shadow: -5px 0 12px -8px rgba(15, 23, 42, 0.14), inset 0 -1px 0 #e2e8f0 !important;
  }
}

@media (max-width: 1024px) {
  .crm-col-team-size { width: 5.5rem; min-width: 5.5rem; }
  .cam-team-size-cell { font-size: 10px; padding-inline: 0.35rem; }
  .cam-team-size-cell__full { display: none; }
  .cam-team-size-cell__compact { display: inline; }
  .crm-col-team-members { width: 8rem; min-width: 8rem; }
  .crm-col-last-activity { width: 6.75rem; min-width: 6.75rem; }
  .cam-team-members-btn { font-size: 11px; padding-inline: 0.5rem; }
  .cam-last-activity__badge { font-size: 10px; }
  .cam-last-activity__time { font-size: 10px; }
}

/* Demo Calendar Page (SPA — mock data only) */
.demo-calendar-dash-entry { padding: 0; overflow: hidden; }
.demo-calendar-dash-entry__btn {
  display: flex; align-items: center; gap: 1rem; width: 100%; padding: 1rem 1.25rem;
  border: 0; background: transparent; text-align: left; cursor: pointer; transition: background 0.15s;
}
.demo-calendar-dash-entry__btn:hover,
.demo-calendar-dash-entry__btn:focus-visible { background: #f8fafc; outline: none; box-shadow: inset 0 0 0 2px rgb(59 130 246 / 0.35); }
.demo-calendar-dash-entry__icon {
  display: flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem;
  border-radius: 0.75rem; background: #eff6ff; flex-shrink: 0;
}
.demo-calendar-dash-entry__body { flex: 1; min-width: 0; }
.demo-calendar-dash-entry__title { display: block; font-size: 0.95rem; font-weight: 700; color: #0f172a; }
.demo-calendar-dash-entry__desc { display: block; font-size: 0.78rem; color: #64748b; margin-top: 0.15rem; }
.demo-calendar-dash-entry__arrow { color: #94a3b8; flex-shrink: 0; }

.dcp-page { padding: 0.85rem 1rem; display: flex; flex-direction: column; gap: 0.65rem; min-height: calc(100vh - 8rem); background: #fff; color: #0f172a; }
.dcp-header { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; padding-bottom: 0.35rem; border-bottom: 1px solid #e2e8f0; }
.dcp-header__heading { display: flex; align-items: center; gap: 0.45rem; font-size: 1.05rem; font-weight: 700; color: #0f172a; margin: 0; }
.dcp-export-icons { display: inline-flex; align-items: center; gap: 0.35rem; flex-shrink: 0; }
.dcp-top { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.dcp-month-nav { display: flex; align-items: center; gap: 0.35rem; }
.dcp-month-input { width: 9.5rem; }
.dcp-top-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-left: auto; justify-content: flex-end; }

.dcp-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.5rem; }
.dcp-kpi {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.65rem;
  border: 1px solid #e2e8f0; border-radius: 0.55rem; background: #fff;
}
.dcp-kpi__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 0.45rem; background: #f1f5f9; color: #475569; flex-shrink: 0;
}
.dcp-kpi--brand .dcp-kpi__icon { background: #eff6ff; color: #1d4ed8; }
.dcp-kpi--blue .dcp-kpi__icon { background: #eff6ff; color: #2563eb; }
.dcp-kpi--green .dcp-kpi__icon { background: #ecfdf5; color: #059669; }
.dcp-kpi--slate .dcp-kpi__icon { background: #f1f5f9; color: #64748b; }
.dcp-kpi--red .dcp-kpi__icon { background: #fef2f2; color: #dc2626; }
.dcp-kpi--orange .dcp-kpi__icon { background: #fff7ed; color: #ea580c; }
.dcp-kpi__body { min-width: 0; }
.dcp-kpi__label { display: block; font-size: 0.65rem; color: #64748b; line-height: 1.2; }
.dcp-kpi__value { display: block; font-size: 1.1rem; font-weight: 700; color: #0f172a; line-height: 1.2; }

.dcp-search-bar { display: flex; flex-direction: column; gap: 0.45rem; padding: 0.55rem 0.65rem; border: 1px solid #e2e8f0; border-radius: 0.55rem; background: #f8fafc; }
.dcp-search-row { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.dcp-search-input { flex: 1; min-width: 10rem; }
.dcp-search-select { min-width: 7.5rem; }
.dcp-search-date { width: 9rem; }

.dcp-filters { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.dcp-filter-btn {
  border: 1px solid #e2e8f0; background: #fff; border-radius: 9999px; padding: 0.28rem 0.7rem;
  font-size: 0.72rem; font-weight: 500; color: #475569; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s;
}
.dcp-filter-btn:hover { border-color: #cbd5e1; }
.dcp-filter-btn.active { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; box-shadow: 0 1px 2px rgb(15 23 42 / 0.06); }
.dcp-filter-btn:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }

.dcp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: 0.65rem; flex: 1; min-height: 0; }
.dcp-main { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; min-height: 0; }

.dcp-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap;
  padding: 0.15rem 0 0.35rem; border-bottom: 1px solid #e2e8f0;
}
.dcp-toolbar-title { font-size: 0.92rem; font-weight: 700; color: #0f172a; text-align: left; flex: 1; min-width: 8rem; margin: 0; }
.dcp-view-tabs { display: inline-flex; gap: 0.2rem; background: #f1f5f9; padding: 0.2rem; border-radius: 0.5rem; }
.dcp-view-tab {
  border: 0; background: transparent; padding: 0.32rem 0.65rem; border-radius: 0.4rem;
  font-size: 0.75rem; color: #64748b; cursor: pointer;
}
.dcp-view-tab.active { background: #fff; color: #0f172a; box-shadow: 0 1px 2px rgb(15 23 42 / 0.08); }
.dcp-view-tab:focus-visible { outline: 2px solid #3b82f6; outline-offset: 1px; }
.dcp-body { flex: 1; min-height: 0; overflow: auto; }

.dcp-queue { padding: 0; overflow: hidden; align-self: start; position: sticky; top: 0.5rem; max-height: calc(100vh - 10rem); display: flex; flex-direction: column; }
.dcp-queue-head { padding: 0.55rem 0.65rem; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
.dcp-queue-title { display: flex; align-items: center; gap: 0.35rem; font-size: 0.82rem; font-weight: 700; color: #0f172a; margin: 0; }
.dcp-queue-list { overflow: auto; padding: 0.35rem 0; flex: 1; }
.dcp-queue-empty { font-size: 0.75rem; color: #94a3b8; text-align: center; padding: 1rem 0.65rem; margin: 0; }
.dcp-queue-item {
  display: grid; grid-template-columns: 1fr; gap: 0.1rem; width: 100%; border: 0; background: transparent;
  text-align: left; padding: 0.45rem 0.65rem; cursor: pointer; font-size: 0.75rem;
}
.dcp-queue-item:hover { background: #f8fafc; }
.dcp-queue-item__time { font-weight: 700; color: #0f172a; font-size: 0.78rem; }
.dcp-queue-item__firm { color: #334155; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcp-queue-item__exec { color: #64748b; font-size: 0.7rem; }
.dcp-queue-item__status { font-size: 0.68rem; font-weight: 600; }
.dcp-queue-divider { height: 1px; background: #f1f5f9; margin: 0 0.65rem; }

.dcp-demo-card {
  display: flex; flex-direction: column; gap: 0.08rem; width: 100%; border: 1px solid; border-radius: 0.4rem;
  padding: 0.35rem 0.45rem; text-align: left; cursor: pointer; font-size: 0.68rem; line-height: 1.25;
  color: #0f172a; appearance: none; font-family: inherit;
}
.dcp-demo-card--compact { font-size: 0.62rem; padding: 0.2rem 0.3rem; gap: 0.04rem; }
.dcp-demo-card--compact .dcp-demo-card__meta { display: none; }
.dcp-demo-card--compact .dcp-demo-card__foot { margin-top: 0.05rem; }
.dcp-demo-card--week {
  font-size: 0.62rem; padding: 0.28rem 0.35rem; gap: 0.12rem;
  min-height: 4.5rem; height: auto; width: 100%; box-sizing: border-box;
}
.dcp-demo-card--week .dcp-demo-card__firm {
  white-space: normal; overflow: hidden; text-overflow: unset;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  line-height: 1.2; font-size: 0.62rem;
}
.dcp-demo-card--week .dcp-demo-card__foot { margin-top: auto; }
.dcp-demo-card--week .dcp-status-pill { font-size: 0.58rem; max-width: 100%; }
.dcp-demo-card:hover { z-index: 5; box-shadow: 0 2px 8px rgb(15 23 42 / 0.12); }
.dcp-demo-card__time { font-weight: 700; color: #0f172a; font-size: 0.72rem; }
.dcp-demo-card__firm { font-weight: 600; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcp-demo-card__meta { color: #64748b; font-size: 0.65rem; }
.dcp-demo-card__foot { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; margin-top: 0.15rem; }
.dcp-status-pill {
  display: inline-flex; align-items: center; border: 1px solid; border-radius: 9999px;
  padding: 0.05rem 0.35rem; font-size: 0.6rem; font-weight: 600; white-space: nowrap;
}
.dcp-priority-pill {
  display: inline-flex; align-items: center; border-radius: 9999px; padding: 0.05rem 0.35rem;
  font-size: 0.6rem; font-weight: 600; text-transform: capitalize;
}
.dcp-priority-pill--high { background: #fef2f2; color: #b91c1c; }
.dcp-priority-pill--medium { background: #fffbeb; color: #b45309; }
.dcp-priority-pill--low { background: #f1f5f9; color: #64748b; }

.dcp-month { display: flex; flex-direction: column; height: 100%; }
.dcp-month-head { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid #e2e8f0; }
.dcp-month-head-cell { padding: 0.35rem; font-size: 0.7rem; font-weight: 600; color: #64748b; text-align: center; }
.dcp-month-grid { display: grid; grid-template-columns: repeat(7, 1fr); flex: 1; min-height: 24rem; }
.dcp-month-cell {
  border-right: 1px solid #f1f5f9; border-bottom: 1px solid #f1f5f9; padding: 0.2rem 0.25rem;
  min-height: 5rem; cursor: pointer; background: #fff;
}
.dcp-month-cell--muted { background: #f8fafc; }
.dcp-month-cell--muted .dcp-month-date { color: #94a3b8; }
.dcp-month-cell--closed { background: #f1f5f9; cursor: not-allowed; }
.dcp-month-cell--closed .dcp-month-date { color: #94a3b8; }
.dcp-month-cell--closed .dcp-month-stats { display: none; }
.dcp-month-closed-label { font-size: 0.58rem; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.15rem; }
.dcp-month-head-cell--closed { color: #94a3b8; }
.dcp-month-cell--today { background: #eff6ff; box-shadow: inset 0 0 0 1px #bfdbfe; }
.dcp-month-cell--today.dcp-month-cell--closed { background: #e2e8f0; box-shadow: none; }
.dcp-month-date { font-size: 0.75rem; font-weight: 600; color: #334155; margin-bottom: 0.15rem; }
.dcp-month-stats { display: flex; flex-direction: column; gap: 0.1rem; }
.dcp-month-stat { font-size: 0.62rem; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dcp-time-wrap { overflow: auto; max-height: calc(100vh - 20rem); border: 1px solid #e2e8f0; border-radius: 0.5rem; }
.dcp-time-grid { min-width: 44rem; }
.dcp-time-days-head {
  display: grid; grid-template-columns: 3.5rem repeat(var(--dcp-days, 7), minmax(5rem, 1fr));
  position: sticky; top: 0; z-index: 3; background: #fff; border-bottom: 1px solid #e2e8f0;
}
.dcp-time-corner-cell { border-right: 1px solid #e2e8f0; }
.dcp-time-day-head { padding: 0.4rem; text-align: center; border-left: 1px solid #f1f5f9; }
.dcp-time-day-head--today { background: #eff6ff; }
.dcp-time-day-head--closed { background: #f1f5f9; }
.dcp-time-day-closed { display: block; font-size: 0.58rem; font-weight: 600; color: #94a3b8; text-transform: uppercase; margin-top: 0.1rem; }
.dcp-time-col--closed { background: #f8fafc; pointer-events: none; }
.dcp-time-col-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgb(248 250 252 / 0.85); z-index: 3; font-size: 0.72rem; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; }
.dcp-time-now-line { position: absolute; left: 0; right: 0; height: 2px; background: #ef4444; z-index: 4; pointer-events: none; }
.dcp-time-now-line::before { content: ''; position: absolute; left: 0; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; }
.dcp-empty--closed { color: #64748b; font-style: italic; }
.dcp-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.dcp-form-field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.78rem; font-weight: 500; color: #475569; }
.dcp-form-field--full { grid-column: 1 / -1; }
.dcp-form-hours-note { font-size: 0.75rem; color: #64748b; margin-bottom: 0.75rem; }
.dcp-form-error { color: #b91c1c; font-size: 0.78rem; margin-top: 0.5rem; min-height: 1rem; }
body:has(#modal-dcp-form.open) #overlay.active { background: rgb(15 23 42 / 0.35); }
#modal-dcp-form .ca-modal-panel { max-width: 36rem; }
.dcp-time-day-num { display: block; font-size: 0.82rem; font-weight: 700; color: #0f172a; }
.dcp-time-day-name { display: block; font-size: 0.65rem; color: #64748b; }
.dcp-time-body { display: flex; overflow: visible; }
.dcp-time-labels { width: 3.5rem; flex-shrink: 0; position: sticky; left: 0; z-index: 2; background: #fff; border-right: 1px solid #e2e8f0; }
.dcp-time-label { font-size: 0.6rem; color: #94a3b8; padding-right: 0.35rem; text-align: right; border-bottom: 1px solid #f8fafc; box-sizing: border-box; }
.dcp-time-columns { display: flex; flex: 1; overflow: visible; }
.dcp-time-col { position: relative; flex: 1; border-left: 1px solid #f1f5f9; min-width: 6.75rem; overflow: visible; }
.dcp-time-col--today { background: rgb(239 246 255 / 0.35); }
.dcp-time-slot { border-bottom: 1px solid #f8fafc; box-sizing: border-box; }
.dcp-time-event-wrap {
  position: absolute; left: 3px; right: 3px; z-index: 1;
  height: auto; overflow: visible; pointer-events: none;
}
.dcp-time-event-wrap .dcp-demo-card { pointer-events: auto; }

.dcp-day-groups { display: flex; flex-direction: column; gap: 0.65rem; padding: 0.25rem 0; }
.dcp-day-group__hour {
  font-size: 0.78rem; font-weight: 700; color: #475569; margin: 0 0 0.35rem;
  padding-bottom: 0.25rem; border-bottom: 1px solid #e2e8f0;
}
.dcp-day-group__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.45rem; }

.dcp-agenda-wrap { overflow: auto; max-height: calc(100vh - 20rem); border: 1px solid #e2e8f0; border-radius: 0.5rem; }
.dcp-agenda-table { width: 100%; border-collapse: collapse; font-size: 0.76rem; }
.dcp-agenda-table th {
  position: sticky; top: 0; background: #f8fafc; padding: 0.4rem 0.6rem; text-align: left;
  font-size: 0.7rem; font-weight: 600; color: #64748b; border-bottom: 1px solid #e2e8f0; white-space: nowrap;
}
.dcp-agenda-row { background: #fff; cursor: pointer; transition: background 0.12s; }
.dcp-agenda-row:hover { background: #f8fafc; }
.dcp-agenda-row td { padding: 0.38rem 0.6rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.dcp-empty { text-align: center; color: #64748b; font-size: 0.82rem; padding: 2rem 1rem; }

.dcp-detail-body { font-size: 0.84rem; background: #fff; color: #0f172a; }
.dcp-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem 1rem; margin-bottom: 0.75rem; }
.dcp-detail-row { display: flex; flex-direction: column; gap: 0.15rem; }
.dcp-detail-row--block { margin-top: 0.25rem; }
.dcp-detail-label { font-weight: 600; color: #64748b; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.02em; }
.dcp-detail-value { color: #0f172a; font-weight: 500; font-size: 0.84rem; }
.dcp-detail-link { color: #2563eb; font-size: 0.82rem; word-break: break-all; }
.dcp-detail-remarks { margin: 0.25rem 0 0; font-size: 0.82rem; color: #475569; line-height: 1.45; }
.dcp-detail-actions { flex-wrap: wrap; gap: 0.35rem; }

#modal-dcp-detail .ca-modal-panel {
  width: 100%;
  max-width: 720px;
  background: #fff;
  color: #0f172a;
}
#modal-dcp-detail .ca-modal-header,
#modal-dcp-detail .ca-modal-body,
#modal-dcp-detail .ca-modal-footer {
  background: #fff;
  color: #0f172a;
}
#modal-dcp-detail .ca-modal-header {
  background: linear-gradient(to right, rgb(76 180 212 / 0.12), #fff 55%);
}
#modal-dcp-detail .ca-modal-footer {
  white-space: normal;
  overflow-x: visible;
  background: #fafbfc;
}
#modal-dcp-detail .ca-modal-footer-buttons {
  flex-wrap: wrap;
  white-space: normal;
  min-width: 0;
  width: 100%;
  justify-content: flex-end;
}
#modal-dcp-detail .dcp-detail-value,
#modal-dcp-detail .dcp-detail-remarks,
#modal-dcp-detail .ca-modal-title {
  color: #0f172a;
}

@media (max-width: 1200px) {
  .dcp-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dcp-layout { grid-template-columns: 1fr; }
  .dcp-queue { position: static; max-height: 16rem; }
}

@media (max-width: 768px) {
  .dcp-page { padding: 0.65rem; min-height: auto; }
  .dcp-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dcp-toolbar-title { order: -1; width: 100%; }
  .dcp-detail-grid { grid-template-columns: 1fr; }
  .dcp-month-grid { min-height: 18rem; }
  .dcp-month-cell { min-height: 4rem; }
  .dcp-time-wrap { max-height: calc(100vh - 14rem); }
}

@media print {
  .dcp-search-bar, .dcp-filters, .dcp-queue, .dcp-top-actions, .dcp-export-icons, .dcp-view-tabs, .dcp-month-nav { display: none !important; }
  .dcp-layout { grid-template-columns: 1fr; }
  .dcp-page { padding: 0; border: 0; box-shadow: none; }
}

/* Reports hub — compact typography */
body.crm-layout .reports-hub-page .text-page-title {
  font-size: 1.875rem !important;
  line-height: 2.25rem !important;
  margin-bottom: 0.35rem !important;
}

body.crm-layout .reports-hub-page .page-hero {
  padding-bottom: 0.5rem;
}

body.crm-layout .reports-hub-page .report-card__title,
body.crm-layout .reports-hub-page .report-card .text-card-heading {
  font-size: 0.9375rem !important;
  line-height: 1.3 !important;
  font-weight: 600 !important;
}

body.crm-layout .reports-hub-page .report-card-meta,
body.crm-layout .reports-hub-page .report-card .text-caption {
  font-size: 11px !important;
  line-height: 1.25 !important;
}

body.crm-layout .reports-hub-page .report-card {
  padding: 0.875rem 1rem !important;
  gap: 0.75rem;
  min-height: 4.75rem;
  align-items: center;
}

body.crm-layout .reports-hub-page .report-card__icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
    background: #e8f8f6 !important;
  color: #25b7a7 !important;
}

body.crm-layout .reports-hub-page .report-card__icon i {
  width: 1.25rem;
  height: 1.25rem;
}

body.crm-layout .reports-hub-page .report-card__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
}

body.crm-layout .reports-hub-page .grid.gap-4 {
  gap: 0.75rem;
}

body.crm-layout .reports-hub-page #reports-filter-bar.crm-listing-filter-bar {
  padding: 0.5rem 1rem;
  margin-bottom: 0.75rem !important;
}

body.crm-layout .reports-hub-page #reports-filter-bar .crm-listing-filter-label {
  font-size: 0.5625rem;
  margin-bottom: 0.15rem;
}

body.crm-layout .reports-hub-page #reports-filter-bar .crm-listing-filter-input,
body.crm-layout .reports-hub-page #reports-filter-bar .crm-col-filter-input {
  height: 1.875rem;
  min-height: 1.875rem;
  padding: 0.25rem 0.5rem;
  font-size: 12px !important;
}

body.crm-layout .reports-hub-page [data-tab-group="reports-hub"] .text-card-heading {
  font-size: 0.9375rem !important;
  line-height: 1.3 !important;
}

body.crm-layout .reports-hub-page [data-tab-group="reports-hub"] .text-caption {
  font-size: 11px !important;
}

body.crm-layout .reports-hub-page [data-tab-group="reports-hub"] .text-body {
  font-size: 13px !important;
}

body.crm-layout .reports-hub-page .ca-tab-panel .card.p-5 {
  padding: 1rem !important;
}

body.crm-layout .reports-hub-page .ca-tab-panel .card.p-5 .text-card-heading.mb-4 {
  margin-bottom: 0.65rem !important;
}

/* ─── Report Analytics Drawer (BI dashboard) ─── */
body.ra-drawer-open {
  overflow: hidden;
}

#report-analytics-drawer.ca-modal:not(.open) {
  display: none !important;
}

#report-analytics-drawer.ra-drawer {
  position: fixed;
  inset: 0;
  z-index: 1300 !important;
  display: flex !important;
  flex-direction: column;
  align-items: stretch !important;
  justify-content: stretch !important;
  padding: 0 !important;
}

#report-analytics-drawer.ca-modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body:has(#report-analytics-drawer.open) #overlay.active {
  background: transparent;
  pointer-events: none;
}

#report-analytics-drawer.ra-drawer .ra-drawer__backdrop {
  position: fixed;
  inset: 0;
  background: rgb(15 23 42 / 0.5);
  backdrop-filter: blur(2px);
  z-index: 0;
}

#report-analytics-drawer .ra-drawer__panel {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  border-radius: 0;
  background: #f8fafc;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  animation: ra-slide-in 0.22s ease;
  overflow: hidden;
}

body.ra-drawer-open .crm-sidebar,
body.ra-drawer-open .crm-header {
  z-index: 1000;
}

@keyframes ra-slide-in {
  from { transform: translateY(8px); opacity: 0.85; }
  to { transform: translateY(0); opacity: 1; }
}

#report-analytics-drawer .ra-drawer__content {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.ra-drawer__header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 0.75rem 1rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.ra-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
  padding: 0.45rem 0.75rem 0.45rem 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.ra-back-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.ra-drawer__header-main {
  min-width: 0;
}

.ra-drawer__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.25rem;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #2E7F96;
}

.ra-drawer__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}

.ra-drawer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-top: 0.45rem;
  font-size: 12px;
  color: #64748b;
}

.ra-drawer__meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.ra-drawer__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.ra-export-menu { position: relative; }

.ra-export-menu__list {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 9rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgb(15 23 42 / 0.12);
  padding: 0.35rem;
  z-index: 20;
}

.ra-export-menu__list button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.65rem;
  border: 0;
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
}

.ra-export-menu__list button:hover { background: #f1f5f9; }

.ra-drawer__layout {
  display: grid;
  grid-template-columns: minmax(170px, 190px) minmax(0, 1fr) minmax(220px, 260px);
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.ra-drawer__filters {
  background: #fff;
  border-right: 1px solid #e2e8f0;
  padding: 0.85rem;
  overflow-y: auto;
}

.ra-drawer__filters h3 {
  margin: 0 0 0.65rem;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.ra-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.55rem;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
}

.ra-filter-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.ra-drawer__main {
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.85rem;
  min-width: 0;
}

.ra-drawer__insights {
  background: #fff;
  border-left: 1px solid #e2e8f0;
  overflow-y: auto;
  padding: 0.85rem;
}

.ra-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.ra-kpi-card {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  min-width: 0;
  min-height: 4.25rem;
  height: 100%;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}

.ra-kpi-card__body {
  min-width: 0;
  flex: 1 1 auto;
}

.ra-kpi-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border-radius: 8px;
  background: #e8f8f6;
  color: #25b7a7;
  margin: 0;
}

.ra-kpi-card__label {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ra-kpi-card__value {
  margin: 0 0 0.15rem;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ra-kpi-card__trend {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0.35rem 0 0;
  font-size: 11px;
  font-weight: 600;
}

.ra-trend--up { color: #047857; }
.ra-trend--down { color: #b91c1c; }
.ra-trend--neutral { color: #64748b; }

.ra-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.ra-chart-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
  overflow: hidden;
}

.ra-chart-card--wide { grid-column: 1 / -1; }

.ra-chart-card__head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

.ra-chart-card__head h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.ra-chart-card__body {
  padding: 0.65rem 0.75rem 0.75rem;
  min-height: 9rem;
}

.ra-chart-empty {
  margin: 0;
  padding: 1.5rem 0;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
}

.ra-hbar-list { display: flex; flex-direction: column; gap: 0.45rem; }

.ra-hbar-item__head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 12px;
  color: #475569;
  margin-bottom: 0.15rem;
}

.ra-hbar-track {
  height: 6px;
  border-radius: 999px;
  background: #f1f5f9;
  overflow: hidden;
}

.ra-hbar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4CB4D4, #25b7a7);
}

.ra-donut-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 8rem; }

.ra-donut {
  width: 6.5rem;
  height: 6.5rem;
  border-radius: 50%;
  background: conic-gradient(#4CB4D4 0deg, #4CB4D4 var(--ra-pct, 0deg), #e2e8f0 var(--ra-pct, 0deg));
  display: grid;
  place-items: center;
  position: relative;
}

.ra-donut::before {
  content: '';
  width: 4.2rem;
  height: 4.2rem;
  border-radius: 50%;
  background: #fff;
  position: absolute;
}

.ra-donut__value {
  position: relative;
  z-index: 1;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.ra-donut__label {
  margin: 0.45rem 0 0;
  font-size: 12px;
  color: #64748b;
}

.ra-funnel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.35rem 0;
}

.ra-funnel__stage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 140px;
  max-width: 100%;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  background: linear-gradient(90deg, #EDF9FC, #fff);
  border: 1px solid #c9e8f0;
  font-size: 12px;
}

.ra-funnel__value { font-size: 14px; font-weight: 700; color: #0f172a; }
.ra-funnel__pct, .ra-funnel__drop { font-size: 11px; color: #64748b; }
.ra-funnel__arrow { color: #94a3b8; line-height: 1; }

.ra-line-chart { min-height: 8rem; }
.ra-line-chart__svg { width: 100%; height: 120px; display: block; }
.ra-line-chart__labels {
  display: flex;
  justify-content: space-between;
  gap: 0.25rem;
  margin-top: 0.35rem;
  font-size: 10px;
  color: #94a3b8;
}

.ra-heatmap table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ra-heatmap th, .ra-heatmap td { padding: 0.35rem 0.45rem; border-bottom: 1px solid #f1f5f9; text-align: center; }
.ra-heatmap th { font-size: 11px; color: #64748b; text-transform: uppercase; }
.ra-heat-cell {
  display: inline-block;
  min-width: 2.5rem;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
  background: rgb(76 180 212 / calc(0.12 + (var(--ra-intensity, 0) * 0.006)));
  font-weight: 600;
}

.ra-table-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}

.ra-table-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
}

.ra-table-section__head h4 { margin: 0; font-size: 13px; font-weight: 700; color: #334155; }
.ra-table-section__head p { margin: 0.1rem 0 0; font-size: 11px; color: #94a3b8; }

.ra-table-search {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 12rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.ra-table-search input {
  border: 0;
  outline: none;
  font-size: 12px;
  width: 100%;
  background: transparent;
}

.ra-table-wrap { max-height: 320px; overflow: auto; }

.ra-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--crm-font-size-table-cell);
}

.ra-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  padding: var(--crm-table-cell-py) var(--crm-table-cell-px);
  text-align: left;
  font-size: var(--crm-font-size-table-header);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
  white-space: nowrap;
  vertical-align: middle;
  line-height: var(--crm-line-height-tight);
}

.ra-table td {
  padding: var(--crm-table-cell-py) var(--crm-table-cell-px);
  border-bottom: 1px solid #f8fafc;
  color: #334155;
  vertical-align: middle;
  line-height: var(--crm-line-height-tight);
}

.ra-table tbody tr:hover { background: #f8fdff; }
.ra-table-empty { text-align: center; color: #94a3b8; padding: 1rem !important; }

.ra-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: #EDF9FC;
  color: #2E7F96;
  font-size: 10px;
  font-weight: 700;
  margin-right: 0.25rem;
}

.ra-progress-cell span { display: block; font-size: 11px; font-weight: 600; margin-bottom: 0.15rem; }
.ra-progress-track { height: 4px; border-radius: 999px; background: #f1f5f9; overflow: hidden; }
.ra-progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4CB4D4, #25b7a7); }

.ra-insights-panel__head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.ra-insights-panel__head h4 { margin: 0; font-size: 13px; font-weight: 700; color: #334155; flex: 1; }

.ra-ai-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #EDF9FC, #f5f3ff);
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.ra-insights-list { display: flex; flex-direction: column; gap: 0.5rem; }

.ra-insight-card {
  display: flex;
  gap: 0.5rem;
  padding: 0.6rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fafbfc;
}

.ra-insight-card__icon {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fff;
  color: #2E7F96;
  border: 1px solid #e2e8f0;
}

.ra-insight-card h5 { margin: 0 0 0.15rem; font-size: 12px; font-weight: 700; color: #334155; }
.ra-insight-card p { margin: 0; font-size: 11px; line-height: 1.35; color: #64748b; }

.ra-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 0.75rem;
  color: #64748b;
  font-size: 13px;
}

.ra-loading__spinner {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 3px solid #e2e8f0;
  border-top-color: #4CB4D4;
  animation: ra-spin 0.8s linear infinite;
}

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

@media (max-width: 1100px) {
  .ra-drawer__layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow-y: auto;
  }

  .ra-drawer__filters {
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
    max-height: none;
  }

  .ra-drawer__filters .ra-filter-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .ra-drawer__filters .ra-filter-actions .btn-sm {
    flex: 1 1 auto;
    width: auto !important;
  }

  .ra-drawer__main {
    overflow: visible;
  }

  .ra-drawer__insights {
    border-left: 0;
    border-top: 1px solid #e2e8f0;
  }

  .ra-charts-grid {
    grid-template-columns: 1fr;
  }

  .ra-drawer__header {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "back actions"
      "main main";
  }

  .ra-back-btn { grid-area: back; }
  .ra-drawer__header-main { grid-area: main; }
  .ra-drawer__actions {
    grid-area: actions;
    justify-self: end;
  }
}

@media print {
  body * { visibility: hidden; }
  #report-analytics-drawer, #report-analytics-drawer * { visibility: visible; }
  #report-analytics-drawer { position: absolute; inset: 0; }
  #report-analytics-drawer .ra-drawer__backdrop,
  #report-analytics-drawer .ra-drawer__filters,
  #report-analytics-drawer .ra-drawer__actions { display: none !important; }
  #report-analytics-drawer .ra-drawer__panel { width: 100%; box-shadow: none; }
  .ra-drawer__layout { grid-template-columns: 1fr; }
}

/* ─── Lead Conversion Report (enterprise dashboard) ─── */
.ra-lc-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.85rem;
  min-height: 48px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.ra-lc-header__title {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
}

.ra-lc-header__brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  min-width: 0;
  flex: 1;
}

.ra-lc-header__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: 0.75rem;
  background: #edf9fc;
  color: #2e7f96;
}

.ra-lc-header__text {
  min-width: 0;
  flex: 1;
}

.ra-lc-header__title h2,
.ra-lc-header__text h2 {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.3;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ra-lc-header__subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.35;
  font-weight: 400;
  color: #64748b;
}

@media (max-width: 640px) {
  .ra-lc-header__brand {
    gap: 0.65rem;
  }

  .ra-lc-header__icon {
    width: 2.5rem;
    height: 2.5rem;
  }

  .ra-lc-header__text h2 {
    white-space: normal;
    font-size: 1rem;
  }

  .ra-lc-header__subtitle {
    font-size: 0.75rem;
  }
}

.ra-lc-header__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.ra-lc-toolbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.ra-lc-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.ra-lc-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #64748b;
}

.ra-lc-filter--grow {
  flex: 1 1 120px;
  min-width: 110px;
}

.ra-lc-filter .input-field-sm {
  min-height: 32px;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  font-size: 12px;
}

.ra-lc-filter select.input-field-sm,
.ra-lc-filter input.input-field-sm {
  width: 100%;
  min-width: 0;
}

.ra-lc-apply {
  min-height: 32px;
  padding-left: 0.85rem;
  padding-right: 0.85rem;
}

.ra-lc-main {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.65rem 0.85rem 0.85rem;
  background: #f1f5f9;
}

.ra-lc-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

#dup-attempts-metrics.ra-lc-kpi-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.ra-lc-kpi-card {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  width: 100%;
  min-width: 0;
  min-height: 4.25rem;
  height: 100%;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}

.ra-lc-kpi-card__body {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.1rem;
}

.ra-lc-kpi-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border-radius: 8px;
  background: #e8f8f6;
  color: #25b7a7;
  margin: 0;
}

.ra-lc-kpi-card__icon i,
.ra-lc-kpi-card__icon svg,
.ra-lc-kpi-card__icon [data-lucide] {
  width: 1rem;
  height: 1rem;
}

/* Neutralize legacy tone modifiers — icons stay uniform CRM pastel */
.ra-lc-kpi-card--green,
.ra-lc-kpi-card--red,
.ra-lc-kpi-card--orange,
.ra-lc-kpi-card--blue,
.ra-lc-kpi-card--gray,
.ra-lc-kpi-card--purple {
  border-top: none;
  border-color: #e2e8f0;
}

.ra-lc-kpi-card--green .ra-lc-kpi-card__icon,
.ra-lc-kpi-card--red .ra-lc-kpi-card__icon,
.ra-lc-kpi-card--orange .ra-lc-kpi-card__icon,
.ra-lc-kpi-card--blue .ra-lc-kpi-card__icon,
.ra-lc-kpi-card--gray .ra-lc-kpi-card__icon,
.ra-lc-kpi-card--purple .ra-lc-kpi-card__icon {
  background: #e8f8f6;
  color: #25b7a7;
}

.ra-lc-kpi-card__label {
  order: 1;
  margin: 0;
  font-size: 11px !important;
  font-weight: 500 !important;
  line-height: 1.25 !important;
  color: #64748b !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.ra-lc-kpi-card__value {
  order: 2;
  margin: 0;
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.ra-lc-kpi-card__value.text-rose-600 { color: #e11d48 !important; }
.ra-lc-kpi-card__value.text-amber-600 { color: #d97706 !important; }

.ra-lc-kpi-card__trend {
  order: 3;
  display: inline-block;
  margin: 0;
  font-size: 10px;
  font-weight: 500;
}

.ra-lc-charts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.ra-lc-chart {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}

.ra-lc-chart--span2 { grid-column: span 2; }
.ra-lc-chart--full { grid-column: 1 / -1; }

.ra-lc-chart__head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid #f1f5f9;
  color: #475569;
}

.ra-lc-chart__head h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.ra-lc-chart__body {
  padding: 0.55rem 0.65rem 0.65rem;
  min-height: 7.5rem;
}

.ra-lc-chart__body--funnel {
  min-height: auto;
  padding: 0.65rem;
}

.ra-lc-donut-block {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
}

.ra-lc-donut {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.ra-lc-donut__hole {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.1;
}

.ra-lc-donut__hole strong {
  font-size: 13px;
  color: #0f172a;
}

.ra-lc-donut__hole span {
  font-size: 9px;
  color: #94a3b8;
  font-weight: 600;
}

.ra-lc-donut-legend,
.ra-lc-stacked-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 11px;
  color: #475569;
}

.ra-lc-donut-legend li,
.ra-lc-stacked-legend li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ra-lc-donut-legend em {
  font-style: normal;
  color: #94a3b8;
  font-size: 10px;
}

.ra-lc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ra-lc-stacked__bar {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: #f1f5f9;
  margin-bottom: 0.45rem;
}

.ra-lc-stacked__seg {
  min-width: 2px;
  transition: width 0.2s ease;
}

.ra-lc-funnel .ra-funnel__stage {
  background: linear-gradient(90deg, #dbeafe, #eff6ff);
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
}

.ra-lc-funnel .ra-funnel__value { color: #1e40af; }

.ra-lc-table-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}

.ra-lc-table-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid #f1f5f9;
}

.ra-lc-table-section__head h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.ra-lc-table .ra-table-wrap { max-height: 240px; }

.ra-lc-table th,
.ra-lc-table td {
  font-size: var(--crm-font-size-table-cell);
  padding: var(--crm-table-cell-py) var(--crm-table-cell-px);
  line-height: var(--crm-line-height-tight);
}

.ra-progress-fill--green { background: linear-gradient(90deg, #10b981, #34d399); }
.ra-progress-fill--blue { background: linear-gradient(90deg, #3b82f6, #4CB4D4); }
.ra-progress-fill--orange { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.ra-lc-perf {
  display: inline-block;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.ra-lc-perf--green { background: #ecfdf5; color: #047857; }
.ra-lc-perf--blue { background: #eff6ff; color: #1d4ed8; }
.ra-lc-perf--orange { background: #fffbeb; color: #b45309; }

.ra-lc-main .ra-hbar-fill { background: linear-gradient(90deg, #3b82f6, #4CB4D4); }

@media (max-width: 1200px) {
  .ra-lc-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ra-lc-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ra-lc-chart--span2 { grid-column: span 2; }
}

@media (max-width: 768px) {
  .ra-lc-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ra-lc-charts { grid-template-columns: 1fr; }
  .ra-lc-chart--span2,
  .ra-lc-chart--full { grid-column: auto; }
  .ra-lc-filters { gap: 0.35rem; }
  .ra-lc-filter { flex: 1 1 calc(50% - 0.35rem); }
}

@media print {
  #report-analytics-drawer .ra-lc-header__actions,
  #report-analytics-drawer .ra-lc-toolbar { display: none !important; }
}

.ra-lc-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0.15rem 0 0;
  font-size: 11px;
  color: #64748b;
}

.ra-lc-header__meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.ra-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.75rem;
  border-radius: 0.5rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 12px;
}

.ra-drill-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
}

.ra-skeleton { padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.ra-skeleton__header,
.ra-skeleton__filters,
.ra-skeleton__table { height: 48px; border-radius: 8px; background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%); background-size: 200% 100%; animation: ra-shimmer 1.2s infinite; }
.ra-skeleton__filters { height: 40px; }
.ra-skeleton__table { height: 180px; }
.ra-skeleton__kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.5rem; }
.ra-skeleton__kpi { height: 72px; border-radius: 8px; background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%); background-size: 200% 100%; animation: ra-shimmer 1.2s infinite; }
.ra-skeleton__charts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.ra-skeleton__chart { height: 140px; border-radius: 8px; background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%); background-size: 200% 100%; animation: ra-shimmer 1.2s infinite; }

@keyframes ra-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.ra-error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 280px;
  padding: 2rem;
  text-align: center;
  color: #64748b;
}

.ra-error-state h3 { margin: 0; color: #334155; font-size: 1rem; }
.ra-error-state p { margin: 0; max-width: 28rem; font-size: 13px; }

#report-analytics-drawer .ra-drawer__layout,
#report-analytics-drawer .ra-drawer__insights,
#report-analytics-drawer .ra-drawer__filters { display: none !important; }

#report-analytics-drawer .ra-lc-main .ra-table-wrap { max-height: 360px; }

/* ─── Document OCR panel (Lead drawer) ─── */
.ocr-panel {
  padding: 1rem;
  background: #fff;
}
.ocr-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.ocr-panel__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #0f172a;
}
.ocr-panel__subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: #64748b;
}
.ocr-panel__upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}
.ocr-panel__dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  border: 1px dashed #cbd5e1;
  border-radius: 0.75rem;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.75rem;
  text-align: center;
}
.ocr-panel__dropzone.is-dragover {
  border-color: #25b7a7;
  background: #f0fdfa;
}
.ocr-panel__list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.ocr-panel__item {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.75rem;
  background: #fff;
}
.ocr-panel__item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.ocr-panel__item-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  color: #0f172a;
  font-size: 0.8125rem;
  font-weight: 600;
}
.ocr-panel__filename {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ocr-panel__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
  font-size: 0.6875rem;
  color: #94a3b8;
}
.ocr-panel__processing,
.ocr-panel__error,
.ocr-panel__preview {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
}
.ocr-panel__processing {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #0e7490;
}
.ocr-panel__error { color: #b91c1c; }
.ocr-panel__preview {
  color: #475569;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ocr-panel__actions,
.ocr-panel__editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}
.ocr-panel__textarea {
  min-height: 8rem;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
}
.ocr-panel__empty,
.ocr-panel__loading {
  padding: 0.75rem;
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
}
.ocr-status {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 700;
  white-space: nowrap;
}
.ocr-status--pending { background: #f1f5f9; color: #475569; }
.ocr-status--processing { background: #ecfeff; color: #0e7490; }
.ocr-status--completed { background: #ecfdf5; color: #047857; }
.ocr-status--failed { background: #fef2f2; color: #b91c1c; }

/* Master Data → OCR Import */
.ocr-import-page { display: flex; flex-direction: column; gap: 1rem; }
.ocr-import-page__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.1rem 1.25rem;
}
.ocr-import-page__subtitle { margin: 0.35rem 0 0; color: #64748b; font-size: 0.875rem; max-width: 42rem; }
.ocr-import-page__header-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem; }
.ocr-import-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #ecfeff;
  color: #0e7490;
  font-size: 0.7rem;
  font-weight: 700;
}
.ocr-import-layout {
  display: grid;
  grid-template-columns: minmax(16rem, 22rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.ocr-import-upload,
.ocr-import-history,
.ocr-import-detail { padding: 1.1rem 1.25rem; }
.ocr-import-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1.5px dashed #cbd5e1;
  border-radius: 0.75rem;
  padding: 1.5rem 1rem;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.ocr-import-dropzone.is-dragover,
.ocr-import-dropzone:hover {
  border-color: #25b7a7;
  background: #f0fdfa;
}
.ocr-import-history__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}
.ocr-import-history__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 1;
}
.ocr-import-history__filters .input-field { max-width: 16rem; }
.ocr-import-table tbody tr.is-selected { background: #f0fdfa; }
.ocr-import-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.ocr-import-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}
.ocr-import-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.45rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  cursor: pointer;
}
.ocr-import-action-btn:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.ocr-import-action-btn:focus-visible {
  outline: 2px solid #0d9488;
  outline-offset: 2px;
}
.ocr-import-action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.ocr-import-action-btn--danger {
  color: #e11d48;
}
.ocr-import-action-btn--danger:hover:not(:disabled) {
  background: #fff1f2;
  border-color: #fecdd3;
}
.ocr-import-detail.is-open {
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  border-color: #99f6e4;
}
.ocr-import-detail__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.ocr-import-detail__body {
  max-height: min(70vh, 40rem);
  overflow: auto;
}
.ocr-import-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: center;
}
.ocr-import-detail__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.65rem 1rem;
}
.ocr-import-detail__meta-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.875rem;
  color: #0f172a;
}
.ocr-import-confirm {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10060;
  padding: 1rem;
}
.ocr-import-confirm.hidden { display: none !important; }
.ocr-import-confirm__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.ocr-import-confirm__panel {
  position: relative;
  z-index: 1;
  width: min(28rem, 100%);
  padding: 1.25rem 1.35rem;
}
.ocr-import-confirm__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.15rem;
}
.ocr-import-confirm__delete {
  background: #e11d48 !important;
  border-color: #e11d48 !important;
}
.ocr-import-confirm__delete:hover:not(:disabled) {
  background: #be123c !important;
  border-color: #be123c !important;
}
.ocr-structured-results__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.ocr-firm-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 0.85rem;
}
.ocr-firm-card {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1rem 1.1rem;
  background: #fff;
}
.ocr-firm-card__top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}
.ocr-firm-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  color: #0f172a;
  line-height: 1.35;
}
.ocr-firm-card__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: capitalize;
  background: #f1f5f9;
  color: #475569;
  white-space: nowrap;
}
.ocr-firm-card__badge--approved,
.ocr-firm-card__badge--auto_created,
.ocr-firm-card__badge--auto_mapped { background: #ecfdf5; color: #047857; }
.ocr-firm-card__badge--rejected,
.ocr-firm-card__badge--failed { background: #fef2f2; color: #b91c1c; }
.ocr-firm-card__badge--pending { background: #fff7ed; color: #c2410c; }
.ocr-firm-card__badge--needs_review { background: #fffbeb; color: #b45309; }
.ocr-firm-card__badge--conflict { background: #eff6ff; color: #1d4ed8; }
.ocr-firm-bulk-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.ocr-firm-bulk-toolbar .input-field { max-width: 12rem; }
.ocr-firm-bulk-toolbar [data-ocr-firm-search] { max-width: 16rem; min-width: 12rem; }
.ocr-firm-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e2e8f0;
}
.ocr-firm-pagination__controls {
  display: flex;
  gap: 0.4rem;
}
.ocr-mapping-dashboard {
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.75rem 0.9rem;
  background: #f8fafc;
}
.ocr-mapping-dashboard__stages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.ocr-mapping-stage {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 0.2rem 0.45rem;
  border-radius: 0.25rem;
  background: #fff;
  border: 1px solid #e2e8f0;
}
.ocr-mapping-stage.is-done {
  color: #047857;
  border-color: #a7f3d0;
  background: #ecfdf5;
}
.ocr-mapping-stage.is-active {
  color: #0f766e;
  border-color: #5eead4;
  background: #f0fdfa;
}
.ocr-mapping-dashboard__bar {
  margin-top: 0.55rem;
  height: 0.35rem;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.ocr-mapping-dashboard__bar > span {
  display: block;
  height: 100%;
  background: #0d9488;
  transition: width 0.25s ease;
}
.ocr-firm-card__field--low-confidence .ocr-firm-card__value,
.ocr-firm-card__title--low-confidence {
  background: #fff7ed;
  border-radius: 0.25rem;
  box-decoration-break: clone;
}
.ocr-review-triptych {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
}
.ocr-review-pane {
  min-width: 0;
}
.ocr-review-invalid {
  color: #b91c1c;
  font-weight: 600;
}
.ocr-firm-card--collision,
.ocr-firm-card--invalid {
  border-color: #fecaca;
}
.ocr-firm-card--review {
  border-color: #fcd34d;
}
.ocr-firm-card__technical summary {
  user-select: none;
}
.ocr-entity-pipeline__list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}
.ocr-entity-pipeline__row {
  display: grid;
  grid-template-columns: 1fr auto auto auto 1fr;
  gap: 0.35rem 0.5rem;
  align-items: center;
  padding: 0.35rem 0;
  border-bottom: 1px solid #e2e8f0;
}
.ocr-entity-pipeline__row--mismatch {
  background: #fff1f2;
  color: #b91c1c;
}
.ocr-entity-pipeline__arrow {
  color: #94a3b8;
}
.ocr-entity-pipeline__type {
  font-weight: 600;
  color: #0f766e;
}
.ocr-entity-pipeline__field {
  color: #475569;
}
@media (max-width: 900px) {
  .ocr-review-triptych {
    grid-template-columns: 1fr;
  }
}
.ocr-low-conf-tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: #c2410c;
  text-transform: uppercase;
}
.ocr-firm-card__select {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  color: #64748b;
  margin-right: 0.15rem;
  flex: 0 0 auto;
  white-space: nowrap;
}
.ocr-quality-report {
  border: 1px solid #ccfbf1;
  background: #f0fdfa;
  border-radius: 0.5rem;
  padding: 0.55rem 0.75rem;
}
.ocr-completeness-warn {
  padding: 0.5rem 0.65rem;
  border-radius: 0.5rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
}
.ocr-firm-card__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}
.ocr-firm-card__field {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.5rem;
  font-size: 0.875rem;
}
.ocr-firm-card__label {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.ocr-firm-card__value {
  color: #0f172a;
  word-break: break-word;
}
.ocr-firm-card__partners {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.ocr-firm-card__partners li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: #0f172a;
}
.ocr-firm-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid #f1f5f9;
  max-width: 100%;
  overflow: hidden;
}
.ocr-firm-card__actions .btn-secondary,
.ocr-firm-card__actions .btn-xs {
  flex: 0 1 auto;
  padding: 0.18rem 0.4rem !important;
  min-height: 1.5rem !important;
  font-size: 0.68rem !important;
  border-radius: 0.35rem !important;
  white-space: nowrap;
}

/* All Firms — Merchant Centre partners + inline edit */
.cam-firm-with-partners {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}
.cam-partner-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.3rem;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  flex: 0 0 auto;
  padding: 0;
}
.cam-partner-toggle.is-open i {
  transform: rotate(90deg);
}
.cam-firm-with-partners__body {
  min-width: 0;
  flex: 1;
}
.cam-partner-meta {
  display: block;
  font-size: 0.68rem;
  color: #64748b;
  margin-top: 0.1rem;
}
.cam-partner-count-label {
  font-weight: 600;
  color: #334155;
}
.cam-partner-child-row td {
  background: #f8fafc;
  font-size: 0.8125rem;
}
.cam-partner-indent {
  padding-left: 1.75rem !important;
}
.cam-partner-child-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #94a3b8;
}
.cam-partner-primary-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  background: #ecfdf5;
  color: #047857;
  vertical-align: middle;
}
.cam-inline-assign-btn,
.cam-inline-mobile-btn,
.cam-inline-email-btn,
.cam-inline-remarks-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 100%;
  border: none;
  background: transparent;
  padding: 0.1rem 0.15rem;
  border-radius: 0.3rem;
  cursor: pointer;
  text-align: left;
  color: inherit;
}
.cam-inline-assign-btn:hover,
.cam-inline-mobile-btn:hover,
.cam-inline-email-btn:hover,
.cam-inline-remarks-btn:hover {
  background: #f1f5f9;
}
.cam-inline-remarks-btn {
  width: 100%;
}
.cam-inline-remarks-btn .truncate-cell,
.cam-inline-remarks-btn .cam-sales-remarks-cell {
  max-width: 100%;
}
.cam-inline-remarks-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  width: 100%;
  max-width: 16rem;
}
.cam-inline-remarks-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  font-size: 0.75rem !important;
  min-height: 1.75rem !important;
  padding: 0.15rem 0.4rem !important;
}
.cam-inline-remarks-btn.is-loading {
  opacity: 0.7;
  pointer-events: none;
}
.cam-inline-assign-caret {
  color: #94a3b8;
  flex: 0 0 auto;
}
.cam-inline-assign-select {
  min-width: 9rem;
  max-width: 14rem;
  font-size: 0.75rem !important;
  min-height: 1.75rem !important;
  padding: 0.15rem 0.4rem !important;
}
.cam-inline-mobile-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.cam-inline-mobile-input {
  width: 7.5rem;
  font-size: 0.75rem !important;
  min-height: 1.75rem !important;
  padding: 0.15rem 0.4rem !important;
}
.cam-inline-email-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  width: 100%;
  max-width: 16rem;
}
.cam-inline-email-input {
  flex: 1 1 auto;
  min-width: 9rem;
  max-width: 14rem;
  font-size: 0.75rem !important;
  min-height: 1.75rem !important;
  padding: 0.15rem 0.4rem !important;
}
.cam-inline-assign-btn.is-loading,
.cam-inline-mobile-btn.is-loading,
.cam-inline-email-btn.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

.ocr-raw-text-panel { margin-top: 0.5rem; }
@media (max-width: 960px) {
  .ocr-import-layout { grid-template-columns: 1fr; }
}

/* Fix Master Data sticky first column overlap */

#ca-masters-table th:first-child,
#ca-masters-table td:first-child {
    position: sticky;
    left: 0;
    background: #ffffff !important;
    z-index: 3;
    overflow: hidden;
    box-shadow: 1px 0 0 #e2e8f0;
}

#ca-masters-table thead th:first-child {
    z-index: 6;
    background: #f8fafc !important;
}

#ca-masters-table tbody tr:hover td:first-child {
    background: #f8fafc !important;
}

/* OCR Needs Verification Master rows */
#ca-masters-table tbody tr.cam-row--needs-verification td {
    background: #fffbeb;
}
#ca-masters-table tbody tr.cam-row--needs-verification td:first-child {
    background: #fffbeb !important;
}
.cam-badge--needs-verification {
    display: inline-flex;
    align-items: center;
    border-radius: 0.25rem;
    padding: 0.125rem 0.4rem;
    font-size: 0.6875rem;
    font-weight: 600;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}
.cam-badge--quality-issue {
    display: inline-flex;
    align-items: center;
    border-radius: 0.25rem;
    padding: 0.125rem 0.4rem;
    font-size: 0.6875rem;
    font-weight: 600;
    background: #fee2e2;
    color: #991b1b;
}
.cam-badge--ocr-source {
    display: inline-flex;
    align-items: center;
    border-radius: 0.25rem;
    padding: 0.125rem 0.4rem;
    font-size: 0.6875rem;
    font-weight: 600;
    background: #e0f2fe;
    color: #075985;
}

/* Assignment Heat Map dropdown arrow spacing */
.assign-heatmap-toolbar select.input-field {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 3rem !important;

  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231e293b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 16px 16px;
}

/* Tickets module */
.ticket-kpi-grid .ticket-kpi-card { text-align: left; width: 100%; border: 1px solid #e2e8f0; }
.ticket-kpi-card--open .crm-kpi-card__icon { background: #eff6ff; color: #2563eb; }
.ticket-kpi-card--review .crm-kpi-card__icon { background: #fff7ed; color: #ea580c; }
.ticket-kpi-card--closed .crm-kpi-card__icon { background: #ecfdf5; color: #059669; }
.ticket-kpi-card--mine .crm-kpi-card__icon { background: #f1f5f9; color: #475569; }
.ticket-kpi-card--assigned .crm-kpi-card__icon { background: #f0fdfa; color: #0d9488; }
.ticket-kpi-card--high .crm-kpi-card__icon { background: #fef2f2; color: #dc2626; }
.ticket-kpi-card--unread .crm-kpi-card__icon { background: #f5f3ff; color: #7c3aed; }
.ticket-filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
@media (min-width: 768px) { .ticket-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .ticket-filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ticket-badge { display: inline-flex; align-items: center; border-radius: 9999px; padding: 0.125rem 0.5rem; font-size: 0.6875rem; font-weight: 600; line-height: 1.25; white-space: nowrap; }
.ticket-badge--open { background: #eff6ff; color: #1d4ed8; }
.ticket-badge--review { background: #fff7ed; color: #c2410c; }
.ticket-badge--closed { background: #ecfdf5; color: #047857; }
.ticket-badge--issue { background: #fef2f2; color: #b91c1c; }
.ticket-badge--improvement { background: #eff6ff; color: #1d4ed8; }
.ticket-badge--feature { background: #f5f3ff; color: #6d28d9; }
.ticket-badge--prio-low { background: #f1f5f9; color: #475569; }
.ticket-badge--prio-normal { background: #eff6ff; color: #1d4ed8; }
.ticket-badge--prio-high { background: #fff7ed; color: #c2410c; }
.ticket-badge--prio-urgent { background: #fef2f2; color: #b91c1c; }
.ticket-badge--internal { background: #fef3c7; color: #92400e; }
.ticket-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ticket-desc-cell { max-width: 14rem; }
.ticket-comment { border: 1px solid #e2e8f0; border-radius: 0.5rem; padding: 0.75rem; margin-bottom: 0.5rem; background: #fff; }
.ticket-comment--internal { border-color: #fcd34d; background: #fffbeb; }
.ticket-comment__head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.ticket-comment__body { white-space: pre-wrap; color: #334155; font-size: 0.875rem; }
.ticket-thread--internal { border-left: 3px solid #f59e0b; padding-left: 0.75rem; }
.ticket-attachment-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.ticket-attachment-item { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; border: 1px solid #e2e8f0; border-radius: 0.5rem; padding: 0.65rem 0.75rem; }
.ticket-history__item { border-bottom: 1px solid #f1f5f9; padding: 0.5rem 0; }
.ticket-history__meta { font-size: 0.75rem; color: #94a3b8; }
.ticket-drawer-actions { margin: 0.75rem 0 1rem; padding: 0.75rem; border: 1px solid #e2e8f0; border-radius: 0.5rem; background: #f8fafc; }
@media (max-width: 640px) {
  #modal-ticket .ca-modal-footer-buttons { flex-direction: column; }
  #modal-ticket #ticket-org-search-btn { width: 100%; }
  #modal-ticket .flex.gap-2 { flex-direction: column; }
}
