/* ==========================================================================
   Al Omran CRM V2.9 — Executive workspace refresh
   A reversible visual layer: no routes, field names, or workflows are changed.
   ========================================================================== */

:root{
  --brand:var(--lapis-800);
  --brand2:var(--lapis-500);
  --brand-soft:var(--lapis-100);
  --brand-ring:rgba(36,74,118,.18);
  --gold:var(--gold-500);
  --gold-bright:var(--gold-300);
  --gold-soft:var(--gold-050);
  --ink:var(--neutral-900);
  --muted:var(--neutral-500);
  --bg:var(--surface-canvas);
  --surface:#FFFFFF;
  --surface-2:var(--neutral-050);
  --line:var(--neutral-200);
  --line-strong:#CCD6E2;
  --shadow-sm:0 2px 8px rgba(10,23,53,.045);
  --shadow:0 18px 46px rgba(10,23,53,.085);
  /* Three planes: the page, components on it, overlays above them. */
  --surface-level-0:var(--surface-page);
  --surface-level-1:var(--surface-panel);
  --surface-level-2:var(--surface-overlay);
  --shadow-level-1:var(--elevation-raised);
  --shadow-level-2:var(--elevation-overlay);
  /* Legacy names kept for the selectors that already reference them, but
     now resolved from design-tokens.css so there is one motion scale. */
  --motion-button:var(--motion-fast);
  --motion-control:var(--motion-normal);
  --motion-panel:var(--motion-slow);
  --ease-enter:var(--ease-standard);
  --ease-press:var(--ease-exit);
  --control-radius:var(--radius-sm);
  --focus-ring:var(--focus-ring-shadow);
  --z-overlay:140;
  --z-tooltip:170;
  --radius:16px;
  --radius-sm:10px;
  --sidebar:276px;
  --topbar:80px;
}

/* Lead lifecycle choices: keyboard friendly and compact. */
.lead-lifecycle-cell{width:560px;min-width:560px;max-width:660px}
.lead-quick-controls{display:grid;gap:7px;margin-top:8px}
.quick-choice-form{min-width:0;padding:7px;border:1px solid var(--neutral-200);border-radius:var(--radius-sm);background:var(--neutral-050)}
.quick-choice-fieldset{min-width:0;margin:0;padding:0;border:0}
.quick-choice-fieldset legend{display:flex;align-items:center;gap:5px;margin:0 0 5px;padding:0;color:var(--neutral-600);font-size:var(--fs-micro);font-weight:var(--fw-bold)}
.quick-choice-line{display:flex;align-items:center;gap:7px;min-width:0}
.quick-choice-scroll{display:flex;align-items:center;gap:5px;min-width:0;flex:1;overflow-x:auto;padding:1px 1px 4px;scrollbar-width:thin;scrollbar-color:#C5D0DD transparent;overscroll-behavior-inline:contain}
.quick-choice-scroll::-webkit-scrollbar{height:4px}.quick-choice-scroll::-webkit-scrollbar-thumb{background:#C5D0DD;border-radius:var(--radius-pill)}
.quick-choice-pill{position:relative;flex:0 0 auto;cursor:pointer}
.quick-choice-pill input{position:absolute;width:1px;height:1px;margin:0;overflow:hidden;clip-path:inset(50%);opacity:0}
.quick-choice-pill span{display:inline-flex;align-items:center;gap:5px;min-height:28px;padding:4px 8px;border:1px solid #D8E0E9;border-radius:var(--radius-pill);background:#fff;color:var(--neutral-600);white-space:nowrap;font-size:var(--fs-micro);font-weight:var(--fw-bold);transition:border-color .14s ease,background .14s ease,color .14s ease,box-shadow .14s ease}
.quick-choice-pill span i{width:8px;height:8px;display:block;border:1.5px solid var(--neutral-400);border-radius:var(--radius-circle);background:#fff;box-shadow:inset 0 0 0 2px #fff}
.quick-choice-pill input:checked+span{border-color:var(--choice-color,var(--brand2));background:color-mix(in srgb,var(--choice-color,var(--brand2)) 9%,white);color:var(--choice-color,var(--brand2));box-shadow:0 0 0 1px color-mix(in srgb,var(--choice-color,var(--brand2)) 18%,transparent)}
.quick-choice-pill input:checked+span i{border-color:var(--choice-color,var(--brand2));background:var(--choice-color,var(--brand2))}
.quick-choice-pill input:focus-visible+span{outline:3px solid var(--brand-ring);outline-offset:2px}
.quick-choice-pill.qualification-not_evaluated{--choice-color:var(--neutral-500)}.quick-choice-pill.qualification-qualified{--choice-color:var(--success-700)}.quick-choice-pill.qualification-unqualified{--choice-color:var(--danger-700)}
.quick-choice-save{flex:0 0 auto;min-height:30px;padding-inline:10px}
.quick-choice-save:disabled{cursor:not-allowed;filter:grayscale(.5);opacity:.48;transform:none;box-shadow:none}
.quick-choice-extra{display:flex;align-items:center;gap:6px;min-width:0;margin-top:5px}
.quick-choice-extra input,.quick-choice-extra select{height:31px;min-width:145px;padding:5px 8px;border-radius:var(--radius-sm);font-size:var(--fs-micro)}
.qualification-extra input{flex:1}.qualification-extra select{flex:0 1 210px}.qualification-extra:not(.has-required-reason) select[hidden]+input{max-width:100%}

html{background:var(--bg)}
body{
  color:var(--ink);
  background:var(--bg);
  font-family:var(--font-sans);
  font-size:var(--fs-body);
  line-height:var(--lh-body);
  text-rendering:optimizeLegibility;
  -webkit-font-smoothing:antialiased;
}

::selection{background:rgba(201,168,76,.26);color:var(--lapis-900)}

.skip-link{
  position:fixed;z-index:1000;inset-block-start:10px;inset-inline-start:14px;
  padding:10px 14px;border-radius:var(--radius-sm);background:#fff;color:var(--brand);
  box-shadow:var(--shadow);font-weight:var(--fw-bold);transform:translateY(-160%);
  transition:transform .16s ease;
}
.skip-link:focus{transform:translateY(0)}

/* App shell */
.app-shell .sidebar{
  width:var(--sidebar);
  padding:18px 14px 14px;
  background:
    radial-gradient(circle at 78% 2%,rgba(201,168,76,.11),transparent 22%),
    linear-gradient(180deg,var(--lapis-900) 0%,var(--lapis-800) 52%,var(--lapis-900) 100%);
  border-inline-end:1px solid rgba(226,198,109,.15);
  box-shadow:var(--elevation-inverse-3);
}
.app-shell .sidebar:after{
  display:block;opacity:.16;
  background-image:linear-gradient(rgba(255,255,255,.025) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.02) 1px,transparent 1px);
  background-size:32px 32px;
  mask-image:linear-gradient(180deg,#000,transparent 78%);
}
.app-shell .brand-block{
  gap:11px;padding:2px 5px 14px;margin-bottom:10px;
  border-bottom-color:rgba(226,198,109,.15);
}
.app-shell .brand-logo{
  width:52px;height:52px;border-radius:var(--radius-md);
  border-color:rgba(226,198,109,.45);
  box-shadow:var(--elevation-inverse-2);
}
.app-shell .brand-copy strong{font-size:var(--fs-body);font-weight:var(--fw-bold)}
.app-shell .brand-copy span{font-size:var(--fs-micro);color:var(--label-inverse-secondary);letter-spacing:0}

.app-shell .workspace-pill{
  margin:0 2px 11px;padding:10px 11px;border-radius:var(--radius-md);
  border-color:rgba(226,198,109,.15);
  background:linear-gradient(135deg,rgba(201,168,76,.09),rgba(255,255,255,.045));
}
.app-shell .workspace-pill b{font-size:var(--fs-caption);color:#fff;letter-spacing:.2px}
.app-shell .workspace-pill small{font-size:var(--fs-micro);color:var(--label-inverse-secondary)}
.app-shell .workspace-dot{
  width:8px;height:8px;background:#32D583;
  box-shadow:0 0 0 4px rgba(50,213,131,.12),0 0 16px rgba(50,213,131,.32);
}

.app-shell .nav-menu{padding-inline:3px;scrollbar-color:rgba(226,198,109,.18) transparent}
.app-shell .nav-link{
  min-height:44px;margin:2px 0;padding:9px 10px;border-radius:var(--radius-sm);
  color:var(--label-inverse-secondary);font-size:var(--fs-data);font-weight:var(--fw-semibold);
  border:1px solid transparent;transform:none;
}
.app-shell .nav-link:hover{
  color:#fff;background:rgba(255,255,255,.06);
  border-color:rgba(255,255,255,.07);transform:none;
}
.app-shell .nav-link.active{
  color:#fff;background:linear-gradient(135deg,rgba(49,87,132,.72),rgba(28,57,94,.66));
  border-color:rgba(226,198,109,.22);
  box-shadow:inset 3px 0 0 var(--gold),0 10px 22px rgba(0,0,0,.14);
}
[dir=rtl] .app-shell .nav-link.active{box-shadow:inset -3px 0 0 var(--gold),0 10px 22px rgba(0,0,0,.14)}
.app-shell .nav-icon{color:#9EB3CD}
.app-shell .nav-link.active .nav-icon{color:var(--gold-bright)}
.app-shell .nav-chevron{margin-inline-start:auto;color:#8799B2}
.app-shell .nav-submenu{margin-block:2px 5px;padding-inline-start:19px;border-inline-start:1px solid rgba(226,198,109,.14)}
.app-shell .nav-sublink{min-height:38px;color:var(--label-inverse-secondary);font-size:var(--fs-caption)}
.app-shell .nav-sublink:hover,.app-shell .nav-sublink.active{color:#fff;background:rgba(255,255,255,.055)}
.app-shell .nav-sublink>span:first-child{color:#AFC7E5}

.app-shell .sidebar-shortcuts{
  gap:6px;padding:10px 0 9px;margin:0 2px 8px;
  border-block-color:rgba(226,198,109,.12);
}
.app-shell .sidebar-shortcuts .shortcut-link{
  min-height:54px;padding:7px 4px;border-radius:var(--radius-sm);
  border-color:rgba(255,255,255,.08);background:rgba(255,255,255,.045);
  color:var(--label-inverse-secondary);font-size:var(--fs-micro);font-weight:var(--fw-semibold);
}
.app-shell .sidebar-shortcuts .shortcut-link:hover{
  color:#fff;border-color:rgba(226,198,109,.24);background:rgba(201,168,76,.08);
}
.app-shell .sidebar-shortcuts .shortcut-link .ui-icon{color:var(--gold-bright)}
.app-shell .user-panel{padding:10px 5px 1px}
.app-shell .avatar{
  width:38px;height:38px;border-radius:var(--radius-sm);background:var(--gold-soft);
  color:var(--brand);box-shadow:none;border:1px solid rgba(201,168,76,.32);
}

.app-shell .main-area{
  margin-inline-start:var(--sidebar);min-width:0;background:var(--bg);
  border-radius:26px 0 0 26px;box-shadow:var(--elevation-4);
}
[dir=rtl] .app-shell .main-area{border-radius:0 26px 26px 0;box-shadow:var(--elevation-4)}
.app-shell .topbar{
  height:var(--topbar);padding-inline:26px;background:rgba(255,255,255,.92);
  border-bottom:1px solid var(--line);box-shadow:var(--elevation-2);
  backdrop-filter:blur(20px) saturate(135%);
}
.app-shell .topbar:after{inset-inline:26px;background:linear-gradient(90deg,transparent,var(--gold),transparent);opacity:.34}
.page-heading h1{font-size:22px;font-weight:var(--fw-bold);letter-spacing:-.35px;color:var(--brand)}
.page-heading p{margin-top:5px;font-size:var(--fs-caption);color:var(--neutral-500)}
.content-wrap{max-width:1720px;padding:25px 26px 48px}

/* Controls and shared surfaces */
.card,.form-card,.table-card,.filters,.stat-card,.summary-tile,.integration-card{
  border-color:var(--line);border-radius:var(--radius);
  box-shadow:var(--shadow-sm);background:rgba(255,255,255,.985);
}
.card:hover,.stat-card:hover{border-color:#D5DEE9}
.card-title h2,.card-title h3,.table-head h2,.table-head h3{color:var(--brand);font-weight:var(--fw-bold)}
.card-title p,.field-hint{color:var(--neutral-500)}

.btn{
  min-height:41px;border-radius:var(--radius-sm);padding-inline:15px;font-weight:var(--fw-bold);
  transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease,background-color .16s ease;
}
.btn-primary{
  color:#fff;background:linear-gradient(135deg,var(--lapis-800),var(--lapis-500));
  border-color:#2B527D;box-shadow:var(--elevation-2);
}
.btn-primary:hover{filter:none;background:linear-gradient(135deg,#102044,#2A578B);box-shadow:var(--elevation-3)}
.btn-secondary{border-color:var(--line-strong);color:var(--neutral-700)}
.btn-secondary:hover{border-color:var(--neutral-400);color:var(--brand);background:var(--neutral-050)}
.btn-soft{background:var(--gold-soft);border-color:var(--gold-100);color:var(--gold-800)}
.btn-sm{min-height:34px;border-radius:var(--radius-sm);font-size:var(--fs-caption)}
.top-add{min-width:126px}

.quick-search,.top-action,.language-switch{
  height:42px;border-color:var(--line);border-radius:var(--radius-sm);background:#fff;color:var(--neutral-500);
}
.quick-search{width:224px}
.quick-search:hover,.top-action:hover,.language-switch:hover{border-color:#AAB8CA;color:var(--brand);box-shadow:0 0 0 3px rgba(36,74,118,.08)}
.quick-search kbd{background:var(--neutral-050);border-color:var(--neutral-200);color:var(--neutral-500)}

input,select,textarea,.control{
  border-color:#D6DEE8;border-radius:var(--radius-sm);color:var(--ink);background:#fff;
}
input,select{height:43px}
input:hover,select:hover,textarea:hover{border-color:#B4C1D0}
input:focus,select:focus,textarea:focus{border-color:var(--lapis-400);box-shadow:0 0 0 4px rgba(36,74,118,.11)}
.field label{font-size:var(--fs-caption);color:var(--neutral-600);font-weight:var(--fw-semibold)}

.table-card{overflow:hidden}
.table-head{padding:16px 18px;border-bottom-color:var(--line)}
.data-table th,.data-table td{padding:13px 14px}
.data-table th{
  font-size:var(--fs-caption);letter-spacing:.15px;text-transform:none;color:var(--neutral-600);
  background:var(--neutral-050);border-bottom:1px solid var(--neutral-200);
}
.data-table td{font-size:var(--fs-data);color:var(--neutral-700)}
.data-table tbody tr{transition:background-color .14s ease}
.data-table tbody tr:hover{background:var(--neutral-050)}
.client-avatar{border-radius:var(--radius-sm);background:var(--lapis-100);color:var(--brand);border-color:#D4DFEA}

.empty-state{padding:44px 20px}
.empty-icon{border-radius:var(--radius-md);background:var(--neutral-100);border-color:var(--neutral-300);color:var(--brand2)}
.empty-state h3{font-size:var(--fs-body);color:var(--neutral-700)}
.empty-state p{font-size:var(--fs-caption)}

/* Dashboard: compact command deck with one expanded workspace at a time. */
.dashboard-control-deck{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px;margin-bottom:18px;
}
.dashboard-control-bar{
  min-width:0;border-color:var(--line);border-radius:var(--radius-md);overflow:hidden;
  box-shadow:var(--shadow-sm);background:#fff;
}
.dashboard-control-bar[open]{grid-column:1/-1;border-color:var(--neutral-350);box-shadow:var(--elevation-3)}
.dashboard-control-bar>summary{min-height:68px;padding:11px 13px;background:#fff}
.dashboard-control-bar>summary:hover{background:#FAFCFE}
.control-bar-icon{width:38px;height:38px;border-radius:var(--radius-sm);background:var(--lapis-100);color:var(--brand)}
.status-control .control-bar-icon{background:var(--neutral-100)}
.filter-control .control-bar-icon{background:var(--lapis-100);color:var(--lapis-500)}
.search-control-bar .control-bar-icon{background:#EEF8F3;color:#18794E}
.control-bar-copy b{font-size:var(--fs-data);color:var(--brand)}
.control-bar-copy small{font-size:var(--fs-micro);color:var(--neutral-500)}
.control-bar-meta{padding:5px 8px;border-color:var(--line);background:var(--neutral-050)}
.control-bar-meta b{font-size:var(--fs-subsection)}
.control-panel{padding:15px;background:var(--neutral-050);border-top-color:var(--line)}
.status-choice{border-color:#DFE6EE;border-radius:var(--radius-sm);box-shadow:none}
.status-choice:hover{border-color:#B8C6D6;box-shadow:var(--elevation-2);transform:translateY(-1px)}

.dashboard-main-grid{grid-template-columns:minmax(0,1.55fr) minmax(300px,.72fr);gap:18px}
.pipeline-card{border-top:0;position:relative;overflow:hidden}
.pipeline-card:before{content:"";position:absolute;inset-inline:18px;top:0;height:2px;background:linear-gradient(90deg,transparent,var(--gold),transparent)}
.pipeline{gap:9px}
.pipeline-item{
  min-height:78px;padding:13px 14px;border-color:var(--neutral-200);background:var(--neutral-050);
  transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease;
}
.pipeline-item:hover{transform:translateY(-2px);border-color:#C8D3E0;box-shadow:var(--elevation-2)}
.pipeline-item b{font-size:23px;color:var(--brand)}
.pipeline-item span{font-size:var(--fs-caption);color:var(--neutral-500)}
.attention-card{border-top:2px solid #D8C175}
.quick-action{min-height:72px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;font-size:var(--fs-caption);background:var(--neutral-050)}
.quick-action:hover{background:var(--gold-soft);border-color:var(--gold-100);color:var(--gold-800);transform:translateY(-1px)}

/* Authentication */
.auth-page{min-height:100dvh;grid-template-columns:minmax(0,1.08fr) minmax(420px,.92fr);background:#fff}
.auth-visual{
  padding:44px 52px;background:
    radial-gradient(circle at 82% 8%,rgba(201,168,76,.16),transparent 24%),
    radial-gradient(circle at 18% 84%,rgba(36,74,118,.24),transparent 34%),
    linear-gradient(145deg,var(--lapis-900),var(--lapis-800) 58%,#132C50);
  border-inline-end:1px solid rgba(226,198,109,.22);
}
.auth-visual:before{
  width:510px;height:510px;top:-270px;inset-inline-end:-165px;background:transparent;
  border:1px solid rgba(226,198,109,.12);box-shadow:0 0 0 44px rgba(226,198,109,.025),0 0 0 88px rgba(226,198,109,.018);
}
.auth-visual:after{width:320px;height:320px;background:radial-gradient(circle,rgba(36,74,118,.23),transparent 66%)}
.auth-brand img{width:58px;height:58px;border-radius:var(--radius-lg);border-color:rgba(226,198,109,.44)}
.auth-brand b{font-size:var(--fs-subsection)}.auth-brand span{color:#B8C4D6}
.auth-pitch{max-width:680px;position:relative;z-index:1}
.auth-pitch:before{content:"";display:block;width:54px;height:3px;margin-bottom:20px;border-radius:var(--radius-xs);background:linear-gradient(90deg,var(--gold),transparent)}
.auth-pitch h1{max-width:650px;font-size:clamp(34px,4vw,56px);line-height:1.17;letter-spacing:-1.1px;text-wrap:balance}
.auth-pitch p{max-width:620px;font-size:var(--fs-data);line-height:1.85;color:var(--label-inverse-secondary)}
.auth-features{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:25px}
.auth-feature{min-height:54px;border-radius:var(--radius-md);background:rgba(255,255,255,.055);border-color:rgba(226,198,109,.13);color:#EEF2F7}
.auth-feature .ui-icon{color:var(--gold-bright)}
.auth-version{position:relative;z-index:1;font-size:var(--fs-micro);color:#9FAEC2;letter-spacing:.35px}
.auth-form-side{padding:44px;background:linear-gradient(180deg,#fff,var(--neutral-050))}
.auth-box{width:min(440px,100%)}
.auth-box h2{font-size:27px;color:var(--brand);letter-spacing:-.3px}
.auth-box>p{font-size:var(--fs-data);line-height:1.7;color:var(--neutral-500)}
.auth-box .field label{font-size:var(--fs-caption)}
.auth-box input{height:46px;background:#fff}
.auth-box .btn-primary{height:47px;margin-top:20px!important}
.auth-footer{margin-top:25px;padding-top:18px;border-top:1px solid var(--line);color:var(--neutral-500);font-size:var(--fs-micro);text-align:center}

/* Accessibility and motion */
:where(a,button,input,select,textarea,summary):focus-visible{
  outline:var(--focus-ring-width) solid var(--focus-ring-color)!important;
  outline-offset:var(--focus-ring-offset);
}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}
}

/* Final compact CRM refinement -------------------------------------------
   Progressive disclosure keeps the lead table dense without hiding state. */
.lead-lifecycle-cell{width:400px;min-width:400px;max-width:440px}
.lead-quick-controls{display:grid;gap:5px;margin:0}
.quick-choice-form{padding:0;border:0;border-radius:var(--radius-sm);background:transparent;box-shadow:none}
.quick-choice-form.has-unsaved-changes,
[dir=rtl] .quick-choice-form.has-unsaved-changes{background:transparent;box-shadow:none}
.lifecycle-summary{
  width:100%;min-height:38px;padding:5px 9px;display:grid;grid-template-columns:9px minmax(0,1fr) 18px;
  align-items:center;gap:8px;border:1px solid var(--neutral-300);border-radius:var(--radius-sm);background:#fff;color:var(--text);
  text-align:start;box-shadow:var(--elevation-1);
  transition:border-color var(--motion-control) var(--ease-enter),background-color var(--motion-control) var(--ease-enter),box-shadow var(--motion-control) var(--ease-enter);
}
.lifecycle-summary:hover{border-color:#B9C8D8;background:#F9FBFD}
.lifecycle-summary:focus-visible{outline:0;box-shadow:var(--focus-ring);border-color:var(--lapis-400)}
.lifecycle-state-dot{width:8px;height:8px;border-radius:var(--radius-circle);background:var(--state-color,var(--neutral-400));box-shadow:0 0 0 3px color-mix(in srgb,var(--state-color,var(--neutral-400)) 13%,transparent)}
.lifecycle-state-dot.qualification-qualified{background:#159455;box-shadow:0 0 0 3px rgba(21,148,85,.12)}
.lifecycle-state-dot.qualification-unqualified{background:#D92D20;box-shadow:0 0 0 3px rgba(217,45,32,.1)}
.lifecycle-state-dot.qualification-not_evaluated{background:var(--neutral-400);box-shadow:0 0 0 3px rgba(152,162,179,.13)}
.lifecycle-summary-copy{min-width:0;display:flex;align-items:baseline;gap:7px;white-space:nowrap;overflow:hidden}
.lifecycle-summary-copy small{flex:0 0 auto;color:var(--neutral-500);font-size:var(--fs-micro);font-weight:var(--fw-bold);text-transform:uppercase;letter-spacing:.35px}
.lifecycle-summary-copy b{min-width:0;overflow:hidden;text-overflow:ellipsis;color:var(--neutral-800);font-size:var(--fs-caption)}
.lifecycle-chevron{display:grid;place-items:center;color:var(--neutral-500);transition:transform var(--motion-control) var(--ease-enter)}
.lifecycle-summary[aria-expanded=true] .lifecycle-chevron{transform:rotate(180deg)}
.quick-choice-form.has-unsaved-changes .lifecycle-summary{border-color:#8DA8C2;background:#F7FAFD;box-shadow:inset 3px 0 0 var(--brand2)}
[dir=rtl] .quick-choice-form.has-unsaved-changes .lifecycle-summary{box-shadow:inset -3px 0 0 var(--brand2)}
.lifecycle-panel{
  display:grid;grid-template-rows:0fr;min-width:0;overflow:hidden;opacity:0;transform:translateY(-3px);
  transition:grid-template-rows var(--motion-panel) var(--ease-enter),opacity var(--motion-control) var(--ease-enter),transform var(--motion-control) var(--ease-enter);
}
.lifecycle-panel[hidden]{display:none}
.lifecycle-panel.is-expanded{grid-template-rows:1fr;opacity:1;transform:translateY(0)}
.lifecycle-panel-inner{min-height:0;overflow:hidden;padding:0 6px;border:1px solid transparent;border-top:0;border-radius:0 0 8px 8px;background:var(--neutral-050)}
.lifecycle-panel.is-expanded .lifecycle-panel-inner{padding:7px 6px 6px;border-color:var(--neutral-200)}
.followup-inline-fields{display:grid;grid-template-columns:minmax(170px,1fr) minmax(170px,.8fr);gap:6px;align-items:end}
.compact-inline-field{display:grid;min-width:0;gap:3px;color:var(--neutral-500);font-size:var(--fs-micro);font-weight:var(--fw-bold)}
.compact-inline-field input{width:100%;height:34px;min-width:0}
.lead-readonly-lifecycle{padding-block:3px}

/* Standalone contact actions: grouping by spacing, not by a decorative shell. */
.app-shell .brand-action-row{
  padding:0;gap:5px;border:0;border-radius:0;background:transparent;box-shadow:none;
}
.contact-command-bar{
  width:max-content;max-width:100%;padding:0;gap:6px;border:0;border-radius:0;background:transparent;box-shadow:none;
}
.contact-command-bar .contact-pill,.contact-command-bar>.btn{box-shadow:var(--elevation-1)}

/* In-page notification center. */
.notification-center{position:relative}
.notification-popover{
  position:absolute;z-index:var(--z-popover,80);top:calc(100% + 10px);inset-inline-end:0;width:min(390px,calc(100vw - 24px));
  overflow:hidden;border:1px solid var(--neutral-300);border-radius:var(--radius-md);background:#fff;box-shadow:var(--elevation-4);
  opacity:0;transform:translateY(-5px) scale(.99);transform-origin:top right;
  transition:opacity var(--motion-control) var(--ease-enter),transform var(--motion-panel) var(--ease-enter);
}
[dir=rtl] .notification-popover{transform-origin:top left}
.notification-popover[hidden]{display:none}
.notification-popover.is-visible{opacity:1;transform:translateY(0) scale(1)}
.notification-popover:focus{outline:0}
.notification-popover-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 15px 11px;border-bottom:1px solid var(--neutral-100);background:var(--neutral-050)}
.notification-popover-head h2{margin:0;color:#14253C;font-size:var(--fs-data);letter-spacing:-.1px}
.notification-popover-head p{margin:2px 0 0;color:var(--neutral-500);font-size:var(--fs-micro)}
.notification-popover-head>a{color:var(--lapis-500);font-size:var(--fs-caption);font-weight:var(--fw-bold)}
.notification-popover-head>a:hover{text-decoration:underline}
.notification-list{max-height:min(430px,calc(100vh - 150px));overflow-y:auto;overscroll-behavior:contain}
.notification-item-form{margin:0;border-bottom:1px solid var(--neutral-100)}
.notification-item-form:last-child{border-bottom:0}
.notification-item{
  width:100%;min-height:68px;padding:11px 13px;display:grid;grid-template-columns:28px minmax(0,1fr) auto;align-items:start;gap:9px;
  border:0;background:#fff;color:var(--neutral-800);text-align:start;transition:background-color var(--motion-control) var(--ease-enter);
}
.notification-item:hover,.notification-item:focus-visible{background:#F6F9FC;outline:0}
.notification-item.is-unread{background:#F7FAFD}
.notification-item-icon{width:28px;height:28px;display:grid;place-items:center;border-radius:var(--radius-sm);background:var(--lapis-100);color:var(--lapis-500)}
.notification-item.is-unread .notification-item-icon{background:var(--lapis-500);color:#fff}
.notification-item-copy{min-width:0;display:grid;gap:2px}
.notification-item-copy b,.notification-item-copy span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.notification-item-copy b{font-size:var(--fs-caption)}
.notification-item-copy span{color:var(--neutral-500);font-size:var(--fs-micro)}
.notification-item-copy time{color:var(--neutral-500);font-size:var(--fs-micro)}
.notification-state{padding-top:2px;color:var(--neutral-500);font-size:var(--fs-micro);font-weight:var(--fw-bold)}
.notification-item.is-unread .notification-state{color:var(--lapis-500)}
.notification-empty{min-height:150px;padding:25px;display:grid;place-items:center;align-content:center;gap:5px;color:var(--neutral-500);text-align:center}
.notification-empty .ui-icon{color:var(--lapis-500)}
.notification-empty b{color:var(--neutral-800);font-size:var(--fs-caption)}.notification-empty span{font-size:var(--fs-micro)}

/* Dynamic connected lead-status path. Only the component scrolls on small screens. */
.lead-status-stepper-wrap{
  position:relative;z-index:1;margin-top:16px;padding:11px 3px 4px;overflow-x:auto;overscroll-behavior-inline:contain;
  scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.25) transparent;border-top:1px solid rgba(255,255,255,.12);
}
.lead-status-stepper-wrap:focus-visible{outline:2px solid rgba(255,255,255,.78);outline-offset:3px;border-radius:var(--radius-xs)}
.lead-status-stepper{display:flex;min-width:max-content;margin:0;padding:0 4px;list-style:none}
.lead-status-step{position:relative;width:104px;display:grid;justify-items:center;align-content:start;gap:5px;color:rgba(255,255,255,.56);text-align:center}
.lead-status-step:not(:last-child)::after{content:"";position:absolute;z-index:0;top:11px;inset-inline-start:calc(50% + 13px);width:calc(100% - 26px);height:2px;background:rgba(255,255,255,.18);transition:background-color var(--motion-control) var(--ease-enter)}
.lead-status-step.is-complete:not(:last-child)::after{background:rgba(255,255,255,.56)}
.lead-status-node{position:relative;z-index:1;width:24px;height:24px;display:grid;place-items:center;border:2px solid rgba(255,255,255,.28);border-radius:var(--radius-circle);background:#20385A;color:#C9D4E3;font-size:var(--fs-micro);font-weight:var(--fw-bold);transition:border-color var(--motion-control) var(--ease-enter),background-color var(--motion-control) var(--ease-enter),box-shadow var(--motion-control) var(--ease-enter),color var(--motion-control) var(--ease-enter)}
.lead-status-step.is-complete .lead-status-node{border-color:var(--step-color);background:var(--step-color);color:#fff}
.lead-status-step.is-current .lead-status-node{border-color:#fff;background:var(--step-color);color:#fff;box-shadow:0 0 0 4px rgba(255,255,255,.15)}
.lead-status-label{max-width:98px;color:inherit;font-size:var(--fs-micro);font-weight:var(--fw-semibold);line-height:1.25}
.lead-status-step.is-complete,.lead-status-step.is-current{color:#fff}

/* Information summary with readable notes and quiet empty states. */
.customer-summary-card .card-title{margin-bottom:11px}
.customer-summary-body{display:grid;gap:13px}
.customer-summary-section{display:grid;gap:5px}
.customer-summary-section h4{margin:0;color:var(--neutral-500);font-size:var(--fs-micro);font-weight:var(--fw-bold);text-transform:uppercase;letter-spacing:.35px}
.customer-note{margin:0;max-height:180px;overflow:auto;color:var(--neutral-700);font-size:var(--fs-caption);line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere}
.customer-summary-empty{margin:0;color:var(--neutral-500);font-size:var(--fs-caption);font-style:normal}
.customer-tag-list{display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.customer-tag-list .tag{margin:0;padding:4px 7px;border:1px solid #DCE5EF;border-radius:var(--radius-xs);background:var(--neutral-100);color:#385675;font-size:var(--fs-micro)}
.customer-summary-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0;padding-top:11px;border-top:1px solid var(--neutral-100)}
.customer-summary-meta>div{min-width:0}.customer-summary-meta dt{color:var(--neutral-500);font-size:var(--fs-micro);font-weight:var(--fw-bold);text-transform:uppercase}.customer-summary-meta dd{margin:3px 0 0;color:var(--neutral-800);font-size:var(--fs-caption);overflow-wrap:anywhere}

/* Decorative labels remain typography; status and data chips retain capsules. */
.app-shell .workspace-pill{margin:0 4px 10px;padding:3px 4px;border:0;border-radius:0;background:transparent}
.app-shell .page-heading h1{font-weight:var(--fw-bold);letter-spacing:-.35px}
.app-shell .card-title h2,.app-shell .card-title h3,.app-shell .table-head h2,.app-shell .table-head h3{font-weight:var(--fw-bold);letter-spacing:-.12px}

@media(max-width:720px){
  .lead-lifecycle-cell{width:min(390px,calc(100vw - 42px));min-width:min(390px,calc(100vw - 42px));max-width:min(390px,calc(100vw - 42px))}
  .lifecycle-summary{min-height:44px}
  .followup-inline-fields{grid-template-columns:1fr}
  .notification-popover{position:fixed;top:calc(var(--topbar) + 7px);inset-inline:8px;width:auto;max-height:calc(100vh - var(--topbar) - 15px)}
  .notification-list{max-height:calc(100vh - var(--topbar) - 86px)}
  .lead-status-stepper-wrap{margin-inline:-4px}
  .lead-status-step{width:96px}
  .customer-summary-meta{grid-template-columns:1fr}
}

@media(prefers-reduced-motion:reduce){
  .lifecycle-panel,.lifecycle-chevron,.lifecycle-summary,.notification-popover,.notification-item{animation:none!important;transition:none!important;transform:none!important}
}

@media(max-width:1240px){
  :root{--sidebar:264px}
  .dashboard-main-grid{grid-template-columns:minmax(0,1.35fr) minmax(280px,.72fr)}
  .content-wrap{padding-inline:22px}
}

@media(max-width:1040px){
  .dashboard-control-deck{grid-template-columns:1fr}
  .dashboard-control-bar[open]{grid-column:auto}
  .dashboard-main-grid{grid-template-columns:1fr}
  .auth-page{grid-template-columns:1fr 1fr}
  .auth-visual{padding-inline:36px}
  .auth-pitch h1{font-size:40px}
}

@media(max-width:900px){
  .app-shell .main-area,[dir=rtl] .app-shell .main-area{margin-inline-start:0;border-radius:0;box-shadow:none}
  .app-shell .sidebar{width:min(88vw,320px)}
  .app-shell .topbar{padding-inline:16px}
}

@media(max-width:720px){
  .auth-page{display:flex;flex-direction:column;min-height:100dvh}
  .auth-visual{display:flex;min-height:210px;padding:24px 22px;justify-content:flex-start;gap:28px}
  .auth-brand img{width:50px;height:50px}
  .auth-pitch:before,.auth-pitch p,.auth-features,.auth-version{display:none}
  .auth-pitch h1{font-size:26px;line-height:1.28;max-width:420px;margin:0}
  .auth-form-side{min-height:auto;flex:1;padding:28px 20px 34px;align-items:flex-start}
  .auth-box{margin:auto}
  .auth-logo-mobile{display:none}
  .content-wrap{padding:18px 13px 36px}
  .app-shell .topbar{height:72px;gap:9px}
  .page-heading h1{font-size:var(--fs-section)}.page-heading p{font-size:var(--fs-micro)}
  .quick-search{width:42px;padding:0;justify-content:center}.quick-search kbd{display:none}
  .top-add{min-width:42px;width:42px;padding:0}
  .dashboard-control-bar>summary{min-height:64px;padding:10px}
  .control-bar-copy small{white-space:normal;line-height:1.4}
  .pipeline{grid-template-columns:repeat(2,minmax(0,1fr))}
  .pipeline-item{min-height:72px}
  .table-head{align-items:flex-start}
}

@media(max-width:430px){
  .auth-visual{min-height:190px}
  .auth-pitch h1{font-size:23px}
  .topbar-actions{gap:6px}
  .top-action,.language-switch,.quick-search,.top-add{width:38px;min-width:38px;height:38px}
  .control-bar-meta{display:none}
  .dashboard-filter-actions{flex-direction:column}.dashboard-filter-actions .btn{width:100%}
}

/* V2.9 workforce, qualification and Customer 360 */
.top-break-form{margin:0}
.top-break-btn{
  height:42px;display:inline-flex;align-items:center;gap:8px;padding:0 12px;
  border:1px solid #D5DEE8;border-radius:var(--radius-sm);background:#fff;color:var(--brand);
  font:inherit;font-size:var(--fs-caption);font-weight:var(--fw-bold);cursor:pointer;white-space:nowrap;
  transition:.16s ease;box-shadow:var(--elevation-2);
}
.top-break-btn:hover{border-color:var(--neutral-400);background:var(--neutral-050);box-shadow:var(--elevation-2)}
.top-break-btn.is-active{background:var(--success-100);border-color:var(--success-200);color:var(--success-700)}
.top-break-btn em{padding:3px 6px;border-radius:var(--radius-xs);background:rgba(8,116,67,.09);font-size:var(--fs-micro);font-style:normal}

.classification-notice{
  min-height:43px;display:flex;align-items:center;gap:8px;padding:9px 11px;
  border:1px dashed #C8D4E1;border-radius:var(--radius-sm);background:var(--neutral-050);color:var(--neutral-600);font-size:var(--fs-caption);line-height:1.45;
}
.classification-notice .ui-icon{color:var(--gold);flex:0 0 auto}
.lock-badge{display:inline-grid;place-items:center;color:var(--neutral-500);background:var(--neutral-100)}

.app-shell .brand-action-row{
  width:max-content;padding:4px;gap:4px;border:1px solid var(--neutral-200);border-radius:var(--radius-md);
  background:var(--neutral-050);box-shadow:inset 0 1px 0 #fff;flex-wrap:nowrap;
}
.app-shell .brand-action-btn{
  width:34px;height:34px;min-width:34px;border:1px solid transparent;border-radius:var(--radius-sm);
  box-shadow:none;background:transparent;color:var(--neutral-600);
}
.app-shell .brand-action-btn:before{display:none}
.app-shell .brand-action-btn:hover{transform:translateY(-1px);background:#fff;border-color:#CDD8E4;box-shadow:var(--elevation-2)}
.app-shell .brand-action-btn.is-whatsapp,.app-shell .brand-action-btn.is-call{background:transparent}
.app-shell .brand-action-btn.is-history{color:var(--lapis-500);background:var(--lapis-100)}
.app-shell .brand-action-btn.is-history:hover{background:#DDE8F3;border-color:var(--neutral-400)}
.app-shell .brand-action-btn.action-note{color:var(--teal-700);background:transparent}
.app-shell .brand-action-btn.action-detail{color:#fff;background:var(--brand)}
.app-shell .brand-action-btn.action-detail:hover{background:#173762;border-color:#173762}
.app-shell .brand-action-btn .brand-svg{width:23px;height:23px;filter:none}

.qualification-card{border-top:2px solid var(--gold);overflow:hidden}
.qualification-card .card-title{align-items:flex-start}
.qualification-card .card-title h3{display:flex;align-items:center;gap:8px}
.qualification-badge{display:inline-flex;padding:6px 9px;border-radius:var(--radius-pill);font-size:var(--fs-micro);font-weight:var(--fw-bold);white-space:nowrap}
.qualification-badge.status-unclassified{background:var(--neutral-100);color:var(--neutral-500)}
.qualification-badge.status-qualified{background:var(--success-100);color:var(--success-700)}
.qualification-badge.status-nurture{background:var(--warning-100);color:var(--warning-700)}
.qualification-badge.status-unqualified{background:var(--danger-100);color:var(--danger-700)}
.qualification-form{padding-top:13px;border-top:1px solid var(--line)}
.qualification-readonly{padding:13px;border-radius:var(--radius-sm);background:var(--neutral-050);color:var(--neutral-600);white-space:pre-wrap}
.history-cta{color:var(--lapis-500)!important;background:var(--lapis-100)!important;border-color:var(--lapis-200)!important}

.workspace-hero,.customer360-hero,.smart-report-hero{
  position:relative;overflow:hidden;display:flex;align-items:center;justify-content:space-between;gap:18px;
  margin-bottom:18px;padding:22px 24px;border:1px solid #203A60;border-radius:var(--radius-lg);
  background:radial-gradient(circle at 88% 0,rgba(201,168,76,.18),transparent 28%),linear-gradient(135deg,var(--lapis-900),var(--lapis-700));
  color:#fff;box-shadow:var(--elevation-4);
}
.workspace-hero:after,.customer360-hero:after,.smart-report-hero:after{content:"";position:absolute;inset-inline-end:-70px;top:-120px;width:270px;height:270px;border:1px solid rgba(226,198,109,.13);border-radius:var(--radius-circle);box-shadow:0 0 0 34px rgba(226,198,109,.025)}
.workspace-person,.customer360-identity{position:relative;z-index:1;display:flex;align-items:center;gap:14px}
.workspace-avatar,.customer360-identity .client-avatar{width:54px;height:54px;display:grid;place-items:center;border-radius:var(--radius-md);background:var(--gold-soft);color:var(--brand);border:1px solid rgba(226,198,109,.55);font-size:20px;font-weight:var(--fw-bold)}
.workspace-person h2,.customer360-identity h2,.smart-report-hero h2{margin:3px 0 4px;font-size:22px;color:#fff}
.workspace-person p,.customer360-identity p,.smart-report-hero p{margin:0;color:var(--label-inverse-secondary);font-size:var(--fs-caption)}
.workspace-hero .eyebrow,.smart-report-hero .eyebrow{color:var(--gold-bright)}
.work-status-card{position:relative;z-index:1;display:flex;align-items:center;gap:10px;min-width:330px;padding:11px 12px;border:1px solid rgba(255,255,255,.15);border-radius:var(--radius-md);background:rgba(255,255,255,.075);backdrop-filter:blur(12px)}
.work-status-card>span{width:36px;height:36px;display:grid;place-items:center;border-radius:var(--radius-sm);background:rgba(255,255,255,.1);color:#75E4AE}
.work-status-card>div{flex:1}.work-status-card b,.work-status-card small{display:block}.work-status-card b{font-size:var(--fs-caption)}.work-status-card small{margin-top:3px;color:var(--label-inverse-secondary);font-size:var(--fs-micro)}
.work-status-card .btn{min-height:36px;font-size:var(--fs-caption)}

.metric-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:18px}
.metric-card{position:relative;min-height:125px;padding:16px;border:1px solid var(--line);border-radius:var(--radius-md);background:#fff;box-shadow:var(--shadow-sm)}
.metric-card .metric-icon{width:36px;height:36px;display:grid;place-items:center;margin-bottom:12px;border-radius:var(--radius-sm);background:var(--lapis-100);color:var(--brand)}
.metric-card small,.metric-card strong,.metric-card em{display:block}.metric-card small{color:var(--neutral-500);font-size:var(--fs-caption);font-weight:var(--fw-semibold)}.metric-card strong{margin-top:5px;color:var(--brand);font-size:24px}.metric-card strong i{font-size:var(--fs-caption);font-style:normal}.metric-card em{margin-top:4px;color:var(--neutral-500);font-size:var(--fs-micro);font-style:normal}
.target-focus-card{margin-bottom:18px}.target-progress-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.target-progress-item>div:first-child{display:flex;justify-content:space-between}.progress{height:8px;margin-top:8px;border-radius:var(--radius-pill);background:#E9EEF4;overflow:hidden}.progress span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--brand2),var(--gold))}
.workspace-grid{align-items:start}.workspace-list{padding:4px 16px 14px}.workspace-list article,.workspace-list>a{display:flex;align-items:center;gap:11px;min-height:59px;padding:10px 0;border-bottom:1px solid var(--neutral-100);color:inherit}.workspace-list article:last-child,.workspace-list>a:last-child{border-bottom:0}.workspace-list .list-icon{width:34px;height:34px;display:grid;place-items:center;border-radius:var(--radius-sm);background:var(--lapis-100);color:var(--brand)}.workspace-list article>div,.workspace-list>a>div{min-width:0;flex:1}.workspace-list b,.workspace-list small{display:block}.workspace-list b{font-size:var(--fs-caption)}.workspace-list small{margin-top:4px;color:var(--neutral-500);font-size:var(--fs-micro)}
.team-snapshot{margin-top:18px}.team-snapshot-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.team-snapshot-grid span{padding:13px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--neutral-050)}.team-snapshot-grid b,.team-snapshot-grid small{display:block}.team-snapshot-grid b{font-size:22px;color:var(--brand)}.team-snapshot-grid small{margin-top:3px;color:var(--neutral-500);font-size:var(--fs-micro)}

.hr-filterbar{margin-bottom:16px}.hr-summary-grid{margin-bottom:18px}.hr-table .cell-sub{display:block;margin-top:4px;font-size:var(--fs-micro);color:var(--neutral-500)}.danger-text{color:var(--danger-700)!important}
.presence-pill{display:inline-flex;align-items:center;gap:5px;padding:5px 7px;border-radius:var(--radius-pill);font-size:var(--fs-micro);font-weight:var(--fw-bold)}.presence-pill i{width:6px;height:6px;border-radius:var(--radius-circle)}.presence-pill.available{background:var(--success-100);color:var(--success-700)}.presence-pill.available i{background:var(--success-700)}.presence-pill.on-break{background:var(--warning-100);color:var(--warning-700)}.presence-pill.on-break i{background:var(--warning-500)}
.score-ring{--score:0;width:48px;height:48px;display:grid;place-items:center;border-radius:var(--radius-circle);background:conic-gradient(var(--brand2) calc(var(--score)*1%),var(--neutral-100) 0);position:relative}.score-ring:before{content:"";position:absolute;inset:5px;border-radius:var(--radius-circle);background:#fff}.score-ring b{position:relative;z-index:1;color:var(--brand);font-size:var(--fs-caption)}.score-ring.xlarge{width:86px;height:86px;background:conic-gradient(var(--gold-bright) calc(var(--score)*1%),rgba(255,255,255,.16) 0)}.score-ring.xlarge:before{inset:8px;background:var(--lapis-700)}.score-ring.xlarge b{color:#fff;font-size:23px}
.professional-icon-btn{width:35px;height:35px;display:inline-grid;place-items:center;border:1px solid var(--neutral-300);border-radius:var(--radius-sm);background:#fff;color:var(--brand)}.professional-icon-btn:hover{border-color:var(--neutral-400);background:var(--neutral-050)}.professional-icon-btn.is-ai{color:var(--gold-800);background:var(--gold-soft);border-color:var(--gold-100)}
.btn-ai{color:#fff;background:linear-gradient(135deg,var(--gold-800),var(--gold-600));border-color:#D0B25B}.ai-disclaimer{display:flex;gap:10px;margin-bottom:16px;padding:12px 14px;border:1px solid var(--gold-100);border-radius:var(--radius-md);background:var(--gold-soft);color:var(--gold-800)}.ai-disclaimer b,.ai-disclaimer p{display:block;margin:0}.ai-disclaimer b{font-size:var(--fs-caption)}.ai-disclaimer p{margin-top:3px;font-size:var(--fs-micro);line-height:1.55}.report-summary p{font-size:var(--fs-data);line-height:1.8}.report-findings .positive{border-top:2px solid var(--success-700)}.report-findings .attention{border-top:2px solid var(--warning-500)}.report-point{display:flex;gap:8px;padding:9px 0;border-bottom:1px solid var(--neutral-100);font-size:var(--fs-caption);line-height:1.55}.evidence-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:1px;background:var(--line)}.evidence-grid span{padding:16px;background:#fff}.evidence-grid small,.evidence-grid b{display:block}.evidence-grid small{font-size:var(--fs-micro);color:var(--neutral-500)}.evidence-grid b{margin-top:5px;color:var(--brand);font-size:19px}

.customer360-toolbar{margin-bottom:14px}.customer360-status{position:relative;z-index:1;display:flex;align-items:center;gap:10px}.customer360-status>span{font-size:var(--fs-caption);color:var(--label-inverse-secondary)}.customer360-layout{display:grid;grid-template-columns:minmax(260px,.6fr) minmax(0,1.6fr);gap:18px;align-items:start}.customer360-summary{position:sticky;top:calc(var(--topbar) + 18px)}.history-counts>div{display:flex;align-items:center;justify-content:space-between;padding:10px 0;border-bottom:1px solid var(--neutral-100)}.history-counts span{display:flex;align-items:center;gap:7px;color:var(--neutral-600);font-size:var(--fs-caption)}.history-counts b{color:var(--brand);font-size:var(--fs-subsection)}.ai-ready-note{display:flex;gap:9px;margin-top:14px;padding:11px;border:1px solid var(--gold-100);border-radius:var(--radius-sm);background:var(--gold-soft);color:var(--gold-800)}.ai-ready-note b,.ai-ready-note p{display:block;margin:0}.ai-ready-note b{font-size:var(--fs-caption)}.ai-ready-note p{margin-top:4px;color:#7C6A3B;font-size:var(--fs-micro);line-height:1.6}
.unified-timeline{position:relative;padding:3px 0}.unified-timeline:before{content:"";position:absolute;inset-block:14px;inset-inline-start:18px;width:1px;background:var(--neutral-300)}.history-event{position:relative;display:flex;gap:13px;padding:9px 0}.history-event-icon{position:relative;z-index:1;width:37px;height:37px;display:grid;place-items:center;flex:0 0 37px;border:1px solid var(--neutral-300);border-radius:var(--radius-sm);background:#fff;color:var(--brand2);box-shadow:var(--elevation-2)}.history-event.kind-message .history-event-icon{color:var(--success-700);background:var(--success-100)}.history-event.kind-finance .history-event-icon,.history-event.kind-offer .history-event-icon{color:var(--gold-800);background:var(--gold-soft)}.history-event-body{min-width:0;flex:1;padding:11px 13px;border:1px solid var(--neutral-200);border-radius:var(--radius-md);background:var(--neutral-050)}.history-event-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.history-event h4{margin:0;color:var(--brand);font-size:var(--fs-caption)}.history-event time{color:var(--neutral-500);font-size:var(--fs-micro);white-space:nowrap}.history-event p{margin:7px 0 0;color:var(--neutral-600);font-size:var(--fs-caption);line-height:1.65;white-space:pre-wrap}.history-event footer{display:flex;gap:8px;margin-top:8px;color:var(--neutral-500);font-size:var(--fs-micro)}.history-event footer span{display:inline-flex;align-items:center;gap:4px}.history-status{padding:2px 5px;border-radius:var(--radius-xs);background:#EDF2F7;color:var(--neutral-600)}

@media(max-width:1180px){.metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.customer360-layout{grid-template-columns:1fr}.customer360-summary{position:static}.history-counts{display:grid;grid-template-columns:repeat(2,1fr);gap:0 18px}.evidence-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:780px){.workspace-hero,.customer360-hero,.smart-report-hero{align-items:flex-start;flex-direction:column;padding:18px}.work-status-card{width:100%;min-width:0;flex-wrap:wrap}.work-status-card .btn{width:100%}.target-progress-grid,.team-snapshot-grid{grid-template-columns:repeat(2,1fr)}.customer360-status{width:100%;justify-content:space-between}.qualification-card .card-title{gap:10px}.qualification-badge{align-self:flex-start}.evidence-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:520px){.metric-grid{grid-template-columns:1fr 1fr;gap:8px}.metric-card{min-height:112px;padding:13px}.metric-card strong{font-size:20px}.history-counts{grid-template-columns:1fr}.history-event-head{display:block}.history-event time{display:block;margin-top:4px}.hide-sm{display:none}.top-break-btn{width:40px;justify-content:center;padding:0}.top-break-btn em{position:absolute;margin-top:38px;background:#fff;border:1px solid var(--line)}}

/* HR section navigation and dedicated workspaces */
.nav-accordion-hr>.nav-link{background:linear-gradient(135deg,rgba(201,168,76,.09),rgba(255,255,255,.035));border-color:rgba(226,198,109,.12)}
.nav-accordion-hr>.nav-link .nav-icon{color:var(--gold-bright)}
.nav-accordion-hr[open]>.nav-link{background:linear-gradient(135deg,rgba(49,87,132,.72),rgba(28,57,94,.66));border-color:rgba(226,198,109,.22)}

.hr-command-header{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:18px;padding:20px 22px;border:1px solid #203A60;border-radius:var(--radius-lg);background:radial-gradient(circle at 88% 0,rgba(201,168,76,.16),transparent 28%),linear-gradient(135deg,var(--lapis-900),var(--lapis-700));color:#fff;box-shadow:var(--elevation-3)}
.hr-command-header h2{margin:5px 0;color:#fff;font-size:21px}.hr-command-header p{margin:0;color:var(--label-inverse-secondary);font-size:var(--fs-caption)}.hr-command-header .eyebrow{color:var(--gold-bright)}
.hr-period-form{display:flex;align-items:flex-end;gap:8px}.hr-period-form .field label{color:var(--label-inverse-secondary)}.hr-period-form input{min-width:140px;background:rgba(255,255,255,.96)}.hr-period-form .btn{height:43px}
.hr-module-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px;margin-bottom:18px}
.hr-module-card{display:flex;align-items:center;gap:11px;min-height:88px;padding:14px;border:1px solid var(--line);border-radius:var(--radius-md);background:#fff;color:inherit;box-shadow:var(--shadow-sm);transition:.16s ease}
.hr-module-card>span{width:42px;height:42px;display:grid;place-items:center;flex:0 0 42px;border-radius:var(--radius-sm);background:var(--lapis-100);color:var(--brand)}
.hr-module-card>div{min-width:0;flex:1}.hr-module-card b,.hr-module-card small{display:block}.hr-module-card b{color:var(--brand);font-size:var(--fs-caption)}.hr-module-card small{margin-top:5px;color:var(--neutral-500);font-size:var(--fs-micro);line-height:1.45}.hr-module-card>.ui-icon{color:var(--neutral-500);transform:rotate(180deg)}
[dir=rtl] .hr-module-card>.ui-icon{transform:none}.hr-module-card:hover{transform:translateY(-2px);border-color:#B6C5D6;box-shadow:var(--elevation-3)}
.hr-module-card.is-gold{border-color:#E6D59A;background:linear-gradient(135deg,var(--gold-050),var(--gold-soft))}.hr-module-card.is-gold>span{background:var(--gold-100);color:var(--gold-800)}
.hr-overview-grid{align-items:start}.department-overview a{position:relative;display:flex;align-items:center;justify-content:space-between;overflow:hidden;margin-bottom:8px;padding:11px 12px;border:1px solid #E5EAF0;border-radius:var(--radius-sm);background:var(--neutral-050);color:var(--neutral-600);font-size:var(--fs-caption)}.department-overview a span,.department-overview a b{position:relative;z-index:1}.department-overview a b{color:var(--brand);font-size:var(--fs-subsection)}.department-overview a i{position:absolute;inset-block-end:0;inset-inline-start:0;height:3px;background:linear-gradient(90deg,var(--brand2),var(--gold))}
.hr-attention-list{padding:4px 16px 13px}.hr-attention-list a{display:flex;align-items:center;gap:10px;min-height:58px;padding:9px 0;border-bottom:1px solid var(--neutral-100);color:inherit}.hr-attention-list a:last-child{border-bottom:0}.hr-attention-list a>div{min-width:0;flex:1}.hr-attention-list b,.hr-attention-list small{display:block}.hr-attention-list b{font-size:var(--fs-caption)}.hr-attention-list small{margin-top:4px;color:var(--neutral-500);font-size:var(--fs-micro)}.hr-attention-list em{width:34px;height:34px;display:grid;place-items:center;border-radius:var(--radius-circle);background:var(--lapis-100);color:var(--brand);font-size:var(--fs-caption);font-style:normal;font-weight:var(--fw-bold)}

.attendance-live-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.attendance-live-grid>a{display:flex;align-items:center;gap:10px;padding:11px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--neutral-050);color:inherit}.attendance-live-grid>a>div{min-width:0;flex:1}.attendance-live-grid b,.attendance-live-grid small{display:block}.attendance-live-grid b{font-size:var(--fs-caption)}.attendance-live-grid small{margin-top:4px;color:var(--neutral-500);font-size:var(--fs-micro)}.attendance-live-grid .presence-pill{white-space:nowrap}.attendance-grid{margin-top:18px;grid-template-columns:minmax(300px,.65fr) minmax(0,1.35fr);align-items:start}.attendance-grid .break-summary-grid{grid-template-columns:1fr}.attendance-grid .cell-sub{display:block;margin-top:3px;color:var(--neutral-500);font-size:var(--fs-micro)}

.team-directory-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.team-directory-card{padding:15px;border:1px solid var(--line);border-radius:var(--radius-md);background:#fff;box-shadow:var(--shadow-sm)}.team-directory-head{display:flex;align-items:center;gap:10px}.team-directory-head>span{width:42px;height:42px;display:grid;place-items:center;border-radius:var(--radius-sm);background:var(--lapis-100);color:var(--brand)}.team-directory-head>div{min-width:0;flex:1}.team-directory-head h3,.team-directory-head p{margin:0}.team-directory-head h3{font-size:var(--fs-data);color:var(--brand)}.team-directory-head p{margin-top:4px;color:var(--neutral-500);font-size:var(--fs-micro)}.team-directory-stats{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:14px}.team-directory-stats span{padding:10px;border-radius:var(--radius-sm);background:var(--neutral-050)}.team-directory-stats b,.team-directory-stats small{display:block}.team-directory-stats b{color:var(--brand);font-size:18px}.team-directory-stats small{margin-top:3px;color:var(--neutral-500);font-size:var(--fs-micro)}

.report-center-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.employee-report-card{overflow:hidden;border:1px solid var(--line);border-radius:var(--radius-md);background:#fff;box-shadow:var(--shadow-sm)}.employee-report-head{display:flex;align-items:center;gap:10px;padding:14px}.employee-report-head>div{min-width:0;flex:1}.employee-report-head h3,.employee-report-head p{margin:0}.employee-report-head h3{font-size:var(--fs-caption);color:var(--brand)}.employee-report-head p{margin-top:4px;color:var(--neutral-500);font-size:var(--fs-micro)}.employee-report-head .score-ring{width:43px;height:43px}.employee-report-evidence{display:grid;grid-template-columns:repeat(3,1fr);gap:1px;background:var(--line);border-block:1px solid var(--line)}.employee-report-evidence span{padding:10px;background:var(--neutral-050)}.employee-report-evidence small,.employee-report-evidence b{display:block}.employee-report-evidence small{color:var(--neutral-500);font-size:var(--fs-micro)}.employee-report-evidence b{margin-top:4px;color:var(--brand);font-size:var(--fs-data)}.employee-report-card footer{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:11px 13px}.employee-report-card footer>span{color:var(--neutral-500);font-size:var(--fs-micro)}

@media(max-width:1280px){.hr-module-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.attendance-live-grid,.team-directory-grid,.report-center-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:820px){.hr-command-header{align-items:flex-start;flex-direction:column}.hr-period-form{width:100%;flex-wrap:wrap}.hr-period-form .field{flex:1}.hr-period-form input{width:100%;min-width:0}.attendance-live-grid,.team-directory-grid,.report-center-grid{grid-template-columns:1fr}.attendance-grid{grid-template-columns:1fr}}
@media(max-width:560px){.hr-module-grid{grid-template-columns:1fr}.hr-period-form .field{flex:1 1 42%}.hr-period-form .btn{width:100%}.employee-report-card footer{align-items:stretch;flex-direction:column}.employee-report-card footer .btn{width:100%}}

/* Pre-go-live polish: preserve the supplied logo artwork without a fake tile. */
.app-shell .brand-logo,.auth-brand img,.auth-logo-mobile,.appearance-preview-brand img{
  width:auto;max-width:84px;height:54px;object-fit:contain;border:0;border-radius:0;
  background:transparent;box-shadow:none;padding:0;
}
.auth-brand img{height:64px;max-width:96px}.auth-logo-mobile{height:72px;max-width:112px}

/* Compact, semantic source recognition. Unknown sources remain deliberately neutral. */
.source-with-indicator{display:inline-flex;align-items:center;gap:7px;min-width:0}
.channel-indicator{width:25px;height:25px;display:inline-grid;place-items:center;flex:0 0 25px;border:1px solid var(--neutral-300);border-radius:var(--radius-sm);background:var(--neutral-050);color:var(--neutral-600)}
.channel-indicator .brand-svg,.channel-indicator .ui-icon{max-width:20px;max-height:20px}
.channel-indicator.channel-instagram{color:#B42375;background:#FFF1F6;border-color:#FBCFE8}
.channel-indicator.channel-website{color:var(--info-700);background:var(--info-100);border-color:var(--info-200)}
.channel-indicator.channel-ai_agent{color:var(--gold-800);background:var(--gold-soft);border-color:var(--gold-100)}

.qualification-badge.status-not_evaluated{background:var(--neutral-100);color:var(--neutral-500)}
.quick-qualification>summary{color:var(--gold-800)}.qualification-history{margin-top:14px;padding-top:13px;border-top:1px solid var(--line)}
.qualification-history h4{margin:0 0 8px;font-size:var(--fs-caption)}.qualification-history>div{display:flex;justify-content:space-between;gap:10px;padding:8px 0;border-bottom:1px solid var(--neutral-100)}.qualification-history b{font-size:var(--fs-caption)}.qualification-history span{color:var(--neutral-500);font-size:var(--fs-micro)}

/* One canonical permission registry instead of repeating the feature list per role. */
.permission-registry-card{padding:0;overflow:hidden}.permission-registry-card>.card-title{padding:17px 18px;margin:0;border-bottom:1px solid var(--line)}
.permission-matrix-wrap{overflow:auto;overscroll-behavior-inline:contain}.permission-matrix{width:100%;min-width:980px;border-collapse:separate;border-spacing:0}
.permission-matrix th,.permission-matrix td{padding:10px;border-inline-end:1px solid var(--neutral-100);border-bottom:1px solid var(--neutral-100);text-align:center;vertical-align:middle}
.permission-matrix thead th{position:sticky;top:0;z-index:3;background:var(--neutral-050)}.permission-matrix th:first-child{position:sticky;inset-inline-start:0;z-index:4;min-width:230px;text-align:start;background:#fff}
.permission-matrix thead th:first-child{background:var(--neutral-050)}.permission-matrix th b,.permission-matrix th small,.permission-matrix tfoot td small{display:block}.permission-matrix th b{font-size:var(--fs-caption)}.permission-matrix th small,.permission-matrix tfoot td small{margin-top:3px;color:var(--neutral-500);font-size:var(--fs-micro)}
.matrix-check{display:inline-grid;place-items:center;cursor:pointer}.matrix-check input{position:absolute;width:1px;height:1px;margin:0;overflow:hidden;clip-path:inset(50%);opacity:0;pointer-events:none}.matrix-check span{width:28px;height:28px;display:grid;place-items:center;border:1px solid #CCD6E2;border-radius:var(--radius-sm);color:transparent;background:#fff}.matrix-check input:checked+span{color:#fff;background:var(--brand2);border-color:var(--brand2)}.matrix-check input:disabled+span{opacity:.7;cursor:not-allowed}

@media(max-width:720px){
  .content-wrap,.dashboard-main-grid,.dashboard-main-grid>.stack,.pipeline-card{min-width:0;width:100%}
  .pipeline-card{overflow:hidden}
  /* The mobile pipeline carousel was removed in Phase D. The funnel is a
     vertical list, so every stage is visible on a phone without a
     horizontal scroll gesture that carried no visible affordance. */
  .lead-lifecycle-cell{width:min(430px,calc(100vw - 48px));min-width:min(430px,calc(100vw - 48px));max-width:min(430px,calc(100vw - 48px))}
  .quick-choice-form{padding:7px 6px}.quick-choice-line{gap:5px}.quick-choice-pill span{min-height:34px;padding:5px 9px;font-size:var(--fs-micro)}.quick-choice-save{min-height:34px}
  .quick-choice-extra{align-items:stretch;flex-wrap:wrap}.quick-choice-extra input,.quick-choice-extra select{height:36px;min-width:0;flex:1 1 145px}
  .permission-registry-card{margin-inline:0}.permission-matrix th:first-child{min-width:190px}
}

/* ==========================================================================
   V2.9 premium professional polish
   A conservative, high-density refinement of the existing Navy + White UI.
   ========================================================================== */
:root{
  --radius:12px;
  --radius-sm:8px;
  --sidebar:268px;
  --topbar:74px;
  --shadow-sm:0 1px 3px rgba(10,23,53,.045),0 8px 20px rgba(10,23,53,.035);
  --shadow:0 18px 42px rgba(10,23,53,.09);
}

/* Shared geometry, type hierarchy, and restrained surfaces. */
.app-shell .main-area,[dir=rtl] .app-shell .main-area{border-radius:18px 0 0 18px}
[dir=rtl] .app-shell .main-area{border-radius:0 18px 18px 0}
.app-shell .sidebar{padding:15px 12px 12px}
.app-shell .brand-block{padding-bottom:11px;margin-bottom:7px}
.app-shell .nav-link{min-height:40px;margin:1px 0;padding:8px 9px;border-radius:var(--radius-sm);font-size:var(--fs-data)}
.app-shell .nav-sublink{min-height:34px;border-radius:var(--radius-xs);font-size:var(--fs-caption)}
.app-shell .workspace-pill{padding:8px 10px;border-radius:var(--radius-sm)}
.app-shell .sidebar-shortcuts .shortcut-link{min-height:49px;border-radius:var(--radius-sm)}
.app-shell .avatar{border-radius:var(--radius-sm)}
.app-shell .user-copy b{color:#fff}
.app-shell .user-copy span{color:var(--label-inverse-secondary)}
.app-shell .topbar{padding-inline:22px}
.content-wrap{padding:22px 22px 42px}
.page-heading h1{font-size:20px;letter-spacing:-.25px}
.page-heading p{margin-top:3px;font-size:var(--fs-caption)}

.card,.form-card,.table-card,.filters,.stat-card,.summary-tile,.integration-card,
.metric-card,.hr-module-card,.team-directory-card,.employee-report-card{
  border-radius:var(--radius);box-shadow:var(--shadow-sm);
}
.card:hover,.stat-card:hover,.metric-card:hover{border-color:#CED8E4}
.card-title,.table-head{padding:14px 16px}
.card-title h2,.card-title h3,.table-head h2,.table-head h3{letter-spacing:-.1px}
.field label{margin-bottom:6px;font-size:var(--fs-caption);font-weight:var(--fw-semibold);color:var(--neutral-600)}
.field-hint{line-height:1.5}
input,select,textarea,.control{border-radius:var(--radius-sm)}
input,select{height:40px}
textarea{min-height:88px}
input:focus,select:focus,textarea:focus{border-color:var(--lapis-400);box-shadow:0 0 0 3px rgba(36,74,118,.12)}

/* One crisp, predictable button system. */
.btn{
  min-height:38px;padding-inline:13px;border-radius:var(--radius-sm);font-size:var(--fs-caption);font-weight:var(--fw-semibold);
  letter-spacing:0;box-shadow:none;transform:none;
  transition:color .14s ease,background-color .14s ease,border-color .14s ease,box-shadow .14s ease;
}
.btn:hover,.btn:active{transform:none}
.btn-primary{background:var(--brand);border-color:var(--brand);box-shadow:var(--elevation-2)}
.btn-primary:hover{background:#142D53;border-color:#142D53;box-shadow:var(--elevation-2)}
.btn-primary:active{background:var(--lapis-900);box-shadow:none}
.btn-secondary{background:#fff;border-color:var(--neutral-350);color:var(--neutral-700)}
.btn-secondary:hover{background:var(--neutral-050);border-color:var(--neutral-400);color:var(--brand)}
.btn-soft{background:var(--neutral-050);border-color:var(--neutral-300);color:var(--neutral-600)}
.btn-soft:hover{background:var(--lapis-100);border-color:var(--neutral-350);color:var(--brand)}
.btn-danger,.btn-destructive{background:var(--danger-700);border-color:var(--danger-700);color:#fff}
.btn-danger:hover,.btn-destructive:hover{background:#912018;border-color:#912018}
.btn-sm{min-height:32px;padding-inline:10px;border-radius:var(--radius-xs);font-size:var(--fs-caption)}
.btn:disabled,.btn[aria-disabled=true]{cursor:not-allowed;box-shadow:none;opacity:.52}
.icon-btn,.professional-icon-btn{border-radius:var(--radius-sm)}

/* Tables: clearer headers, lighter rows, faster scanning. */
.table-head{min-height:58px;background:#fff}
.table-wrap{scrollbar-color:#AEBBCC var(--neutral-100);overscroll-behavior-inline:contain}
.data-table th,.data-table td{padding:11px 12px}
.data-table th{font-size:var(--fs-micro);font-weight:var(--fw-bold);letter-spacing:.18px;background:#F5F7FA;color:var(--neutral-600)}
.data-table td{font-size:var(--fs-caption);border-bottom-color:var(--neutral-100)}
.data-table tbody tr:nth-child(even){background:#FCFDFE}
.data-table tbody tr:hover{background:var(--neutral-100)}
.client-avatar{width:34px;height:34px;border-radius:var(--radius-sm)}
.client-copy b{font-size:var(--fs-caption)}.client-copy small,.phone-link{font-size:var(--fs-micro)}
.pagination-note{padding:10px 14px;background:var(--neutral-050);color:var(--neutral-500)}

/* Premium, integrated communication actions. */
.app-shell .brand-action-row{padding:3px;gap:3px;border-radius:var(--radius-sm);background:var(--neutral-050)}
.app-shell .brand-action-btn{width:32px;height:32px;min-width:32px;border-radius:var(--radius-xs)}
.app-shell .brand-action-btn:hover{transform:none;background:#fff;border-color:var(--neutral-350);box-shadow:var(--elevation-2)}
.app-shell .brand-action-btn.is-whatsapp{color:var(--success-700);background:var(--success-100)}
.app-shell .brand-action-btn.is-whatsapp:hover{background:#E6F7EF;border-color:#A9DCC2}
.app-shell .brand-action-btn.is-call{color:var(--lapis-500);background:var(--lapis-100)}
.app-shell .brand-action-btn.is-call:hover{background:#E5EEF7;border-color:#B8CBE0}
.app-shell .brand-action-btn.is-history{background:var(--neutral-100);color:#344F70}
.app-shell .brand-action-btn.action-note{color:var(--teal-700)}
.app-shell .brand-action-btn.action-detail{background:var(--brand);color:#fff}
.app-shell .brand-action-btn .brand-svg{width:21px;height:21px}
.app-shell .quick-contact-bar{gap:6px}
.app-shell .quick-contact-bar .contact-pill{min-height:38px;padding:6px 10px;border-radius:var(--radius-sm);font-size:var(--fs-caption);box-shadow:none;transform:none}
.app-shell .quick-contact-bar .contact-pill:hover{transform:none;box-shadow:var(--elevation-2)}

/* Lead filters are unchanged on desktop and intentionally collapsed on mobile. */
.lead-filter-disclosure{margin-bottom:16px}
.lead-mobile-toolbar{display:none}
.lead-filter-form{margin-bottom:0}
.lead-filter-form .btn{width:100%}
.lead-lifecycle-cell{width:520px;min-width:520px;max-width:590px}
.quick-choice-form{border-radius:var(--radius-sm);background:var(--neutral-050)}
.quick-choice-pill span{border-radius:var(--radius-xs)}
.quick-choice-save{align-self:center}

/* Dashboard and authentication: executive density without oversized display type. */
.dashboard-control-deck{gap:10px;margin-bottom:15px}
.dashboard-control-bar{border-radius:var(--radius-sm)}
.dashboard-control-bar>summary{min-height:62px;padding:9px 11px}
.control-bar-icon{width:35px;height:35px;border-radius:var(--radius-sm)}
.dashboard-main-grid{gap:15px}
.pipeline-item{min-height:72px;padding:11px 12px;border-radius:var(--radius-sm)}
.pipeline-item .pipeline-metric{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.pipeline-item .pipeline-metric small{font-size:var(--fs-micro);color:var(--neutral-500)}
.pipeline-item>span:last-child{display:block;margin-top:3px}
.pipeline-item:hover,.quick-action:hover{transform:none}
.metric-grid{gap:10px;margin-bottom:15px}
.metric-card{min-height:116px;padding:14px}
.metric-card .metric-icon{border-radius:var(--radius-sm)}
.auth-pitch h1{max-width:610px;font-size:clamp(31px,3.35vw,46px);line-height:1.2;letter-spacing:-.75px}
.auth-pitch p{font-size:var(--fs-data);line-height:1.75}
.auth-feature{min-height:50px;border-radius:var(--radius-sm)}
.auth-form-side{padding:40px}
.auth-box{width:min(410px,100%)}
.auth-box h2{font-size:25px}
.auth-box input{height:44px}
.auth-box .auth-submit{width:100%;height:44px;margin-top:18px}
.auth-submit span{margin-inline-start:auto;font-size:var(--fs-section);line-height:1}
[dir=rtl] .auth-submit span{transform:rotate(180deg)}

/* Permission and settings surfaces retain behavior while reducing visual weight. */
.permission-registry-card>.card-title{padding:14px 16px}
.permission-matrix th,.permission-matrix td{padding:8px 9px}
.matrix-check span{width:27px;height:27px;border-radius:var(--radius-xs)}
.settings-grid,.form-grid{gap:14px}

@media(max-width:900px){
  .app-shell .main-area,[dir=rtl] .app-shell .main-area{border-radius:0}
}

@media(max-width:720px){
  :root{--topbar:64px}
  .content-wrap{padding:13px 10px 30px}
  .app-shell .topbar{height:64px;padding-inline:10px}
  .section-toolbar{align-items:stretch;gap:9px;margin-bottom:10px}
  .section-toolbar>.toolbar-actions{flex-wrap:nowrap;overflow-x:auto;padding-bottom:3px;scrollbar-width:none}
  .section-toolbar>.toolbar-actions::-webkit-scrollbar{display:none}
  .section-toolbar>.toolbar-actions>.field-hint{display:none}
  .section-toolbar>.toolbar-actions .btn{flex:0 0 auto}
  .lead-filter-disclosure{margin:0 0 9px;border:1px solid var(--neutral-300);border-radius:var(--radius-sm);background:#fff;box-shadow:var(--shadow-sm)}
  .lead-mobile-toolbar{
    min-height:54px;display:grid;grid-template-columns:minmax(0,1fr) auto auto 18px;align-items:center;gap:8px;
    padding:7px 9px;list-style:none;cursor:pointer;color:var(--brand);user-select:none;
  }
  .lead-mobile-toolbar::-webkit-details-marker{display:none}
  .lead-mobile-toolbar-primary,.lead-mobile-toolbar-meta{display:flex;align-items:center;min-width:0;overflow:hidden}
  .lead-mobile-toolbar-primary{gap:6px}
  .lead-mobile-toolbar-primary>b{overflow:hidden;font-size:var(--fs-caption);white-space:nowrap;text-overflow:ellipsis}
  .lead-mobile-toolbar-primary>em{padding:3px 5px;border-radius:var(--radius-xs);background:var(--lapis-100);color:var(--lapis-500);font-size:var(--fs-micro);font-style:normal;font-weight:var(--fw-bold);white-space:nowrap}
  .lead-mobile-toolbar-meta{flex-direction:column;align-items:flex-start;gap:1px;padding-inline-start:8px;border-inline-start:1px solid var(--neutral-200)}
  .lead-mobile-toolbar-meta>.ui-icon{display:none}
  .lead-mobile-toolbar-meta small{color:var(--neutral-500);font-size:var(--fs-micro);line-height:1;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .lead-mobile-toolbar-meta b{max-width:100%;overflow:hidden;color:var(--neutral-700);font-size:var(--fs-micro);white-space:nowrap;text-overflow:ellipsis}
  .lead-mobile-toolbar-chevron{display:grid;place-items:center;color:var(--neutral-500);transition:transform .14s ease}
  .lead-filter-disclosure[open] .lead-mobile-toolbar-chevron{transform:rotate(180deg)}
  .lead-filter-form{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:0;padding:11px;border:0;border-top:1px solid var(--neutral-200);border-radius:0;background:var(--neutral-050);box-shadow:none}
  .lead-filter-form .search-control{grid-column:1/-1}
  .lead-filter-form .field label{margin-bottom:4px;font-size:var(--fs-micro)}
  .app-shell .lead-filter-form input,.app-shell .lead-filter-form select{height:42px;line-height:40px;padding-block:0;padding-inline:12px;font-size:var(--fs-caption)}
  .app-shell .lead-filter-form select{padding-inline-end:32px}
  .app-shell .lead-filter-form .search-control input{height:42px;line-height:40px;padding-block:0;padding-inline-start:38px;padding-inline-end:12px;font-size:var(--fs-caption)}
  .lead-filter-form .field:nth-last-child(-n+2) label{display:none}
  .lead-filter-form .field:nth-last-child(-n+2){align-self:end}
  .lead-filter-form .btn{min-height:40px}
  .table-card{border-radius:var(--radius-sm)}
  .table-head{min-height:52px;padding:10px 11px}
  .table-head h2{font-size:var(--fs-data)}
  .data-table th,.data-table td{padding:9px 10px}
  .data-table td[colspan] .empty-state{position:sticky;inset-inline-start:0;width:calc(100vw - 42px);padding:30px 10px}
  .app-shell .brand-action-btn{width:44px;height:44px;min-width:44px}
  .app-shell .brand-action-row{gap:4px}
  .app-shell .quick-contact-bar{flex-wrap:nowrap;overflow-x:auto;padding-bottom:3px;scrollbar-width:none;overscroll-behavior-inline:contain}
  .app-shell .quick-contact-bar::-webkit-scrollbar{display:none}
  .app-shell .quick-contact-bar .contact-pill,.app-shell .quick-contact-bar>.btn{flex:0 0 auto;min-height:42px}
  .quick-choice-pill span{min-height:36px;border-radius:var(--radius-xs)}
  .quick-choice-save{min-height:36px}
  .auth-visual{min-height:180px;padding:20px}
  .auth-pitch h1{font-size:24px}
  .auth-form-side{padding:24px 18px 30px}
  .auth-box h2{font-size:23px}
  .btn{min-height:40px}
}

@media(max-width:430px){
  .lead-mobile-toolbar{grid-template-columns:minmax(0,1fr) 46px 34px 15px;gap:5px;padding-inline:8px}
  .lead-mobile-toolbar-primary{gap:4px}
  .lead-mobile-toolbar-primary>b{font-size:var(--fs-micro)}
  .lead-mobile-toolbar-primary>em{font-size:var(--fs-micro);padding-inline:4px}
  .lead-mobile-toolbar-meta{padding-inline-start:5px}
  .lead-mobile-toolbar-meta small{font-size:var(--fs-micro)}.lead-mobile-toolbar-meta b{font-size:var(--fs-micro)}
  .lead-filter-form{grid-template-columns:repeat(2,minmax(0,1fr));padding:9px}
  .lead-filter-form .search-control{grid-column:1/-1}
  .auth-visual{min-height:168px}
  .auth-pitch h1{font-size:21px;line-height:1.3}
}

@media(max-width:340px){
  .lead-mobile-toolbar-primary>em{display:none}
  .lead-mobile-toolbar{grid-template-columns:minmax(0,1fr) 44px 30px 14px}
  .content-wrap{padding-inline:8px}
}

/* Premium motion and depth system -----------------------------------------
   One restrained vocabulary for feedback, overlays and state changes. */
.ui-live-region{
  position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;
  overflow:hidden!important;clip:rect(0,0,0,0)!important;clip-path:inset(50%)!important;
  white-space:nowrap!important;border:0!important;
}

.card,.form-card,.table-card,.filters,.stat-card,.summary-tile,.integration-card,
.metric-card,.hr-module-card,.team-directory-card,.employee-report-card{
  background:var(--surface-level-1);box-shadow:var(--shadow-level-1);
}
.card:hover,.stat-card:hover,.metric-card:hover,.form-card:hover,.table-card:hover{
  border-color:var(--line);box-shadow:var(--shadow-level-1);transform:none;
}
.menu-pop,.action-menu[open] .menu-pop,.dashboard-control-bar[open],.modal-card{
  background:var(--surface-level-2);box-shadow:var(--shadow-level-2);
}

.btn,.icon-btn,.professional-icon-btn,.top-action,.language-switch,.top-break-btn,
.brand-action-btn,.contact-pill,.quick-action,.status-choice,.pipeline-item,.summary-tile,
.hr-module-card,.dashboard-control-bar>summary{
  transition-property:transform,box-shadow,border-color,background-color,color,opacity;
  transition-duration:var(--motion-button);
  transition-timing-function:var(--ease-enter);
}
.btn{
  box-shadow:var(--elevation-2);
  transform:translateY(0) scale(1);
}
.btn-primary{box-shadow:var(--elevation-2)}
.btn:disabled,.btn[aria-disabled=true],button:disabled{
  cursor:not-allowed;transform:none!important;box-shadow:none!important;opacity:.52;
}
.btn:active:not(:disabled):not([aria-disabled=true]),
.icon-btn:active:not(:disabled),.professional-icon-btn:active:not(:disabled),
.top-action:active,.language-switch:active,.top-break-btn:active:not(:disabled),
.brand-action-btn:active,.contact-pill:active,.quick-action:active,.status-choice:active,
.pipeline-item:active,.summary-tile:active,.hr-module-card:active{
  transform:translateY(0) scale(.985);box-shadow:var(--elevation-1);
  transition-duration:120ms;transition-timing-function:var(--ease-press);
}
@media(hover:hover){
  .btn:hover:not(:disabled):not([aria-disabled=true]),.icon-btn:hover:not(:disabled),
  .professional-icon-btn:hover:not(:disabled),.top-action:hover,.language-switch:hover,
  .top-break-btn:hover:not(:disabled),.brand-action-btn:hover,.contact-pill:hover{
    transform:translateY(-1px);
  }
  .quick-action:hover,.status-choice:hover,.pipeline-item:hover,.summary-tile:hover,
  .hr-module-card:hover,.dashboard-control-bar>summary:hover{
    transform:translateY(-1px);border-color:var(--neutral-350);box-shadow:var(--shadow-level-2);
  }
}

.is-busy{cursor:wait!important;pointer-events:none}
.btn.is-busy::before,.top-break-btn.is-busy::before,.quick-choice-save.is-busy::before{
  content:"";width:12px;height:12px;flex:0 0 12px;border:2px solid currentColor;border-inline-end-color:transparent;
  border-radius:var(--radius-circle);animation:crm-spinner .72s linear infinite;
}
form[aria-busy=true]{cursor:progress}

input,select,textarea,.control{
  transition-property:border-color,box-shadow,background-color,color;
  transition-duration:var(--motion-control);transition-timing-function:var(--ease-enter);
}
input:focus,select:focus,textarea:focus,.control:focus{
  border-color:var(--lapis-400);box-shadow:var(--focus-ring);background:#fff;
}
input:user-invalid,select:user-invalid,textarea:user-invalid{
  border-color:#D92D20;box-shadow:0 0 0 3px rgba(217,45,32,.1);
}
input:disabled,select:disabled,textarea:disabled{
  color:var(--neutral-500);background:var(--neutral-100);border-color:var(--neutral-200);cursor:not-allowed;opacity:.76;
}

.app-shell .nav-link,.app-shell .nav-sublink,.app-shell .shortcut-link,.app-shell .nav-chevron{
  transition-property:color,background-color,border-color,box-shadow,transform;
  transition-duration:var(--motion-control);transition-timing-function:var(--ease-enter);
}
.app-shell .nav-link.active{box-shadow:inset 3px 0 0 var(--gold),0 9px 20px rgba(0,0,0,.15)}
[dir=rtl] .app-shell .nav-link.active{box-shadow:inset -3px 0 0 var(--gold),0 9px 20px rgba(0,0,0,.15)}
.nav-accordion[open]>.nav-submenu{animation:crm-submenu-in var(--motion-control) var(--ease-enter) both}
.nav-accordion .nav-chevron{transition-duration:var(--motion-control)}

/* Lead command bars: recognizable accents inside one coherent control set. */
.app-shell .brand-action-row{
  border-color:var(--neutral-300);background:var(--neutral-050);box-shadow:inset 0 1px 0 #fff,0 4px 12px rgba(10,23,53,.055);
}
.app-shell .brand-action-btn{
  position:relative;border-color:transparent;box-shadow:var(--elevation-1);
  transform:translateY(0) scale(1);
}
.app-shell .brand-action-btn:hover{transform:translateY(-1px);box-shadow:var(--elevation-2)}
.app-shell .brand-action-btn:active{transform:translateY(0) scale(.97);box-shadow:inset 0 1px 2px rgba(10,23,53,.12)}
.app-shell .brand-action-btn.is-whatsapp{color:var(--success-700);background:var(--success-100);border-color:var(--success-200)}
.app-shell .brand-action-btn.is-call{color:var(--lapis-500);background:var(--lapis-100);border-color:#D2E0ED}
.app-shell .brand-action-btn.is-history{color:#344F70;background:var(--neutral-100);border-color:var(--neutral-300)}
.app-shell .brand-action-btn.action-copy,.app-shell .brand-action-btn.action-note{background:#fff;border-color:var(--neutral-200)}
.app-shell .brand-action-btn.action-detail{border-color:var(--brand)}
.contact-command-bar{
  width:max-content;max-width:100%;padding:4px;border:1px solid var(--neutral-300);border-radius:var(--radius-sm);
  background:var(--neutral-050);box-shadow:inset 0 1px 0 #fff,0 5px 14px rgba(10,23,53,.055);
}
.contact-command-bar .contact-pill,.contact-command-bar>.btn{box-shadow:var(--elevation-1)}
.contact-command-bar .contact-pill.whatsapp{background:var(--success-100);border-color:var(--success-200);color:var(--success-700)}
.contact-command-bar .contact-pill.call{background:var(--lapis-100);border-color:#D2E0ED;color:var(--lapis-500)}

.brand-action-btn[data-copy-state=success] .ui-icon,.brand-action-btn[data-copy-state=success] .brand-svg{opacity:0;transform:scale(.72)}
.brand-action-btn[data-copy-state=success]::after{
  content:"✓";position:absolute;inset:0;display:grid;place-items:center;color:var(--success-700);font-size:var(--fs-section);font-weight:var(--fw-bold);
}
[data-copy-state=success]{border-color:#85D5AD!important;background:var(--success-100)!important;color:var(--success-700)!important}
[data-copy-state=error]{border-color:#FDA29B!important;background:var(--danger-100)!important;color:var(--danger-700)!important}
.btn[data-copy-state=success]::after{content:"✓";font-weight:var(--fw-bold)}

/* Compact lifecycle controls with clear unsaved and selection feedback. */
.quick-choice-form{
  transition:border-color var(--motion-control) var(--ease-enter),background-color var(--motion-control) var(--ease-enter),box-shadow var(--motion-control) var(--ease-enter);
}
.quick-choice-form.has-unsaved-changes{
  border-color:#9EB4CA;background:#F7FAFD;box-shadow:inset 3px 0 0 var(--brand2),0 3px 10px rgba(10,23,53,.045);
}
[dir=rtl] .quick-choice-form.has-unsaved-changes{box-shadow:inset -3px 0 0 var(--brand2),0 3px 10px rgba(10,23,53,.045)}
.quick-choice-pill span{
  transition-property:border-color,background-color,color,box-shadow,transform;
  transition-duration:var(--motion-control);transition-timing-function:var(--ease-enter);
}
.quick-choice-pill span i{
  transform:scale(.86);transition:transform var(--motion-button) var(--ease-enter),background-color var(--motion-button) var(--ease-enter),border-color var(--motion-button) var(--ease-enter),box-shadow var(--motion-button) var(--ease-enter);
}
.quick-choice-pill input:checked+span{transform:translateY(-1px)}
.quick-choice-pill input:checked+span i{
  transform:scale(1);box-shadow:inset 0 0 0 2px #fff,0 0 0 2px color-mix(in srgb,var(--choice-color,var(--brand2)) 18%,transparent);
}
.quick-choice-save{transition-duration:var(--motion-button)}
.quick-choice-save.is-activated{animation:crm-save-ready 260ms var(--ease-enter) both}
.quick-choice-expandable{
  display:grid;grid-template-rows:0fr;min-width:0;margin-top:0;overflow:hidden;opacity:0;
  transform:translateY(-4px);transition:grid-template-rows var(--motion-panel) var(--ease-enter),opacity var(--motion-control) var(--ease-enter),transform var(--motion-control) var(--ease-enter),margin-top var(--motion-panel) var(--ease-enter);
}
.quick-choice-expandable[hidden]{display:none}
.quick-choice-expandable.is-expanded{grid-template-rows:1fr;margin-top:5px;opacity:1;transform:translateY(0)}
.quick-choice-extra-inner{min-height:0;margin-top:0;overflow:hidden}
#lead-activity{scroll-margin-block-start:calc(var(--topbar) + 16px)}

/* Fast, non-obstructive tooltips for icon-only actions. */
.crm-tooltip{
  position:fixed;z-index:var(--z-tooltip);max-width:min(220px,calc(100vw - 16px));padding:6px 9px;
  border:1px solid rgba(255,255,255,.12);border-radius:var(--radius-xs);background:var(--lapis-900);color:#fff;
  box-shadow:var(--elevation-3);font-size:var(--fs-caption);font-weight:var(--fw-semibold);line-height:1.35;
  text-align:center;pointer-events:none;opacity:0;transform:translateY(3px) scale(.98);
  transition:opacity 130ms var(--ease-enter),transform 130ms var(--ease-enter);
}
.crm-tooltip.is-visible{opacity:1;transform:translateY(0) scale(1)}

/* Overlays remain native Flask/Jinja controls but gain focus-safe motion. */
.modal{
  display:flex;z-index:var(--z-overlay);background:rgba(2,8,23,.52);opacity:0;visibility:hidden;pointer-events:none;
  transition:opacity var(--motion-panel) var(--ease-enter),visibility 0s linear var(--motion-panel);
}
.modal.open{opacity:1;visibility:visible;pointer-events:auto;transition-delay:0s}
.modal-card{
  opacity:0;transform:translateY(8px) scale(.99);
  transition:opacity var(--motion-control) var(--ease-enter),transform var(--motion-panel) var(--ease-enter);
}
.modal.open .modal-card{opacity:1;transform:translateY(0) scale(1)}
body.has-modal-open,body.has-sidebar-open{overflow:hidden}

.alert{animation:crm-alert-in var(--motion-panel) var(--ease-enter) both}
.alert.is-dismissing{opacity:0;transform:translateY(-4px);transition:opacity 180ms var(--ease-enter),transform 180ms var(--ease-enter)}
.alert button{cursor:pointer;border-radius:var(--radius-xs);transition:background-color var(--motion-button) var(--ease-enter),transform var(--motion-button) var(--ease-enter)}
.alert button:hover{background:rgba(255,255,255,.55)}
.alert button:active{transform:scale(.92)}

@keyframes crm-spinner{to{transform:rotate(360deg)}}
@keyframes crm-submenu-in{from{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}
@keyframes crm-save-ready{0%{transform:scale(.97);box-shadow:none}60%{transform:scale(1.02);box-shadow:0 0 0 3px rgba(36,74,118,.12)}100%{transform:scale(1);box-shadow:var(--elevation-2)}}
@keyframes crm-alert-in{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}
@keyframes crm-filter-in{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}

@media(max-width:980px){
  .app-shell .sidebar{transition:transform var(--motion-panel) var(--ease-enter)}
  .sidebar-backdrop{
    display:block;opacity:0;visibility:hidden;pointer-events:none;
    transition:opacity var(--motion-panel) var(--ease-enter),visibility 0s linear var(--motion-panel);
  }
  .app-shell.sidebar-open .sidebar-backdrop{display:block;opacity:1;visibility:visible;pointer-events:auto;transition-delay:0s}
}

@media(max-width:720px){
  .lead-mobile-toolbar{transition:background-color var(--motion-control) var(--ease-enter),color var(--motion-control) var(--ease-enter)}
  .lead-filter-disclosure[open]>.lead-mobile-toolbar{background:var(--neutral-050)}
  .lead-filter-disclosure[open] .lead-filter-form{animation:crm-filter-in var(--motion-panel) var(--ease-enter) both}
  .lead-filter-disclosure.is-applying .lead-filter-form{opacity:.72;transform:translateY(-2px);transition:opacity var(--motion-button) var(--ease-enter),transform var(--motion-button) var(--ease-enter)}
  .quick-choice-pill span,.quick-choice-save{min-height:42px}
  .contact-command-bar{overflow-x:auto;overscroll-behavior-inline:contain;scrollbar-width:none}
  .contact-command-bar::-webkit-scrollbar{display:none}
}

@media(hover:none),(pointer:coarse){
  .crm-tooltip{display:none!important}
  :where(.btn,.icon-btn,.professional-icon-btn,.top-action,.language-switch,.top-break-btn,
    .brand-action-btn,.contact-pill,.quick-action,.status-choice,.pipeline-item,.summary-tile,.hr-module-card):hover{
    transform:none;
  }
}

@media(prefers-reduced-motion:reduce){
  .btn,.icon-btn,.professional-icon-btn,.top-action,.language-switch,.top-break-btn,
  .brand-action-btn,.contact-pill,.quick-action,.status-choice,.pipeline-item,.summary-tile,.hr-module-card,
  .modal,.modal-card,.crm-tooltip,.quick-choice-expandable,.quick-choice-pill span,.quick-choice-pill span i,
  .lead-filter-form,.nav-submenu,.alert,.alert.is-dismissing{
    animation:none!important;transition:none!important;transform:none!important;
  }
}

/* Keep the final compact layer authoritative over legacy V2.x cascade. */
.lead-lifecycle-cell{width:400px;min-width:400px;max-width:440px}
.quick-choice-form{padding:0;border:0;border-radius:var(--radius-sm);background:transparent;box-shadow:none}
.quick-choice-form.has-unsaved-changes,
[dir=rtl] .quick-choice-form.has-unsaved-changes{background:transparent;box-shadow:none}
.app-shell .brand-action-row{padding:0;gap:5px;border:0;border-radius:0;background:transparent;box-shadow:none}
.contact-command-bar{padding:0;gap:6px;border:0;border-radius:0;background:transparent;box-shadow:none}
.app-shell .workspace-pill{margin:0 4px 10px;padding:3px 4px;border:0;border-radius:0;background:transparent}
.lead-status-stepper-wrap{border-top-color:var(--neutral-200);scrollbar-color:#B8C5D3 transparent}
.lead-status-stepper-wrap:focus-visible{outline-color:var(--lapis-500)}
.lead-status-step{color:var(--neutral-500)}
.lead-status-step:not(:last-child)::after{background:var(--neutral-300)}
.lead-status-step.is-complete:not(:last-child)::after{background:var(--lapis-300)}
.lead-status-node{border-color:var(--neutral-350);background:#fff;color:var(--neutral-500)}
.lead-status-step.is-complete,.lead-status-step.is-current{color:var(--lapis-600)}
.lead-status-step.is-current{color:var(--lapis-800)}
.lead-status-label{font-size:var(--fs-micro)}
.lead-status-stepper-wrap.has-terminal-alternative .lead-status-stepper{padding-bottom:30px}
.compact-inline-field[hidden]{display:none}
.lead-status-step.branches-to-terminal:not(:last-child)::after{
  width:calc(200% - 26px);background:var(--lapis-300);
}
.lead-status-step.is-alternative:not(:last-child)::after{background:transparent}
.lead-status-step.is-alternative .lead-status-node,
.lead-status-step.is-alternative .lead-status-label{transform:translateY(28px)}
.lead-status-step.is-alternative .lead-status-node{border-style:dashed;background:#fff;color:var(--neutral-500)}

@media(max-width:720px){
  .lead-lifecycle-cell{width:min(390px,calc(100vw - 42px));min-width:min(390px,calc(100vw - 42px));max-width:min(390px,calc(100vw - 42px))}
  .quick-choice-pill span,.quick-choice-save,.lifecycle-summary{min-height:44px}
}

@media(max-width:980px){
  .detail-layout{grid-template-columns:minmax(0,1fr)}
  .detail-layout>.stack,.lead-hero,.lead-hero-top,.lead-identity,.lead-identity>div{min-width:0}
  .lead-identity h2,.lead-identity p{overflow-wrap:anywhere}
}

@media(prefers-reduced-motion:reduce){
  .lifecycle-panel,.lifecycle-chevron,.lifecycle-summary,.notification-popover,.notification-item{
    animation:none!important;transition:none!important;transform:none!important;
  }
}

/* ==========================================================================
   V2.9 UI/UX foundation
   Typography hierarchy, one button system, one icon-control treatment.
   Every value here resolves from design-tokens.css. This block is the
   authoritative end of the cascade for the primitives it names — extend it
   rather than appending another override further down.
   ========================================================================== */

/* ------------------------------------------------------------- Typography
   Six readable steps. The old layers dropped to 6.5px in places; nothing a
   user is expected to read now sits below --fs-micro (11px). */
body{font-size:var(--fs-body);line-height:var(--lh-body)}

.page-heading h1{font-size:var(--fs-title);font-weight:var(--fw-bold);line-height:var(--lh-tight)}
.page-heading p{font-size:var(--fs-caption);line-height:var(--lh-snug)}

.card-title h2,.card-title h3,
.table-head h2,.table-head h3,
.app-shell .card-title h2,.app-shell .card-title h3,
.app-shell .table-head h2,.app-shell .table-head h3{
  font-size:var(--fs-section);font-weight:var(--fw-semibold);line-height:var(--lh-tight);
}
.card-title p{font-size:var(--fs-caption);line-height:var(--lh-snug)}

.workspace-panel-head h2{font-size:var(--fs-subsection);font-weight:var(--fw-semibold)}
.workspace-panel-head p{font-size:var(--fs-caption)}

/* Data surfaces read at 13px; headers stay a step down as labels, not copy. */
.data-table td{font-size:var(--fs-data);line-height:var(--lh-snug)}
.data-table th{font-size:var(--fs-micro);font-weight:var(--fw-semibold)}
.client-copy b{font-size:var(--fs-data)}
.client-copy span,.client-copy small,.phone-link{font-size:var(--fs-caption)}

.field label{font-size:var(--fs-caption);font-weight:var(--fw-semibold)}
.field-hint{font-size:var(--fs-caption);line-height:var(--lh-snug)}
.empty-state h3{font-size:var(--fs-subsection)}
.empty-state p{font-size:var(--fs-caption);line-height:var(--lh-snug)}

/* Long-form copy earns the relaxed step, which widens again in Arabic. */
.customer-note,.report-summary p,.qualification-readonly,
.inbox-message p,.ai-message-body p{line-height:var(--lh-relaxed)}

/* ---------------------------------------------------- Decorative eyebrows
   Section kickers are typography, not capsules. Removing the pill keeps the
   label available to screen readers while stopping it competing with real
   status chips for the user's attention. */
.eyebrow,.panel-kicker,.app-shell .eyebrow,.app-shell .panel-kicker{
  display:inline-block;padding:0;border:0;border-radius:0;background:transparent;
  font-size:var(--fs-micro);font-weight:var(--fw-semibold);letter-spacing:.4px;
  text-transform:none;
}

/* -------------------------------------------------------- Button hierarchy
   PRIMARY   one per screen — the action the page exists for
   SECONDARY supporting actions
   GHOST     utilities: call, history, copy, open, toolbar and table actions
   DESTRUCTIVE removal only
   WhatsApp keeps its own green because users recognise the service by it. */
.btn{
  min-height:var(--control-height);padding-inline:var(--space-3);
  border-radius:var(--radius-sm);font-size:var(--fs-data);font-weight:var(--fw-semibold);
  letter-spacing:0;
}
.btn-primary{
  color:#fff;background:var(--brand);border-color:var(--brand);
  box-shadow:var(--elevation-subtle);
}
.btn-primary:hover{background:#142D53;border-color:#142D53;box-shadow:var(--elevation-raised)}
.btn-primary:active{background:var(--lapis-900);box-shadow:none}

.btn-secondary{background:var(--surface-panel);border-color:var(--border-strong);color:var(--neutral-700);box-shadow:none}
.btn-secondary:hover{background:var(--surface-sunken);border-color:var(--neutral-400);color:var(--brand)}

/* Ghost / utility: quieter than secondary, but still visibly a control at
   rest — a border-less button is indistinguishable from a link until hover. */
.btn-ghost,.btn-soft{
  background:transparent;border-color:var(--border-default);color:var(--neutral-600);box-shadow:none;
}
.btn-ghost:hover,.btn-soft:hover{background:var(--surface-sunken);border-color:var(--border-strong);color:var(--brand)}

.btn-danger,.btn-destructive{background:var(--danger-700);border-color:var(--danger-700);color:#fff;box-shadow:none}
.btn-danger:hover,.btn-destructive:hover{background:#912018;border-color:#912018}

.btn-success{background:var(--success-100);border-color:var(--success-200);color:var(--success-700);box-shadow:none}
.btn-success:hover{background:#D7F7E6;border-color:#7FD4AC}

.btn-sm{min-height:var(--control-height-sm);padding-inline:var(--space-2);border-radius:var(--radius-sm);font-size:var(--fs-caption)}

/* ------------------------------------------------------------ Icon controls
   Four icon-only treatments existed. They now share one geometry, one hover
   and one focus so a utility action looks the same wherever it appears. */
.icon-btn,.professional-icon-btn,.app-shell .brand-action-btn,
.composer-icon-button,.mobile-thread-back{
  width:var(--icon-button-size);height:var(--icon-button-size);min-width:var(--icon-button-size);
  display:inline-grid;place-items:center;
  border:var(--border-width) solid var(--border-default);border-radius:var(--radius-sm);
  background:var(--surface-panel);color:var(--neutral-600);box-shadow:none;
}
.icon-btn:hover,.professional-icon-btn:hover,.app-shell .brand-action-btn:hover,
.composer-icon-button:hover:not(:disabled),.mobile-thread-back:hover{
  background:var(--surface-sunken);border-color:var(--border-strong);color:var(--brand);
}
/* Legacy layers sized icons at 14, 21, 23 and 38px. Everything is pulled onto
   the four-step scale here so the macro's size argument and the CSS agree. */
.nav-icon .ui-icon{width:var(--icon-lg);height:var(--icon-lg)}
.nav-sublink .ui-icon{width:var(--icon-sm);height:var(--icon-sm)}
.sidebar-shortcuts .ui-icon,.sidebar-shortcuts a .ui-icon,
.app-shell .sidebar-shortcuts .shortcut-link .ui-icon{width:var(--icon-lg);height:var(--icon-lg)}
.field-label-icon>.ui-icon,.field-label-icon>.brand-svg{width:var(--icon-sm);height:var(--icon-sm)}
.app-shell .brand-action-btn .ui-icon,.app-shell .brand-action-btn .brand-svg{width:var(--icon-lg);height:var(--icon-lg)}
.media-file-card .ui-icon{width:var(--icon-xl);height:var(--icon-xl)}
.channel-indicator .brand-svg,.channel-indicator .ui-icon{max-width:var(--icon-lg);max-height:var(--icon-lg)}

/* The sidebar sits on navy — its icon controls stay transparent rather than
   punching white tiles into the brand surface. */
.app-shell .sidebar .icon-btn{background:transparent;border-color:transparent;color:var(--label-inverse-secondary)}
.app-shell .sidebar .icon-btn:hover{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.12);color:#fff}
.app-shell .sidebar .logout-btn:hover{background:rgba(180,35,24,.18);border-color:rgba(253,162,155,.34);color:#FDA29B}

/* Utility actions sit in a row, grouped by spacing — not inside an outer
   capsule that reads as a component of its own. */
.app-shell .brand-action-row,.contact-command-bar{
  padding:0;gap:var(--space-1);border:0;border-radius:0;background:transparent;box-shadow:none;
}

/* Service identities the user recognises by colour are the only exception. */
.app-shell .brand-action-btn.is-whatsapp{color:var(--success-700);background:var(--success-100);border-color:var(--success-200)}
.app-shell .brand-action-btn.is-whatsapp:hover{background:#E6F7EF;border-color:#A9DCC2}
.contact-command-bar .contact-pill.whatsapp{background:var(--success-100);border-color:var(--success-200);color:var(--success-700)}
.app-shell .brand-action-btn.action-detail{background:var(--brand);border-color:var(--brand);color:#fff}
.app-shell .brand-action-btn.action-detail:hover{background:#173762;border-color:#173762;color:#fff}

/* --------------------------------------------------------- Touch targets
   Coarse pointers get the full 44px without inflating the desktop layout. */
@media(hover:none),(pointer:coarse){
  .icon-btn,.professional-icon-btn,.app-shell .brand-action-btn,
  .composer-icon-button,.mobile-thread-back,.top-action,.language-switch,
  .quick-search,.app-shell .top-add{
    width:var(--touch-target);height:var(--touch-target);min-width:var(--touch-target);
  }
  .btn{min-height:var(--touch-target)}
  .btn-sm{min-height:var(--control-height-lg)}
  /* Sidebar navigation is a drawer on touch; its rows need real targets. */
  .app-shell .nav-link,.app-shell .nav-sublink,.app-shell .sidebar-shortcuts .shortcut-link{
    min-height:var(--touch-target);
  }
}

/* ------------------------------------------------------------ Focus state
   Visible on every control, including the ones legacy layers styled by hand.
   Kept as an outline so it is never clipped by an ancestor's overflow. */
:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{
  outline:var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset:var(--focus-ring-offset);
}
input:focus,select:focus,textarea:focus,.control:focus{box-shadow:var(--focus-ring-shadow)}

/* --------------------------------------------------------------- Pills
   Capsules are reserved for functional state: lead status, qualification,
   unread, VIP, presence, connection, delivery and real categorical tags.
   Everything decorative was converted to typography above. */

/* Unread previously separated itself with weight 900 against a bold sibling.
   Collapsing the synthetic weights would have erased that signal, so the read
   state steps down instead and the unread count badge remains as a second,
   non-typographic cue. */
.inbox-row-line b{font-weight:var(--fw-semibold)}
.inbox-conversation-row.is-unread .inbox-row-main b{font-weight:var(--fw-bold)}

/* -------------------------------------------------------------- Motion
   fast (120ms) for pressed feedback, normal (180ms) for controls and state,
   slow (240ms) for panels and overlays. Opacity and transform only. */
.quick-choice-save.is-activated{animation:crm-save-settle var(--motion-normal) var(--ease-standard) both}
@keyframes crm-save-settle{from{opacity:.72;transform:scale(.98)}to{opacity:1;transform:scale(1)}}

@media(prefers-reduced-motion:reduce){
  .quick-choice-save.is-activated,.alert,.nav-accordion[open]>.nav-submenu,
  .lead-filter-disclosure[open] .lead-filter-form,.workspace-toast,
  .inbox-context-panel,.ai-context-panel,.context-scrim{
    animation:none!important;transition:none!important;
  }
  /* The busy spinner is a state indicator, not decoration: it keeps turning
     but slowly enough not to trigger motion sensitivity. */
  .btn.is-busy::before,.top-break-btn.is-busy::before,.quick-choice-save.is-busy::before{
    animation-duration:1.8s!important;animation-iteration-count:infinite!important;
  }
}

/* ==========================================================================
   P0 — All Lead Management
   Every selector below is scoped to leads/index.html markup only (verified:
   lead-lifecycle-cell, lead-quick-controls, lifecycle-*, quick-choice-extra,
   compact-inline-field, followup-inline-fields and lead-filter-* are not
   referenced by any other template). This is the authoritative end of the
   cascade for this screen — extend it rather than layering another override.
   ========================================================================== */

/* --------------------------------------------------------- Column protection
   Table auto-layout starves whichever column has no explicit minimum once
   the fixed-width lifecycle/actions columns claim their share — identity
   (priority #1) was measured wrapping the customer's name and visibly
   compressing the avatar below its own square size. Project/source and
   follow-up/updated are merged into one column each (matching the brief's
   own grouping) to recover the width identity needs. */
.lead-table td[data-col=identity]{min-width:190px}
.lead-table td[data-col=project]{min-width:132px}
.lead-table td[data-col=employee]{min-width:112px}
.lead-table td[data-col=followup]{min-width:134px}
.lead-stack-cell{display:flex;flex-direction:column;align-items:flex-start;gap:4px}

/* ---------------------------------------------------- Status & Qualification
   Two compact triggers side by side instead of two full-width stacked bars.
   Category labels stay in the accessible name (.sr-only in the template) —
   the dot color, fixed position and hover tooltip carry the visual meaning,
   freeing the row for the value itself. */
.lead-lifecycle-cell{width:280px;min-width:280px;max-width:320px;position:relative}
.lead-quick-controls{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:0}
.lead-quick-controls>form{min-width:0}
.lifecycle-summary{min-height:34px;padding:5px 8px}

/* Expanding a trigger's panel grows its form to the full cell width via
   :has() — no JS position math, no popover clipping risk inside the table's
   scroll container. The sibling trigger reflows to the row below and stays
   fully usable. */
.lead-quick-controls>form:has(.lifecycle-panel.is-expanded){grid-column:1/-1}

/* The expanded panel's fields stack full-width instead of forcing a fixed
   min-width that no longer fits a compact column. */
.followup-inline-fields{grid-template-columns:1fr}
.quick-choice-extra.qualification-extra{flex-direction:column;align-items:stretch}
.qualification-extra select{flex:0 0 auto;width:100%;min-width:0}
.qualification-extra input{width:100%;min-width:0}

/* Read-only viewers (no leads.edit) get the same two-signal summary as a
   static pair of badges instead of a single status chip that hid
   qualification entirely. */
.lead-readonly-lifecycle{display:flex;flex-wrap:wrap;align-items:center;gap:6px}

/* ------------------------------------------------------------- Follow-up
   Overdue is now carried by three redundant signals (icon, color, weight),
   not color alone. The date-comparison expression itself is untouched —
   this only restyles its existing output. */
.followup-chip{display:inline-flex;align-items:center;gap:5px;font-size:var(--fs-caption);color:var(--neutral-700)}
.followup-chip .ui-icon{color:var(--neutral-500)}
.followup-chip.is-overdue{color:var(--danger-700);font-weight:var(--fw-semibold)}
.followup-chip.is-overdue .ui-icon{color:var(--danger-700)}
.lead-updated-chip{display:inline-block;white-space:nowrap}

/* ------------------------------------------------------------- Filter bar
   auto-fit packs as many 124px+ fields per row as the viewport allows —
   denser and more predictable than flex-wrap, which wraps early whenever
   one item (search) is wider than the rest. */
.lead-filter-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(124px,1fr));gap:9px 10px;align-items:end}
.lead-filter-form .search-control{grid-column:span 2}
.lead-filter-actions{grid-column:span 1;display:flex;gap:8px;align-self:end}
.lead-filter-actions-count{display:inline-grid;place-items:center;min-width:16px;height:16px;padding:0 4px;margin-inline-start:5px;border-radius:var(--radius-pill);background:var(--brand);color:#fff;font-size:9px;font-weight:var(--fw-bold)}

/* ------------------------------------------------------------------ Mobile
   The table becomes a card list: each row is a bordered card, cells reflow
   via flex order/basis into an identity header, a full-width status line,
   a wrapping meta line and a full-width action row. No DOM changes — same
   <table>/<tr>/<td> elements, explicit roles (set in the template) keep the
   accessibility tree correct once display leaves table/row/cell. Scoped to
   .lead-table(-wrap) only — .data-table/.table-wrap are shared by ~29 other
   screens that must keep their normal contained horizontal scroll. */
@media(max-width:720px){
  .lead-table-wrap{overflow:visible}
  .lead-table{min-width:0;width:100%;border-collapse:separate;border-spacing:0}
  .lead-table thead{
    position:absolute!important;width:1px!important;height:1px!important;padding:0!important;
    margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important;
  }
  .lead-table tbody{display:block}
  .lead-table tr{
    display:flex;flex-wrap:wrap;align-items:flex-start;gap:8px 10px;
    padding:12px;margin-bottom:10px;border:1px solid var(--line);border-radius:var(--radius-md);
    background:var(--surface-panel);box-shadow:var(--elevation-subtle);
  }
  .lead-table tr:last-child{margin-bottom:0}
  .lead-table td{display:block;padding:0;border:0;flex:0 0 auto}
  /* The compact 34px collapsed trigger is a desktop-density choice; on a
     touch card it must clear the 44px target, and the native checkbox
     (20x40 at its intrinsic size) needs an explicit hit area to match. */
  .lead-table .lifecycle-summary{min-height:44px}
  .lead-table td[data-col=check]{order:1;align-self:center;width:24px;height:44px;display:flex;align-items:center;justify-content:center}
  .lead-table .lead-check{width:20px;height:20px}
  .lead-table td[data-col=identity]{order:2;flex:1 1 auto;min-width:0}
  .lead-table td[data-col=status]{order:3;flex:0 0 100%}
  .lead-table td[data-col=project],.lead-table td[data-col=employee],
  .lead-table td[data-col=priority],.lead-table td[data-col=followup]{
    order:4;min-width:0;font-size:var(--fs-caption);
  }
  .lead-table td[data-col=actions]{order:5;flex:0 0 100%;margin-top:2px;padding-top:10px;border-top:1px solid var(--line)}
  .lead-table td[data-col=actions] .row-actions{flex-wrap:wrap}
  .lead-table .lead-lifecycle-cell{width:100%;min-width:0;max-width:none}
  .lead-table .client-cell{align-items:flex-start}
  .lead-table .empty-state{width:100%}
}

/* ==========================================================================
   P0 — Customer 360 / Lead Details
   Scoped to leads/details.html markup. .lead-hero-badges/.lead-hero-subline,
   .customer-info-*, .assignment-log-*, .related-task-* and
   .qualification-disclosure are unique to this template. .history-event /
   .unified-timeline are shared with leads/history.html by design (reused
   intentionally); .row-actions/.brand-action-btn are shared with All Lead
   Management by design (same contact-action language on both screens).
   ========================================================================== */

/* ---------------------------------------------------------------- Header
   Lean hero: identity, then status+qualification+priority as one badge row,
   then a quiet meta subline (employee, project, follow-up). The 9-field
   grid that used to live here moved into its own Customer Information card
   below — a hero should introduce the customer, not hold every field. */
.lead-hero{padding:18px 20px}
.lead-hero-badges{display:flex;flex-wrap:wrap;align-items:center;gap:7px}
.lead-hero-subline{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}
.lead-hero-subline>span{display:inline-flex;align-items:center;gap:6px;color:var(--neutral-500);font-size:var(--fs-caption)}
.lead-hero-subline>span .ui-icon{color:var(--neutral-500)}
.lead-hero-subline b{color:var(--neutral-800);font-weight:var(--fw-semibold)}
.lead-hero-subline .followup-chip{font-size:var(--fs-caption)}
.lead-identity-head{display:grid;grid-template-columns:62px minmax(0,1fr);align-items:center;gap:10px;min-width:0}
.lead-identity-head>span:first-child{text-align:center;white-space:nowrap}
.lead-id-avatar{width:auto!important;min-width:62px;max-width:none;padding-inline:6px;font-size:var(--fs-micro)!important;font-variant-numeric:tabular-nums;line-height:1;white-space:nowrap;direction:ltr;unicode-bidi:isolate}
.lead-id-label{display:inline-flex;align-items:baseline;gap:3px;color:var(--neutral-500);font-size:var(--fs-micro);font-weight:var(--fw-semibold);line-height:1.3;white-space:nowrap;vertical-align:middle}
.lead-id-label b{color:inherit;font-weight:var(--fw-bold);direction:ltr;unicode-bidi:isolate}
.lead-identity h2 .lead-id-label{margin-inline-start:7px;color:var(--label-inverse-secondary)}
.customer360-identity .lead-id-label{margin-bottom:2px;color:var(--label-inverse-secondary)}
.lead-status-stepper-wrap{margin-top:14px;padding-top:14px}

/* ---------------------------------------------------------- Contact actions
   Same ghost icon-first language as the All Lead Management row actions —
   one visual vocabulary for "contact this customer" everywhere it appears. */
.lead-detail-actions{margin-inline-start:auto}
@media(max-width:720px){.section-toolbar{flex-wrap:wrap}.lead-detail-actions{margin-inline-start:0}}

/* Sales Intelligence P1 — stage-age SLA is intentionally quiet until a lead
   reaches warning/critical, then the level is readable without relying on
   colour alone. */
.stage-sla-card{border-color:#D8E2EC}
.stage-sla-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;padding:0 16px 12px}
.stage-sla-count{min-width:0;padding:8px 9px;border:1px solid var(--line);border-radius:var(--radius-sm);background:#fff;color:#52616F}
.stage-sla-count b,.stage-sla-count small{display:block}.stage-sla-count b{font-size:var(--fs-data);line-height:1.1}.stage-sla-count small{margin-top:3px;font-size:var(--fs-micro)}
.stage-sla-count.is-warning{border-color:#F2D79C;background:#FFF9E9;color:#8A5A00}.stage-sla-count.is-critical{border-color:#F0B7B2;background:#FFF4F2;color:#A33A32}
.stage-sla-list{border-top:1px solid var(--line)}
.stage-sla-item{display:grid;grid-template-columns:8px minmax(0,1fr) auto;align-items:center;gap:10px;padding:11px 16px;border-bottom:1px solid var(--line);color:inherit;text-decoration:none}
.stage-sla-item:last-child{border-bottom:0}.stage-sla-signal{width:8px;height:32px;border-radius:var(--radius-pill);background:#E0A23A}.stage-sla-item.is-critical .stage-sla-signal{background:#C84C43}
.stage-sla-copy,.stage-sla-age{min-width:0}.stage-sla-copy b,.stage-sla-copy small,.stage-sla-age b,.stage-sla-age small{display:block}.stage-sla-copy b{font-size:var(--fs-caption);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.stage-sla-copy small,.stage-sla-age small{margin-top:3px;color:var(--muted);font-size:var(--fs-micro)}
.stage-sla-age{text-align:end}.stage-sla-age b{font-size:var(--fs-caption);color:#8A5A00}.stage-sla-item.is-critical .stage-sla-age b{color:#A33A32}
.stage-sla-settings input[type=number]{width:104px;min-height:36px}
@media(max-width:520px){.stage-sla-summary{padding-inline:11px}.stage-sla-item{padding:10px 11px;grid-template-columns:6px minmax(0,1fr)}.stage-sla-signal{width:6px;height:34px}.stage-sla-age{grid-column:2;text-align:start;display:flex;align-items:baseline;gap:6px}.stage-sla-age small{margin-top:0}.stage-sla-settings input[type=number]{width:88px}}

/* Sales Intelligence P1 â€” follow-up compliance.  Dense, auditable summary
   states with text labels; normal/future work stays visually quiet. */
.followup-compliance-card{border-color:#D8E2EC}
.followup-compliance-summary{display:grid;grid-template-columns:1.2fr repeat(4,1fr);gap:7px;padding:0 16px 10px}
.followup-compliance-count{min-width:0;padding:8px 8px;border:1px solid var(--line);border-radius:var(--radius-sm);background:#fff;color:#52616F}.followup-compliance-count b,.followup-compliance-count small{display:block}.followup-compliance-count b{font-size:var(--fs-data);line-height:1.1}.followup-compliance-count small{margin-top:3px;font-size:var(--fs-micro)}
.followup-compliance-count.is-rate{border-color:#B9D5C9;background:#F2FBF6;color:#17613C}.followup-compliance-count.is-on-time{border-color:#CDE7D8;background:#F7FCF9;color:#17613C}.followup-compliance-count.is-late{border-color:#F2D79C;background:#FFF9E9;color:#8A5A00}.followup-compliance-count.is-overdue{border-color:#F0B7B2;background:#FFF4F2;color:#A33A32}
.followup-compliance-definition,.followup-compliance-legacy{margin:0;padding:0 16px 11px;color:var(--muted);font-size:var(--fs-micro);line-height:1.5}.followup-compliance-legacy{padding-top:10px;border-top:1px solid var(--line)}
.followup-compliance-list{border-top:1px solid var(--line)}.followup-compliance-item{display:grid;grid-template-columns:8px minmax(0,1fr) auto;align-items:center;gap:10px;padding:11px 16px;border-bottom:1px solid var(--line);color:inherit;text-decoration:none}.followup-compliance-item:last-child{border-bottom:0}.followup-compliance-signal{width:8px;height:32px;border-radius:var(--radius-pill);background:#A7B3C0}.followup-compliance-item.is-overdue .followup-compliance-signal{background:#C84C43}.followup-compliance-item.is-late .followup-compliance-signal{background:#D99B28}.followup-compliance-copy,.followup-compliance-time{min-width:0}.followup-compliance-copy b,.followup-compliance-copy small,.followup-compliance-time b,.followup-compliance-time small{display:block}.followup-compliance-copy b{font-size:var(--fs-caption);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.followup-compliance-copy small,.followup-compliance-time small{margin-top:3px;color:var(--muted);font-size:var(--fs-micro)}.followup-compliance-time{text-align:end}.followup-compliance-time b{font-size:var(--fs-micro);font-weight:var(--fw-semibold);color:var(--neutral-600)}
@media(max-width:520px){.followup-compliance-summary{grid-template-columns:repeat(3,1fr);padding-inline:11px}.followup-compliance-count.is-rate{grid-column:span 2}.followup-compliance-definition,.followup-compliance-legacy{padding-inline:11px}.followup-compliance-item{padding:10px 11px;grid-template-columns:6px minmax(0,1fr)}.followup-compliance-signal{width:6px;height:34px}.followup-compliance-time{grid-column:2;text-align:start}.followup-compliance-time small{margin-top:2px}}

/* ------------------------------------------------------- Qualification card
   Current value is always visible in the card-title badge; editing is an
   on-demand disclosure instead of a permanently open form. */
.qualification-disclosure{margin-top:12px;border-top:1px solid var(--line);padding-top:12px}
.qualification-disclosure>summary{min-height:36px;padding:6px 2px;border-radius:var(--radius-sm)}
.qualification-disclosure>summary:hover{color:var(--brand)}
.qualification-disclosure[open]>summary{margin-bottom:10px}
@media(hover:none),(pointer:coarse){.qualification-disclosure>summary{min-height:44px}}

/* ------------------------------------------------------- Customer Information
   One surface, several label/value groups — not a card per field. */
.customer-info-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:18px 22px}
.customer-info-group h4{margin:0;color:var(--neutral-500);font-size:var(--fs-micro);font-weight:var(--fw-bold);text-transform:uppercase;letter-spacing:.35px}
.customer-info-group dl{display:grid;gap:8px;margin:9px 0 0}
.customer-info-group dl>div{display:grid;gap:2px;min-width:0}
.customer-info-group dt{color:var(--neutral-500);font-size:var(--fs-micro)}
.customer-info-group dd{margin:0;color:var(--neutral-800);font-size:var(--fs-caption);overflow-wrap:anywhere}
.customer-info-group .followup-chip{font-size:var(--fs-caption)}

/* -------------------------------------------------------------- Quick actions
   Buttons wrapped in a <form> need the form to disappear from the grid
   layout so the button itself is the grid cell, matching its siblings —
   this replaces the inline width:100% previously set on each form. */
.quick-action-grid form{display:contents}

/* --------------------------------------------------------------- Sidebar lists
   Assignment history and related tasks: plain rows, no inline styles. */
.assignment-log-item,.related-task-item{padding:9px 0;border-bottom:1px solid var(--line)}
.assignment-log-item:last-child,.related-task-item:last-child{border-bottom:0}
.assignment-log-item>b{font-size:var(--fs-caption)}
.assignment-log-reason{margin-top:3px;color:var(--neutral-600);font-size:var(--fs-caption)}
.related-task-item{display:flex;justify-content:space-between;align-items:flex-start;gap:8px}
.related-task-item>div>b{font-size:var(--fs-caption)}

/* --------------------------------------------------------------------- Mobile
   Desktop priority already matches the brief's mobile order (identity+
   actions, status/qualification, lifecycle, customer data, notes/history)
   since .detail-layout collapses to one column in DOM order — no reordering
   needed. Only spacing/touch adjustments follow. */
@media(max-width:720px){
  .lead-hero{padding:16px}
  .lead-hero-subline{gap:8px 12px}
  .customer-info-grid{grid-template-columns:1fr 1fr;gap:16px}
  .lead-status-stepper-wrap{margin-inline:-4px}
}
@media(max-width:430px){
  .customer-info-grid{grid-template-columns:1fr}
}

/* ==========================================================================
   PHASE B — Premium shell, chrome and component system
   ==========================================================================
   The interface is split into two layers, per current Apple HIG:

     CONTENT LAYER    opaque, scrolls, owns the edge of its panel.
     FUNCTIONAL LAYER sidebar and topbar. Floats above content on a
                      translucent material; content scrolls beneath it,
                      with a scroll-edge blur instead of a hard rule.

   Brand deviation, stated deliberately: the Apple system tint is blue and
   its chrome is near-monochrome. We keep the structure and the restraint —
   floating chrome, one tinted action per view, 44px targets, material
   depth, dim-and-scale presses — and swap the tint to Al Omran lapis and
   gold. Gold is punctuation: active states, focus, hairlines and marks of
   distinction. It is never a button fill on a light surface, where it
   fails contrast (2.4:1 on white) and cheapens the mark.
   ========================================================================== */

/* --------------------------------------------------------------- 1. Shell
   Two floating islands on the lapis field. The main area becomes its own
   scroll container, which is what lets the topbar genuinely stick and lets
   content slide beneath it. The previous overflow:hidden made sticky inert
   on long pages. */
.app-shell{height:100dvh;overflow:hidden}

.app-shell .sidebar{
  position:fixed;
  inset-block:var(--space-3);
  inset-inline-start:var(--space-3);
  width:var(--sidebar);
  height:auto;
  border-radius:var(--radius-lg);
  border:1px solid var(--separator-inverse);
  box-shadow:var(--elevation-inverse-3);
  overflow:hidden;
}

.app-shell .main-area,[dir=rtl] .app-shell .main-area{
  margin-block:var(--space-3);
  margin-inline-end:var(--space-3);
  margin-inline-start:calc(var(--sidebar) + var(--space-3) * 2);
  height:calc(100dvh - var(--space-3) * 2);
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  border-radius:var(--radius-lg);
  box-shadow:var(--elevation-inverse-2);
  scrollbar-width:thin;
  scrollbar-color:var(--neutral-300) transparent;
}
.app-shell .main-area::-webkit-scrollbar{width:10px}
.app-shell .main-area::-webkit-scrollbar-thumb{
  background:var(--neutral-300);
  border-radius:var(--radius-pill);
  border:3px solid var(--surface-canvas);
}

/* ------------------------------------------------------------- 2. Topbar
   Floating material rather than an opaque strip glued to the edge. */
.app-shell .topbar{
  position:sticky;
  top:0;
  z-index:40;
  height:var(--topbar);
  background:var(--material-light-thick);
  backdrop-filter:blur(var(--material-blur)) saturate(var(--material-saturate));
  -webkit-backdrop-filter:blur(var(--material-blur)) saturate(var(--material-saturate));
  border-bottom:1px solid var(--separator);
  box-shadow:none;
}
/* The gold hairline under the topbar restates the line quality of the mark,
   once. It is the only decorative gold in the chrome. */
.app-shell .topbar:after{
  content:"";
  position:absolute;
  inset-inline:0;
  bottom:-1px;
  height:1px;
  background:linear-gradient(90deg,transparent,var(--gold-500),transparent);
  opacity:.5;
}

/* --------------------------------------------------------- 3. Navigation
   Active state is a gold rail plus a quiet fill, not a saturated block.
   The rail reads instantly in peripheral vision while the label stays
   legible, which a filled navy pill on a navy ground does not manage. */
.app-shell .nav-link{
  position:relative;
  min-height:38px;
  margin-block:1px;
  padding-block:8px;
  padding-inline:var(--space-3);
  border-radius:var(--radius-sm);
  border:0;
  color:var(--label-inverse-secondary);
  font-size:var(--fs-data);
  font-weight:var(--fw-medium);
  transition:background-color var(--motion-fast) var(--ease-standard),
             color var(--motion-fast) var(--ease-standard);
}
.app-shell .nav-link:hover{
  background:var(--fill-inverse-hover);
  color:var(--label-inverse);
  transform:none;
}
.app-shell .nav-link.active,
.app-shell .nav-accordion[open]>summary.active{
  background:var(--fill-inverse-pressed);
  color:var(--label-inverse);
  font-weight:var(--fw-semibold);
  box-shadow:none;
  border:0;
}
.app-shell .nav-link.active::before,
.app-shell .nav-accordion[open]>summary.active::before{
  content:"";
  position:absolute;
  inset-block:7px;
  inset-inline-start:0;
  width:3px;
  border-radius:var(--radius-pill);
  background:var(--gold-500);
}
.app-shell .nav-link.active .nav-icon{color:var(--gold-300)}
.app-shell .nav-icon{
  color:var(--label-inverse-secondary);
  transition:color var(--motion-fast) var(--ease-standard);
}
.app-shell .nav-link:hover .nav-icon{color:var(--label-inverse)}

.app-shell .nav-sublink{
  min-height:32px;
  border-radius:var(--radius-xs);
  color:var(--label-inverse-secondary);
  font-size:var(--fs-caption);
}
.app-shell .nav-sublink:hover{background:var(--fill-inverse-hover);color:var(--label-inverse)}
.app-shell .nav-sublink.active{
  background:var(--fill-inverse-pressed);
  color:var(--label-inverse);
  font-weight:var(--fw-semibold);
  box-shadow:none;
}
.app-shell .nav-submenu{border-inline-start:1px solid var(--separator-inverse)}

/* The mark gets air, and a rule that echoes it. */
.app-shell .brand-block{
  padding:var(--space-4) var(--space-4) var(--space-3);
  margin-bottom:var(--space-2);
  border-bottom:1px solid var(--separator-inverse);
}

/* ------------------------------------------------------------ 4. Surfaces
   Hairline borders separate; shadow is reserved for things that float.
   Cards previously carried a popover-weight shadow at rest, which was the
   single biggest reason the UI read as assembled rather than designed. */
/* Scoped to .app-shell so this wins over the V2.5 navy layer, which sets
   a popover-weight shadow at .app-shell specificity. */
.app-shell .card,.app-shell .form-card,.app-shell .table-card,
.app-shell .filters,.app-shell .stat-card,.app-shell .summary-tile,
.app-shell .integration-card,.app-shell .metric-card,
.app-shell .hr-module-card,.app-shell .team-directory-card,
.app-shell .employee-report-card,.app-shell .dashboard-control-bar,
.app-shell .channel-card,.app-shell .project-kpi,.app-shell .offer-card,
.app-shell .module-card,.app-shell .target-card,.app-shell .team-stat-card{
  background:var(--surface-raised);
  border:1px solid var(--separator);
  border-radius:var(--radius-md);
  box-shadow:var(--elevation-1);
}
.app-shell .card:hover,.app-shell .stat-card:hover,
.app-shell .metric-card:hover,.app-shell .form-card:hover,
.app-shell .table-card:hover{
  border-color:var(--separator-strong);
  box-shadow:var(--elevation-1);
  transform:none;
}
.menu-pop,.notification-popover,.modal-card{box-shadow:var(--elevation-3)}
.modal-card{border-radius:var(--radius-lg)}
.modal{background:var(--scrim)}

/* ------------------------------------------------------------- 5. Buttons
   One prominent action per view. Press is a dim-and-scale, never a lift. */
.btn{
  min-height:var(--control-height);
  padding-inline:var(--space-4);
  border-radius:var(--radius-sm);
  font-size:var(--fs-data);
  font-weight:var(--fw-semibold);
  letter-spacing:var(--tracking-normal);
  box-shadow:none;
  transition:background-color var(--motion-fast) var(--ease-standard),
             border-color var(--motion-fast) var(--ease-standard),
             color var(--motion-fast) var(--ease-standard),
             opacity var(--motion-fast) var(--ease-standard);
}
.app-shell .btn-primary,.btn-primary{
  background:var(--accent);
  background-image:none;
  border-color:var(--accent);
  color:var(--label-inverse);
  box-shadow:none;
}
.app-shell .btn-primary:hover,.btn-primary:hover{
  background:var(--accent-hover);
  border-color:var(--accent-hover);
  filter:none;
  box-shadow:none;
}
.btn-primary:active{background:var(--accent-pressed);border-color:var(--accent-pressed)}
.app-shell .btn-secondary,.btn-secondary{
  background:var(--surface-raised);
  border-color:var(--separator-strong);
  color:var(--neutral-700);
}
.app-shell .btn-secondary:hover,.btn-secondary:hover{
  background:var(--fill-subtle);
  border-color:var(--neutral-350);
  color:var(--accent);
}
.btn-ghost,.app-shell .btn-soft,.btn-soft{
  background:transparent;
  border-color:var(--separator);
  color:var(--neutral-600);
}
.btn-ghost:hover,.app-shell .btn-soft:hover,.btn-soft:hover{
  background:var(--fill-subtle);
  border-color:var(--separator-strong);
  color:var(--accent);
}
.btn:active:not(:disabled):not([aria-disabled=true]){opacity:.82;transform:scale(.985)}
.btn:hover{transform:none}
@media(hover:hover){.btn:hover:not(:disabled):not([aria-disabled=true]){transform:none}}

/* The one place gold leads: the topbar create action, which sits on glass
   over navy and carries 7.6:1 there. */
.app-shell .top-add{
  background:var(--gold-500);
  background-image:none;
  border-color:var(--gold-600);
  color:var(--lapis-900);
  font-weight:var(--fw-bold);
  box-shadow:none;
}
.app-shell .top-add:hover{background:var(--gold-400);border-color:var(--gold-500)}

/* -------------------------------------------------------------- 6. Tables
   Quieter chrome, clearer rows, header reads as a label not a band. */
.table-card{overflow:hidden}
.table-head{
  min-height:56px;
  padding:var(--space-4) var(--space-5);
  background:var(--surface-raised);
  border-bottom:1px solid var(--separator);
}
.data-table th{
  background:var(--surface-sunken);
  color:var(--label-tertiary);
  font-size:var(--fs-micro);
  font-weight:var(--fw-semibold);
  letter-spacing:var(--tracking-wide);
  text-transform:uppercase;
  border-bottom:1px solid var(--separator);
}
.data-table td{border-bottom:1px solid var(--separator-subtle)}
.data-table tbody tr{transition:background-color var(--motion-fast) var(--ease-standard)}
.data-table tbody tr:nth-child(even){background:transparent}
.data-table tbody tr:hover,.app-shell .data-table tbody tr:hover{background:var(--fill-subtle)}
.pagination-note{
  background:var(--surface-sunken);
  color:var(--label-tertiary);
  border-top:1px solid var(--separator);
}

/* --------------------------------------------------------------- 7. Forms */
input,select,textarea,.control{
  border:1px solid var(--separator-strong);
  border-radius:var(--radius-sm);
  background:var(--surface-raised);
  color:var(--label-primary);
}
input:hover,select:hover,textarea:hover{border-color:var(--neutral-350)}
input:focus,select:focus,textarea:focus,.control:focus{
  border-color:var(--lapis-400);
  box-shadow:var(--focus-ring-shadow);
  background:var(--surface-raised);
}
input::placeholder,textarea::placeholder{color:var(--label-quaternary)}
.field label{color:var(--label-secondary)}

/* -------------------------------------------------------- 8. Status chips
   Functional state only; shape and label carry meaning alongside colour. */
.status-badge,.qualification-badge,.priority,.connection-badge,
.presence-pill,.conversation-state,.channel-chip{
  border-radius:var(--radius-pill);
  font-weight:var(--fw-semibold);
  letter-spacing:0;
}
.vip-badge{
  background:var(--gold-050);
  color:var(--gold-800);
  border:1px solid var(--gold-100);
  border-radius:var(--radius-xs);
}

/* ---------------------------------------------------------- 9. Responsive
   Below 980px the sidebar becomes a drawer and the main area goes
   full-bleed; the islands only make sense when both fit side by side. */
@media(max-width:980px){
  .app-shell{height:auto;overflow:visible}
  .app-shell .sidebar{
    inset-block:0;
    inset-inline-start:0;
    height:100dvh;
    border-radius:0;
    border:0;
    box-shadow:var(--elevation-inverse-3);
  }
  .app-shell .main-area,[dir=rtl] .app-shell .main-area{
    margin:0;
    height:auto;
    min-height:100dvh;
    overflow:visible;
    border-radius:0;
    box-shadow:none;
  }
  .app-shell .topbar{position:sticky;top:0}
}

/* ------------------------------------------------- 10. Overflow containment
   Flex and grid children default to min-width:auto, so a wide descendant
   (a data-table with min-width:940px) forces its whole column wide instead
   of letting the table's own .table-wrap scroller do the work. The old
   shell hid this behind overflow:hidden on .main-area; making the shell a
   proper scroll container exposed it. Fixing the cause rather than
   re-clipping means the contained scrollers actually get used. */
.stack,.stack>*,
.detail-layout,.detail-layout>*,
.grid-2>*,.grid-3>*,
.content-wrap>*{min-width:0}

.table-wrap{max-width:100%}

/* Safety net: the page itself must never scroll sideways. overflow-x:clip
   (not hidden) avoids turning the element into a scroll container, so the
   mobile body-scroll behaviour is preserved. */
.app-shell .main-area{overflow-x:clip}
@media(max-width:980px){
  .app-shell .main-area,[dir=rtl] .app-shell .main-area{
    overflow-x:clip;
    overflow-y:visible;
  }
}

/* ==========================================================================
   PHASE C — Product experience: motion, executive dashboard, personality
   ========================================================================== */

/* ------------------------------------------------------- 1. Motion system
   One vocabulary: fast (120ms) for pressed feedback, normal (180ms) for
   controls and state, slow (240ms) for panels and overlays. Opacity and
   transform only, so nothing triggers layout. Every rule here is cancelled
   wholesale by the reduced-motion block at the end of this section. */
@keyframes crm-enter{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* Content entrance: a page settles rather than snapping in. Deliberately
   one short movement with a shallow stagger — a long cascade reads as a
   marketing site, not an operations tool people use all day. */
.app-shell .content-wrap>*{animation:crm-enter var(--motion-slow) var(--ease-standard) both}
.app-shell .content-wrap>*:nth-child(2){animation-delay:40ms}
.app-shell .content-wrap>*:nth-child(3){animation-delay:80ms}
.app-shell .content-wrap>*:nth-child(n+4){animation-delay:110ms}

/* Menus rise from their anchor. */
.menu-pop,.notification-popover{transform-origin:top center}
.action-menu[open] .menu-pop{animation:crm-enter var(--motion-normal) var(--ease-standard) both}

/* Interactive feedback is dim-and-settle, never a lift and never a ripple. */
.app-shell .quick-action,.app-shell .summary-tile,.app-shell .hr-module-card,
.app-shell .module-card,.app-shell .pipeline-item,.app-shell .status-choice{
  transition:border-color var(--motion-normal) var(--ease-standard),
             background-color var(--motion-normal) var(--ease-standard);
}
.app-shell .quick-action:hover,.app-shell .summary-tile:hover,
.app-shell .hr-module-card:hover,.app-shell .module-card:hover,
.app-shell .pipeline-item:hover,.app-shell .status-choice:hover{
  transform:none;
  box-shadow:var(--elevation-1);
  border-color:var(--separator-strong);
}
.app-shell .quick-action:active,.app-shell .pipeline-item:active,
.app-shell .summary-tile:active,.app-shell .module-card:active{
  transform:scale(.99);
  transition-duration:var(--motion-fast);
}

/* ------------------------------------------------- 2. Executive dashboard
   The pipeline drew every stage with its own saturated 3px top border —
   eight competing hues in one row, the strongest template signal on the
   screen. Stage colour is real information, so it is kept but demoted to a
   thin rail: the count becomes the figure, the hue becomes the index mark. */
.app-shell .pipeline-item{
  border:1px solid var(--separator);
  border-top:1px solid var(--separator);
  background:var(--surface-raised);
  padding-inline-start:var(--space-4);
}
.app-shell .pipeline-item:hover{
  background:var(--surface-raised);
  border-color:var(--separator-strong);
}
.app-shell .pipeline-item:before{
  content:"";
  position:absolute;
  inset-block:var(--space-3);
  inset-inline-start:0;
  width:2px;
  border-radius:var(--radius-pill);
  background:var(--c,var(--lapis-500));
  opacity:.85;
}
.app-shell .pipeline-item b{
  font-size:26px;
  font-weight:var(--fw-bold);
  color:var(--label-primary);
  letter-spacing:var(--tracking-snug);
  font-variant-numeric:tabular-nums;
}
.app-shell .pipeline-item span{color:var(--label-tertiary)}

/* KPI figures read as data, not body copy. Tabular numerals keep columns
   of figures aligned as values change. */
.app-shell .metric-card strong,.app-shell .stat-card strong,
.app-shell .team-snapshot-grid b,.app-shell .project-kpi b,
.app-shell .control-bar-meta b,.app-shell .status-choice b,
.app-shell .evidence-grid b,.app-shell .team-directory-stats b{
  font-variant-numeric:tabular-nums;
  letter-spacing:var(--tracking-snug);
  color:var(--label-primary);
}

/* The collapsed control bars are navigation, not content, so they sit
   quieter than the data they filter. */
.app-shell .dashboard-control-bar>summary{background:var(--surface-raised)}
.app-shell .dashboard-control-bar>summary:hover{background:var(--fill-subtle)}
.app-shell .dashboard-control-bar[open]{border-color:var(--separator-strong)}

/* ---------------------------------------------------- 3. Button hierarchy
   One prominent action per view. The topbar already carries the gold create
   action, so a second full-strength primary in the page toolbar competes
   with it; the toolbar copy steps down to secondary. */
.app-shell .section-toolbar .toolbar-actions .btn-primary{
  background:var(--surface-raised);
  border-color:var(--separator-strong);
  color:var(--neutral-700);
}
.app-shell .section-toolbar .toolbar-actions .btn-primary:hover{
  background:var(--fill-subtle);
  border-color:var(--neutral-350);
  color:var(--accent);
}
/* Form submits stay prominent — they are the point of their view. */
.app-shell .form-footer .btn-primary,
.app-shell .modal .btn-primary,
.app-shell .lead-filter-actions .btn-primary{
  background:var(--accent);
  border-color:var(--accent);
  color:var(--label-inverse);
}
.app-shell .form-footer .btn-primary:hover,
.app-shell .modal .btn-primary:hover,
.app-shell .lead-filter-actions .btn-primary:hover{
  background:var(--accent-hover);
  border-color:var(--accent-hover);
}

/* --------------------------------------------------- 4. Personality layer
   Empty states say what is missing and what to do next, in the quiet
   register of the brand rather than as a shrug. */
.app-shell .empty-state{padding:var(--space-10) var(--space-6);color:var(--label-tertiary)}
.app-shell .empty-icon{
  width:56px;height:56px;
  border-radius:var(--radius-lg);
  background:var(--surface-accent-wash);
  border:1px solid var(--accent-border);
  color:var(--accent);
  box-shadow:none;
}
.app-shell .empty-state h3{
  color:var(--label-primary);
  font-size:var(--fs-subsection);
  font-weight:var(--fw-semibold);
  margin-bottom:var(--space-2);
}
.app-shell .empty-state p{
  color:var(--label-tertiary);
  font-size:var(--fs-caption);
  line-height:var(--lh-snug);
  max-width:44ch;
  margin-inline:auto;
}

/* System messages carry a status rail alongside the tint, so state survives
   greyscale printing and colour-blindness. */
.app-shell .alert{
  border-radius:var(--radius-sm);
  border:1px solid;
  border-inline-start-width:3px;
  box-shadow:none;
  font-size:var(--fs-data);
}

/* Busy states read as the system working, not as decoration. */
.app-shell .btn.is-busy{opacity:.7}
form[aria-busy=true] .form-footer{opacity:.75;transition:opacity var(--motion-normal) var(--ease-standard)}

/* --------------------------------------------------------- 5. Mobile pass
   The topbar overflowed its own box at 390px, which the page-level clip
   then hid, so the page title was being silently cut instead of truncated.
   The heading must be allowed to shrink and ellipsis. */
@media(max-width:720px){
  .app-shell .topbar{gap:var(--space-2);padding-inline:var(--space-3)}
  .app-shell .topbar-start{min-width:0;flex:1 1 auto;gap:var(--space-2)}
  .app-shell .topbar-actions{flex:0 0 auto;gap:6px}
  .app-shell .page-heading{min-width:0}
  .app-shell .page-heading h1{
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
    font-size:var(--fs-section);
  }
  /* Page toolbars scroll inside themselves rather than pushing the layout
     wide and getting clipped. */
  .app-shell .section-toolbar>.toolbar-actions{
    overflow-x:auto;
    scrollbar-width:none;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-inline:contain;
  }
  .app-shell .section-toolbar>.toolbar-actions::-webkit-scrollbar{display:none}
  .app-shell .content-wrap>*{animation-delay:0ms}
}

/* ------------------------------------------------------ 6. Reduced motion
   Everything introduced above is cancelled, not merely shortened. */
@media(prefers-reduced-motion:reduce){
  .app-shell .content-wrap>*,
  .action-menu[open] .menu-pop{
    animation:none!important;
    opacity:1!important;
    transform:none!important;
  }
  .app-shell .quick-action:active,.app-shell .pipeline-item:active,
  .app-shell .summary-tile:active,.app-shell .module-card:active{transform:none}
}

/* ==========================================================================
   PHASE C.1 — Brand integration, login, sidebar scale, filter density
   ========================================================================== */

/* --------------------------------------------------------- 1. Brand mark
   One rule governs the mark everywhere, so swapping the raster for the
   official SVG changes nothing else. object-fit:contain preserves the
   original proportions whatever the source aspect ratio turns out to be. */
.app-shell .brand-logo,
.auth-brand img,
.auth-logo-mobile,
.appearance-preview-brand img{
  width:auto;
  object-fit:contain;
  background:transparent;
  border:0;
  border-radius:0;
  box-shadow:none;
  padding:0;
}
.app-shell .brand-logo{height:38px;max-width:56px}
.auth-brand img{height:56px;max-width:84px}
.auth-logo-mobile{height:64px;max-width:96px}

/* ------------------------------------------------------------- 2. Login
   The form previously floated in the middle of a tall empty column. It now
   sits on a defined vertical rhythm with the mark carrying real presence,
   and the whole panel arrives in one short movement. */
@keyframes crm-auth-in{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}

.auth-form-side{
  position:relative;
  align-content:center;
  padding-block:var(--space-10);
}
.auth-box{animation:crm-auth-in 420ms var(--ease-standard) both}
.auth-box>h2{
  font-size:28px;
  font-weight:var(--fw-bold);
  letter-spacing:var(--tracking-snug);
  color:var(--label-primary);
  margin-bottom:var(--space-2);
}
.auth-box>p{
  color:var(--label-tertiary);
  font-size:var(--fs-body);
  line-height:var(--lh-snug);
  margin-bottom:var(--space-8);
}
.auth-box .field label{
  font-size:var(--fs-caption);
  font-weight:var(--fw-semibold);
  color:var(--label-secondary);
}
.auth-box input{
  height:46px;
  border-radius:var(--radius-sm);
  border-color:var(--separator-strong);
  font-size:var(--fs-body);
}
.auth-submit{
  width:100%;
  height:48px;
  margin-top:var(--space-6);
  font-size:var(--fs-body);
  border-radius:var(--radius-sm);
}
.auth-footer{
  margin-top:var(--space-8);
  padding-top:var(--space-5);
  border-top:1px solid var(--separator);
  color:var(--label-quaternary);
  font-size:var(--fs-micro);
}

/* The brand panel: a single gold hairline under the lockup does the work
   that a stack of gradients was attempting. */
.auth-visual{position:relative}
.auth-brand{gap:var(--space-4);padding-bottom:var(--space-5);border-bottom:1px solid var(--separator-inverse)}
.auth-brand b{font-size:var(--fs-section);color:var(--label-inverse);letter-spacing:var(--tracking-snug)}
.auth-brand span{color:var(--label-inverse-secondary);font-size:var(--fs-caption)}
.auth-pitch h1{letter-spacing:var(--tracking-tight);text-wrap:balance}
.auth-pitch p{color:var(--label-inverse-secondary)}
.auth-feature{
  background:var(--fill-inverse-hover);
  border:1px solid var(--separator-inverse);
  border-radius:var(--radius-sm);
  color:var(--label-inverse);
  font-size:var(--fs-caption);
}
.auth-feature .ui-icon{color:var(--gold-300)}
.auth-version{color:var(--label-inverse-secondary);font-size:var(--fs-micro)}

/* ---------------------------------------------------- 3. Sidebar at scale
   The nav list is long enough to clip its own footer on a 900px screen.
   The shell becomes a column: brand and workspace pinned at the top, the
   nav scrolling in the middle, shortcuts and the user panel pinned at the
   bottom, so identity and sign-out are always reachable. */
.app-shell .sidebar{display:flex;flex-direction:column;min-height:0}
.app-shell .brand-block,
.app-shell .workspace-pill,
.app-shell .sidebar-shortcuts,
.app-shell .user-panel{flex:0 0 auto}
.app-shell .nav-menu{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  scrollbar-color:var(--separator-inverse) transparent;
  padding-inline:var(--space-2);
  padding-block-end:var(--space-2);
  /* the list fades as it passes under the pinned footer rather than being
     chopped by a hard edge */
  mask-image:linear-gradient(to bottom,#000 calc(100% - 20px),transparent 100%);
  -webkit-mask-image:linear-gradient(to bottom,#000 calc(100% - 20px),transparent 100%);
}
.app-shell .nav-menu::-webkit-scrollbar{width:6px}
.app-shell .nav-menu::-webkit-scrollbar-thumb{
  background:var(--separator-inverse);border-radius:var(--radius-pill);
}
.app-shell .sidebar-shortcuts{
  border-top:1px solid var(--separator-inverse);
  border-bottom:0;
  padding-block:var(--space-3);
  margin-block-start:0;
}
.app-shell .user-panel{
  border-top:1px solid var(--separator-inverse);
  padding-block-start:var(--space-3);
}
/* Submenus read as a related group rather than a second list. */
.app-shell .nav-submenu{margin-block:2px var(--space-2)}

/* --------------------------------------------------- 4. Filter density
   The filter card consumed roughly 180px above the data on Lead
   Management. Tighter controls and labels recover most of it without
   dropping a single field. */
.app-shell .lead-filter-form{gap:var(--space-2) var(--space-3);padding:var(--space-4)}
.app-shell .lead-filter-form .field{gap:var(--space-1)}
.app-shell .lead-filter-form .field label{
  font-size:var(--fs-micro);
  font-weight:var(--fw-semibold);
  color:var(--label-tertiary);
  letter-spacing:var(--tracking-wide);
  text-transform:uppercase;
}
.app-shell .lead-filter-form input,
.app-shell .lead-filter-form select{height:42px;line-height:40px;padding-block:0;padding-inline:12px;font-size:var(--fs-data)}
.app-shell .lead-filter-form select{padding-inline-end:32px;text-overflow:ellipsis;white-space:nowrap}
.app-shell .lead-filter-actions .btn{min-height:36px}

/* The disclosure header reads as a control strip, not a card title. */
.app-shell .lead-filter-disclosure{border-radius:var(--radius-md);overflow:hidden}
.app-shell .lead-mobile-toolbar{background:var(--surface-raised)}

/* Search is the primary way into this screen, so it is the one field that
   keeps full weight. */
.app-shell .lead-filter-form .search-control input{
  height:42px;
  line-height:40px;
  padding-block:0;
  padding-inline-start:38px;
  padding-inline-end:12px;
  font-size:var(--fs-body);
  background:var(--surface-sunken);
}
.app-shell .lead-filter-form .search-control input:focus{background:var(--surface-raised)}

/* ------------------------------------------------------- 5. Responsive */
@media(max-width:980px){
  .app-shell .nav-menu{mask-image:none;-webkit-mask-image:none}
}
@media(max-width:720px){
  .auth-form-side{padding-block:var(--space-6)}
  .auth-box>h2{font-size:24px}
  .auth-box>p{margin-bottom:var(--space-6)}
}

/* -------------------------------------------------- 6. Reduced motion */
@media(prefers-reduced-motion:reduce){
  .auth-box{animation:none!important;opacity:1!important;transform:none!important}
}

/* ==========================================================================
   PHASE D — Executive dashboard: visual analytics

   Every chart here is hand-authored SVG/CSS driven by a custom property the
   template sets from data the route already returns. No charting library, no
   new query, no new dependency. The rule applied throughout: a visual earns
   its space only if it answers a question a number alone cannot — proportion,
   drop-off, or whether a figure is good or bad.
   ========================================================================== */

/* -------------------------------------------------------- 1. Executive band
   Four indicators, each carrying its own denominator. A bare "47" tells a
   sales director nothing; "47 — 62% of 76" is a judgement they can act on. */
.app-shell .exec-band{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:var(--space-3);
  margin-bottom:var(--space-5);
}
.app-shell .exec-kpi{
  background:var(--surface-raised);
  border:1px solid var(--separator);
  border-radius:var(--radius-md);
  box-shadow:var(--elevation-1);
  padding:var(--space-4) var(--space-4) var(--space-3);
  display:flex;
  flex-direction:column;
  gap:var(--space-2);
  min-width:0;
  /* the tone drives one accent only: the meter fill and nothing else, so the
     card stays quiet until the number needs attention */
  --kpi-tone:var(--accent);
}
.app-shell .exec-kpi[data-tone=positive]{--kpi-tone:var(--status-success)}
.app-shell .exec-kpi[data-tone=critical]{--kpi-tone:var(--status-danger)}
.app-shell .exec-kpi[data-tone=premium]{--kpi-tone:var(--gold-600)}

.app-shell .exec-kpi-label{
  margin:0;
  font-size:var(--fs-micro);
  font-weight:var(--fw-semibold);
  letter-spacing:var(--tracking-wide);
  text-transform:uppercase;
  color:var(--label-tertiary);
}
.app-shell .exec-kpi-value{
  margin:0;
  font-size:var(--fs-display);
  font-weight:var(--fw-bold);
  line-height:var(--lh-tight);
  letter-spacing:var(--tracking-tight);
  color:var(--label-primary);
  font-variant-numeric:tabular-nums;
}
.app-shell .exec-kpi-note{
  margin:0;
  font-size:var(--fs-micro);
  color:var(--label-tertiary);
  font-variant-numeric:tabular-nums;
}

/* The meter is the smallest honest chart: one bar, one scale, no axis. */
.app-shell .exec-meter{
  height:4px;
  border-radius:var(--radius-pill);
  background:var(--fill-subtle);
  overflow:hidden;
}
.app-shell .exec-meter>span{
  display:block;
  height:100%;
  width:var(--fill,0%);
  border-radius:inherit;
  background:var(--kpi-tone,var(--accent));
  transition:width var(--motion-slow) var(--ease-standard);
}

/* ------------------------------------------------ 2. Conversion outcome bar
   One stacked bar answers "are we winning?" before any digit is read. Won,
   in-progress and lost are ordered so the two decided outcomes bracket the
   work still in play. */
.app-shell .outcome-strip{
  padding:var(--space-4);
  border:1px solid var(--separator);
  border-radius:var(--radius-md);
  background:var(--surface-sunken);
  margin-bottom:var(--space-4);
}
.app-shell .outcome-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:var(--space-3);
  flex-wrap:wrap;
  margin-bottom:var(--space-3);
}
.app-shell .outcome-rate{
  margin:0;
  display:flex;
  align-items:baseline;
  gap:var(--space-2);
  font-size:var(--fs-title);
  font-weight:var(--fw-bold);
  letter-spacing:var(--tracking-tight);
  color:var(--label-primary);
  font-variant-numeric:tabular-nums;
}
.app-shell .outcome-rate small{
  font-size:var(--fs-micro);
  font-weight:var(--fw-semibold);
  letter-spacing:var(--tracking-wide);
  text-transform:uppercase;
  color:var(--label-tertiary);
}
.app-shell .outcome-context{
  margin:0;
  font-size:var(--fs-caption);
  color:var(--label-secondary);
  font-variant-numeric:tabular-nums;
}
.app-shell .outcome-bar{
  display:flex;
  height:10px;
  border-radius:var(--radius-pill);
  overflow:hidden;
  background:var(--fill-subtle);
  /* hairlines between segments keep adjacent fills readable without borders */
  gap:2px;
}
.app-shell .outcome-seg{
  display:block;
  min-width:0;
  transition:width var(--motion-slow) var(--ease-standard);
}
.app-shell .outcome-seg.is-won{background:var(--status-success)}
.app-shell .outcome-seg.is-active{background:var(--accent)}
.app-shell .outcome-seg.is-lost{background:var(--neutral-350)}

.app-shell .outcome-legend{
  display:flex;
  flex-wrap:wrap;
  gap:var(--space-2) var(--space-5);
  margin:var(--space-3) 0 0;
  padding:0;
  list-style:none;
}
.app-shell .outcome-legend li{
  display:flex;
  align-items:baseline;
  gap:var(--space-2);
  font-variant-numeric:tabular-nums;
}
.app-shell .outcome-legend li::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:var(--radius-circle);
  background:var(--legend-dot,var(--neutral-350));
  flex:0 0 auto;
  align-self:center;
}
.app-shell .outcome-legend .is-won{--legend-dot:var(--status-success)}
.app-shell .outcome-legend .is-active{--legend-dot:var(--accent)}
.app-shell .outcome-legend .is-lost{--legend-dot:var(--neutral-350)}
.app-shell .outcome-legend b{
  font-size:var(--fs-data);
  font-weight:var(--fw-bold);
  color:var(--label-primary);
}
.app-shell .outcome-legend small{
  font-size:var(--fs-micro);
  color:var(--label-tertiary);
}

/* --------------------------------------------------------- 3. Pipeline funnel
   The stage row replaces the old four-across card grid. Bars are scaled to
   the largest stage, not to the total, because the question a funnel answers
   is "where do leads stop moving?" — and that drop is invisible when every
   bar is a sliver of the grand total. The percentage beside each count is
   still share-of-total, so both readings are available. */
.app-shell .pipeline-funnel{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.app-shell .pipeline-funnel .pipeline-item{
  display:grid;
  grid-template-columns:minmax(88px,1.1fr) minmax(0,3fr) auto;
  align-items:center;
  gap:var(--space-3);
  min-height:var(--touch-target);
  padding:var(--space-2) var(--space-3);
  border:0;
  border-radius:var(--radius-sm);
  background:transparent;
  box-shadow:none;
  transition:background var(--motion-fast) var(--ease-standard);
}
.app-shell .pipeline-funnel .pipeline-item::before{content:none}
.app-shell .pipeline-funnel .pipeline-item:hover,
.app-shell .pipeline-funnel .pipeline-item:focus-visible{
  background:var(--fill-hover);
  transform:none;
  border-color:transparent;
  box-shadow:none;
}
.app-shell .pipeline-stage{
  font-size:var(--fs-caption);
  font-weight:var(--fw-semibold);
  color:var(--label-secondary);
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.app-shell .pipeline-track{
  display:block;
  height:8px;
  min-width:0;
  border-radius:var(--radius-pill);
  background:var(--fill-subtle);
  overflow:hidden;
}
.app-shell .pipeline-fill{
  display:block;
  height:100%;
  width:var(--fill,0%);
  min-width:2px;
  border-radius:inherit;
  /* the stage's own configured colour stays the identity of the stage --
     admins set it in master data and it is used consistently elsewhere */
  background:var(--c,var(--accent));
  transition:width var(--motion-slow) var(--ease-standard);
}
.app-shell .pipeline-funnel .pipeline-metric{
  display:flex;
  align-items:baseline;
  gap:var(--space-2);
  justify-content:flex-end;
  min-width:64px;
  font-variant-numeric:tabular-nums;
}
.app-shell .pipeline-funnel .pipeline-metric b{
  font-size:var(--fs-body);
  font-weight:var(--fw-bold);
  color:var(--label-primary);
  display:inline;
}
.app-shell .pipeline-funnel .pipeline-metric small{
  font-size:var(--fs-micro);
  color:var(--label-tertiary);
  min-width:30px;
  text-align:end;
}

/* ------------------------------------------------------- 4. Health bar (SLA)
   Three segments, one line: how much of the open book is on time, slipping,
   or already breached. */
.app-shell .health-bar{
  display:flex;
  gap:2px;
  height:8px;
  border-radius:var(--radius-pill);
  overflow:hidden;
  background:var(--fill-subtle);
  margin-top:var(--space-3);
}
.app-shell .health-seg{display:block;min-width:0;transition:width var(--motion-slow) var(--ease-standard)}
.app-shell .health-seg.is-normal{background:var(--status-success)}
.app-shell .health-seg.is-warning{background:var(--status-warning)}
.app-shell .health-seg.is-critical{background:var(--status-danger)}

/* ------------------------------------------------------- 5. Compliance ring
   A donut is the right shape here and nowhere else on this screen: the value
   is a single share of a whole, and the ring reads as "how full" at a glance
   from across a room. Circumference for r=20 is 125.66. */
.app-shell .compliance-ring-row{
  display:flex;
  align-items:center;
  gap:var(--space-4);
  padding-bottom:var(--space-4);
  margin-bottom:var(--space-4);
  border-bottom:1px solid var(--separator-subtle);
}
.app-shell .kpi-ring{
  position:relative;
  width:72px;
  height:72px;
  flex:0 0 auto;
  display:grid;
  place-items:center;
  --ring-tone:var(--accent);
}
.app-shell .kpi-ring[data-tone=positive]{--ring-tone:var(--status-success)}
.app-shell .kpi-ring[data-tone=warning]{--ring-tone:var(--status-warning)}
.app-shell .kpi-ring[data-tone=critical]{--ring-tone:var(--status-danger)}
.app-shell .kpi-ring svg{
  width:100%;
  height:100%;
  /* start the arc at 12 o'clock in both directions; the ring is a quantity,
     not a direction, so it does not mirror in RTL */
  transform:rotate(-90deg);
}
.app-shell .kpi-ring circle{
  fill:none;
  stroke-width:6;
  stroke-linecap:round;
}
.app-shell .kpi-ring-track{stroke:var(--fill-subtle)}
.app-shell .kpi-ring-value{
  stroke:var(--ring-tone);
  stroke-dasharray:calc(var(--ring,0) * 1.2566) 125.66;
  transition:stroke-dasharray var(--motion-slow) var(--ease-standard);
}
.app-shell .kpi-ring>b{
  position:absolute;
  font-size:var(--fs-data);
  font-weight:var(--fw-bold);
  color:var(--label-primary);
  font-variant-numeric:tabular-nums;
}
.app-shell .compliance-ring-note{
  margin:0;
  font-size:var(--fs-caption);
  line-height:var(--lh-snug);
  color:var(--label-secondary);
}

/* ----------------------------------------------------------- 6. Responsive */
@media(max-width:1180px){
  .app-shell .exec-band{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:560px){
  .app-shell .exec-band{grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--space-2)}
  .app-shell .exec-kpi{padding:var(--space-3)}
  .app-shell .exec-kpi-value{font-size:var(--fs-section)}
  /* The funnel keeps every stage visible on a phone; only the label column
     narrows. This is why the old horizontal carousel was removed rather than
     restyled — it hid stages behind a gesture with no affordance. */
  .app-shell .pipeline-funnel .pipeline-item{
    grid-template-columns:minmax(70px,1fr) minmax(0,2fr) auto;
    gap:var(--space-2);
    padding-inline:var(--space-2);
  }
  .app-shell .pipeline-funnel .pipeline-metric{min-width:52px}
  .app-shell .outcome-head{gap:var(--space-2)}
  .app-shell .outcome-legend{gap:var(--space-2) var(--space-4)}
  .app-shell .compliance-ring-row{gap:var(--space-3)}
  .app-shell .kpi-ring{width:60px;height:60px}
}

/* ------------------------------------------------------- 7. Reduced motion */
@media(prefers-reduced-motion:reduce){
  .app-shell .exec-meter>span,
  .app-shell .outcome-seg,
  .app-shell .health-seg,
  .app-shell .pipeline-fill,
  .app-shell .kpi-ring-value{transition:none}
}

/* ------------------------------------------- 8. Project performance (Phase F)
   The project card already carried leads / closed / media as three raw
   counts. The rate is what makes one project comparable to the next, and it
   borrows the dashboard meter rather than inventing a second bar style. */
.app-shell .project-conversion{
  display:flex;
  flex-direction:column;
  gap:var(--space-2);
  padding-top:var(--space-3);
  margin:0 0 var(--space-4);
  border-top:1px solid var(--separator-subtle);
}
.app-shell .project-conversion-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:var(--space-2);
}
.app-shell .project-conversion-head span{
  font-size:var(--fs-micro);
  font-weight:var(--fw-semibold);
  letter-spacing:var(--tracking-wide);
  text-transform:uppercase;
  color:var(--label-tertiary);
}
.app-shell .project-conversion-head b{
  font-size:var(--fs-data);
  font-weight:var(--fw-bold);
  color:var(--label-primary);
  font-variant-numeric:tabular-nums;
}

/* Terminal stages (won / lost) are outcomes, not steps in the funnel. A rule
   and a quieter bar keep the narrowing shape of the in-flight stages legible
   above them. */
.app-shell .pipeline-funnel .pipeline-item[data-terminal]{margin-top:var(--space-2)}
.app-shell .pipeline-funnel .pipeline-item[data-terminal]:first-of-type,
.app-shell .pipeline-funnel .pipeline-item:not([data-terminal]) + .pipeline-item[data-terminal]{
  border-top:1px solid var(--separator);
  padding-top:var(--space-3);
  margin-top:var(--space-3);
}
.app-shell .pipeline-funnel .pipeline-item[data-terminal] .pipeline-fill{opacity:.55}
.app-shell .pipeline-funnel .pipeline-item[data-terminal] .pipeline-stage{color:var(--label-tertiary)}

/* ---------------------------------------------- 9. Phase D visual corrections
   Reviewed against a seeded pipeline at 1440px. Three things were wrong.

   (a) Six saturated master-data colours, one per bar, turned the funnel into
       a rainbow and read as a generic analytics widget rather than Al Omran.
       The bar now carries one accent -- the funnel measures quantity, and
       quantity has no colour of its own -- while the stage's configured
       colour survives as the dot beside its name, which is where it is used
       everywhere else in the product. */
.app-shell .pipeline-funnel .pipeline-fill{background:var(--accent)}
.app-shell .pipeline-stage{display:flex;align-items:center;gap:var(--space-2)}
.app-shell .pipeline-dot{
  width:8px;height:8px;flex:0 0 auto;
  border-radius:var(--radius-circle);
  background:var(--c,var(--accent));
}
.app-shell .pipeline-funnel .pipeline-item[data-terminal] .pipeline-fill{
  opacity:1;
  background:var(--neutral-400);
}

/* (b) The in-progress segment was set in the full-strength accent, which at
       this width reads as a black void and swallows the won segment beside
       it. A mid-ramp lapis keeps the three outcomes legible as a set. */
.app-shell .outcome-seg.is-active{background:var(--lapis-400)}
.app-shell .outcome-legend .is-active{--legend-dot:var(--lapis-400)}

/* (c) The SLA counters were drawn with a full border and looked like three
       disabled inputs sitting above the list. They are readouts, so they get
       a wash and a colour instead of a box. */
.app-shell .stage-sla-summary{gap:var(--space-2)}
.app-shell .stage-sla-count{
  border:0;
  border-radius:var(--radius-sm);
  padding:var(--space-2) var(--space-3);
  background:var(--fill-subtle);
}
.app-shell .stage-sla-count b{font-variant-numeric:tabular-nums}
.app-shell .stage-sla-count.is-normal{background:var(--status-success-wash);color:var(--status-success)}
.app-shell .stage-sla-count.is-warning{background:var(--status-warning-wash);color:var(--status-warning)}
.app-shell .stage-sla-count.is-critical{background:var(--status-danger-wash);color:var(--status-danger)}
.app-shell .stage-sla-count small{color:inherit;opacity:.85}

/* --------------------------------------------- 10. Topbar heading at mid-width
   Caught at 1000px on Project Details: the page subtitle collapsed into a
   ~60px column and wrapped over the quick-search field. The cause is the
   default min-width:auto on a flex child -- .page-heading refused to shrink
   below its longest word, so the browser overflowed it instead. Same trap as
   the leads table at mobile: fix the shrink, do not clip the symptom. The
   subtitle is supporting text, so it truncates rather than pushing chrome. */
.app-shell .topbar-start{min-width:0;flex:1 1 auto}
.app-shell .page-heading{min-width:0;flex:1 1 auto}
@media(max-width:1200px){
  .app-shell .quick-search{display:none}
}
.app-shell .page-heading h1,
.app-shell .page-heading p{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* ------------------------------------- 11. One funnel language (Phase E)
   The Reports "Sales Funnel by Status" was drawn with the raw status colour
   per bar while the dashboard funnel uses the accent. Same chart, same
   product, two languages. The label now carries the stage dot -- the same
   component the dashboard funnel uses -- and the bar is left to the shared
   .progress fill, so the two screens finally read as one system. */
.app-shell .metric-bar label{
  display:flex;
  align-items:center;
  gap:var(--space-2);
  width:104px;
  min-width:0;
}
.app-shell .metric-bar label>span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* ------------------------------------ 12. Shared meters and card decoration
   (a) .progress is the product's oldest bar component and still filled with a
   navy-to-gold gradient, so the same quantity was drawn three ways: solid
   accent on the dashboard funnel, gold-tipped gradient on Reports and
   Targets. Gold is reserved for brand moments and the single tinted action;
   it is not a data colour. One solid accent everywhere. */
.app-shell .progress{background:var(--fill-subtle)}
.app-shell .progress>span{
  background:var(--accent);
  transition:width var(--motion-slow) var(--ease-standard);
}

/* (b) The stat card's decorative corner blob is a pastel circle that carries
   no information -- the exact ornament the foundation pass removed
   elsewhere. Six of them in a row read as a template, and the pastels are
   outside the palette entirely. The tone survives where it means something:
   on the icon. */
.app-shell .stat-card:after{content:none}
.app-shell .stat-card{overflow:visible}

/* ==========================================================================
   PREMIUM TRANSFORMATION — brand, colour discipline, controls, desktop

   Continues from Phases A–D. Nothing here restarts earlier work; each block
   states the specific defect it corrects.
   ========================================================================== */

/* ------------------------------------------------------- 1. The Omran mark
   The new emblem is ornate -- a lapis tower, gold filigree, a crescent, and
   a CRM wordmark inside a gold ring. That is a crest, not a flat glyph, and
   it stops being readable somewhere around 40px. Every placement below is
   sized so the detail survives, and the artwork is square (1254x1254) so
   height alone fixes the box. object-fit:contain guarantees no stretch and
   no crop whatever the source turns out to be. */
.app-shell .brand-logo,
.auth-brand img,
.auth-logo-mobile,
.appearance-preview-brand img{
  object-fit:contain;
  background:transparent;
  border:0;
  border-radius:0;
  box-shadow:none;
  padding:0;
}
/* Sidebar: raised from 38px, which turned the crest to mud. */
.app-shell .brand-logo{width:54px;height:54px;max-width:none}
/* Login is the brand moment -- the mark carries the panel. */
.auth-brand img{width:92px;height:92px;max-width:none}
.auth-logo-mobile{width:104px;height:104px;max-width:none}
.appearance-preview-brand img{width:64px;height:64px}

/* The brand block needs to breathe now that the mark has real size. */
.app-shell .brand-block{
  gap:var(--space-3);
  padding-block:var(--space-2) var(--space-4);
  align-items:center;
}
.app-shell .brand-copy strong{
  font-size:var(--fs-data);
  letter-spacing:var(--tracking-snug);
  line-height:var(--lh-tight);
}
.app-shell .brand-copy span{
  font-size:var(--fs-micro);
  letter-spacing:var(--tracking-normal);
  color:var(--label-inverse-secondary);
}
.auth-brand{align-items:center}

/* ------------------------------------------------- 2. Gold discipline
   Gold was leading the topbar create action. On a brief that reserves gold
   for luxury accents, the single most-clicked button in the product is the
   one place it must not be: "Add Lead" is an everyday interaction, not a
   brand moment. Navy leads; gold retreats to the accents listed below. */
.app-shell .top-add{
  background:var(--accent);
  background-image:none;
  border-color:var(--accent);
  color:var(--label-inverse);
  font-weight:var(--fw-semibold);
  box-shadow:none;
}
.app-shell .top-add:hover{background:var(--accent-hover);border-color:var(--accent-hover)}
.app-shell .top-add:active{background:var(--accent-pressed);border-color:var(--accent-pressed)}

/* Where gold is still allowed, and nowhere else: the active-nav rail, the
   topbar hairline, VIP and premium indicators, the focus ring, and the mark
   itself. Those are all pre-existing and deliberately left in place. */

/* --------------------------------------------------- 3. Form controls
   The largest remaining "template" tell in the product: every <select> was
   a raw native control with an OS chevron, and file and colour inputs were
   completely unstyled. A premium platform does not ship the browser's
   default widgets. The chevron is an inline data URI -- no icon library,
   no external request. */
.app-shell select,
.app-shell .control select{
  appearance:none;
  -webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right var(--space-3) center;
  background-size:16px 16px;
  padding-inline-end:calc(var(--space-3) * 2 + 16px);
  cursor:pointer;
}
/* background-position does not follow writing direction, so RTL is explicit. */
[dir=rtl] .app-shell select,
[dir=rtl] .app-shell .control select{
  background-position:left var(--space-3) center;
  padding-inline-end:var(--space-3);
  padding-inline-start:calc(var(--space-3) * 2 + 16px);
}
.app-shell select:disabled{opacity:.6;cursor:not-allowed}

/* File input: the bare "Choose File / No file chosen" was the most obviously
   unfinished control on Settings. */
.app-shell input[type=file]{
  padding:var(--space-2);
  background:var(--surface-sunken);
  border:1px dashed var(--separator-strong);
  border-radius:var(--radius-sm);
  color:var(--label-secondary);
  font-size:var(--fs-caption);
  cursor:pointer;
  height:auto;
}
.app-shell input[type=file]:hover{border-color:var(--accent);background:var(--accent-wash)}
.app-shell input[type=file]::file-selector-button{
  appearance:none;
  margin-inline-end:var(--space-3);
  padding:var(--space-2) var(--space-4);
  border:1px solid var(--separator-strong);
  border-radius:var(--radius-xs);
  background:var(--surface-raised);
  color:var(--label-primary);
  font-family:inherit;
  font-size:var(--fs-caption);
  font-weight:var(--fw-semibold);
  cursor:pointer;
  transition:background var(--motion-fast) var(--ease-standard),
             border-color var(--motion-fast) var(--ease-standard);
}
.app-shell input[type=file]::file-selector-button:hover{
  background:var(--fill-hover);
  border-color:var(--accent);
}

/* Colour input: was rendering as a raw OS swatch with chrome padding. */
.app-shell input[type=color]{
  padding:3px;
  height:var(--input-height);
  border:1px solid var(--separator-strong);
  border-radius:var(--radius-sm);
  background:var(--surface-raised);
  cursor:pointer;
}
.app-shell input[type=color]::-webkit-color-swatch-wrapper{padding:0}
.app-shell input[type=color]::-webkit-color-swatch{
  border:0;
  border-radius:var(--radius-xs);
}

/* Search fields read as search, not as another text box. */
.app-shell input[type=search]::-webkit-search-cancel-button{
  appearance:none;
  width:16px;height:16px;
  cursor:pointer;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center/14px no-repeat;
}

/* One focus treatment for every control, replacing three near-identical ones. */
.app-shell input:focus-visible,
.app-shell select:focus-visible,
.app-shell textarea:focus-visible{
  outline:none;
  border-color:var(--accent);
  box-shadow:0 0 0 var(--focus-ring-width) var(--accent-wash);
}

/* ------------------------------------------- 4. Button system (complete)
   Primary / secondary / ghost / danger, one weight scale, one motion. The
   ghost variant did not exist, so low-emphasis actions were being drawn as
   secondary buttons and competing with real ones. */
.app-shell .btn{
  font-weight:var(--fw-semibold);
  letter-spacing:var(--tracking-normal);
  transition:background var(--motion-fast) var(--ease-standard),
             border-color var(--motion-fast) var(--ease-standard),
             color var(--motion-fast) var(--ease-standard),
             box-shadow var(--motion-fast) var(--ease-standard);
}
.app-shell .btn-ghost{
  background:transparent;
  border-color:transparent;
  color:var(--label-secondary);
}
.app-shell .btn-ghost:hover{background:var(--fill-hover);color:var(--label-primary)}
.app-shell .btn-ghost:active{background:var(--fill-pressed)}
.app-shell .btn:disabled,
.app-shell .btn[aria-disabled=true]{opacity:.5;cursor:not-allowed}

/* ------------------------------------------------ 5. Desktop composition
   The brief is specific: desktop feels like a stretched mobile layout. The
   cause is that every page shares one 1720px measure, so a three-column
   form stretches a "Full name" field to nearly 400px on a large monitor
   while a data table -- which genuinely wants the width -- gets the same
   treatment. Page type now decides the measure, with no template change:
   :has() reads the content that is actually on the page. */
@media(min-width:1400px){
  .app-shell .content-wrap:has(.form-card){max-width:1280px}
  .app-shell .content-wrap:has(.auth-box){max-width:none}
}
/* A form on a wide screen reads in columns, not in one long line. */
.app-shell .form-card{padding:var(--space-6)}
.app-shell .form-section{padding-block:var(--space-5)}

/* ------------------------------------------------------- 6. Table polish
   Rows were uniform grey-on-white with the action column marooned at the
   far edge of a very wide table. Identity leads, numbers align, and the
   header reads as a label rather than a filled band. */
.app-shell .data-table th{
  background:var(--surface-sunken);
  color:var(--label-tertiary);
  font-size:var(--fs-micro);
  font-weight:var(--fw-bold);
  letter-spacing:var(--tracking-wide);
  text-transform:uppercase;
  white-space:nowrap;
}
.app-shell .data-table td{border-bottom:1px solid var(--separator-subtle)}
.app-shell .data-table tbody tr{
  transition:background var(--motion-fast) var(--ease-standard);
}
.app-shell .data-table tbody tr:hover{background:var(--accent-wash)}
/* Counts and dates line up when they share a column. */
.app-shell .data-table td:has(> .money),
.app-shell .data-table td .money{font-variant-numeric:tabular-nums}
/* The actions column stops drifting: it holds its own width at the end. */
.app-shell .data-table th:last-child,
.app-shell .data-table td:last-child{width:1%;white-space:nowrap}
.app-shell .row-actions{justify-content:flex-end}

/* ------------------------------------------- 7. Premium micro-interactions
   Restrained: a lift on things that are genuinely elevated, a settle on
   press, nothing that draws attention to itself. */
.app-shell .card,
.app-shell .table-card{
  transition:box-shadow var(--motion-normal) var(--ease-standard),
             border-color var(--motion-normal) var(--ease-standard);
}
.app-shell .quick-action,
.app-shell .stat-card{
  transition:background var(--motion-fast) var(--ease-standard),
             border-color var(--motion-fast) var(--ease-standard),
             box-shadow var(--motion-normal) var(--ease-standard),
             transform var(--motion-fast) var(--ease-standard);
}
@media(hover:hover){
  .app-shell .quick-action:hover,
  .app-shell .stat-card:hover{
    box-shadow:var(--elevation-2);
    border-color:var(--accent-border);
  }
}
.app-shell .quick-action:active{transform:scale(.985)}

@media(prefers-reduced-motion:reduce){
  .app-shell .btn,
  .app-shell .card,
  .app-shell .table-card,
  .app-shell .quick-action,
  .app-shell .stat-card,
  .app-shell .data-table tbody tr,
  .app-shell input[type=file]::file-selector-button{transition:none!important}
  .app-shell .quick-action:active{transform:none}
}

/* ----------------------------------------------------------- 8. Responsive */
@media(max-width:720px){
  .app-shell .brand-logo{width:46px;height:46px}
  .auth-brand img{width:72px;height:72px}
}

/* ------------------------------------------- 9. Icon system (single language)
   63 text glyphs were standing in for icons across the product -- a
   multiplication sign as a modal close, a fullwidth plus on add buttons, a
   tick passed to empty_state() as an icon NAME that matched nothing, and
   typographic chevrons in the sidebar. Every one of them had a real SVG in
   the set already; they now use it, so the product has one icon language at
   one set of weights. The chevrons need the layout to follow. */
.app-shell .nav-chevron{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  color:currentColor;
  opacity:.55;
  transition:transform var(--motion-normal) var(--ease-standard),
             opacity var(--motion-fast) var(--ease-standard);
}
.app-shell .nav-link:hover .nav-chevron{opacity:.9}
/* "Navigates deeper" points along the reading direction; the icon set holds
   one chevron and this rotates it, so the two never drift apart. */
.app-shell .nav-chevron-next{transform:rotate(-90deg)}
[dir=rtl] .app-shell .nav-chevron-next{transform:rotate(90deg)}
/* A disclosure chevron points down when the group is open. */
.app-shell details[open] > .nav-link > .nav-chevron:not(.nav-chevron-next){transform:rotate(180deg)}

/* Modal close is now an icon button, not a glyph in a text box. */
.app-shell .modal-head .icon-btn{color:var(--label-tertiary)}
.app-shell .modal-head .icon-btn:hover{background:var(--fill-hover);color:var(--label-primary)}

@media(prefers-reduced-motion:reduce){
  .app-shell .nav-chevron{transition:none}
}

/* The dashboard control deck and the leads mobile toolbar carried the same
   typographic chevron; both now use the icon, and both rotate on open so the
   disclosure state is legible without reading the panel. */
.app-shell .control-chevron,
.app-shell .lead-mobile-toolbar-chevron{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  color:var(--label-tertiary);
  transition:transform var(--motion-normal) var(--ease-standard);
}
.app-shell details[open] > summary .control-chevron,
.app-shell details[open] > summary .lead-mobile-toolbar-chevron{transform:rotate(180deg)}
@media(prefers-reduced-motion:reduce){
  .app-shell .control-chevron,
  .app-shell .lead-mobile-toolbar-chevron{transition:none}
}

/* ============================ FINAL PREMIUM PASS ============================ */

/* ------------------------------- 1. Lead lifecycle stepper (no change made)
   Investigated after a screenshot appeared to show "Not Interested" clipped
   at the card edge. It is not a defect: .lead-status-stepper-wrap sets
   overflow-x:auto and the stepper sets min-width:max-content, so this is a
   deliberately scrollable stepper with a focusable wrap for keyboard
   scrolling. The label was scrolled out of view, not broken. An earlier
   attempt here forced the steps to shrink, which would have crushed a
   working component; it was withdrawn rather than kept. */

/* --------------------------------------------- 2. Navigation progress
   A 2px rule pinned to the top of the viewport. Gold leads here and it is
   one of the few places it should: this is a brand moment, it is never a
   control, and it is the only gold that moves. */
.app-shell .nav-progress{
  position:fixed;
  inset-block-start:0;
  inset-inline-start:0;
  z-index:200;
  height:2px;
  width:0;
  border-end-end-radius:var(--radius-pill);
  background:linear-gradient(90deg,var(--gold-600),var(--gold-400));
  box-shadow:0 0 8px rgba(201,162,74,.5);
  transition:width 120ms linear;
  pointer-events:none;
}
[dir=rtl] .app-shell .nav-progress{background:linear-gradient(270deg,var(--gold-600),var(--gold-400))}
/* Reduced motion gets a static full-width rule rather than a creeping one. */
.app-shell .nav-progress[data-static]{transition:none;opacity:.85}

/* ------------------------------------------------- 3. Feedback details
   Toasts and empty states arrive rather than appear. Both are short, both
   settle, and both stop entirely under reduced motion. */
@keyframes crm-rise{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.app-shell .toast-stack .alert{animation:crm-rise var(--motion-slow) var(--ease-standard) both}
.app-shell .empty-state{animation:crm-rise var(--motion-slow) var(--ease-standard) both}
.app-shell .empty-icon{
  background:var(--accent-wash);
  color:var(--accent);
  border:1px solid var(--accent-border);
}
.app-shell .empty-state h3{color:var(--label-primary)}
.app-shell .empty-state p{color:var(--label-tertiary);max-width:42ch;margin-inline:auto}

@media(prefers-reduced-motion:reduce){
  .app-shell .toast-stack .alert,
  .app-shell .empty-state{animation:none}
  .app-shell .nav-progress{transition:none}
}

/* --------------------------------------- 4. Filter actions own their row
   Measured on the dashboard at 1600px: the Apply/Reset pair needs 186px but
   sits in a filter-grid column 118px wide, so the buttons overflowed their
   cell. They are not a field and should never have been competing with the
   fields for a column -- they now take the full width of the grid and sit
   below it, which is also where the eye expects to finish a filter form. */
.app-shell .dashboard-filter-actions,
.app-shell .lead-filter-actions{
  grid-column:1 / -1;
  display:flex;
  flex-wrap:wrap;
  gap:var(--space-2);
  justify-content:flex-end;
  align-items:center;
  min-width:0;
  padding-top:var(--space-2);
  border-top:1px solid var(--separator-subtle);
}
/* .lead-filter-form .btn carried width:100% from when the actions sat in a
   single 140px grid column, where a full-width button was right. Now that
   the row spans the grid, that same rule stretched Apply to 1208px -- a navy
   slab across the whole filter card. The buttons size to their content. */
.app-shell .dashboard-filter-actions .btn,
.app-shell .lead-filter-actions .btn{flex:0 0 auto;width:auto}

/* ------------------------------------------ 5. Select chevron proportion
   The custom chevron reserved 40px of end padding, which is fine on a wide
   control and disproportionate on the 118px selects in the filter grids --
   "All WhatsApp Numbers" lost most of its room to the arrow. The reserve is
   now 32px, and the arrow sits closer to the edge. */
.app-shell select,
.app-shell .control select{
  background-position:right var(--space-2) center;
  padding-inline-end:calc(var(--space-2) * 2 + 16px);
}
[dir=rtl] .app-shell select,
[dir=rtl] .app-shell .control select{
  background-position:left var(--space-2) center;
  padding-inline-end:var(--space-3);
  padding-inline-start:calc(var(--space-2) * 2 + 16px);
}

/* ------------------------------------- 6. Compliance labels stop clipping
   "Compliance" and "Overdue" were each a few pixels wider than their column
   in the follow-up summary. The row wraps rather than truncating, because a
   truncated metric label is worse than a slightly taller card. */
.app-shell .followup-compliance-count{min-width:0}
.app-shell .followup-compliance-count small{white-space:normal;overflow-wrap:anywhere}

/* ==================== SHOWCASE PASS — project identity ==================== */

/* The code chip was position:static, so it sat flush in the corner of the
   cover with a one-pixel offset and read as clipped. It is an overlay and now
   behaves like one. */
.app-shell .project-directory-cover{position:relative}
.app-shell .project-directory-cover .project-code-chip{
  position:absolute;
  inset-block-start:var(--space-3);
  inset-inline-start:var(--space-3);
  z-index:2;
  padding:var(--space-1) var(--space-2);
  border-radius:var(--radius-xs);
  font-size:var(--fs-micro);
  font-weight:var(--fw-bold);
  letter-spacing:var(--tracking-wide);
  background:var(--surface-inverse);
  color:var(--label-inverse);
  box-shadow:var(--elevation-1);
}

/* No photograph: the block carries the project's identity rather than a blank
   gradient. Navy ground, the code set large and quiet, a single gold hairline
   at the base -- the one gold moment on this card. */
.app-shell .project-directory-cover.is-placeholder{
  background:linear-gradient(150deg,var(--lapis-900),var(--lapis-700));
  display:grid;
  place-items:center;
}
.app-shell .project-directory-cover.is-placeholder::after{
  content:"";
  position:absolute;
  inset-inline:0;
  inset-block-end:0;
  height:2px;
  background:linear-gradient(90deg,transparent,var(--gold-500),transparent);
}
.app-shell .project-cover-placeholder{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:var(--space-2);
  color:var(--label-inverse-secondary);
}
.app-shell .project-cover-placeholder .ui-icon{opacity:.5}
.app-shell .project-cover-placeholder b{
  font-size:var(--fs-section);
  font-weight:var(--fw-bold);
  letter-spacing:.14em;
  color:var(--label-inverse);
  opacity:.92;
}

/* ==================== SIDEBAR INFORMATION ARCHITECTURE ==================== */

/* Fifteen top-level entries in one flat list gave a daily sales action the
   same weight as an admin screen, and left no way to scan. Four sections now
   carry it -- Workspace, Sales, Management, Administration. Every entry moved
   verbatim: routes, permission gates and active-state logic are untouched,
   so what a role can see is exactly what it could see before.

   The label is a quiet eyebrow, not a heading -- it should be findable when
   scanned and invisible when reading. */
.app-shell .nav-group{display:flex;flex-direction:column;gap:2px}
.app-shell .nav-group + .nav-group{
  margin-block-start:var(--space-4);
  padding-block-start:var(--space-3);
  border-block-start:1px solid var(--separator-inverse);
}
.app-shell .nav-group-label{
  margin:0 0 var(--space-1);
  padding-inline:var(--space-3);
  font-size:var(--fs-micro);
  font-weight:var(--fw-bold);
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--label-inverse-secondary);
  opacity:.62;
  user-select:none;
}

/* A role that can see nothing in a section must not be shown its heading.
   :has() keeps that decision next to the layout instead of duplicating every
   permission test in a Jinja condition. */
.app-shell .nav-group:not(:has(.nav-link)){display:none}
.app-shell .nav-group:not(:has(.nav-link)) + .nav-group{
  margin-block-start:0;
  padding-block-start:0;
  border-block-start:0;
}

/* The first group sits directly under the workspace pill and needs no rule. */
.app-shell .nav-group:first-of-type{margin-block-start:0}

/* Nav rows were 45px except "Advanced Operations", which wrapped to two lines
   and stood at 58px -- one item taller than the other fourteen reads as a
   mistake even when nobody can name it. The label takes the space it has and
   truncates rather than reflowing the row; the full text stays available to
   assistive tech and as a title. */
.app-shell .nav-link > span:not(.nav-icon):not(.nav-chevron){
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.app-shell .nav-link{gap:var(--space-2)}


/* ------------------------------------------------------- Sales Performance
   Dashboard (MVP command center, Admin + Sales Manager only). Dense KPI grid,
   reuses .stat-card/.stage-sla-item/.kpi-ring from elsewhere in this file so
   the page reads as one system rather than a new design language. */
.perf-filter-bar{display:flex;align-items:flex-end;gap:10px;padding:12px 14px;background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-sm);margin-bottom:15px;flex-wrap:wrap}
.perf-filter-bar .field{gap:5px}
.perf-filter-bar input{height:38px;line-height:36px;padding-block:0;min-width:150px}
.perf-kpi-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(148px,1fr));gap:11px;margin-bottom:17px}
.perf-kpi{text-decoration:none;color:inherit;cursor:pointer}
.perf-kpi:hover{border-color:var(--accent,var(--brand));transform:translateY(-1px)}
.perf-kpi strong{font-size:22px}
.perf-main-grid{align-items:start}
.perf-attention-list{max-height:420px;overflow:auto}
.perf-trend-chart{display:flex;align-items:flex-end;gap:3px;height:120px;padding:14px 16px 4px;overflow-x:auto}
.perf-trend-col{flex:1 0 10px;min-width:10px;height:100%;display:flex;align-items:flex-end}
.perf-trend-bars{display:flex;align-items:flex-end;gap:2px;width:100%;height:100%}
.perf-trend-bar{flex:1;min-height:2px;border-radius:2px 2px 0 0}
.perf-trend-bar.is-new{background:var(--brand2)}
.perf-trend-bar.is-won{background:var(--success-700)}
.perf-trend-legend{display:flex;align-items:center;gap:6px;padding:0 16px 14px;font-size:var(--fs-micro);color:var(--muted)}
.perf-legend-swatch{width:9px;height:9px;border-radius:2px;display:inline-block;margin-inline-start:10px}
.perf-legend-swatch:first-child{margin-inline-start:0}
.perf-legend-swatch.is-new{background:var(--brand2)}
.perf-legend-swatch.is-won{background:var(--success-700)}
.perf-target-card{align-self:start}
.perf-employee-table td{white-space:nowrap}
.perf-flag-bad{color:var(--danger-700);font-weight:var(--fw-bold)}
.perf-flag-good{color:var(--success-700);font-weight:var(--fw-bold)}
@media(max-width:1024px){.perf-main-grid{grid-template-columns:1fr}}
@media(max-width:720px){.perf-kpi-grid{grid-template-columns:repeat(2,1fr)}.perf-filter-bar{padding:10px}}
@media(max-width:430px){.perf-kpi-grid{grid-template-columns:repeat(2,1fr)}.perf-kpi strong{font-size:19px}}


/* --------------------- Sales Performance Dashboard V2 additions --------- */
.app-shell .kpi-ring[data-tone=neutral]{--ring-tone:var(--muted)}
.perf-scope-banner{margin-bottom:15px}
.perf-field-employee{min-width:200px;flex:1 1 200px}
.perf-field-employee select{height:38px;line-height:36px;padding-block:0;padding-inline-end:32px}
.perf-rings-card{margin-bottom:17px}
.perf-ring-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:14px;padding:6px 4px 4px}
.perf-ring{display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;padding:10px 6px;border-radius:var(--radius-sm)}
.perf-ring-label{font-size:var(--fs-caption);font-weight:var(--fw-semibold);color:var(--text)}
.perf-ring-fraction{font-size:var(--fs-micro);color:var(--muted)}
.perf-ring-fraction.perf-ring-nodata{font-style:italic}
.perf-ring-note{margin:8px 4px 0;font-size:var(--fs-micro);color:var(--muted);line-height:1.5}
@media(max-width:820px){.perf-ring-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:460px){.perf-ring-grid{grid-template-columns:repeat(2,1fr)}.perf-ring .kpi-ring{width:64px;height:64px}}


/* --------------------- Morning Manager Brief --------------------------- */
.perf-brief-card{margin-bottom:15px;padding:16px 18px}
.perf-brief-head{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.perf-brief-head h3{margin:0;font-size:var(--fs-subsection)}
.perf-brief-section{margin-bottom:10px}
.perf-brief-label{display:block;font-size:var(--fs-caption);font-weight:var(--fw-bold);color:var(--muted);text-transform:uppercase;letter-spacing:.3px;margin-bottom:5px}
.perf-brief-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px;font-size:var(--fs-data)}
.perf-brief-list li{display:block}
.perf-brief-list b{color:var(--text)}
.perf-brief-snapshot{flex-direction:row;flex-wrap:wrap;gap:14px}
.perf-brief-snapshot li{white-space:nowrap}
.perf-brief-clear{margin:0;color:var(--success-700);font-weight:var(--fw-semibold);display:flex;align-items:center;gap:6px}
.perf-brief-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}
@media(max-width:430px){.perf-brief-snapshot{flex-direction:column;gap:4px}}
