/* Filed OPS — UI refinement R1 (v0.8.65 compatible).
 * Incremental design layer: no business logic, route changes or 3rd-party assets.
 * Keeping it separate from app.css allows an instant visual rollback.
 */
.crm-body {
  --ui-bg: #f7f9fc;
  --ui-card: #ffffff;
  --ui-ink: #1e3343;
  --ui-text: #465968;
  --ui-muted: #6b7c88;
  --ui-line: #e8edf1;
  --ui-radius: 17px;
  --ui-shadow: 0 2px 9px rgba(18,43,58,.025),0 13px 32px rgba(18,43,58,.028);
  background: var(--ui-bg);
  color: var(--ui-ink);
}
.crm-body :is(button,a,input,select,textarea):focus-visible,
.master-body :is(button,a,input,select,textarea):focus-visible {
  outline: 3px solid var(--brand,#2a72e5);
  outline-offset: 3px;
}
.crm-body :is(.content,.main,.app-shell) { min-width:0; }
.crm-body .main {background:var(--ui-bg);}
.crm-body .content {width:100%;max-width:1536px;padding:30px clamp(18px,2.5vw,46px) 70px;}
.crm-body .crm-footer {color:#81909a;border-top-color:var(--ui-line);}
.crm-body :is(.card,.data-card,.modern-card,.settings-card,.panel) {
  border-color:var(--ui-line); border-radius:var(--ui-radius);
  box-shadow:var(--ui-shadow);
}
.crm-body :is(.page-head,.modern-page-head) {margin-bottom:24px;align-items:center;gap:18px;}
.crm-body :is(.page-head h1,.page-head h2,.modern-page-head h1) {color:var(--ui-ink);font-size:clamp(24px,2vw,31px);font-weight:770;line-height:1.2;letter-spacing:-.035em;}
.crm-body :is(.page-head p,.modern-page-head p) {color:var(--ui-muted);font-size:13px;line-height:1.55;}
.crm-body .eyebrow {font-size:10.5px;letter-spacing:.12em;font-weight:800;}
.crm-body .btn {font-weight:690;border-radius:10px;transition:filter .16s,box-shadow .16s,transform .16s;min-height:41px;}
.crm-body .btn:hover {filter:brightness(.985);}
.crm-body .btn-primary {box-shadow:0 4px 12px color-mix(in srgb,var(--brand) 14%,transparent);}
.crm-body :is(.input,.select,.textarea,input[type="search"]) {border-radius:11px;border-color:#dfe5e9;background:#fff;color:var(--ui-ink);}
.crm-body :is(.input,.select,.textarea):focus {border-color:var(--brand);box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 11%,transparent);}
.crm-body .sidebar {background:#fff!important;border-right:1px solid var(--ui-line);box-shadow:none;}
.crm-body .sidebar-top {border-bottom-color:var(--ui-line);}
.crm-body .nav {gap:3px;}
.crm-body .nav a {min-height:39px; border-radius:10px;color:#516473;font-size:12.2px;font-weight:640;transition:background .16s,color .16s;}
.crm-body .nav a .nav-icon {color:#70818f;}
.crm-body .nav a:hover {color:var(--ui-ink);background:#f4f7f9;}
.crm-body .nav a.active {color:var(--brand-dark);background:var(--brand-soft);box-shadow:inset 3px 0 0 var(--brand);font-weight:780;}
.crm-body .nav a.active .nav-icon {color:var(--brand);}
.crm-body .nav-create {border-radius:10px;min-height:40px;}
.crm-body .ux-nav-label {color:#91a0a9;font-size:9px;font-weight:820;letter-spacing:.13em;text-transform:uppercase;padding:14px 12px 3px;display:block;}
.crm-body .nav-divider {margin:7px 6px 2px;border-color:var(--ui-line);}
.crm-body .topbar {border-bottom:1px solid var(--ui-line);background:#fff;box-shadow:none;}
.crm-body .global-search input {border-radius:11px;background:#f6f8fa;border-color:#e8edf1;font-size:12.5px;}
.crm-body .top-icon {border-radius:10px;color:#536979;}
.crm-body .top-icon:hover {background:#f4f7f9;}
.crm-body .user-menu {border-radius:12px;}
.crm-body .table :is(th,td) {border-bottom-color:var(--ui-line);}
.crm-body .table th {background:#f9fafc; color:#72818c;font-size:10.5px;letter-spacing:.05em;}
.crm-body .table td {font-size:12px;line-height:1.5;}
.crm-body .modern-table tbody tr:hover td {background:#fbfcfd;}
.crm-body .table .icon-btn {border-color:#e7ebef;}
.crm-body .table .icon-btn:hover {border-color:#ced8e1;background:#f7f9fa;}
.crm-body .lead-filter-card {padding:17px;border-radius:15px;}
.crm-body .lead-summary-card {border:1px solid var(--ui-line);box-shadow:var(--ui-shadow);border-radius:13px;}
.crm-body .lead-summary-card strong {letter-spacing:-.04em;}
.crm-body .status-filter {border-radius:999px;}
.crm-body .team-plan-usage {border-radius:15px;}
.crm-body .source-filter-chip {border-radius:999px;}
.crm-body :is(.rich-empty-state,.empty-state) {color:var(--ui-muted);}
.crm-body .notif-pop {border-radius:15px;border:1px solid #e2e9ed;box-shadow:0 18px 60px rgba(20,48,62,.18);width:min(385px,calc(100vw - 24px));}
.crm-body .modal-panel {border-radius:18px;max-width:min(850px,calc(100vw - 20px));}
.crm-body .modal-body {overscroll-behavior:contain;}
.crm-body .sidebar-backdrop {background:rgba(15,40,55,.44);}

/* New dashboard — deliberately namespace every widget to prevent collisions. */
.crm-body .ux-dashboard {display:grid;gap:26px;max-width:1450px;margin:0 auto;min-width:0;}
.crm-body .ux-dashboard :is(h1,h2,p) {margin:0;}
.crm-body .ux-dashboard-header {display:flex;align-items:center;justify-content:space-between;gap:20px;min-width:0;}
.crm-body .ux-dashboard-intro {min-width:0;}
.crm-body .ux-overline {font-size:10px;letter-spacing:.115em;font-weight:810;color:#74909f;text-transform:uppercase;line-height:1.5;}
.crm-body .ux-dashboard-header h1 {font-size:clamp(25px,2.7vw,34px);line-height:1.2;letter-spacing:-.042em;margin:6px 0 8px;font-weight:790;}
.crm-body .ux-dashboard-header h1 span {font-size:.7em;display:inline-block;vertical-align:3px;}
.crm-body .ux-dashboard-intro p {color:#71818c;font-size:13px;line-height:1.6;}
.crm-body .ux-dashboard-head-actions {display:flex;gap:9px;align-items:center;flex-wrap:wrap;justify-content:flex-end;}
.crm-body .ux-dashboard-head-actions .btn {white-space:nowrap;}
.crm-body .ux-shortcuts {display:flex;flex-wrap:wrap;gap:8px;padding:0 0 3px;min-width:0;}
.crm-body .ux-shortcuts a {display:flex;align-items:center;justify-content:center;gap:8px;border:1px solid var(--ui-line);color:#4c6271;background:#fff;min-height:43px;padding:8px 15px;border-radius:11px;font-size:12px;font-weight:690;box-shadow:0 2px 8px rgba(21,44,57,.02);transition:border .15s,transform .15s;}
.crm-body .ux-shortcuts a:hover {border-color:color-mix(in srgb,var(--brand) 40%,white);transform:translateY(-1px);}
.crm-body .ux-shortcuts svg {width:17px;height:17px;color:var(--brand);}
.crm-body .ux-shortcuts b {display:grid;place-items:center;min-width:19px;height:19px;padding:0 4px;border-radius:99px;background:#fae7e6;color:#a9433a;font-size:10px;}
.crm-body .ux-kpi-section {display:grid;gap:14px;min-width:0;}
.crm-body .ux-section-heading h2 {font-size:17px;font-weight:770;letter-spacing:-.02em;margin:3px 0 0;}
.crm-body .ux-kpi-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px;}
.crm-body .ux-kpi {display:flex;flex-direction:column;position:relative;min-height:176px;min-width:0;padding:17px 17px 14px;border:1px solid #e7ecf0;border-radius:15px;background:#fff;box-shadow:var(--ui-shadow);color:var(--ui-ink);transition:transform .18s,border-color .18s,box-shadow .18s;}
.crm-body .ux-kpi:hover {transform:translateY(-2px);border-color:color-mix(in srgb,var(--brand) 30%,#e7ecf0);box-shadow:0 8px 25px rgba(28,55,72,.07);}
.crm-body .ux-kpi-icon {display:grid;place-items:center;width:35px;height:35px;border-radius:11px;margin-bottom:13px;flex:0 0 auto;}
.crm-body .ux-kpi-icon svg {width:18px;height:18px;}
.crm-body .ux-kpi-icon.blue,.crm-body .ux-person-avatar {background:#eaf3ff;color:#3275bc;}
.crm-body .ux-kpi-icon.violet {background:#f0eefd;color:#6d61bf;}
.crm-body .ux-kpi-icon.amber {background:#fff4e6;color:#b0792f;}
.crm-body .ux-kpi-icon.green {background:#eaf8f0;color:#27875b;}
.crm-body .ux-kpi-label {font-size:11.5px;font-weight:730;color:#596c7a;line-height:1.3;}
.crm-body .ux-kpi strong {font-size:clamp(25px,2.4vw,32px);letter-spacing:-.05em;line-height:1.35;font-weight:810;color:#233a49;overflow-wrap:anywhere;margin-top:5px;}
.crm-body .ux-kpi .ux-kpi-money {font-size:clamp(20px,1.9vw,27px);letter-spacing:-.047em;}
.crm-body .ux-kpi small {color:#82919b;font-size:10.5px;line-height:1.45;margin-top:auto;padding-top:6px;padding-right:12px;}
.crm-body .ux-kpi-arrow {position:absolute;bottom:14px;right:13px;color:#a3b0b8;}
.crm-body .ux-kpi-arrow svg {width:15px;height:15px;}
.crm-body .ux-dashboard-layout {display:grid;grid-template-columns:minmax(0,1.64fr) minmax(288px,1fr);align-items:start;gap:17px;}
.crm-body .ux-dashboard-primary,.crm-body .ux-dashboard-side {display:grid;gap:17px;min-width:0;}
.crm-body .ux-panel {background:#fff;border:1px solid #e8edf0;border-radius:16px;box-shadow:var(--ui-shadow);min-width:0;overflow:hidden;}
.crm-body .ux-panel-head {padding:19px 21px 17px;display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid #eef1f3;}
.crm-body .ux-panel-head>div {min-width:0;}
.crm-body .ux-panel-head h2 {font-size:17px;font-weight:770;letter-spacing:-.025em;margin:3px 0 0;line-height:1.35;}
.crm-body .ux-panel-head p {font-size:11px;line-height:1.5;color:#8a979f;margin-top:4px;}
.crm-body .ux-link {color:var(--brand-dark);display:inline-flex;gap:3px;align-items:center;white-space:nowrap;font-weight:770;font-size:11px;}
.crm-body .ux-link svg {width:13px;height:13px;}
.crm-body .ux-activity-list {display:grid;}
.crm-body .ux-activity-row {display:grid;grid-template-columns:39px minmax(0,1fr) auto 13px;align-items:center;gap:12px;min-height:73px;padding:10px 20px;color:inherit;border-bottom:1px solid #f0f2f4;}
.crm-body .ux-activity-row:last-child {border-bottom:0;}
.crm-body .ux-activity-row:hover {background:#f9fbfd;}
.crm-body .ux-person-avatar {display:grid;place-items:center;width:38px;height:38px;border-radius:12px;font-size:15px;font-weight:760;flex:0 0 auto;}
.crm-body .ux-job-avatar {background:#eff7f3;color:#398469;}
.crm-body .ux-job-avatar svg {width:19px;height:19px;}
.crm-body .ux-activity-info {display:grid;gap:3px;min-width:0;}
.crm-body .ux-activity-info strong {font-size:12.5px;font-weight:755;line-height:1.4;min-width:0;overflow-wrap:anywhere;color:#294253;}
.crm-body .ux-activity-info small {font-size:10.5px;color:#8b9aa4;line-height:1.4;}
.crm-body .ux-activity-state .badge {font-size:10px;white-space:nowrap;}
.crm-body .ux-activity-arrow {width:14px;height:14px;color:#a6b4bf;}
.crm-body .ux-appointment-list {display:grid;}
.crm-body .ux-appointment {display:grid;grid-template-columns:42px 12px minmax(0,1fr) auto;gap:10px;align-items:center;color:inherit;padding:12px 21px;min-height:73px;border-bottom:1px solid #f0f2f4;}
.crm-body .ux-appointment:last-child {border-bottom:0;}
.crm-body .ux-appointment:hover {background:#f9fbfd;}
.crm-body .ux-appointment time {font-size:11.3px;font-weight:800;color:#4e697c;align-self:start;padding-top:7px;}
.crm-body .ux-appointment-line {height:100%;min-height:32px;border-left:2px solid #d7e9f9;position:relative;margin-left:5px;}
.crm-body .ux-appointment-line:before {content:"";width:9px;height:9px;background:var(--brand);position:absolute;left:-5.5px;top:9px;border:2px solid #fff;border-radius:50%;box-sizing:content-box;}
.crm-body .ux-appointment-info {display:grid;gap:4px;min-width:0;}
.crm-body .ux-appointment-info strong {font-size:12px;color:#263f50;line-height:1.4;overflow-wrap:anywhere;}
.crm-body .ux-appointment-info small {font-size:10.5px;color:#8b99a3;line-height:1.4;}
.crm-body .ux-empty-state {padding:35px 17px;display:flex;align-items:center;justify-content:center;text-align:center;flex-direction:column;gap:8px;}
.crm-body .ux-empty-state .ux-empty-icon {display:grid;place-items:center;width:52px;height:52px;border-radius:16px;background:#f0f6f8;color:#7291a1;margin-bottom:3px;}
.crm-body .ux-empty-icon svg {width:24px;height:24px;}
.crm-body .ux-empty-state strong {color:#3a5362;font-size:13px;}
.crm-body .ux-empty-state p {font-size:11.5px;line-height:1.5;color:#8d9ca5;max-width:300px;}
.crm-body .ux-empty-state .btn {margin-top:7px;}
.crm-body .ux-attention-list {display:grid;padding:7px 12px;}
.crm-body .ux-attention-row {display:grid;grid-template-columns:34px minmax(0,1fr) 27px;gap:10px;align-items:center;padding:11px 5px;border-bottom:1px solid #f1f3f5;color:inherit;}
.crm-body .ux-attention-row:last-child {border-bottom:0;}
.crm-body .ux-attention-row:hover {background:#fafbfc;}
.crm-body .ux-attention-icon {display:grid;place-items:center;width:33px;height:33px;border-radius:11px;color:#bd8228;background:#fff5e5;}
.crm-body .ux-attention-icon svg {width:17px;height:17px;}
.crm-body .ux-attention-row>span:nth-child(2) {display:grid;min-width:0;gap:3px;}
.crm-body .ux-attention-row strong {font-size:11.6px;font-weight:740;color:#334d5d;overflow-wrap:anywhere;}
.crm-body .ux-attention-row small {font-size:10px;line-height:1.3;color:#919fa8;}
.crm-body .ux-attention-row b {justify-self:end;display:grid;place-items:center;background:#fff3e1;color:#aa782e;border-radius:9px;min-width:27px;height:27px;padding:0 5px;font-size:11px;}
.crm-body .ux-attention-clear {display:flex;flex-direction:column;align-items:center;text-align:center;padding:30px 17px;gap:7px;}
.crm-body .ux-attention-clear span {display:grid;place-items:center;background:#edf8f1;color:#3b9468;width:40px;height:40px;border-radius:50%;margin-bottom:5px;}
.crm-body .ux-attention-clear small {color:#8a9ca5;font-size:10.5px;}
.crm-body .ux-channel-stats {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:14px;}
.crm-body .ux-channel-stats a {min-width:0;display:grid;justify-items:start;gap:6px;border-radius:12px;border:1px solid #edf1f4;padding:13px;color:inherit;}
.crm-body .ux-channel-stats a:hover {background:#fafbfc;}
.crm-body .ux-channel-stats a>span {width:29px;height:29px;display:grid;place-items:center;border-radius:10px;background:#edf5fb;color:#5080a5;}
.crm-body .ux-channel-stats a>span svg {width:15px;height:15px;}
.crm-body .ux-channel-stats strong {font-size:22px;line-height:1;letter-spacing:-.04em;color:#2c4253;}
.crm-body .ux-channel-stats small {color:#8595a0;font-size:10px;line-height:1.5;}
.crm-body .ux-progress-list {display:grid;padding:8px 19px 13px;}
.crm-body .ux-progress-list a {display:flex;align-items:center;justify-content:space-between;gap:9px;min-height:43px;padding:10px 0;border-bottom:1px solid #f0f2f4;color:#60717d;font-size:11px;}
.crm-body .ux-progress-list a:last-child {border-bottom:0;}
.crm-body .ux-progress-list strong {font-size:14px;color:#2c4252;}
.crm-body .ux-help-panel {padding:21px;display:flex;gap:13px;align-items:flex-start;background:#f1f6f8;border-color:#e1ecf0;box-shadow:none;}
.crm-body .ux-help-icon {width:37px;height:37px;flex:0 0 auto;border-radius:12px;background:#fff;display:grid;place-items:center;color:#658998;}
.crm-body .ux-help-icon svg {width:18px;height:18px;}
.crm-body .ux-help-panel strong {font-size:12.5px;}
.crm-body .ux-help-panel p {color:#7e909c;font-size:11px;line-height:1.5;margin:5px 0 9px;}
.crm-body .ux-side-tip {padding:20px;display:grid;justify-items:start;gap:12px;}
.crm-body .ux-side-tip p {font-size:12px;line-height:1.65;color:#647987;}

/* Responsiveness shared by browser and installed PWA. */
@media(max-width:1180px) {
  .crm-body .ux-kpi-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
  .crm-body .ux-dashboard-layout {grid-template-columns:minmax(0,1fr) minmax(260px,.8fr);}
}
@media(max-width:900px) {
  .crm-body .ux-nav-label {padding:12px 14px 3px;}
  .crm-body .content {padding:20px 16px calc(92px + env(safe-area-inset-bottom));}
  .crm-body .sidebar {box-shadow:14px 0 38px rgba(19,46,64,.12);}
  .crm-body .ux-dashboard {gap:20px;}
  .crm-body .ux-dashboard-layout {grid-template-columns:1fr;}
  .crm-body .ux-dashboard-header {align-items:flex-start;}
  .crm-body .ux-shortcuts {flex-wrap:nowrap;overflow-x:auto;scroll-snap-type:x proximity;scrollbar-width:none;padding-bottom:8px;overscroll-behavior-x:contain;}
  .crm-body .ux-shortcuts::-webkit-scrollbar {display:none;}
  .crm-body .ux-shortcuts a {flex:0 0 auto;scroll-snap-align:start;}
  .crm-body .notif-pop {max-height:min(72dvh,550px);overflow-y:auto;overscroll-behavior:contain;}
  .crm-body .modal-panel {max-height:calc(100dvh - 18px)!important;}
  .crm-body .schedule-page .schedule-google-state {font-size:11px;line-height:1.5;}
  .crm-body :is(.schedule-page,.schedule-list-view,.schedule-toolbar) {max-width:100%;min-width:0;}
  .crm-body .schedule-list-head {flex-wrap:wrap;gap:10px;}
  /* Existing mobile-card-table logic stays intact; only its presentation changes. */
  .crm-body .data-card:has(.mobile-card-table) {background:transparent;border:0;box-shadow:none;overflow:visible;}
  .crm-body table.mobile-card-table tbody tr {box-shadow:0 5px 21px rgba(25,51,68,.045)!important;border-color:var(--ui-line)!important;border-radius:16px!important;}
  .crm-body table.mobile-card-table tbody td:first-child .entity-cell strong {font-size:13px!important;line-height:1.4!important;}
  .crm-body table.mobile-card-table tbody td.row-actions {border-top:1px solid #eef1f3!important;padding-top:12px!important;margin-top:4px!important;}
}
@media(max-width:650px) {
  .crm-body .topbar {padding:0 11px;}
  .crm-body .top-actions {gap:3px;}
  .crm-body .top-actions .top-icon {width:39px;min-width:39px;height:39px;}
  .crm-body .content {padding:18px 13px calc(90px + env(safe-area-inset-bottom));}
  .crm-body .ux-dashboard-header {display:grid;gap:15px;}
  .crm-body .ux-dashboard-head-actions {width:100%;justify-content:stretch;}
  .crm-body .ux-dashboard-head-actions .btn {flex:1 1 130px;}
  .crm-body .ux-dashboard-header h1 {font-size:26px;}
  .crm-body .ux-dashboard-intro p {font-size:12px;}
  .crm-body .ux-dashboard {gap:17px;}
  .crm-body .ux-kpi-grid {gap:9px;}
  .crm-body .ux-kpi {min-height:152px;padding:13px;}
  .crm-body .ux-kpi-icon {height:31px;width:31px;margin-bottom:10px;border-radius:9px;}
  .crm-body .ux-kpi-icon svg {width:17px;height:17px;}
  .crm-body .ux-kpi-label {font-size:10.5px;}
  .crm-body .ux-kpi strong {font-size:25px;}
  .crm-body .ux-kpi .ux-kpi-money {font-size:clamp(17px,4.5vw,24px);}
  .crm-body .ux-kpi small {font-size:9.5px;}
  .crm-body .ux-panel-head {padding:16px 15px;align-items:flex-start;}
  .crm-body .ux-panel-head h2 {font-size:16px;}
  .crm-body .ux-activity-row {grid-template-columns:36px minmax(0,1fr) auto;gap:9px;padding:10px 14px;}
  .crm-body .ux-activity-arrow {display:none;}
  .crm-body .ux-person-avatar {width:35px;height:35px;}
  .crm-body .ux-appointment {grid-template-columns:36px 9px minmax(0,1fr);padding:11px 14px;gap:7px;}
  .crm-body .ux-appointment .ux-activity-state {grid-column:3;justify-self:start;}
  .crm-body .ux-activity-state .badge {font-size:9px;}
  .crm-body .ux-dashboard-head-actions .ux-outline-action {display:none;}
  .crm-body :is(.lead-filter-form,.inbox-filter-form) {padding:0;}
  .crm-body .modern-page-head .page-actions {gap:8px!important;}
  .crm-body .schedule-page .schedule-toolbar {gap:12px;}
  .crm-body .schedule-page .schedule-actions {display:flex;flex-wrap:wrap;gap:8px;}
  .crm-body .schedule-page .schedule-actions .btn {min-width:0;}
  .crm-body .schedule-page .schedule-display-switch {flex:0 0 auto;}
  /* Notification panel is fixed to viewport by app.js on mobile. */
  .crm-body .notif-pop {left:10px!important;right:10px!important;width:auto!important;max-width:calc(100vw - 20px)!important;max-height:calc(100dvh - var(--notif-offset,75px) - 15px)!important;overflow:auto!important;}
}
@media(max-width:390px) {
  .crm-body .ux-channel-stats {grid-template-columns:1fr;}
  .crm-body .ux-kpi {min-height:146px;}
  .crm-body .ux-kpi .ux-kpi-money {font-size:17px;}
  .crm-body .ux-shortcuts a {font-size:11px;padding:8px 12px;}
  .crm-body .ux-activity-row {grid-template-columns:31px minmax(0,1fr);}
  .crm-body .ux-activity-state {grid-column:2;justify-self:start;}
}
@media (prefers-reduced-motion:reduce) {
  .crm-body .ux-kpi,.crm-body .ux-shortcuts a,.crm-body .btn {transition:none;}
  .crm-body .ux-kpi:hover,.crm-body .ux-shortcuts a:hover {transform:none;}
}

/* Light touch to Master; leave its specialized billing and admin flows unchanged. */
.master-body .master-main {background:#f7f9fc;}
.master-body .master-content-shell {max-width:1480px;}
.master-body :is(.master-card,.master-kpi) {border-color:#e7edf1;border-radius:15px;box-shadow:0 3px 20px rgba(20,45,63,.033);}
.master-body .master-page-head-clean h1 {letter-spacing:-.03em;}
.crm-body .ux-skip-link {position:fixed;z-index:9999;top:-80px;left:10px;background:#fff;color:var(--brand-dark);padding:12px 16px;border:2px solid var(--brand);border-radius:9px;font-weight:750;}
.crm-body .ux-skip-link:focus {top:calc(var(--crm-banner-h,0px) + 8px);}
@media(min-width:901px) { .crm-body.sidebar-collapsed .ux-nav-label {display:none;} }

/* Mobile fixed shortcuts: independent of the sidebar, only routes enabled by the plan. */
.crm-body .ux-bottom-nav {display:none;}
@media(max-width:760px) {
  .crm-body .ux-bottom-nav {display:flex;justify-content:space-around;align-items:stretch;gap:2px;position:fixed;z-index:29;bottom:0;left:0;right:0;min-height:calc(57px + env(safe-area-inset-bottom));padding:5px 7px calc(5px + env(safe-area-inset-bottom));border-top:1px solid #e6ecf0;background:rgba(255,255,255,.97);box-shadow:0 -8px 25px rgba(26,48,62,.05);backdrop-filter:blur(10px);}
  .crm-body .ux-bottom-nav a {min-width:0;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:46px;border-radius:10px;color:#778997;font-size:9.8px;font-weight:740;line-height:1.2;}
  .crm-body .ux-bottom-nav a svg {width:19px;height:19px;}
  .crm-body .ux-bottom-nav a.active {background:var(--brand-soft);color:var(--brand-dark);}
  .crm-body .ux-bottom-nav a:focus-visible {outline-offset:-2px;}
  .crm-body .top-actions [data-enable-desktop-notifications] {display:none!important;}
}
/* Sign-in screen aligns with the same light visual language without editing auth forms. */
.login-shell {background:linear-gradient(135deg,#f5f9fc 0%,#eef4f8 100%);}
.login-card {border-color:#e6edf0;border-radius:21px;box-shadow:0 20px 65px rgba(24,53,72,.075);padding:clamp(22px,3vw,34px);}
.login-card :is(.input,.select,.textarea) {border-radius:11px;}
.login-card .btn-primary {border-radius:10px;min-height:44px;}
@media(max-width:760px) {
  /* Replace the decorative footer with task navigation in the installed app. */
  .crm-body .crm-footer {display:none;}
}


/* =========================================================
   Filed OPS — UX/UI refinement R2 (full CRM pages)
   Global list / form / detail styling + dashboard implementation
   ========================================================= */
.crm-body {
  --ux-bg-soft: linear-gradient(180deg, #fbfcff 0%, #f4f7fb 100%);
  --ux-card-border: #e7edf5;
  --ux-card-shadow: 0 12px 32px rgba(16, 34, 58, .055);
  --ux-card-shadow-soft: 0 8px 24px rgba(16, 34, 58, .035);
  --ux-title: #0d1b4c;
  --ux-text-soft: #6f7f95;
  --ux-blue: #2f80ed;
  --ux-violet: #8b5cf6;
  --ux-green: #22c55e;
  --ux-orange: #fb923c;
}
.crm-body .content > * {min-width:0;}
.crm-body :is(.card,.data-card,.settings-card,.document-card,.panel,.modal-panel,.confirm-panel) {
  background:#fff;
  border:1px solid var(--ux-card-border);
  box-shadow:var(--ux-card-shadow-soft);
}
.crm-body :is(.page-head,.modern-page-head,.detail-page-head) {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
  margin:0 0 20px;
}
.crm-body :is(.page-head,.modern-page-head,.detail-page-head) > div:first-child {min-width:0;}
.crm-body :is(.page-head h1,.modern-page-head h1,.page-head h2,.form-page-head h2,.detail-page-head h1) {
  margin:6px 0 8px;
  color:var(--ux-title);
  font-size:clamp(26px, 2.6vw, 36px);
  line-height:1.14;
  letter-spacing:-.04em;
  font-weight:800;
}
.crm-body .page-head p,
.crm-body .modern-page-head p,
.crm-body .detail-page-head p {
  max-width:840px;
  color:var(--ux-text-soft);
  font-size:14px;
  line-height:1.65;
}
.crm-body .page-actions {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:10px;
}
.crm-body .page-actions > * {flex:0 0 auto;}
.crm-body .back-link {
  display:inline-flex;
  align-items:center;
  gap:7px;
  color:#58708a;
  font-size:12px;
  font-weight:700;
  margin-bottom:10px;
}
.crm-body .back-link:hover {color:var(--brand-dark);}

.crm-body .list-toolbar,
.crm-body .settings-toolbar,
.crm-body .schedule-filters,
.crm-body .lead-filter-card,
.crm-body .inbox-filter-card {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:16px 18px;
  background:#fff;
  border:1px solid var(--ux-card-border);
  border-radius:18px;
  box-shadow:var(--ux-card-shadow-soft);
  margin-bottom:18px;
}
.crm-body .list-toolbar > *,
.crm-body .settings-toolbar > *,
.crm-body .schedule-filters > * {min-width:0;}
.crm-body .modern-searchbar,
.crm-body .searchbar {
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  flex:1 1 520px;
  min-width:0;
}
.crm-body .input-with-icon {
  position:relative;
  flex:1 1 320px;
  min-width:0;
}
.crm-body .input-with-icon > svg,
.crm-body .input-with-icon > .icon,
.crm-body .input-with-icon > span:first-child svg {
  position:absolute;
  left:14px;
  top:50%;
  width:17px;
  height:17px;
  transform:translateY(-50%);
  color:#88a0b8;
  pointer-events:none;
}
.crm-body .input-with-icon .input,
.crm-body .input-with-icon input {
  padding-left:42px;
}
.crm-body .status-filters,
.crm-body .source-filter-list,
.crm-body .lead-summary-grid,
.crm-body .stats-grid {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.crm-body .status-filter,
.crm-body .source-filter-chip {
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:40px;
  padding:9px 14px;
  border:1px solid #e3eaf2;
  background:#fff;
  border-radius:999px;
  color:#5b6f83;
  font-size:12px;
  font-weight:700;
  box-shadow:0 2px 8px rgba(20, 43, 69, .03);
}
.crm-body .status-filter b,
.crm-body .source-filter-chip b {
  display:grid;
  place-items:center;
  min-width:23px;
  height:23px;
  padding:0 6px;
  border-radius:999px;
  background:#f2f5fa;
  color:#51657e;
  font-size:11px;
}
.crm-body .status-filter.active,
.crm-body .source-filter-chip.active {
  color:var(--brand-dark);
  background:var(--brand-soft);
  border-color:color-mix(in srgb, var(--brand) 28%, white);
}
.crm-body .status-filter.active b,
.crm-body .source-filter-chip.active b {
  background:#fff;
  color:var(--brand-dark);
}

.crm-body .lead-summary-grid {
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:12px;
  margin-bottom:18px;
}
.crm-body .lead-summary-card {
  display:flex;
  align-items:center;
  gap:12px;
  min-height:96px;
  padding:16px;
  background:#fff;
  border:1px solid var(--ux-card-border);
  border-radius:18px;
  box-shadow:var(--ux-card-shadow-soft);
}
.crm-body .lead-summary-card span:first-child {
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:13px;
  background:#eef4ff;
  color:#4480de;
}
.crm-body .lead-summary-card strong {
  display:block;
  color:var(--ux-title);
  font-size:28px;
  line-height:1.05;
}
.crm-body .lead-summary-card small {
  color:var(--ux-text-soft);
  font-size:12px;
}

.crm-body .table-wrap {overflow:auto;}
.crm-body .modern-table,
.crm-body .table {
  width:100%;
  border-collapse:separate;
  border-spacing:0;
}
.crm-body .modern-table thead th,
.crm-body .table thead th {
  position:sticky;
  top:0;
  z-index:1;
  background:#f8fbff;
  color:#76879a;
  text-transform:uppercase;
  font-size:10.5px;
  font-weight:800;
  letter-spacing:.08em;
  padding:14px 16px;
  border-bottom:1px solid #edf2f7;
}
.crm-body .modern-table tbody td,
.crm-body .table tbody td {
  padding:16px;
  vertical-align:middle;
  border-bottom:1px solid #edf1f5;
  color:#33475c;
  font-size:13px;
}
.crm-body .modern-table tbody tr:hover td,
.crm-body .table tbody tr:hover td {
  background:#fbfdff;
}
.crm-body .entity-cell {
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
.crm-body .entity-avatar {
  width:42px;
  height:42px;
  border-radius:14px;
  background:linear-gradient(180deg, #edf4ff 0%, #e7eefb 100%);
  color:#2857a8;
  display:grid;
  place-items:center;
  font-weight:800;
  flex:0 0 auto;
}
.crm-body .entity-cell strong {
  display:block;
  color:#1d3350;
  font-size:13px;
  font-weight:800;
  line-height:1.4;
}
.crm-body .entity-cell small,
.crm-body .contact-stack,
.crm-body .contact-stack span {
  color:#7a8a9b;
  font-size:11px;
  line-height:1.5;
}
.crm-body .row-actions {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  white-space:nowrap;
}
.crm-body .icon-btn {
  width:38px;
  min-width:38px;
  height:38px;
  border-radius:12px;
  border:1px solid #e5ebf2;
  background:#fff;
  color:#5d7086;
  display:grid;
  place-items:center;
  transition:.16s ease;
}
.crm-body .icon-btn:hover {
  background:#f7fbff;
  border-color:#d7e4f3;
  color:var(--brand-dark);
}
.crm-body .danger-icon:hover {
  background:#fff5f5;
  color:#c24141;
  border-color:#ffd5d5;
}
.crm-body .inline-form {display:inline-flex;margin:0;}

.crm-body .entity-form,
.crm-body .inventory-import-form,
.crm-body .integration-modal-form {
  display:grid;
  gap:18px;
}
.crm-body .entity-form.card,
.crm-body .inventory-import-form.card,
.crm-body .integration-modal-form {
  padding:22px;
  border-radius:22px;
}
.crm-body .form-section {
  display:grid;
  gap:16px;
  padding:20px;
  border:1px solid #edf1f6;
  border-radius:18px;
  background:#fbfdff;
}
.crm-body .form-section-head {
  display:flex;
  align-items:flex-start;
  gap:12px;
}
.crm-body .form-section-head > svg,
.crm-body .form-section-head > span:first-child {
  width:40px;
  height:40px;
  min-width:40px;
  display:grid;
  place-items:center;
  padding:10px;
  border-radius:12px;
  background:#eef4ff;
  color:#3d6ecf;
}
.crm-body .form-section-head h3 {
  margin:1px 0 4px;
  color:var(--ux-title);
  font-size:17px;
  font-weight:800;
  letter-spacing:-.02em;
}
.crm-body .form-section-head p,
.crm-body .muted {
  color:var(--ux-text-soft);
  font-size:12px;
  line-height:1.6;
}
.crm-body .form-grid {
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:16px;
}
.crm-body .form-grid-balanced {grid-template-columns:repeat(2, minmax(0,1fr));}
.crm-body .form-group {display:grid;gap:7px;min-width:0;}
.crm-body .form-group.full {grid-column:1 / -1;}
.crm-body .form-group label {
  color:#405467;
  font-size:12px;
  font-weight:700;
}
.crm-body .check-row,
.crm-body .compact-check {
  display:flex;
  align-items:flex-start;
  gap:12px;
  padding:14px 15px;
  border:1px solid #e8eef5;
  border-radius:15px;
  background:#fff;
}
.crm-body .check-row input,
.crm-body .compact-check input {margin-top:2px;}
.crm-body .check-row strong,
.crm-body .compact-check strong {display:block;color:#203750;font-size:13px;}
.crm-body .check-row small,
.crm-body .compact-check small {display:block;color:#7e8f9f;font-size:11px;line-height:1.55;}
.crm-body .form-page-actions {
  display:flex;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
}
.crm-body .appointment-danger-zone {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:16px 18px;
  border-radius:18px;
  border:1px solid #ffe3e3;
  background:#fff8f8;
}
.crm-body .appointment-danger-zone strong {
  display:block;
  color:#7f1d1d;
  font-size:14px;
}
.crm-body .appointment-danger-zone span {
  display:block;
  color:#a26b6b;
  font-size:12px;
  line-height:1.5;
}

.crm-body .detail-grid,
.crm-body .grid.grid-2,
.crm-body .grid {
  display:grid;
  gap:18px;
}
.crm-body .detail-grid {
  grid-template-columns:minmax(0, 1.55fr) minmax(320px, .95fr);
}
.crm-body .document-card,
.crm-body .detail-grid .card,
.crm-body .product-detail-panels .card {
  border-radius:22px;
  overflow:hidden;
}
.crm-body .card-pad {padding:22px;}
.crm-body .section-title {
  margin:0 0 12px;
  color:var(--ux-title);
  font-size:17px;
  font-weight:800;
  letter-spacing:-.02em;
}
.crm-body .section-title-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:12px;
}
.crm-body .kv,
.crm-body .detail-kv {
  display:grid;
  grid-template-columns:minmax(120px, 150px) minmax(0,1fr);
  gap:10px 14px;
}
.crm-body .kv dt,
.crm-body .detail-kv dt {
  color:#7b8da1;
  font-size:11px;
  font-weight:700;
}
.crm-body .kv dd,
.crm-body .detail-kv dd {
  margin:0;
  color:#203750;
  font-size:13px;
  line-height:1.55;
}
.crm-body .document-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
}
.crm-body .document-total {
  color:var(--ux-title);
  font-size:32px;
  line-height:1;
  letter-spacing:-.05em;
}
.crm-body .document-summary {
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:12px;
  padding:20px 22px 22px;
}
.crm-body .document-summary > div {
  padding:14px 16px;
  border-radius:16px;
  background:#f8fbff;
  border:1px solid #edf2f7;
}
.crm-body .document-summary .grand-total {
  background:var(--brand-soft);
  border-color:color-mix(in srgb, var(--brand) 24%, white);
}
.crm-body .document-summary span {
  display:block;
  color:#7a8da4;
  font-size:11px;
  margin-bottom:5px;
}
.crm-body .document-summary strong {
  color:var(--ux-title);
  font-size:18px;
}

.crm-body .badge {
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:28px;
  padding:5px 11px;
  border-radius:999px;
  font-size:11px;
  font-weight:800;
}
.crm-body .badge.info,
.crm-body .badge.neutral {background:#eef4ff;color:#2e6dd8;}
.crm-body .badge.success {background:#ebfbf1;color:#0f8b49;}
.crm-body .badge.danger {background:#fff0f0;color:#c24141;}

.crm-body .overview-shell {
  display:grid;
  gap:20px;
}
.crm-body .overview-hero,
.crm-body .overview-section-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
}
.crm-body .overview-hero {
  padding:8px 2px 0;
}
.crm-body .overview-hero > div:first-child,
.crm-body .overview-section-head > div:first-child {min-width:0;}
.crm-body .overview-date,
.crm-body .overview-overline {
  display:block;
  color:#7c8eab;
  font-size:12px;
  font-weight:600;
  margin-bottom:8px;
}
.crm-body .overview-hero h1 {
  margin:0;
  color:var(--ux-title);
  font-size:clamp(34px, 4vw, 54px);
  line-height:1.04;
  letter-spacing:-.055em;
  font-weight:820;
}
.crm-body .overview-hero h1 span {margin-left:6px;font-size:.68em;vertical-align:10%;}
.crm-body .overview-hero p,
.crm-body .overview-section-head p {
  margin:8px 0 0;
  color:var(--ux-text-soft);
  font-size:14px;
  line-height:1.6;
}
.crm-body .overview-hero-actions {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  flex-wrap:wrap;
}
.crm-body .icon-square {
  width:42px;
  height:42px;
  border-radius:13px;
  border:1px solid #e2e9f2;
  background:#fff;
  display:grid;
  place-items:center;
  color:#5e7490;
  box-shadow:0 3px 10px rgba(16,34,58,.03);
}
.crm-body .overview-date-pill,
.crm-body .overview-filter-pill {
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:42px;
  padding:9px 14px;
  border-radius:14px;
  border:1px solid #e2e9f2;
  background:#fff;
  color:#304960;
  font-size:13px;
  font-weight:700;
}
.crm-body .overview-kpi-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
}
.crm-body .overview-kpi-card {
  position:relative;
  display:grid;
  gap:16px;
  min-height:188px;
  padding:18px 18px 16px;
  background:#fff;
  border:1px solid var(--ux-card-border);
  border-radius:20px;
  box-shadow:var(--ux-card-shadow);
  color:#1f354e;
  overflow:hidden;
}
.crm-body .overview-kpi-card::before {
  content:"";
  position:absolute;
  left:0;top:0;bottom:0;
  width:4px;
  border-radius:20px 0 0 20px;
  background:#d9e1ec;
}
.crm-body .overview-kpi-card.accent-orange::before {background:var(--ux-orange);}
.crm-body .overview-kpi-card.accent-violet::before {background:var(--ux-violet);}
.crm-body .overview-kpi-card.accent-green::before {background:var(--ux-green);}
.crm-body .overview-kpi-card.accent-blue::before {background:var(--ux-blue);}
.crm-body .overview-kpi-head {
  display:flex;
  align-items:flex-start;
  gap:12px;
}
.crm-body .overview-kpi-head > div {min-width:0;}
.crm-body .overview-kpi-icon {
  width:48px;
  height:48px;
  min-width:48px;
  display:grid;
  place-items:center;
  border-radius:15px;
  background:#f3f7fd;
  color:#4a73b2;
}
.crm-body .overview-kpi-icon.soft-blue {background:#edf4ff;color:#3776de;}
.crm-body .overview-kpi-card.accent-orange .overview-kpi-icon {background:#fff3e8;color:#eb7b22;}
.crm-body .overview-kpi-card.accent-violet .overview-kpi-icon {background:#f4efff;color:#7b54ef;}
.crm-body .overview-kpi-card.accent-green .overview-kpi-icon {background:#ebfbf1;color:#17a34a;}
.crm-body .overview-kpi-card.accent-blue .overview-kpi-icon {background:#ecf4ff;color:#2377ed;}
.crm-body .overview-kpi-title {
  display:block;
  color:#5e7288;
  font-size:13px;
  font-weight:700;
}
.crm-body .overview-kpi-head strong {
  display:block;
  margin-top:5px;
  color:var(--ux-title);
  font-size:52px;
  line-height:1;
  letter-spacing:-.06em;
}
.crm-body .overview-inline-badge {
  margin-left:auto;
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:30px;
  padding:6px 10px;
  border-radius:10px;
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
}
.crm-body .overview-inline-badge.positive {background:#ebfbf1;color:#1b9d47;}
.crm-body .overview-inline-badge.neutral {background:#f1f5f9;color:#7b8ca0;}
.crm-body .overview-kpi-foot {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px 16px;
  margin-top:auto;
}
.crm-body .overview-kpi-foot div {display:grid;gap:2px;}
.crm-body .overview-kpi-foot b {
  color:#55697e;
  font-size:12px;
  font-weight:700;
}
.crm-body .overview-kpi-foot small {
  color:#233952;
  font-size:13px;
  font-weight:800;
}

.crm-body .overview-section,
.crm-body .overview-panel,
.crm-body .overview-performance-card {
  background:#fff;
  border:1px solid var(--ux-card-border);
  border-radius:22px;
  box-shadow:var(--ux-card-shadow);
}
.crm-body .overview-section {padding:18px 20px 20px;}
.crm-body .overview-panel,
.crm-body .overview-performance-card {padding:18px 20px 20px;}
.crm-body .overview-section-head h2 {
  margin:0;
  color:var(--ux-title);
  font-size:17px;
  line-height:1.25;
  letter-spacing:-.025em;
  font-weight:800;
}
.crm-body .overview-link {
  display:inline-flex;
  align-items:center;
  gap:6px;
  color:#2164da;
  font-size:13px;
  font-weight:800;
  white-space:nowrap;
}
.crm-body .overview-link svg {width:14px;height:14px;}
.crm-body .overview-insight-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
  margin-top:16px;
}
.crm-body .overview-insight-card {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:18px;
  min-height:112px;
  border:1px solid #edf1f6;
  border-radius:18px;
  background:#fff;
}
.crm-body .overview-insight-left {
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}
.crm-body .overview-insight-left div {min-width:0;}
.crm-body .overview-insight-left small {
  display:block;
  color:#687b93;
  font-size:13px;
  margin-bottom:3px;
}
.crm-body .overview-insight-left strong {
  display:block;
  color:var(--ux-title);
  font-size:18px;
  letter-spacing:-.03em;
  line-height:1.2;
}
.crm-body .overview-insight-left p {
  margin:6px 0 0;
  color:#7f90a2;
  font-size:12px;
  line-height:1.55;
}
.crm-body .overview-spark-group,
.crm-body .performance-sparkline {
  display:flex;
  align-items:flex-end;
  gap:5px;
  min-width:110px;
  justify-content:flex-end;
}
.crm-body .overview-spark-group span,
.crm-body .performance-sparkline span {
  width:8px;
  border-radius:999px 999px 3px 3px;
  background:linear-gradient(180deg, #d6e8ff 0%, #bad4ff 100%);
}
.crm-body .performance-sparkline.blue span {
  background:linear-gradient(180deg, #dbeafe 0%, #c8dcff 100%);
}
.crm-body .overview-chevron {
  color:#a2afbc;
}
.crm-body .overview-chevron svg {width:18px;height:18px;}

.crm-body .overview-bottom-grid {
  display:grid;
  grid-template-columns:minmax(0,1.6fr) minmax(300px,.95fr);
  gap:18px;
  align-items:start;
}
.crm-body .overview-section-head.compact {margin-bottom:14px;}
.crm-body .overview-section-head.with-select {align-items:center;}
.crm-body .overview-summary-strip {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
  padding:15px 16px;
  margin-bottom:8px;
  border-radius:16px;
  background:#f8fbff;
  border:1px solid #edf2f7;
}
.crm-body .overview-summary-strip span {display:grid;gap:4px;}
.crm-body .overview-summary-strip small {color:#7f91a3;font-size:11px;}
.crm-body .overview-summary-strip strong {color:var(--ux-title);font-size:20px;line-height:1;}
.crm-body .overview-table {display:grid;}
.crm-body .overview-table-head,
.crm-body .overview-table-row {
  display:grid;
  grid-template-columns:76px minmax(0,1fr) auto 28px;
  align-items:center;
  gap:12px;
}
.crm-body .overview-table-head {
  padding:10px 4px 14px;
  color:#7e90a3;
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.crm-body .overview-table-row {
  min-height:74px;
  padding:12px 4px;
  border-top:1px solid #eef2f6;
}
.crm-body .overview-time {
  color:#263952;
  font-size:24px;
  font-weight:800;
  letter-spacing:-.04em;
}
.crm-body .overview-event {min-width:0;}
.crm-body .overview-event strong {
  display:block;
  color:#203750;
  font-size:14px;
  line-height:1.45;
}
.crm-body .overview-event small {
  display:block;
  color:#7a8a9d;
  font-size:12px;
  margin-top:3px;
  line-height:1.5;
}
.crm-body .overview-status {justify-self:start;}
.crm-body .overview-dots {
  color:#9aabbd;
  font-size:18px;
  letter-spacing:.08em;
  text-align:right;
}
.crm-body .compact-empty {padding:28px 18px;}

.crm-body .overview-performance-card {
  display:grid;
  gap:12px;
}
.crm-body .performance-list {display:grid;gap:12px;}
.crm-body .performance-item {
  display:grid;
  grid-template-columns:46px minmax(0,1fr) auto;
  align-items:center;
  gap:13px;
  padding:16px;
  border:1px solid #edf2f7;
  border-radius:18px;
  background:#fff;
}
.crm-body .performance-icon {
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:14px;
  background:#eef4ff;
  color:#3e6fde;
}
.crm-body .performance-icon.success {background:#edf9f1;color:#16a34a;}
.crm-body .performance-icon.primary {background:#eef4ff;color:#2563eb;}
.crm-body .performance-icon.positive {background:#eefbf1;color:#16a34a;}
.crm-body .performance-item small {
  display:block;
  color:#677c94;
  font-size:13px;
  margin-bottom:4px;
}
.crm-body .performance-item strong {
  display:block;
  color:var(--ux-title);
  font-size:19px;
  line-height:1.15;
  letter-spacing:-.03em;
}
.crm-body .performance-item p {
  margin:4px 0 0;
  color:#7f90a2;
  font-size:12px;
  line-height:1.5;
}
.crm-body .staff-kpi-grid {grid-template-columns:repeat(2,minmax(0,1fr));}

@media (max-width: 1280px) {
  .crm-body .overview-kpi-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
  .crm-body .lead-summary-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width: 1080px) {
  .crm-body .detail-grid,
  .crm-body .overview-bottom-grid {grid-template-columns:1fr;}
}
@media (max-width: 900px) {
  .crm-body :is(.page-head,.modern-page-head,.detail-page-head),
  .crm-body .list-toolbar,
  .crm-body .settings-toolbar,
  .crm-body .schedule-filters,
  .crm-body .overview-hero,
  .crm-body .overview-section-head {
    flex-direction:column;
    align-items:stretch;
  }
  .crm-body .lead-summary-grid,
  .crm-body .overview-insight-grid,
  .crm-body .staff-kpi-grid,
  .crm-body .document-summary,
  .crm-body .form-grid,
  .crm-body .overview-summary-strip {
    grid-template-columns:1fr;
  }
  .crm-body .overview-kpi-grid {grid-template-columns:1fr;}
  .crm-body .page-actions {justify-content:flex-start;}
  .crm-body .modern-searchbar,
  .crm-body .searchbar {width:100%;}
  .crm-body .status-filters,
  .crm-body .source-filter-list {overflow-x:auto;flex-wrap:nowrap;padding-bottom:4px;}
}
@media (max-width: 680px) {
  .crm-body .entity-form.card,
  .crm-body .inventory-import-form.card,
  .crm-body .integration-modal-form,
  .crm-body .overview-panel,
  .crm-body .overview-performance-card,
  .crm-body .overview-section,
  .crm-body .card-pad {padding:16px;}
  .crm-body .overview-hero h1 {font-size:34px;}
  .crm-body .overview-kpi-head strong {font-size:40px;}
  .crm-body .overview-table-head {display:none;}
  .crm-body .overview-table-row {
    grid-template-columns:64px minmax(0,1fr);
    align-items:flex-start;
    gap:8px 12px;
  }
  .crm-body .overview-status,
  .crm-body .overview-dots {
    grid-column:2;
  }
  .crm-body .overview-dots {display:none;}
  .crm-body .performance-item {
    grid-template-columns:42px minmax(0,1fr);
  }
  .crm-body .performance-sparkline {
    grid-column:1 / -1;
    justify-content:flex-start;
    padding-left:55px;
  }
  .crm-body .appointment-danger-zone {flex-direction:column;align-items:flex-start;}
}
/* =========================================================
   UX/UI refinement R3 — softer focus + refined sidebar
   ========================================================= */
.crm-body :is(button,a):focus-visible,
.master-body :is(button,a):focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand,#2a72e5) 34%, white);
  outline-offset: 2px;
}
.crm-body :is(input,select,textarea,.input,.select,.textarea):focus-visible,
.master-body :is(input,select,textarea,.input,.select,.textarea):focus-visible {
  outline: none;
}
.crm-body :is(.input,.select,.textarea,input[type="search"],input,select,textarea):focus,
.crm-body :is(.input,.select,.textarea,input[type="search"],input,select,textarea):focus-visible {
  border-color: color-mix(in srgb, var(--brand) 52%, #dfe5e9);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 10%, transparent);
}

.crm-body .sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%) !important;
}
.crm-body .sidebar-top {
  padding: 10px 14px 14px;
  margin: 0 -16px 10px;
}
.crm-body .crm-tenant-brand {
  padding: 0 2px;
}
.crm-body .tenant-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: #10253b;
}
.crm-body .nav {
  padding: 2px 6px 10px;
  gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: #ccd7e2 transparent;
}
.crm-body .nav::-webkit-scrollbar {width: 8px;}
.crm-body .nav::-webkit-scrollbar-thumb {background:#d5dee8;border-radius:999px;border:2px solid transparent;background-clip:padding-box;}
.crm-body .nav a {
  min-height: 44px;
  padding: 11px 13px;
  gap: 12px;
  border: 1px solid transparent;
}
.crm-body .nav a:hover {
  border-color: #edf2f7;
  background: #f7faff;
}
.crm-body .nav a.active {
  border-color: color-mix(in srgb, var(--brand) 12%, white);
  box-shadow: none;
}
.crm-body .nav a.active::before {
  content: "";
  width: 4px;
  align-self: stretch;
  margin: -11px 6px -11px -13px;
  border-radius: 0 8px 8px 0;
  background: var(--brand);
}
.crm-body .nav .nav-icon {
  width: 18px;
  height: 18px;
}
.crm-body .nav-create {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid transparent;
  background: transparent;
  color: #243d55;
  justify-content: flex-start;
}
.crm-body .nav-create:hover {
  background: #f7faff;
  border-color: #edf2f7;
}
.crm-body .ux-nav-label {
  padding-top: 16px;
  color: #9aa8b4;
}
.crm-body .nav-divider {
  margin: 8px 8px 4px;
}
.crm-body .sidebar-collapse-control {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid #dfe7f0;
  background: rgba(255,255,255,.96);
  color: #5d7388;
  box-shadow: 0 8px 24px rgba(16, 34, 58, .09);
  backdrop-filter: blur(8px);
}
.crm-body .sidebar-collapse-control:hover {
  background: #f7faff;
  color: var(--brand-dark);
  border-color: color-mix(in srgb, var(--brand) 18%, white);
}
.crm-body .sidebar-collapse-control .icon-svg {
  width: 16px;
  height: 16px;
}
body.sidebar-collapsed .sidebar-collapse-control {
  left: calc(var(--sidebarWCollapsed) - 17px) !important;
}

@media(max-width:900px){
  .crm-body .sidebar-top {
    margin: 0;
    padding: 14px 14px 12px;
  }
  .crm-body .nav {
    padding-inline: 10px;
  }
}

.crm-body .sidebar-expand-icon { display:none !important; }
