/* Pancake-inspired CRM workspace. Layout is scoped to CRM; palette uses semantic tokens. */
.customer-crm-view {
  --crm-surface: var(--crm-content-bg, var(--surface-bg, #fff));
  --crm-muted-surface: var(--crm-content-muted, #f8faf9);
  --crm-line: var(--crm-border-color, #e3e9e5);
  --crm-head: var(--crm-table-head-bg, #ebefec);
  --crm-text: var(--text-primary, #20382b);
  --crm-muted: var(--text-secondary, #536b5b);
  --crm-primary: var(--action-primary-bg, #0b6047);
  --crm-sidebar-size: 200px;
  display: grid;
  grid-template-columns: var(--crm-sidebar-size) minmax(0,1fr);
  grid-template-rows: 58px 46px 52px minmax(0,1fr);
  height: calc(100% - 56px);
  min-height: 0;
  overflow: hidden;
  color: var(--crm-text);
  background: var(--nav-sidebar-bg, #0b503e);
  font-family: var(--ui-font, "Segoe UI", sans-serif);
}
.customer-crm-view.crm-sidebar-collapsed { --crm-sidebar-size: 64px; }
.crm-side-nav { grid-column:1; grid-row:1/5; display:flex; flex-direction:column; min-height:0; padding:12px 12px 0; overflow:auto; color:var(--nav-text,#fff); }
.crm-workspace-switch { display:none; }
.crm-side-items { display:flex; flex-direction:column; gap:8px; }
.crm-side-items>button { display:flex; align-items:center; gap:11px; width:100%; height:48px; flex-shrink:0; padding:0 12px; text-align:left; border:0; border-radius:7px; background:transparent; color:#e2f1e7; font:14px var(--ui-font); cursor:pointer; white-space:nowrap; }
.crm-side-items>button svg { width:18px; height:18px; flex:0 0 18px; }
.crm-side-items>button i { margin-left:auto; font-style:normal; font-size:15px; transition:transform .2s ease; }
.crm-side-items>button.expanded i { transform:rotate(180deg); }
.crm-sub-items { display:flex; flex-direction:column; gap:4px; padding-left:14px; margin-top:-4px; margin-bottom:4px; }
.crm-sub-items>button { display:flex; align-items:center; gap:8px; width:100%; height:34px; padding:0 10px; border:0; border-radius:6px; background:transparent; color:#c7e0d1; font:12px var(--ui-font); text-align:left; cursor:pointer; white-space:nowrap; }
.crm-sub-items>button:hover { background:#ffffff14; color:#fff; }
.crm-sub-items .sub-dot { width:6px; height:6px; border-radius:50%; background:#34d399; flex-shrink:0; }
.crm-sub-items.hidden { display:none; }
.crm-sidebar-collapsed .crm-sub-items { display:none !important; }
.crm-side-items>button.active { background:var(--nav-active-bg,#032d24); color:#fff; font-weight:600; }
.crm-side-items>button:not(:disabled):hover { background:#ffffff14; color:#fff; }
.crm-side-items>button:disabled { opacity:.6; cursor:help; }
.crm-side-footer { margin-top:auto; padding-top:4px; }
#crmStorageBadge { display:block; margin:0 9px 10px; color:#d1e5d8; font-size:9px; line-height:1.5; }
.crm-side-footer>button { display:flex; align-items:center; gap:10px; width:calc(100% + 24px); height:48px; margin-left:-12px; padding:0 24px; color:#e2f1e7; border:0; border-top:1px solid #ffffff20; background:transparent; font:13px var(--ui-font); cursor:pointer; }
.crm-side-footer>button svg { width:17px; height:17px; flex:0 0 17px; }
.crm-sidebar-collapsed .crm-side-items>button { justify-content:center; padding:0; }
.crm-sidebar-collapsed :is(.crm-side-items>button>span,.crm-side-items>button>i,#crmStorageBadge,.crm-side-footer>button>span) { display:none; }
.crm-sidebar-collapsed .crm-side-footer>button { padding:0; justify-content:center; }
.crm-page-heading { grid-column:2; grid-row:1; display:flex; align-items:center; justify-content:space-between; gap:18px; padding:0 20px; border-radius:22px 0 0 0; background:var(--crm-surface); border-bottom:1px solid var(--crm-line); min-width:0; }
.crm-title-copy { min-width:0; }
.crm-page-heading h1 { margin:0 0 4px; font-size:16px; line-height:1.2; font-weight:650; letter-spacing:0; }
.crm-page-heading p { margin:0; font-size:11px; color:var(--crm-muted); line-height:1.35; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.crm-heading-actions { display:flex; align-items:center; gap:10px; flex:0 0 auto; }
.crm-search { display:flex; align-items:center; gap:6px; width:165px; height:32px; padding:0 9px; border:1px solid var(--crm-line); border-radius:5px; color:var(--crm-muted); background:var(--crm-surface); }
.crm-search>span { font-size:19px; }
.crm-search input { width:100%; min-width:0; border:0; outline:0; color:var(--crm-text); background:transparent; font:12px var(--ui-font); }
.crm-search input::placeholder { color:var(--crm-muted); }
.crm-primary-button,.crm-secondary-button { display:inline-flex; align-items:center; justify-content:center; gap:6px; height:32px; padding:0 12px; border-radius:5px; font:500 12px var(--ui-font); white-space:nowrap; cursor:pointer; }
.crm-primary-button { border:1px solid var(--crm-primary); background:var(--crm-primary); color:#fff; }
.crm-primary-button:hover { background:var(--action-primary-hover-bg,#074a36); }
.crm-primary-button:disabled { opacity:.55; cursor:wait; }
.crm-secondary-button { border:1px solid var(--crm-line); background:var(--crm-surface); color:var(--crm-text); }
.crm-secondary-button:hover { background:var(--crm-muted-surface); }
.crm-secondary-button svg { width:15px; height:15px; }
.crm-smart-views { grid-column:2; grid-row:2; display:flex; align-items:center; gap:8px; padding:6px 20px; background:var(--crm-surface); border-bottom:1px solid var(--crm-line); min-width:0; overflow-x:auto; scrollbar-width:none; }
.crm-smart-tab { display:inline-flex; align-items:center; gap:7px; height:32px; padding:0 12px; border:1px solid var(--crm-line); border-radius:18px; background:var(--crm-surface); color:var(--crm-muted); font:500 12px var(--ui-font); cursor:pointer; white-space:nowrap; transition:all .15s ease; }
.crm-smart-tab:hover { background:var(--crm-muted-surface); color:var(--crm-text); }
.crm-smart-tab.active { background:#0b604712; border-color:var(--crm-primary); color:var(--crm-primary); font-weight:600; }
.crm-smart-tab .smart-tab-dot { font-size:12px; color:var(--crm-primary); }
.crm-smart-tab .smart-tab-badge { display:inline-block; padding:1px 7px; border-radius:10px; font-size:11px; font-weight:600; background:var(--app-bg,#d8e2da); color:var(--crm-text); }
.crm-smart-tab.active .smart-tab-badge { background:var(--crm-primary); color:#fff; }
.smart-tab-badge.badge-urgent { background:#fee2e2; color:#b91c1c; }
.crm-smart-tab.active .smart-tab-badge.badge-urgent { background:#b91c1c; color:#fff; }
.smart-tab-badge.badge-repurchase { background:#fef3c7; color:#b45309; }
.crm-smart-tab.active .smart-tab-badge.badge-repurchase { background:#b45309; color:#fff; }
.smart-tab-badge.badge-vip { background:#fef9c3; color:#854d0e; }
.crm-smart-tab.active .smart-tab-badge.badge-vip { background:#ca8a04; color:#fff; }
.smart-tab-badge.badge-risk { background:#ffedd5; color:#c2410c; }
.crm-smart-tab.active .smart-tab-badge.badge-risk { background:#c2410c; color:#fff; }
.crm-table-toolbar { grid-column:2; grid-row:3; display:flex; align-items:center; gap:10px; min-width:0; padding:0 20px; background:var(--crm-surface); }
.crm-quick-filters { display:flex; align-items:center; gap:12px; min-width:0; overflow:auto; scrollbar-width:none; }
.crm-quick-filters select { min-width:0; max-width:180px; height:32px; margin:0; padding:0 20px 0 5px; appearance:none; border:0; border-radius:3px; background-color:transparent; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23536b5b' d='m2 4 4 4 4-4'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-size:12px; background-position:right 3px center; color:var(--crm-muted); font:12px var(--ui-font); cursor:pointer; field-sizing:content; }
.crm-quick-filters select:hover { background-color:var(--crm-muted-surface); }
.crm-quick-filters select[data-filtered="true"] { color:var(--crm-primary); }
.crm-quick-filters option { background:var(--crm-surface); color:var(--crm-text); }
.crm-filter-actions { display:flex; align-items:center; gap:8px; margin-left:auto; flex:0 0 auto; }
.crm-quick-clear-btn { display:inline-flex; align-items:center; gap:5px; height:32px; padding:0 10px; border:1px solid var(--crm-line); border-radius:5px; background:var(--crm-surface); color:var(--crm-muted); font:12px var(--ui-font); font-weight:500; cursor:pointer; white-space:nowrap; transition:all .15s ease; }
.crm-quick-clear-btn:hover { background:#fef2f2; color:#dc2626; border-color:#fca5a5; }
.crm-quick-clear-btn.active { background:#fee2e2; color:#b91c1c; border-color:#f87171; font-weight:600; }
.crm-icon-button { display:grid; place-items:center; width:32px; height:32px; border:1px solid var(--crm-line); border-radius:5px; background:var(--crm-surface); color:var(--crm-muted); cursor:pointer; }
.crm-icon-button svg { width:17px; height:17px; }
.crm-icon-button.active { color:var(--crm-primary); border-color:var(--crm-primary); background:var(--crm-surface); }
.crm-workspace { grid-column:2; grid-row:4; min-width:0; min-height:0; position:relative; padding:0 20px; background:var(--crm-surface); }
.crm-list-panel { height:100%; display:flex; flex-direction:column; min-height:0; min-width:0; background:var(--crm-surface); }
.crm-table-wrap { flex:1; min-height:0; overflow:auto; border-radius:8px 8px 0 0; background:var(--crm-surface); }
.crm-contact-table { width:100%; min-width:950px; border-spacing:0; border-collapse:separate; table-layout:auto; font-size:13px; }
.crm-contact-table th { position:sticky; top:0; z-index:2; height:46px; padding:0 12px; background:var(--crm-head); color:var(--crm-text); text-align:left; font-size:12px; font-weight:600; white-space:nowrap; border-bottom:1px solid var(--crm-line); }
.crm-contact-table td { height:44px; padding:0 12px; color:var(--crm-muted); border-bottom:1px solid var(--crm-line); background:var(--crm-surface); font-size:13px; }
.crm-contact-table tbody tr:nth-child(even) td { background:var(--crm-muted-surface); }
.crm-contact-table .crm-contact-row:hover td { background:var(--conversation-read-hover-bg,#cadbd0); }
.crm-contact-table .crm-contact-row.selected td { background:var(--conversation-read-hover-bg,#cadbd0); }
.crm-contact-table .crm-contact-row:is(:hover,.selected) td { color:var(--text-compact-aa,var(--crm-text)); }
.crm-contact-row { cursor:pointer; }
.crm-contact-row:focus-visible { outline:2px solid var(--crm-primary); outline-offset:-2px; }
.crm-contact-table [data-crm-col="name"] { min-width:155px; }
.crm-contact-table [data-crm-col="phone"] { min-width:145px; white-space:nowrap; }
.crm-contact-table [data-crm-col="marketer"] { min-width:115px; white-space:nowrap; }
.crm-contact-table [data-crm-col="email"] { min-width:180px; max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.crm-contact-table [data-crm-col="orderCount"] { min-width:105px; text-align:right; }
.crm-contact-table [data-crm-col="source"] { min-width:110px; white-space:nowrap; }
.crm-contact-table [data-crm-col="owner"] { min-width:135px; white-space:nowrap; }
.crm-contact-table [data-crm-col="stage"] { min-width:125px; white-space:nowrap; }
.crm-contact-table [data-crm-col="address"] { min-width:240px; }
.crm-contact-table [data-crm-col="lastDeliveredAt"] { min-width:115px; white-space:nowrap; }
.crm-contact-table [data-crm-col="repurchase"] { min-width:155px; }
.crm-contact-table [data-crm-col="nextTask"] { min-width:160px; }
.crm-contact-table [data-crm-col="actions"] { position:sticky; right:0; min-width:125px; text-align:center; white-space:nowrap; background:var(--crm-surface); z-index:1; box-shadow:-4px 0 8px rgba(0,0,0,0.06); }
.crm-contact-table th[data-crm-col="actions"] { z-index:3; background:var(--crm-head); }
.crm-contact-table tbody tr:nth-child(even) td[data-crm-col="actions"] { background:var(--crm-muted-surface); }
.crm-contact-table .crm-contact-row:is(:hover,.selected) td[data-crm-col="actions"] { background:var(--conversation-read-hover-bg,#cadbd0); }
.crm-row-action-btn { display:inline-flex; align-items:center; justify-content:center; gap:5px; height:28px; padding:0 8px; border:1px solid #0284c7; border-radius:5px; background:#f0f9ff; color:#0369a1; font:600 11px var(--ui-font); cursor:pointer; white-space:nowrap; transition:all .15s ease; }
.crm-row-action-btn:hover:not(:disabled) { background:#0284c7; color:#fff; border-color:#0284c7; box-shadow:0 2px 6px #0284c730; }
.crm-row-action-btn:disabled { opacity:.5; cursor:not-allowed; border-color:var(--crm-line); background:transparent; color:var(--crm-muted); }
.crm-row-action-btn.crm-ds-added { background:#dcfce7; border-color:#86efac; color:#15803d; pointer-events:none; }
.crm-row-action-btn.crm-ds-flagged { background:#fef2f2 !important; border-color:#fca5a5 !important; color:#dc2626 !important; opacity:0.95 !important; cursor:not-allowed !important; font-weight:600 !important; }
.crm-row-action-btn.crm-ds-flagged:hover { background:#fee2e2 !important; border-color:#f87171 !important; box-shadow:none !important; }
.crm-row-action-btn svg { width:13px; height:13px; flex-shrink:0; }
.crm-bulk-ds-btn { background:#0284c7 !important; border-color:#0284c7 !important; color:#fff !important; }
.crm-bulk-ds-btn:hover { background:#0369a1 !important; }
.crm-date-val { font-size:12px; font-weight:500; color:var(--crm-text); white-space:nowrap; }
.crm-toast-link { display:inline-block; margin-left:8px; padding:2px 7px; background:#ffffff25; border:1px solid #ffffff50; border-radius:4px; color:#fff; font-size:11px; cursor:pointer; text-decoration:none; }
.crm-toast-link:hover { background:#fff; color:#0b6047; }
.crm-contact-table .crm-checkbox-cell { width:44px; padding:0 13px; }
.crm-contact-table input { width:15px; height:15px; margin:0; accent-color:var(--crm-primary); cursor:pointer; }
.crm-contact-name { display:block; font-weight:400; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.crm-phone-value { display:inline-flex; align-items:center; gap:6px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size:12px; }
.crm-phone-value svg { width:12px; height:12px; fill:var(--crm-primary); flex-shrink:0; }
.crm-marketer-chip { display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:500; color:var(--crm-text); }
.crm-marketer-badge { display:inline-block; padding:2px 8px; border-radius:12px; font-size:11px; font-weight:600; background:#f0fdf4; color:#166534; border:1px solid #bbf7d0; white-space:nowrap; }
.crm-owner-chip { display:inline-flex; align-items:center; gap:7px; font-size:12px; }
.crm-owner-chip>i { display:grid; place-items:center; flex:0 0 auto; width:18px; height:18px; border-radius:50%; background:var(--crm-primary); color:#fff; font-size:8px; font-style:normal; }
.crm-unassigned { color:var(--crm-muted); font-size:11px; }
.crm-active-badge { display:inline-block; padding:4px 7px; border-radius:4px; background:var(--crm-active-bg,#18774f); color:var(--crm-active-text,#fff); font-size:11px; line-height:1.3; white-space:nowrap; }
.crm-active-badge.inactive { background:var(--crm-inactive-bg,#fbedef); color:var(--crm-inactive-text,#913748); }
.crm-tag-list,.crm-profile-tags { display:flex; flex-wrap:wrap; gap:5px; }
.crm-tag-pill,.crm-stage-pill { display:inline-block; padding:4px 6px; border-radius:4px; background:var(--app-bg,#d8e2da); color:var(--crm-muted,var(--text-secondary,#536b5b)); font-size:10px; white-space:nowrap; }
.crm-stage-new { background:var(--crm-stage-new-bg,#e8c77d); color:var(--crm-stage-new-text,#273c2f); }
.crm-stage-qualified { background:var(--crm-stage-qualified-bg,#dceadf); color:var(--crm-stage-qualified-text,#28533a); }
.crm-stage-customer { background:var(--crm-stage-customer-bg,#a9d1b7); color:var(--crm-stage-customer-text,#173d29); }
.crm-stage-inactive { background:var(--crm-stage-inactive-bg,#e7eae7); color:var(--crm-stage-inactive-text,#536b5b); }
.crm-table-footer { display:flex; align-items:center; flex:0 0 42px; gap:10px; height:42px; min-width:0; padding:0 10px 0 58px; color:var(--crm-muted); background:var(--crm-surface); border-top:1px solid var(--crm-line); font-size:12px; }
#crmDataNotice { display:none; }
#crmVisibleCount { margin-left:auto; white-space:nowrap; }
.crm-page-size select { width:42px; height:26px; border:0; background:transparent; color:var(--crm-muted); font-size:11px; }
.crm-table-footer>button { display:grid; place-items:center; width:22px; height:28px; padding:0; border:0; background:transparent; color:var(--crm-muted); font-size:21px; cursor:pointer; }
.crm-table-footer>button:disabled { opacity:.35; cursor:default; }
.crm-bulk-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:9px; flex:0 0 auto; min-height:47px; padding:8px 12px; border:1px solid var(--crm-line); border-radius:7px 7px 0 0; background:var(--crm-muted-surface); font-size:12px; }
.crm-bulk-toolbar select { height:30px; padding:0 7px; border:1px solid var(--crm-line); border-radius:4px; color:var(--crm-text); background:var(--crm-surface); font:11px var(--ui-font); }
.crm-bulk-toolbar>span { font-size:11px; }
.crm-empty-state { padding:55px 20px; text-align:center; color:var(--crm-muted); font-size:13px; }
.crm-empty-state strong { color:var(--crm-text); }
.customer-crm-view[data-page="leads"] { grid-template-rows:58px 0 52px minmax(0,1fr); }
.customer-crm-view[data-page="leads"] .crm-smart-views { display:none; }
.crm-lead-board { display:grid; grid-template-columns:repeat(4,minmax(245px,1fr)); gap:14px; height:100%; padding:8px 0 18px; overflow:auto; }
.crm-board-column { display:flex; flex-direction:column; min-height:0; border-radius:6px; background:var(--crm-muted-surface); }
.crm-board-column>header { display:flex; align-items:center; gap:8px; flex:0 0 44px; padding:0 13px; border-bottom:1px solid var(--crm-line); font-size:13px; }
.crm-board-column>header>span { margin-left:auto; color:var(--crm-muted); font-size:12px; }
.crm-board-dot { width:7px; height:7px; border-radius:50%; background:var(--crm-primary); }
.crm-board-dot.new { background:var(--accent-champagne,#e8c77d); }.crm-board-dot.inactive { background:var(--crm-inactive-text,#913748); }
.crm-board-cards { display:grid; gap:10px; align-content:start; padding:10px; overflow:auto; }
.crm-lead-card { padding:13px; border:1px solid var(--crm-line); border-radius:6px; background:var(--crm-surface); }
.crm-lead-card>button { padding:0; border:0; background:transparent; color:var(--crm-text); font:600 13px var(--ui-font); text-align:left; cursor:pointer; }
.crm-lead-card p { margin:9px 0 0; font-size:12px; color:var(--crm-muted); overflow-wrap:anywhere; }
.crm-lead-card>small { display:block; margin:11px 0; font-size:11px; color:var(--crm-muted); }
.crm-lead-card footer { display:grid; gap:9px; padding-top:9px; border-top:1px solid var(--crm-line); font-size:11px; color:var(--crm-muted); }
.crm-lead-card footer select { width:100%; height:29px; padding:0 5px; border:1px solid var(--crm-line); border-radius:4px; background:var(--crm-surface); color:var(--crm-text); font:11px var(--ui-font); }
.crm-board-empty { padding:10px; font-size:11px; color:var(--crm-muted); text-align:center; }
.crm-profile-panel { display:none; position:fixed; top:56px; right:0; bottom:0; width:560px; max-width:calc(100vw - 42px); min-height:0; z-index:20; flex-direction:column; color:var(--crm-text); background:var(--crm-surface); border-left:1px solid var(--crm-line); box-shadow:-5px 0 16px #20382b20; }
.crm-workspace.has-profile .crm-profile-panel { display:flex; }
.crm-drawer-wide .crm-profile-panel { width:min(920px,calc(100vw - 70px)); }
.crm-drawer-close { position:absolute; top:7px; left:-34px; width:27px; height:27px; display:grid; place-items:center; border:1px solid var(--crm-line); border-radius:50%; background:var(--crm-surface); color:var(--crm-muted); box-shadow:0 1px 7px #20382b20; font-size:21px; cursor:pointer; }
.crm-profile-header { display:flex; align-items:center; gap:12px; flex:0 0 56px; height:56px; padding:0 22px; border-bottom:1px solid var(--crm-line); }
.crm-contact-avatar { display:grid; place-items:center; flex:0 0 38px; width:38px; height:38px; border-radius:50%; background:var(--app-bg,#d8e2da); color:var(--crm-primary); font-size:12px; font-weight:600; }
.crm-profile-header h2 { margin:0; flex:1; min-width:0; font-size:17px; font-weight:600; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.crm-profile-header>button:not(.crm-drawer-to-ds-btn) { width:27px; height:30px; padding:0; border:0; background:transparent; color:var(--crm-muted); font-size:21px; cursor:pointer; }
.crm-drawer-to-ds-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  width: auto !important;
  min-width: 155px !important;
  height: 34px !important;
  padding: 0 14px !important;
  border-radius: 6px !important;
  border: 1px solid #0284c7 !important;
  background: #0284c7 !important;
  color: #ffffff !important;
  font: 600 12px/1 var(--ui-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif) !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.25);
  transition: all 0.15s ease-in-out;
}
.crm-drawer-to-ds-btn svg {
  width: 14px !important;
  height: 14px !important;
  flex-shrink: 0 !important;
}
.crm-drawer-to-ds-btn:hover:not(:disabled) {
  background: #0369a1 !important;
  border-color: #0369a1 !important;
  box-shadow: 0 3px 8px rgba(2, 132, 199, 0.35);
  transform: translateY(-1px);
}
.crm-drawer-to-ds-btn:active:not(:disabled) {
  transform: translateY(0);
}
.crm-drawer-to-ds-btn:disabled {
  opacity: 0.65 !important;
  cursor: not-allowed !important;
  background: #64748b !important;
  border-color: #64748b !important;
  color: #f1f5f9 !important;
  transform: none !important;
  box-shadow: none !important;
}
.crm-drawer-to-ds-btn.crm-ds-added {
  background: #059669 !important;
  border-color: #059669 !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.25);
  pointer-events: none !important;
}
.crm-drawer-to-ds-btn.crm-ds-flagged {
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
  color: #dc2626 !important;
  opacity: 0.95 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
}
.crm-drawer-to-ds-btn.crm-ds-flagged:hover {
  background: #fee2e2 !important;
  border-color: #f87171 !important;
  box-shadow: none !important;
  transform: none !important;
}
@keyframes crmSpin { 100% { transform: rotate(360deg); } }
.crm-spin { animation: crmSpin 0.9s linear infinite; }
.crm-profile-actions { display:flex; justify-content:center; align-items:flex-start; gap:22px; flex:0 0 96px; padding:16px 20px 10px; }
.crm-profile-actions>button { display:grid; justify-items:center; gap:7px; width:52px; padding:0; border:0; background:transparent; color:var(--crm-muted); font:11px var(--ui-font); cursor:pointer; }
.crm-profile-actions>button>span { display:grid; place-items:center; width:44px; height:44px; border-radius:50%; background:var(--crm-muted-surface); color:var(--crm-primary); }
.crm-profile-actions svg { width:22px; height:22px; }
.crm-profile-actions>button:disabled { opacity:.5; cursor:help; }
.crm-profile-actions>button:not(:disabled):hover>span { background:var(--conversation-read-hover-bg,#cadbd0); }
.crm-profile-metrics { display:flex; flex-wrap:wrap; flex:0 0 68px; align-content:start; padding:6px 25px 0; }
.crm-profile-metrics>div { display:grid; justify-items:center; gap:6px; width:50%; font-size:11px; color:var(--crm-muted); }
.crm-profile-metrics strong { padding:3px 7px; border:1px solid var(--crm-line); border-radius:4px; color:var(--crm-primary); font-size:12px; font-weight:500; }
.crm-profile-metrics p { width:100%; margin:5px 0 0; font-size:8px; text-align:center; color:var(--crm-muted); }
.crm-profile-tabs { display:flex; flex:0 0 48px; border-bottom:1px solid var(--crm-line); }
.crm-profile-tabs button { flex:1; position:relative; padding:0 10px; border:0; background:transparent; color:var(--crm-muted); font:13px var(--ui-font); cursor:pointer; }
.crm-profile-tabs button.active { color:var(--crm-primary); }
.crm-profile-tabs button.active:after { content:""; position:absolute; left:0; right:0; bottom:-1px; height:2px; background:var(--crm-primary); }
.crm-profile-content { flex:1; min-height:0; padding:28px 30px; overflow:auto; }
.crm-detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:28px 28px; margin:0; }
.crm-detail-grid>div { min-width:0; }
.crm-detail-grid dt { margin:0 0 10px; font-size:12px; font-weight:600; color:var(--crm-text); }
.crm-detail-grid dt em { color:var(--crm-inactive-text,#913748); font-style:normal; }
.crm-detail-grid dd { margin:0; color:var(--crm-muted); font-size:14px; line-height:1.5; overflow-wrap:anywhere; }
.crm-detail-grid .crm-owner-chip { font-size:12px; }
.crm-inline-edit { padding:0 0 4px; border:0; border-bottom:1px solid transparent; background:transparent; color:inherit; font:inherit; text-align:left; cursor:pointer; }
.crm-inline-edit:hover { border-bottom-color:var(--crm-primary); }
.crm-profile-stage { max-width:100%; height:29px; border:1px solid var(--crm-line); border-radius:4px; background:var(--crm-surface); color:var(--crm-muted); font:12px var(--ui-font); }
.crm-profile-section { margin-top:28px; padding-top:18px; border-top:1px solid var(--crm-line); }
.crm-profile-section-heading { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.crm-profile-section-heading h3,.crm-tab-heading { margin:0; font-size:13px; font-weight:600; }
.crm-profile-section-heading button { border:0; background:transparent; color:var(--crm-primary); font:12px var(--ui-font); cursor:pointer; }
.crm-tab-heading { margin-bottom:18px; }
.crm-field-hint,.crm-tab-empty { color:var(--crm-muted,var(--text-secondary,#536b5b)); font-size:12px; line-height:1.6; }
.crm-note-form { display:grid; gap:10px; }
.crm-note-form textarea { width:100%; min-height:90px; padding:12px; border:1px solid var(--crm-line); border-radius:6px; background:var(--crm-surface); color:var(--crm-text); resize:vertical; font:13px/1.5 var(--ui-font); }
.crm-note-form button { justify-self:end; padding:8px 14px; border:0; border-radius:5px; background:var(--crm-primary); color:#fff; font:12px var(--ui-font); cursor:pointer; }
.crm-note-list { display:grid; gap:18px; margin-top:25px; }
.crm-note-item { display:flex; align-items:flex-start; gap:11px; }
.crm-note-item>i { display:grid; place-items:center; flex:0 0 29px; width:29px; height:29px; border-radius:50%; background:var(--app-bg,#d8e2da); color:var(--crm-primary); font-size:9px; font-style:normal; }
.crm-note-item strong { font-size:12px; font-weight:600; }.crm-note-item p { margin:7px 0; font-size:13px; line-height:1.5; white-space:pre-wrap; overflow-wrap:anywhere; }.crm-note-item small { color:var(--crm-muted); font-size:11px; }
.crm-profile-sample { margin:25px 0 0; color:var(--crm-muted); font-size:10px; }
.crm-linked-conversation { display:grid; gap:12px; padding:17px; border:1px solid var(--crm-line); border-radius:6px; }.crm-linked-conversation>span { color:var(--crm-primary); font-size:11px; }.crm-linked-conversation>strong { font-size:14px; }.crm-linked-conversation p { margin:0; color:var(--crm-muted); font-size:12px; }.crm-linked-conversation button { justify-self:start; }
.crm-column-popover,.crm-toolbar-popover { position:fixed; inset:118px 28px auto auto; margin:0; width:235px; max-height:calc(100dvh - 155px); padding:15px; overflow:auto; border:1px solid var(--border-default,#b6c8bb); border-radius:7px; background:var(--crm-content-bg,var(--surface-bg,#fff)); color:var(--text-primary,#20382b); box-shadow:0 5px 22px #20382b25; font:12px var(--ui-font); }
.crm-column-popover:not(:popover-open),.crm-toolbar-popover:not(:popover-open) { display:none; }
.crm-column-popover header { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; padding-bottom:10px; border-bottom:1px solid var(--border-default,#b6c8bb); font-size:13px; }
.crm-column-popover header button { border:0; background:transparent; color:inherit; font-size:20px; cursor:pointer; }
#crmColumnChoices { display:grid; gap:4px; }#crmColumnChoices label { display:flex; align-items:center; gap:9px; padding:6px 0; cursor:pointer; }#crmColumnChoices input { width:15px; height:15px; accent-color:var(--action-primary-bg,#0b6047); }
.crm-toolbar-popover:popover-open { display:grid; gap:14px; }
.crm-toolbar-popover select { width:100%; height:33px; padding:0 7px; border:1px solid var(--border-default,#b6c8bb); border-radius:4px; background:var(--crm-content-bg,var(--surface-bg,#fff)); color:var(--text-primary,#20382b); font:12px var(--ui-font); }
.crm-toolbar-popover label { display:grid; gap:7px; }
.crm-menu-action { border:0; padding:8px; border-radius:4px; background:transparent; color:inherit; font:12px var(--ui-font); text-align:left; cursor:pointer; }.crm-menu-action:hover { background:var(--app-bg,#d8e2da); }
.crm-contact-dialog { width:min(535px,calc(100vw - 30px)); max-height:90vh; padding:23px; overflow:auto; border-radius:9px; }
.crm-contact-dialog form { display:grid; gap:6px; }
.crm-contact-dialog .field-label { margin-top:10px; font-size:12px; }
.crm-contact-dialog .text-field,.crm-contact-dialog .note-input,.crm-contact-dialog .workflow-select { width:100%; min-height:37px; padding:8px 10px; border:1px solid var(--border-default,#b6c8bb); border-radius:5px; background:var(--crm-content-bg,var(--surface-bg,#fff)); color:var(--text-primary,#20382b); font:13px var(--ui-font); }
.crm-contact-dialog .note-input { resize:vertical; }.crm-form-two { display:grid; grid-template-columns:1fr 1fr; gap:15px; }.crm-contact-dialog .workflow-help { font-size:11px; }.crm-contact-dialog .workflow-dialog-heading h2 { font-size:18px; }
.customer-crm-view :is(button,input,select,textarea):focus-visible,.crm-profile-panel :is(button,input,select,textarea):focus-visible { outline:2px solid var(--action-primary-bg,#0b6047); outline-offset:2px; }

/* Customer 360 Table Columns & Badges */
.crm-code-badge { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 11px; padding: 2px 6px; border-radius: 4px; background: #eef3f0; color: #1e3a29; font-weight: 600; }
.crm-vip-crown { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 700; color: #b45309; background: #fef3c7; padding: 1px 6px; border-radius: 4px; margin-left: 6px; border: 1px solid #fde68a; }
.crm-rfm-tag { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.crm-rfm-vip { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
.crm-rfm-loyal { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.crm-rfm-potential { background: #e0f2fe; color: #0369a1; border: 1px solid #7dd3fc; }
.crm-rfm-risk { background: #ffedd5; color: #c2410c; border: 1px solid #fdba74; }
.crm-rfm-hibernating { background: #f3f4f6; color: #4b5563; border: 1px solid #d1d5db; }
.crm-rfm-new { background: #ede9fe; color: #6d28d9; border: 1px solid #c4b5fd; }
.crm-repurchase-cell { display: flex; flex-direction: column; gap: 2px; }
.crm-sku-name { font-size: 12px; font-weight: 500; color: var(--crm-text); }
.crm-cycle-badge { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 600; width: fit-content; }
.crm-cycle-badge.overdue { background: #fee2e2; color: #b91c1c; }
.crm-cycle-badge.due-soon { background: #fef3c7; color: #b45309; }
.crm-cycle-badge.in-cycle { background: #dcfce7; color: #15803d; }
.crm-next-task-cell { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.crm-task-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  width: fit-content;
  white-space: nowrap !important;
}
.crm-task-pill.urgent { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.crm-task-pill.normal { background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe; }
.crm-task-due { font-size: 10px; color: var(--crm-muted); white-space: nowrap; }
.crm-task-due.urgent { color: #dc2626; font-weight: 500; }
.crm-revenue-val { font-weight: 600; color: #0b6047; }

/* Customer 360 Drawer Enhancements */
.crm-profile-ribbon { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 10px 22px; background: var(--crm-muted-surface); border-bottom: 1px solid var(--crm-line); }
.crm-profile-ribbon > div { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--crm-muted); }
.crm-profile-ribbon strong { font-size: 13px; font-weight: 600; color: var(--crm-text); }
.crm-ribbon-sub { font-size: 10px; color: var(--crm-muted); }

/* 360 Tab Content */
.crm-360-identities { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.crm-id-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 4px; background: #e8f5e9; color: #1b5e20; font-size: 11px; font-weight: 500; }
.crm-id-chip.primary { border: 1px solid #81c784; }

.crm-sku-card { padding: 12px; border: 1px solid var(--crm-line); border-radius: 8px; background: var(--crm-surface); margin-bottom: 10px; }
.crm-sku-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.crm-sku-header strong { font-size: 13px; color: var(--crm-text); }
.crm-sku-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 11px; color: var(--crm-muted); margin-bottom: 8px; }
.crm-sku-action { display: flex; justify-content: flex-end; }
.crm-sku-action button { padding: 4px 10px; font-size: 11px; border: 1px solid var(--crm-primary); background: transparent; color: var(--crm-primary); border-radius: 4px; cursor: pointer; }
.crm-sku-action button:hover { background: var(--crm-primary); color: #fff; }

.crm-task-item { padding: 12px; border: 1px solid var(--crm-line); border-radius: 8px; background: var(--crm-surface); margin-bottom: 10px; }
.crm-task-item.completed { opacity: 0.7; background: var(--crm-muted-surface); }
.crm-task-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.crm-task-desc { font-size: 12px; color: var(--crm-muted); margin-bottom: 8px; }
.crm-outcome-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--crm-line); }
.crm-outcome-form select { height: 28px; padding: 0 6px; border: 1px solid var(--crm-line); border-radius: 4px; font-size: 11px; }
.crm-outcome-form input { height: 28px; flex: 1; padding: 0 8px; border: 1px solid var(--crm-line); border-radius: 4px; font-size: 11px; }
.crm-outcome-form button { height: 28px; padding: 0 10px; background: var(--crm-primary); color: #fff; border: 0; border-radius: 4px; font-size: 11px; cursor: pointer; }

.crm-order-card { padding: 10px 12px; border: 1px solid var(--crm-line); border-radius: 6px; margin-bottom: 8px; background: var(--crm-surface); }
.crm-order-card-header { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin-bottom: 4px; }
.crm-order-card-header strong { color: var(--crm-primary); }
.crm-order-card-body { font-size: 12px; color: var(--crm-text); display: flex; justify-content: space-between; }
.crm-order-card-footer { font-size: 11px; color: var(--crm-muted); margin-top: 4px; }

/* Telesales Quick Call Station & SOP Guidance */
.crm-call-station {
  margin: 10px 18px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  overflow: hidden;
}
.crm-call-station.collapsed .crm-call-tabs,
.crm-call-station.collapsed .crm-call-body {
  display: none;
}
.crm-call-station-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}
.crm-call-station-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.crm-call-station-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: #e0e7ff;
  color: #4338ca;
}
.crm-call-station-toggle {
  background: none;
  border: none;
  color: #64748b;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}
.crm-call-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 6px 10px;
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
}
.crm-call-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px 2px;
  border-radius: 5px;
  border: 1px solid transparent;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}
.crm-call-tab-btn span.tab-icon {
  font-size: 13px;
  margin-bottom: 2px;
}
.crm-call-tab-btn:hover {
  background: #f1f5f9;
}
.crm-call-tab-btn.active[data-outcome="extend_cycle"] {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}
.crm-call-tab-btn.active[data-outcome="follow_up"] {
  background: #fefce8;
  border-color: #fde047;
  color: #854d0e;
}
.crm-call-tab-btn.active[data-outcome="missed_call"] {
  background: #f5f3ff;
  border-color: #c4b5fd;
  color: #5b21b6;
}
.crm-call-tab-btn.active[data-outcome="rejected"] {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}
.crm-call-tab-btn.active[data-outcome="closed_order"] {
  background: #ecfdf5;
  border-color: #34d399;
  color: #065f46;
}
.crm-call-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.crm-quick-chips-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.crm-chip-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  min-width: 58px;
}
.crm-quick-chip {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s;
}
.crm-quick-chip:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}
.crm-quick-chip.selected {
  border-color: #0b6047;
  background: #0b6047;
  color: #fff;
  font-weight: 600;
}
.crm-sop-box {
  padding: 8px 10px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  line-height: 1.4;
}
.crm-sop-goal {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: #0f766e;
  font-weight: 600;
}
.crm-sop-script {
  padding: 6px 8px;
  background: #f0fdfa;
  border-left: 3px solid #14b8a6;
  border-radius: 0 4px 4px 0;
  color: #134e4a;
  font-style: italic;
}
.crm-sop-tip {
  color: #64748b;
  font-size: 10px;
}
.crm-zalo-box {
  padding: 6px 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.crm-zalo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: #1d4ed8;
}
.crm-zalo-copy-btn {
  padding: 2px 7px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}
.crm-zalo-copy-btn:hover {
  background: #1d4ed8;
}
.crm-zalo-text {
  font-size: 11px;
  color: #1e3a8a;
  white-space: pre-wrap;
  margin: 0;
  user-select: all;
  background: #fff;
  padding: 5px 7px;
  border-radius: 4px;
  border: 1px dashed #93c5fd;
  font-family: inherit;
}
.crm-call-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 4px;
  border-top: 1px solid #f1f5f9;
}
.crm-call-feedback-info {
  font-size: 11px;
  color: #059669;
  font-weight: 500;
}
.crm-call-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 12px;
  border-radius: 5px;
  background: #0b6047;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.crm-call-save-btn:hover {
  background: #094e3a;
}
.crm-call-save-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media(max-height:600px) and (min-width:761px) {
  .crm-side-items { gap:5px; }.crm-side-items>button { height:43px; }.crm-side-footer>button { height:42px; }#crmStorageBadge { margin-bottom:6px; font-size:8px; }
}
@media(max-width:1100px) {
  .customer-crm-view { --crm-sidebar-size:180px; }
  .crm-heading-actions { gap:7px; }.crm-search { width:135px; }.crm-page-heading p { max-width:310px; }
  .crm-quick-filters { gap:4px; }.crm-quick-filters select { font-size:11px; padding-left:3px; padding-right:18px; }.crm-filter-actions { gap:5px; }
}
@media(max-width:760px) {
  .customer-crm-view { --crm-sidebar-size:56px; height:calc(100% - 102px); grid-template-rows:68px 50px minmax(0,1fr); }
  .crm-side-nav { padding:10px 7px 0; }.crm-side-items { gap:6px; }.crm-side-items>button { justify-content:center; height:43px; padding:0; }.crm-side-items>button>span,.crm-side-items>button>i,#crmStorageBadge,.crm-side-footer>button>span { display:none; }.crm-side-footer>button { width:calc(100% + 14px); margin-left:-7px; padding:0; justify-content:center; }
  .crm-page-heading { padding:0 12px; gap:10px; border-top-left-radius:15px; }.crm-page-heading h1 { font-size:15px; }.crm-page-heading p { max-width:200px; font-size:10px; }.crm-heading-actions .crm-search { display:none; }.crm-heading-actions button { padding:0 7px; font-size:10px; }.crm-heading-actions .crm-secondary-button { width:31px; font-size:0; }.crm-heading-actions .crm-secondary-button svg { flex:0 0 15px; }
  .crm-table-toolbar { gap:8px; padding:0 12px; }.crm-quick-filters { flex:1; }.crm-quick-filters select { font-size:11px; }.crm-filter-actions { gap:4px; }.crm-filter-actions>.crm-icon-button { width:28px; height:28px; }.crm-filter-actions>.crm-icon-button:first-child { display:none; }
  .crm-workspace { padding:0 12px; }.crm-contact-table { min-width:880px; }.crm-table-footer { padding-left:8px; gap:7px; font-size:10px; }#crmRecordCount { display:none; }#crmVisibleCount { margin-left:0; margin-right:auto; }.crm-bulk-toolbar { font-size:10px; }.crm-bulk-toolbar .crm-primary-button,.crm-bulk-toolbar .crm-secondary-button { font-size:10px; padding:0 8px; }
  .crm-profile-panel { top:56px; bottom:46px; width:calc(100vw - 35px); max-width:none; }.crm-profile-actions { gap:14px; padding-left:10px; padding-right:10px; }.crm-profile-header { padding:0 15px; }.crm-profile-content { padding:22px 19px; }.crm-detail-grid { gap:24px 16px; }.crm-detail-grid dd { font-size:12px; }.crm-profile-tabs button { font-size:12px; padding:0 5px; }
  .customer-crm-view[data-page="leads"] { grid-template-rows:68px 50px minmax(0,1fr); }
  .crm-column-popover,.crm-toolbar-popover { right:15px; top:130px; max-height:calc(100dvh - 190px); }.crm-form-two { grid-template-columns:1fr; }
}

/* =========================================================
   CYCLE CONFIGURATION BUTTON & MODAL
   ========================================================= */
.crm-cycle-config-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.crm-cycle-config-btn:hover {
  background: #e0e7ff;
  border-color: #a5b4fc;
  color: #312e81;
}
.crm-cycle-config-btn svg {
  stroke: #4f46e5;
  flex-shrink: 0;
}

.crm-cycle-config-modal {
  border: none;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 950px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 40px);
  padding: 0;
  background: #ffffff;
  color: #1e293b;
  overflow: hidden;
}
.crm-cycle-config-modal::backdrop {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
}
.crm-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.crm-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.crm-modal-title h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}
.crm-modal-close {
  background: transparent;
  border: none;
  font-size: 16px;
  color: #64748b;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.crm-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.crm-modal-body {
  padding: 16px 20px;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
}
.crm-modal-tip {
  padding: 10px 14px;
  background: #eff6ff;
  border-left: 3px solid #3b82f6;
  border-radius: 6px;
  font-size: 12px;
  color: #1e40af;
  margin-bottom: 14px;
  line-height: 1.5;
}
.crm-cycle-table-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}
.crm-cycle-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.crm-cycle-table thead th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 1px solid #cbd5e1;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.crm-cycle-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.crm-cycle-table tbody tr:hover {
  background: #f8fafc;
}
.crm-cycle-input {
  width: 70px;
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: #0f172a;
  outline: none;
  transition: border-color 0.15s;
}
.crm-cycle-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.crm-cycle-note-input {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 11px;
  color: #475569;
  outline: none;
}
.crm-cycle-note-input:focus {
  border-color: #3b82f6;
}
.crm-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}
.crm-recalculate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid #d97706;
  background: #fffbeb;
  color: #b45309;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.crm-recalculate-btn:hover {
  background: #fef3c7;
  color: #92400e;
}
.crm-call-order-selector {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 8px;
}
.crm-call-order-selector select {
  height: 30px;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  font-size: 12px;
  padding: 0 8px;
}
.crm-call-order-preview {
  padding: 8px 12px;
  border-radius: 6px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  font-size: 11px;
  color: #166534;
  line-height: 1.5;
  margin-top: 6px;
  margin-bottom: 8px;
}

