:root{
  --fm-sidebar-w: 246px;
  --fm-navy:#0F2E4D;
  --fm-navy-strong:#0B2237;
  --fm-red:#C62828;
  --fm-iq-blue:#2EA3FF;
  --fm-green:#2E7D32;
  --fm-amber:#F9A825;

  --fm-bg:#F5F7FA;
  --fm-card:#FFFFFF;
  --fm-surface:#FBFCFD;
  --fm-border:#E3E7ED;
  --fm-border-strong:#D0DCEB;

  --fm-text:#1F2933;
  --fm-muted:#6B7280;
  --fm-muted-strong:#60758A;
  --fm-text-soft:#72869A;

  --fm-radius:12px;
  --fm-radius-sm:8px;
  --fm-radius-md:12px;
  --fm-radius-lg:16px;
  --fm-radius-pill:999px;
  --fm-space-1:4px;
  --fm-space-2:8px;
  --fm-space-3:12px;
  --fm-space-4:16px;
  --fm-space-5:20px;
  --fm-space-6:24px;
  --fm-space-7:32px;
  --fm-control-h:42px;
  --fm-control-h-lg:44px;
  --fm-shadow:0 6px 18px rgba(0,0,0,0.06);
  --fm-shadow-sm:0 2px 8px rgba(0,0,0,0.05);
  --fm-shadow-lg:0 16px 36px rgba(15,39,65,0.10);
  --fm-transition-fast:160ms ease;
  --fm-blue-soft: rgba(46,163,255,.14);
  --fm-green-soft: rgba(46,125,50,.16);
  --fm-amber-soft: rgba(249,168,37,.18);
  --fm-purple-soft: rgba(123,97,255,.16);
}

html, body{
  font-family: Tahoma, sans-serif !important;
  color: var(--fm-text) !important;
  background: var(--fm-bg) !important;
}

h1, h2, h3, h4, h5, h6{
  font-family: Inter, Tahoma, sans-serif !important;
  font-weight: 600 !important;
}

.fm-shell,
.fm-app{
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.fm-sidebar{
  display: flex;
  flex-direction: column;
  width: var(--fm-sidebar-w, 268px);
  min-width: var(--fm-sidebar-w, 268px);
  background: #F8F9FB;
  color: var(--fm-navy);
  border-right: 1px solid rgba(15,46,77,.08);
  padding: 8px 8px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
}

.fm-sidebar .fm-brand{
  display:flex;
  align-items:center;
  margin-bottom: 10px;
}

.fm-sidebar .fm-brand-plate{
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  padding:7px;
  border:1px solid rgba(15,46,77,0.08);
  border-radius:14px;
  background: #fff;
}

.fm-sidebar .fm-brand-badge{
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 1px solid rgba(15,46,77,.12);
  display: block;
  object-fit: cover;
  background: #fff;
  flex: 0 0 52px;
}

.fm-mark{
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #fff;
  position: relative;
}

.fm-mark::after{
  content:"FM";
  color: var(--fm-navy);
  font-size: 10px;
  font-weight: 800;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fm-sidebar .fm-brandname{
  font-family: Inter, Tahoma, sans-serif;
  font-weight: 800;
  font-size: 18px;
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: var(--fm-navy);
}

.fm-sidebar .fm-brandname .iq{
  color: var(--fm-iq-blue);
  margin-left: 1px;
}

.fm-sidebar .fm-brandtag{
  color: rgba(15,46,77,0.62);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 4px;
}

.fm-logo{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom: 12px;
}

.fm-logo-badge{
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--fm-navy);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
}

.fm-logo-text{
  font-family: Inter, Tahoma, sans-serif;
  font-weight: 600;
  color: #fff;
}

.fm-nav{
  display:flex;
  flex-direction:column;
  gap:10px;
  flex: 1 1 auto;
  min-height: 0;
}

.fm-nav-section{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.fm-nav-section__label{
  padding: 2px 8px 2px;
  color: rgba(15,46,77,0.56);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fm-nav-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:7px 8px;
  border-radius: 10px;
  border:1px solid transparent;
  color: var(--fm-navy);
  text-decoration:none;
}
.fm-nav-item:hover{
  background: rgba(15,46,77,.05);
  border-color: transparent;
  text-decoration:none;
}
.fm-nav-item.active{
  background: #FFFFFF;
  box-shadow: 0 6px 16px rgba(15,46,77,.08);
  border-color: rgba(15,46,77,.06);
  border-left: 3px solid var(--fm-iq-blue);
  color: var(--fm-navy);
  padding-left: 9px;
}

.fm-navitem{
  display:flex;
  align-items:center;
  padding:7px 8px;
  border-radius:10px;
  border:1px solid transparent;
  color: var(--fm-navy);
  text-decoration:none;
  font-weight:600;
}

.fm-navitem:hover{
  background: rgba(15,46,77,.05);
  border-color: transparent;
  text-decoration:none;
}

.fm-navitem.active,
.fm-navitem.is-active{
  background: #fff;
  border-color: rgba(15,46,77,.06);
  box-shadow: 0 6px 16px rgba(15,46,77,.08);
  border-left: 3px solid var(--fm-iq-blue);
  color:var(--fm-navy);
  padding-left:9px;
}

.fm-main{
  flex: 1 1 auto;
  min-width:0;
  min-height: 100vh;
  padding: 12px 14px;
}

.fm-topbar,
.fm-header{
  background:#fff;
  border:1px solid rgba(15,46,77,.08);
  border-radius: var(--fm-radius);
  box-shadow: 0 6px 16px rgba(15,46,77,.06);
  padding:10px 12px;
  display:grid;
  grid-template-columns: minmax(120px, auto) minmax(220px, 1fr) auto;
  gap:12px;
  align-items:center;
  margin-bottom: 14px;
}

.fm-topbar-title{
  margin:0;
  font-size: 20px;
}

.fm-title{
  margin: 0;
  font-size: 20px;
}

.fm-headleft{ min-width: 0; }
.fm-headmiddle{ min-width: 0; }
.fm-headright{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:nowrap;
  white-space:nowrap;
  min-width:0;
  justify-self:end;
}

.fm-org-context{
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.fm-org-context__name{
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 700 12px/1.2 Inter, Tahoma, sans-serif;
  color: rgba(15,46,77,.72);
}

.fm-org-switch{
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid rgba(15,46,77,.16);
  background: #fff;
  color: #0F2E4D;
  font: 700 11px/1 Inter, Tahoma, sans-serif;
  text-decoration: none;
}

.fm-org-switch:hover{
  background: rgba(15,46,77,.04);
  text-decoration: none;
}

.fm-render-stamp{
  display:none;
  font-size:11px;
  font-weight:700;
  color:var(--fm-muted);
  white-space:nowrap;
  max-width:220px;
  overflow:hidden;
  text-overflow:ellipsis;
}

body.fm-debug-shell .fm-render-stamp{
  display:inline-flex;
}

.fm-version-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  max-width:260px;
  padding:8px 10px;
  border:1px solid var(--fm-border);
  border-radius:999px;
  background:rgba(255,255,255,.9);
  color:var(--fm-text);
  font-size:11px;
  font-weight:700;
  line-height:1;
  white-space:nowrap;
}

.fm-version-chip__label{
  color:var(--fm-muted);
  text-transform:uppercase;
  letter-spacing:.06em;
}

.fm-version-chip__value{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
}

.fm-headsearch{
  width:100%;
  border:1px solid var(--fm-border);
  border-radius: var(--fm-radius);
  padding:10px 12px;
  background:#fff;
  color: var(--fm-text);
  font-family: Tahoma, sans-serif;
}

.fm-search{
  width:100%;
  border:1px solid var(--fm-border);
  border-radius: var(--fm-radius);
  padding:10px 12px;
  background:#fff;
  color: var(--fm-text);
}

.fm-actions{
  display:flex;
  gap:8px;
  align-items:center;
}

.fm-card{
  background: var(--fm-card);
  border:none;
  border-radius: var(--fm-radius);
  box-shadow: 0 10px 24px rgba(15,46,77,.08);
  padding:18px;
}

.fm-btn{
  border-radius: var(--fm-radius);
  border:1px solid var(--fm-border);
  padding:10px 12px;
  background:#fff;
  color: var(--fm-text);
  font-family: Tahoma, sans-serif;
  font-weight: 600;
  cursor:pointer;
}
.fm-btn:hover{ filter: brightness(0.98); }
.fm-btn.primary{ background: var(--fm-navy); color:#fff; border-color: var(--fm-navy); }
.fm-btn.danger{ background: var(--fm-red); color:#fff; border-color: var(--fm-red); }
.fm-btn.iq{ background: var(--fm-iq-blue); color:#fff; border-color: var(--fm-iq-blue); }
.fm-btn.secondary{ background: transparent; color: var(--fm-text); border-color: var(--fm-border); }

.fm-input{
  border:1px solid var(--fm-border);
  border-radius: var(--fm-radius);
  padding:10px 12px;
  font-family: Tahoma, sans-serif;
  background:#fff;
  color: var(--fm-text);
}

.fm-chip,
.fm-badge{
  display:inline-flex;
  align-items:center;
  border-radius:999px;
  padding:6px 12px;
  font-size:13px;
  font-weight:600;
  border:0;
}
.fm-chip.red,
.fm-badge.red{
  background: rgba(198,40,40,.12);
  color:#C62828;
}
.fm-chip.blue,
.fm-badge.blue{
  background: rgba(15,46,77,.12);
  color:#0F2E4D;
}
.fm-chip.amber,
.fm-badge.amber{
  background: rgba(217,164,65,.18);
  color:#A06B00;
}
.fm-chip.green,
.fm-badge.green{
  background: rgba(46,139,87,.18);
  color:#1F6E45;
}
.fm-chip.gray,
.fm-badge.gray{
  background: rgba(107,114,128,.14);
  color:#4b5563;
}

.fm-kebab{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border:1px solid var(--fm-border);
  background:#fff;
  cursor:pointer;
  font-size: 18px;
  line-height: 1;
}

.fm-content{
  min-width:0;
}

body[data-page="pipeline"] .fm-sidebar{
  background:#F8F9FB;
  color:var(--fm-navy);
  border-right:1px solid rgba(15,46,77,.08);
}
body[data-page="pipeline"] .fm-brandname{
  color:var(--fm-navy);
}
body[data-page="pipeline"] .fm-brandtag{
  color:rgba(15,46,77,.62);
}
body[data-page="pipeline"] .fm-navitem{
  color:var(--fm-navy);
}
body[data-page="pipeline"] .fm-navitem:hover{
  background:rgba(15,46,77,.05);
  border-color:transparent;
}
body[data-page="pipeline"] .fm-navitem.active,
body[data-page="pipeline"] .fm-navitem.is-active{
  background:#fff;
  border-color:rgba(15,46,77,.06);
  box-shadow:0 6px 16px rgba(15,46,77,.08);
  color:var(--fm-navy);
}

body[data-page="pipeline"] .summaryBar .summaryChip,
body[data-page="pipeline"] .mobileTabs .mobileTab{
  border:0;
  border-radius:999px;
  padding:6px 12px;
  font-size:13px;
  font-weight:600;
}
body[data-page="pipeline"] .summaryBar .summaryChip[data-stage="new_lead"],
body[data-page="pipeline"] .mobileTabs .mobileTab[data-stage="new_lead"]{
  background:rgba(198,40,40,.12);
  color:#C62828;
}
body[data-page="pipeline"] .summaryBar .summaryChip[data-stage="qualified"],
body[data-page="pipeline"] .mobileTabs .mobileTab[data-stage="qualified"]{
  background:rgba(15,46,77,.12);
  color:#0F2E4D;
}
body[data-page="pipeline"] .summaryBar .summaryChip[data-stage="job_walk_scheduled"],
body[data-page="pipeline"] .summaryBar .summaryChip[data-stage="job_walk"],
body[data-page="pipeline"] .summaryBar .summaryChip[data-stage="proposal_sent"],
body[data-page="pipeline"] .summaryBar .summaryChip[data-stage="awaiting_approval"],
body[data-page="pipeline"] .summaryBar .summaryChip[data-stage="estimating"],
body[data-page="pipeline"] .mobileTabs .mobileTab[data-stage="job_walk_scheduled"],
body[data-page="pipeline"] .mobileTabs .mobileTab[data-stage="job_walk"],
body[data-page="pipeline"] .mobileTabs .mobileTab[data-stage="proposal_sent"],
body[data-page="pipeline"] .mobileTabs .mobileTab[data-stage="awaiting_approval"],
body[data-page="pipeline"] .mobileTabs .mobileTab[data-stage="estimating"]{
  background:rgba(217,164,65,.18);
  color:#A06B00;
}
body[data-page="pipeline"] .summaryBar .summaryChip[data-stage="approved"],
body[data-page="pipeline"] .mobileTabs .mobileTab[data-stage="approved"]{
  background:rgba(46,139,87,.18);
  color:#1F6E45;
}
body[data-page="pipeline"] .summaryBar .summaryChip[data-stage="lost"],
body[data-page="pipeline"] .mobileTabs .mobileTab[data-stage="lost"]{
  background:rgba(198,40,40,.16);
  color:#B71C1C;
}
body[data-page="pipeline"] .summaryBar .summaryChip.active,
body[data-page="pipeline"] .mobileTabs .mobileTab.active{
  box-shadow:0 4px 12px rgba(15,46,77,.12);
}

body[data-page="pipeline"] [data-col-stage] .colTitle{
  display:inline-flex;
  align-items:center;
  min-height:34px;
  padding:0 14px;
  border-radius:11px;
  font-size:12px;
  font-weight:700;
  letter-spacing:.02em;
  text-transform:none;
  margin-bottom:10px;
}
body[data-page="pipeline"] [data-col-stage="new_lead"] .colTitle{
  background:rgba(198,40,40,.12);
  color:#C62828;
}
body[data-page="pipeline"] [data-col-stage="qualified"] .colTitle{
  background:rgba(15,46,77,.12);
  color:#0F2E4D;
}
body[data-page="pipeline"] [data-col-stage="job_walk_scheduled"] .colTitle,
body[data-page="pipeline"] [data-col-stage="job_walk"] .colTitle,
body[data-page="pipeline"] [data-col-stage="estimating"] .colTitle,
body[data-page="pipeline"] [data-col-stage="proposal_sent"] .colTitle,
body[data-page="pipeline"] [data-col-stage="awaiting_approval"] .colTitle{
  background:rgba(217,164,65,.18);
  color:#A06B00;
}
body[data-page="pipeline"] [data-col-stage="approved"] .colTitle{
  background:rgba(46,139,87,.18);
  color:#1F6E45;
}
body[data-page="pipeline"] [data-col-stage="lost"] .colTitle{
  background:rgba(198,40,40,.16);
  color:#B71C1C;
}

.viewToggle{
  display:inline-flex;
  align-items:center;
  border:1px solid var(--fm-border);
  border-radius:10px;
  overflow:hidden;
  background:#f8fafc;
}

.viewBtn{
  border:0;
  background:transparent;
  color:var(--fm-muted);
  font-family:Tahoma,sans-serif;
  font-size:13px;
  font-weight:700;
  line-height:1;
  padding:8px 12px;
  cursor:pointer;
  white-space:nowrap;
}

.viewBtn + .viewBtn{
  border-left:1px solid var(--fm-border);
}

.viewBtn.active{
  background:#fff;
  color:var(--fm-text);
}

.viewBtn[aria-disabled="true"]{
  opacity:0.65;
}

.newMenu{
  position:relative;
}

.newMenu summary{
  list-style:none;
  white-space:nowrap;
}

.newMenu summary::-webkit-details-marker{
  display:none;
}

.newMenuList{
  position:absolute;
  right:0;
  top:42px;
  min-width:178px;
  z-index:40;
  display:none;
  flex-direction:column;
  gap:6px;
  padding:8px;
}

.newMenu[open] .newMenuList{
  display:flex;
}

body[data-page="projects"] #fmPageContent .projectsCard{
  background:var(--fm-card);
  border:1px solid var(--fm-border);
  border-radius:var(--fm-radius);
  box-shadow:var(--fm-shadow-sm);
}

body[data-page="projects"] #fmPageContent .row{
  background:#fff;
  border:1px solid var(--fm-border);
  border-radius:var(--fm-radius);
  box-shadow:var(--fm-shadow-sm);
}

@media (max-width: 900px){
  .fm-topbar,
  .fm-header{ grid-template-columns: 1fr; }
}

@media (max-width: 720px){
  .fm-shell,
  .fm-app{
    flex-direction: column;
  }
  .fm-sidebar{
    position: static;
    width: 100%;
    min-width: 0;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid #0c243d;
  }
  .fm-sidebar .fm-brand-badge{
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }
  .fm-sidebar .fm-brandname{
    font-size: 16px;
  }
}

/* FAB v3 takeover */
body #globalFabRoot{
  display:none !important;
}
body .fm-fab{
  position:fixed;
  right:18px;
  bottom:64px;
  z-index:10000;
}
body .fm-fab .fm-fab__main{
  width:56px;
  height:56px;
  border-radius:50%;
  border:1px solid var(--fm-navy,#0F2E4D);
  background:var(--fm-navy,#0F2E4D);
  color:#fff;
  font-size:24px;
  font-weight:900;
  line-height:1;
  cursor:pointer;
  box-shadow:var(--fm-shadow,0 6px 18px rgba(0,0,0,.06));
}
body .fm-fab .fm-fab__main:focus{
  outline:2px solid rgba(46,163,255,.35);
  outline-offset:2px;
}
body .fm-fab .fm-fab__panel{
  position:fixed;
  right:18px;
  bottom:130px;
  width:240px;
  max-width:calc(100vw - 24px);
  display:none;
  background:#fff;
  border:1px solid rgba(15,46,77,.10);
  border-radius:12px;
  box-shadow:0 16px 32px rgba(0,0,0,.12);
  overflow:hidden;
}
body .fm-fab .fm-fab__title{
  font-size:12px;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:rgba(15,46,77,.55);
  font-weight:700;
  padding:10px 12px;
}
body .fm-fab .fm-fab__row{
  width:100%;
  border:0;
  background:transparent;
  color:#1F2933;
  text-align:left;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  font:600 14px Tahoma,sans-serif;
  box-shadow:none;
  border-radius:0;
  cursor:pointer;
}
body .fm-fab .fm-fab__row + .fm-fab__row{
  border-top:1px solid rgba(15,46,77,.08);
}
body .fm-fab .fm-fab__row:hover{
  background:rgba(15,46,77,.04);
}
body .fm-fab .fm-fab__icon{
  width:26px;
  height:26px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:13px;
  line-height:1;
}
body .fm-fab .fm-accent--blue{ background:var(--fm-blue-soft,rgba(46,163,255,.14)); color:#0F2E4D; }
body .fm-fab .fm-accent--green{ background:var(--fm-green-soft,rgba(46,125,50,.16)); color:#1F6E45; }
body .fm-fab .fm-accent--amber{ background:var(--fm-amber-soft,rgba(249,168,37,.18)); color:#A06B00; }
body .fm-fab .fm-accent--purple{ background:var(--fm-purple-soft,rgba(123,97,255,.16)); color:#5843bf; }
body .fm-fab #fmFabBackdrop{
  position:fixed;
  inset:0;
  background:transparent;
  display:none;
  z-index:9999;
}
body .fm-fab .fm-fab-debug-badge{
  position:fixed;
  right:18px;
  bottom:40px;
  font:700 11px/1 Tahoma,sans-serif;
  color:#fff;
  background:#111827;
  border:1px solid #ef4444;
  border-radius:999px;
  padding:4px 8px;
  z-index:10001;
}
body .fm-fab.is-open .fm-fab__panel{
  display:block;
}
body.fm-debug-fab .fm-fab.is-open .fm-fab__panel{
  outline:2px solid #ef4444;
  outline-offset:2px;
}
@media (max-width:640px){
  body .fm-fab{
    right:12px;
    bottom:56px;
  }
  body .fm-fab .fm-fab__panel{
    right:12px;
    bottom:120px;
    width:min(228px,calc(100vw - 24px));
  }
  body .fm-fab .fm-fab-debug-badge{
    right:12px;
  }
}

/* FM CHIP SYSTEM + TOOLBAR PARITY (high specificity, keep last) */
body .fm-chip,
body .fm-badge,
body[data-page="pipeline"] .summaryBar .summaryChip,
body[data-page="pipeline"] .mobileTabs .mobileTab,
body[data-page="pipeline"] [data-col-stage] .colTitle,
body[data-page="contacts"] .chipRow .chip,
body[data-page="projects"] .projectStatus{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  height:34px;
  padding:0 14px;
  border-radius:11px;
  border:1px solid rgba(15,46,77,.08);
  background:#fff;
  color:rgba(15,46,77,.70);
  font:600 13px Inter, Tahoma, sans-serif;
  white-space:nowrap;
  box-shadow:none;
}

body .fm-chip.fm-chip--lead,
body .fm-badge.red,
body[data-page="pipeline"] .summaryBar .summaryChip[data-stage="new_lead"],
body[data-page="pipeline"] .mobileTabs .mobileTab[data-stage="new_lead"],
body[data-page="pipeline"] [data-col-stage="new_lead"] .colTitle{
  background:rgba(198,40,40,.14);
  color:#C62828;
  border-color:rgba(198,40,40,.22);
}

body .fm-chip.fm-chip--qualified,
body .fm-badge.blue,
body[data-page="pipeline"] .summaryBar .summaryChip[data-stage="qualified"],
body[data-page="pipeline"] .mobileTabs .mobileTab[data-stage="qualified"],
body[data-page="pipeline"] [data-col-stage="qualified"] .colTitle{
  background:rgba(15,46,77,.10);
  color:#0F2E4D;
  border-color:rgba(15,46,77,.16);
}

body .fm-chip.fm-chip--estimating,
body .fm-badge.amber,
body[data-page="pipeline"] .summaryBar .summaryChip[data-stage="estimating"],
body[data-page="pipeline"] .summaryBar .summaryChip[data-stage="job_walk_scheduled"],
body[data-page="pipeline"] .summaryBar .summaryChip[data-stage="job_walk"],
body[data-page="pipeline"] .summaryBar .summaryChip[data-stage="proposal_sent"],
body[data-page="pipeline"] .mobileTabs .mobileTab[data-stage="estimating"],
body[data-page="pipeline"] .mobileTabs .mobileTab[data-stage="job_walk_scheduled"],
body[data-page="pipeline"] .mobileTabs .mobileTab[data-stage="job_walk"],
body[data-page="pipeline"] .mobileTabs .mobileTab[data-stage="proposal_sent"],
body[data-page="pipeline"] [data-col-stage="estimating"] .colTitle,
body[data-page="pipeline"] [data-col-stage="job_walk_scheduled"] .colTitle,
body[data-page="pipeline"] [data-col-stage="job_walk"] .colTitle,
body[data-page="pipeline"] [data-col-stage="proposal_sent"] .colTitle{
  background:rgba(217,164,65,.20);
  color:#8A5A00;
  border-color:rgba(217,164,65,.24);
}

body .fm-chip.fm-chip--approved,
body .fm-badge.green,
body[data-page="pipeline"] .summaryBar .summaryChip[data-stage="approved"],
body[data-page="pipeline"] .mobileTabs .mobileTab[data-stage="approved"],
body[data-page="pipeline"] [data-col-stage="approved"] .colTitle{
  background:rgba(46,139,87,.18);
  color:#1F6E45;
  border-color:rgba(46,139,87,.22);
}

body .fm-chip.fm-chip--pending,
body[data-page="pipeline"] .summaryBar .summaryChip[data-stage="awaiting_approval"],
body[data-page="pipeline"] .mobileTabs .mobileTab[data-stage="awaiting_approval"],
body[data-page="pipeline"] [data-col-stage="awaiting_approval"] .colTitle{
  background:rgba(217,164,65,.14);
  color:#8A5A00;
  border-color:rgba(217,164,65,.20);
}

body .fm-chip.fm-chip--lost,
body .fm-chip.fm-chip--blocked,
body[data-page="pipeline"] .summaryBar .summaryChip[data-stage="lost"],
body[data-page="pipeline"] .mobileTabs .mobileTab[data-stage="lost"],
body[data-page="pipeline"] [data-col-stage="lost"] .colTitle{
  background:rgba(198,40,40,.12);
  color:#B71C1C;
  border-color:rgba(198,40,40,.18);
}

body .fm-chip.fm-chip--neutral,
body .fm-badge.gray,
body[data-page="projects"] .projectStatus[data-status="unknown"]{
  background:rgba(15,46,77,.06);
  color:rgba(15,46,77,.70);
  border-color:rgba(15,46,77,.10);
}

body[data-page="projects"] .projectStatus[data-status="active"]{
  background:rgba(15,46,77,.10);
  color:#0F2E4D;
  border-color:rgba(15,46,77,.16);
}
body[data-page="projects"] .projectStatus[data-status="planning"]{
  background:rgba(217,164,65,.14);
  color:#8A5A00;
  border-color:rgba(217,164,65,.20);
}
body[data-page="projects"] .projectStatus[data-status="completed"]{
  background:rgba(46,139,87,.18);
  color:#1F6E45;
  border-color:rgba(46,139,87,.22);
}
body[data-page="projects"] .projectStatus[data-status="blocked"]{
  background:rgba(198,40,40,.12);
  color:#B71C1C;
  border-color:rgba(198,40,40,.18);
}

body[data-page="contacts"] .chipRow .chip{
  background:rgba(15,46,77,.06);
  color:rgba(15,46,77,.74);
  border-color:rgba(15,46,77,.12);
  font-weight:600;
}
body[data-page="contacts"] .chipRow .chip:hover{
  background:rgba(15,46,77,.09);
}
body[data-page="contacts"] .chipRow .chip.active{
  background:rgba(46,163,255,.14);
  border-color:rgba(46,163,255,.30);
  color:#0F2E4D;
}

body[data-page="pipeline"] .summaryBar .summaryChip.active,
body[data-page="pipeline"] .mobileTabs .mobileTab.active{
  background:rgba(46,163,255,.14);
  border-color:rgba(46,163,255,.30);
  color:#0F2E4D;
}

body .viewToggle{
  border:1px solid rgba(15,46,77,.12);
  border-radius:11px;
  background:#fff;
  overflow:hidden;
}
body .viewToggle .viewBtn{
  min-height:38px;
  height:38px;
  padding:0 14px;
  border:0;
  border-radius:0;
  font:600 13px Inter, Tahoma, sans-serif;
  color:rgba(15,46,77,.72);
  background:transparent;
}
body .viewToggle .viewBtn + .viewBtn{
  border-left:1px solid rgba(15,46,77,.10);
}
body .viewToggle .viewBtn.active{
  background:rgba(15,46,77,.10);
  color:#0F2E4D;
}
body .newMenu > summary.fm-btn,
body .fm-headright .fm-btn.primary{
  min-height:38px;
  height:38px;
  padding:0 14px;
  border-radius:11px;
  font:600 13px Inter, Tahoma, sans-serif;
  line-height:38px;
  white-space:nowrap;
}

/* CHIP TAKEOVER (final override) */
body .fm-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:34px;
  padding:0 14px;
  border-radius:12px;
  font-family:Inter, Tahoma, sans-serif;
  font-weight:600;
  font-size:13px;
  border:1px solid rgba(15,46,77,.10);
  background:#fff;
  color:rgba(15,46,77,.88);
}

body .fm-chip[data-variant="lead"],
body .fm-chip.fm-chip--lead{
  background-color:rgba(198,40,40,.14) !important;
  color:#C62828 !important;
  border-color:rgba(198,40,40,.22) !important;
}
body .fm-chip[data-variant="qualified"],
body .fm-chip.fm-chip--qualified{
  background-color:rgba(15,46,77,.10) !important;
  color:#0F2E4D !important;
  border-color:rgba(15,46,77,.16) !important;
}
body .fm-chip[data-variant="estimating"],
body .fm-chip.fm-chip--estimating{
  background-color:rgba(217,164,65,.20) !important;
  color:#8A5A00 !important;
  border-color:rgba(217,164,65,.24) !important;
}
body .fm-chip[data-variant="approved"],
body .fm-chip.fm-chip--approved{
  background-color:rgba(46,139,87,.18) !important;
  color:#1F6E45 !important;
  border-color:rgba(46,139,87,.22) !important;
}
body .fm-chip[data-variant="pending"],
body .fm-chip.fm-chip--pending{
  background-color:rgba(217,164,65,.14) !important;
  color:#8A5A00 !important;
  border-color:rgba(217,164,65,.18) !important;
}
body .fm-chip[data-variant="lost"],
body .fm-chip[data-variant="blocked"],
body .fm-chip.fm-chip--lost,
body .fm-chip.fm-chip--blocked{
  background-color:rgba(198,40,40,.12) !important;
  color:#B71C1C !important;
  border-color:rgba(198,40,40,.18) !important;
}
body .fm-chip[data-variant="neutral"],
body .fm-chip.fm-chip--neutral{
  background-color:rgba(15,46,77,.06) !important;
  color:rgba(15,46,77,.78) !important;
  border-color:rgba(15,46,77,.10) !important;
}

body .fm-chip.fm-chip--filter{
  cursor:pointer;
  transition:background-color .15s ease;
}
body .fm-chip.fm-chip--filter:hover{
  background-color:rgba(15,46,77,.04) !important;
}
body .fm-chip.fm-chip--filter.is-active,
body .fm-chip.fm-chip--filter.active,
body .fm-chip.fm-chip--filter[aria-current="true"]{
  background-color:rgba(46,163,255,.16) !important;
  border-color:rgba(46,163,255,.30) !important;
  color:#0F2E4D !important;
}

/* FAB TAKEOVER FINAL (render parity) */
body .fm-fab .fm-fab__panel{
  background:#fff !important;
  border:1px solid rgba(15,46,77,.10) !important;
  border-radius:12px !important;
  box-shadow:0 18px 36px rgba(0,0,0,.12) !important;
  padding:8px 0 !important;
  width:240px !important;
  max-width:calc(100vw - 24px) !important;
}
body .fm-fab .fm-fab__title{
  padding:8px 14px !important;
  font-size:12px !important;
  letter-spacing:.08em !important;
  color:rgba(15,46,77,.55) !important;
  font-weight:700 !important;
  text-transform:uppercase !important;
}
body .fm-fab .fm-fab__row{
  display:flex !important;
  align-items:center !important;
  gap:10px !important;
  width:100% !important;
  padding:10px 14px !important;
  background:transparent !important;
  background-color:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  border-radius:0 !important;
  color:#0F2E4D !important;
  font:600 14px Tahoma,sans-serif !important;
}
body .fm-fab .fm-fab__row + .fm-fab__row{
  border-top:1px solid rgba(15,46,77,.08) !important;
}
body .fm-fab .fm-fab__row:hover{
  background:rgba(15,46,77,.04) !important;
}
body .fm-fab .fm-fab__icon{
  width:26px !important;
  height:26px !important;
  border-radius:999px !important;
  display:grid !important;
  place-items:center !important;
  font-size:14px !important;
  line-height:1 !important;
}
body .fm-fab .fm-fab__icon--lead{
  background:rgba(198,40,40,.14) !important;
  color:#C62828 !important;
}
body .fm-fab .fm-fab__icon--task{
  background:rgba(46,163,255,.16) !important;
  color:#2EA3FF !important;
}
body .fm-fab .fm-fab__icon--note{
  background:rgba(217,164,65,.20) !important;
  color:#8A5A00 !important;
}
body .fm-fab .fm-fab__icon--photo{
  background:rgba(46,139,87,.18) !important;
  color:#1F6E45 !important;
}

/* FAB SPEED-DIAL (screenshot parity) */
body .fm-fab[data-variant="speed-dial"] .fm-fab__panel{
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  padding:0 !important;
  width:auto !important;
  min-width:0 !important;
}
body .fm-fab[data-variant="speed-dial"] .fm-fab__title{
  display:none !important;
}
body .fm-fab[data-variant="speed-dial"] .fm-fab__stack{
  display:flex !important;
  flex-direction:column !important;
  gap:10px !important;
  align-items:flex-end !important;
}
body .fm-fab[data-variant="speed-dial"] .fm-fab-pill{
  height:44px !important;
  padding:0 16px !important;
  border-radius:999px !important;
  border:1px solid rgba(255,255,255,.22) !important;
  box-shadow:0 10px 24px rgba(15,46,77,.18) !important;
  display:flex !important;
  align-items:center !important;
  gap:10px !important;
  font:700 14px Inter, Tahoma, sans-serif !important;
  color:#fff !important;
  background:#0F2E4D !important;
  white-space:nowrap !important;
  cursor:pointer !important;
  transform:translateY(8px) scale(.98);
  opacity:0;
  transition:transform .18s ease, opacity .18s ease, filter .15s ease;
}
body .fm-fab[data-variant="speed-dial"].is-open .fm-fab-pill{
  transform:translateY(0) scale(1);
  opacity:1;
}
body .fm-fab[data-variant="speed-dial"] .fm-fab-pill:hover{
  filter:brightness(1.03);
}
body .fm-fab[data-variant="speed-dial"] .fm-fab-pill__icon{
  width:28px !important;
  height:28px !important;
  border-radius:999px !important;
  display:grid !important;
  place-items:center !important;
  background:rgba(255,255,255,.18) !important;
  color:#fff !important;
  font-size:15px !important;
  line-height:1 !important;
}
body .fm-fab[data-variant="speed-dial"] .fm-fab-pill__label{
  color:#fff !important;
}
body .fm-fab[data-variant="speed-dial"] .fm-fab-pill--lead{
  background:#E06A2B !important;
}
body .fm-fab[data-variant="speed-dial"] .fm-fab-pill--task{
  background:#1E9E8C !important;
}
body .fm-fab[data-variant="speed-dial"] .fm-fab-pill--note{
  background:#2E5BFF !important;
}
body .fm-fab[data-variant="speed-dial"] .fm-fab-pill--photo{
  background:#7A3FF0 !important;
}

/* LAYOUT + RESPONSIVE CONSISTENCY */
body{
  overflow-x:hidden;
}
body .fm-content,
body .page,
body .wrap{
  max-width:1180px;
  margin:0 auto;
  padding:18px 18px 28px;
}
@media (max-width: 900px){
  body .fm-content,
  body .page,
  body .wrap{
    max-width:100%;
    padding:12px 12px 20px;
  }
  body[data-page="pipeline"] .gridWrap{
    overflow-x:visible !important;
  }
  body[data-page="pipeline"] .grid{
    grid-template-columns:1fr !important;
    min-width:0 !important;
  }
  body[data-page="pipeline"] [data-col-stage]{
    width:100%;
  }
}

/* UNIFIED SURFACES */
body .fm-card,
body[data-page="projects"] .projectsCard,
body[data-page="projects"] .row,
body[data-page="pipeline"] .card,
body[data-page="contacts"] .table,
body[data-page="contacts"] .groupBlock{
  background:#fff !important;
  border:1px solid rgba(15,46,77,.10) !important;
  border-radius:12px !important;
  box-shadow:0 10px 24px rgba(15,46,77,.08) !important;
}
body[data-page="pipeline"] .leadName,
body[data-page="projects"] .name{
  font-family:Inter, Tahoma, sans-serif;
  font-weight:700;
  font-size:17px;
  color:#0F2E4D;
}
body[data-page="pipeline"] .meta,
body[data-page="projects"] .muted,
body[data-page="contacts"] .contactCardMeta{
  color:rgba(15,46,77,.65) !important;
  font-size:13px;
}
body[data-page="pipeline"] .small,
body[data-page="pipeline"] .scopePreview,
body[data-page="projects"] .hint{
  color:rgba(15,46,77,.55) !important;
}

/* CONTACTS TABLE PARITY */
body[data-page="contacts"] .table{
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
}
body[data-page="contacts"] .table th{
  background:#f8fafc;
  color:#0F2E4D;
  border-bottom:1px solid rgba(15,46,77,.10);
  font:700 13px Inter, Tahoma, sans-serif;
  padding:12px 14px;
}
body[data-page="contacts"] .table td{
  padding:12px 14px;
  border-bottom:1px solid rgba(15,46,77,.08);
}

/* FAB MAIN BUTTON REFINEMENT */
body .fm-fab .fm-fab__main{
  width:56px !important;
  height:56px !important;
  border-radius:999px !important;
  display:grid !important;
  place-items:center !important;
  line-height:1 !important;
  box-shadow:0 10px 24px rgba(15,46,77,.22) !important;
  border:1px solid rgba(15,46,77,.24) !important;
}

/* KEBAB MINIMAL STYLE MAPPING */
body .fm-kebab,
body .kebabBtn,
body [data-menu],
body [data-contact-menu]{
  width:32px !important;
  height:32px !important;
  min-width:32px !important;
  border-radius:999px !important;
  border:none !important;
  background:transparent !important;
  color:rgba(15,46,77,.65) !important;
  display:grid !important;
  place-items:center !important;
  box-shadow:none !important;
  padding:0 !important;
  font-size:18px !important;
  line-height:1 !important;
}
body .fm-kebab:hover,
body .kebabBtn:hover,
body [data-menu]:hover,
body [data-contact-menu]:hover{
  background:rgba(15,46,77,.06) !important;
}

/* PIPELINE CARD + HEADER POLISH */
body[data-page="pipeline"] .summaryBar{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:12px;
  margin-bottom:20px;
}
body[data-page="pipeline"] .summaryBar .summaryChip{
  margin:0 !important;
}
body[data-page="pipeline"] .fm-header{
  padding:12px 14px;
}
body[data-page="pipeline"] .fm-headright{
  align-items:center;
  gap:8px;
}
body[data-page="pipeline"] .viewToggle{
  gap:0;
}
body[data-page="pipeline"] .viewToggle .viewBtn{
  height:38px;
  min-height:38px;
  padding:0 12px;
  font-size:12px;
}
body[data-page="pipeline"] .newMenu > summary.fm-btn{
  height:38px;
  min-height:38px;
  padding:0 12px;
}

body[data-page="pipeline"] .card{
  padding:14px;
}
body[data-page="pipeline"] .cardTop{
  align-items:flex-start;
  gap:12px;
}
body[data-page="pipeline"] .fm-card-header{
  display:flex;
  align-items:flex-start;
  gap:10px;
  min-width:0;
}
body[data-page="pipeline"] .fm-card-header-text{
  min-width:0;
}
body[data-page="pipeline"] .fm-avatar{
  width:36px;
  height:36px;
  border-radius:999px;
  background:rgba(15,46,77,.10);
  flex-shrink:0;
}
body[data-page="pipeline"] .leadName{
  font-family:Inter, Tahoma, sans-serif;
  font-weight:700;
  font-size:17px;
  color:#0F2E4D;
  line-height:1.2;
  margin:0;
}
body[data-page="pipeline"] .meta{
  margin-top:6px;
  color:rgba(15,46,77,.65);
  font-size:13px;
}
body[data-page="pipeline"] .small,
body[data-page="pipeline"] .scopePreview{
  color:rgba(15,46,77,.55);
}

/* Pipeline list mode + header quick add parity */
body[data-page="pipeline"] .listWrap{
  display:none;
}
body[data-page="pipeline"].mobile-list .listWrap{
  display:block;
}
body[data-page="pipeline"] .listStageGroup{
  display:grid;
  gap:10px;
  margin-bottom:14px;
}
body[data-page="pipeline"] .listStageTitle{
  font:700 12px Inter, Tahoma, sans-serif;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:rgba(15,46,77,.64);
  padding:2px 2px 0;
}

body .fm-header-quickadd-trigger{
  width:38px;
  height:38px;
  min-width:38px;
  border-radius:999px;
  border:1px solid rgba(15,46,77,.24);
  background:#0F2E4D;
  color:#fff;
  font:900 20px/1 Tahoma,sans-serif;
  display:grid;
  place-items:center;
  cursor:pointer;
  box-shadow:0 8px 18px rgba(15,46,77,.24);
}
body .fm-headright{
  position:relative;
}
body .fm-header-quickadd-panel{
  position:absolute;
  right:0;
  top:46px;
  z-index:60;
  display:none;
  max-width:min(320px, calc(100vw - 24px));
}
body .fm-header-quickadd-panel.is-open{
  display:block;
}
body .fm-header-quickadd-panel .fm-fab__stack{
  align-items:stretch;
  width:min(320px, calc(100vw - 24px));
}
body .fm-header-quickadd-panel .fm-fab-pill{
  height:38px !important;
  padding:0 13px !important;
  font-size:13px !important;
  box-shadow:0 8px 18px rgba(15,46,77,.18) !important;
  width:100% !important;
  justify-content:flex-start !important;
  white-space:normal !important;
  line-height:1.2 !important;
  min-height:38px !important;
  height:auto !important;
}
body .fm-header-quickadd-panel .fm-fab-pill__icon{
  width:24px !important;
  height:24px !important;
  font-size:13px !important;
}

@media (max-width: 900px){
  body .fm-header-quickadd-panel{
    right:0;
    left:auto;
    max-width:min(300px, calc(100vw - 24px));
  }
  body .fm-header-quickadd-panel .fm-fab__stack{
    width:min(300px, calc(100vw - 24px));
  }
}

/* VISUAL POLISH PASS #1: unified pipeline/projects/contacts */
body{
  overflow-x:hidden !important;
}

body .fm-main{
  padding:14px 16px !important;
}

body .fm-content,
body .page,
body .wrap{
  max-width:1160px !important;
  margin:0 auto !important;
  padding:18px 18px 28px !important;
}

body .fm-header{
  margin-bottom:12px !important;
  padding:10px 12px !important;
  gap:10px !important;
  grid-template-columns:minmax(120px,auto) minmax(220px,1fr) auto !important;
  box-shadow:0 6px 14px rgba(15,46,77,.05) !important;
}

body .fm-title{
  margin:0 !important;
  font:800 22px/1.15 Inter, Tahoma, sans-serif !important;
  color:#0F2E4D !important;
}

body .fm-headsearch,
body .fm-search,
body .fm-input{
  min-height:40px !important;
  height:40px !important;
  border-radius:12px !important;
  border:1px solid rgba(15,46,77,.12) !important;
  box-shadow:none !important;
  padding:0 12px !important;
}

body .fm-btn,
body .btn,
body .viewBtn{
  min-height:40px !important;
  height:40px !important;
  border-radius:12px !important;
  font-weight:700 !important;
  border-width:1px !important;
  box-shadow:none !important;
}

body .fm-btn.secondary,
body .btn.secondary{
  background:#fff !important;
  color:#0F2E4D !important;
  border-color:rgba(15,46,77,.14) !important;
}

body .fm-btn.secondary:hover,
body .btn.secondary:hover{
  background:rgba(15,46,77,.04) !important;
}

body .fm-card,
body[data-page="projects"] .projectsCard,
body[data-page="projects"] .row,
body[data-page="pipeline"] .card,
body[data-page="contacts"] .table,
body[data-page="contacts"] .groupBlock,
body[data-page="contacts"] .contactCard{
  background:#fff !important;
  border:1px solid rgba(15,46,77,.10) !important;
  border-radius:12px !important;
  box-shadow:0 10px 20px rgba(15,46,77,.06) !important;
}

body[data-page="projects"] .projectsCard,
body[data-page="projects"] .row,
body[data-page="pipeline"] .card{
  padding:16px !important;
}

body[data-page="pipeline"] .cardBtns{
  gap:8px !important;
}

body[data-page="pipeline"] .cardBtns .btn{
  min-height:40px !important;
  height:40px !important;
  border-radius:12px !important;
  padding:0 12px !important;
}

body[data-page="pipeline"] .cardBtns .btn:nth-child(2){
  background:#fff !important;
  color:#0F2E4D !important;
  border-color:rgba(15,46,77,.14) !important;
}

@media (min-width: 901px){
  body[data-page="pipeline"] .listStageGroup{
    max-width: 760px;
  }
  body[data-page="pipeline"] #listBody .card,
  body[data-page="pipeline"] .listStageGroup .card{
    max-width: 760px;
    width: 100%;
  }
}

body .fm-kebab,
body .kebabBtn,
body button[data-menu],
body button[data-contact-menu]{
  width:28px !important;
  height:28px !important;
  min-width:28px !important;
  min-height:28px !important;
  border-radius:999px !important;
  border:none !important;
  background:transparent !important;
  color:rgba(15,46,77,.55) !important;
  box-shadow:none !important;
  outline:none !important;
  display:grid !important;
  place-items:center !important;
  padding:0 !important;
  font-size:16px !important;
}

body .fm-kebab:hover,
body .kebabBtn:hover,
body button[data-menu]:hover,
body button[data-contact-menu]:hover{
  background:rgba(15,46,77,.06) !important;
}

body[data-page="contacts"] .table{
  border-collapse:separate !important;
  border-spacing:0 !important;
}

body[data-page="contacts"] .table th{
  background:#f8fafc !important;
  border-bottom:1px solid rgba(15,46,77,.10) !important;
}

body[data-page="contacts"] .table td{
  border-bottom:1px solid rgba(15,46,77,.08) !important;
}

@media (max-width: 900px){
  body .fm-main{
    padding:10px 10px 14px !important;
  }

  body .fm-content,
  body .page,
  body .wrap{
    max-width:100% !important;
    padding:12px 12px 18px !important;
  }

  body .fm-header{
    grid-template-columns:1fr !important;
    align-items:stretch !important;
    gap:8px !important;
  }

  body .fm-headright{
    justify-content:flex-start !important;
    flex-wrap:wrap !important;
  }

  body[data-page="pipeline"] .gridWrap{
    overflow-x:visible !important;
  }

  body[data-page="pipeline"] .grid{
    grid-template-columns:1fr !important;
    min-width:0 !important;
  }

  body[data-page="pipeline"] [data-col-stage]{
    display:block !important;
    width:100% !important;
  }

  body[data-page="projects"] .row{
    display:grid !important;
    grid-template-columns:1fr auto !important;
    gap:8px !important;
  }

  body[data-page="projects"] .rowMain,
  body[data-page="projects"] .rowHint{
    grid-column:1 / -1 !important;
  }

  body[data-page="projects"] .rowMoney{
    text-align:left !important;
    min-width:0 !important;
  }

  body[data-page="contacts"] #table,
  body[data-page="contacts"] .table,
  body[data-page="contacts"] #groupedList{
    display:none !important;
  }

  body[data-page="contacts"] #contactCards{
    display:flex !important;
    flex-direction:column !important;
    gap:10px !important;
  }

  body[data-page="contacts"] .contactCard{
    position:relative;
    padding:12px !important;
  }

  body[data-page="contacts"] .contactCardHead{
    align-items:flex-start !important;
    gap:10px !important;
  }
}

/* Contacts-specific kebab trigger neutrality */
body[data-page="contacts"] .kebabBtn,
body[data-page="contacts"] button[data-contact-menu]{
  width:30px !important;
  height:30px !important;
  min-width:30px !important;
  min-height:30px !important;
  border:none !important;
  border-radius:999px !important;
  background:transparent !important;
  box-shadow:none !important;
  color:rgba(15,46,77,.60) !important;
  padding:0 !important;
  font-size:18px !important;
  line-height:1 !important;
}

body[data-page="contacts"] .kebabBtn:hover,
body[data-page="contacts"] button[data-contact-menu]:hover{
  background:rgba(15,46,77,.06) !important;
}

/* Project detail shell takeover: hide any legacy New dropdown remnants */
body[data-page="project"] #newActionsBtn,
body[data-page="project"] #newActionsMenu,
body[data-page="project"] .menuWrap{
  display:none !important;
}

/* ========== MOBILE SHELL MODE ========== */
.fm-mobile-topbar{
  display:none;
  position:fixed;
  top:0;
  left:0;
  right:0;
  height:56px;
  background:#fff;
  border-bottom:1px solid rgba(15,46,77,.10);
  z-index:1102;
  align-items:center;
  gap:8px;
  padding:8px 10px;
}

.fm-icon-btn{
  width:38px;
  height:38px;
  border-radius:10px;
  border:1px solid rgba(15,46,77,.14);
  background:#fff;
  color:#0F2E4D;
  font:700 18px/1 Inter, Tahoma, sans-serif;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

.fm-mobile-title{
  flex:1;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font:800 17px/1.2 Inter, Tahoma, sans-serif;
  color:#0F2E4D;
}

.fm-mobile-brand{
  flex:1;
  min-width:0;
  display:flex;
  align-items:center;
  gap:8px;
  justify-content:flex-start;
}

.fm-mobile-brandname{
  font:800 18px/1.1 Inter, Tahoma, sans-serif;
  color:#0F2E4D;
  white-space:nowrap;
}

.fm-mobile-brandname .iq{
  color:#2EA3FF;
}

.fm-mobile-page-name{
  font:700 14px/1 Inter, Tahoma, sans-serif;
  color:rgba(15,46,77,.76);
  white-space:nowrap;
}

.fm-mobile-actions{
  display:flex;
  align-items:center;
  gap:6px;
  min-width: 0;
}

.fm-org-switch--mobile{
  max-width: 150px;
  height: 28px;
  gap: 6px;
  padding: 0 7px;
}

.fm-org-switch__org{
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
}

.fm-org-switch__label{
  font-size: 10px;
  font-weight: 700;
  opacity: .78;
}

.fm-mobile-overlay{
  position:fixed;
  inset:0;
  background:rgba(2,8,23,.42);
  z-index:1100;
}

body.fm-scroll-lock{
  overflow:hidden;
}

.fm-mobile-debug-badge{
  display:inline-flex;
  align-items:center;
  height:22px;
  padding:0 8px;
  border-radius:999px;
  font:700 10px/1 Tahoma, sans-serif;
  letter-spacing:.06em;
  color:#0F2E4D;
  background:rgba(46,163,255,.16);
  border:1px solid rgba(46,163,255,.3);
}

@media (max-width:900px){
  body.fm-is-mobile .fm-mobile-topbar{
    display:flex;
  }

  body.fm-is-mobile .fm-main{
    padding-top:68px !important;
    padding-left:12px !important;
    padding-right:12px !important;
  }

  body.fm-is-mobile .fm-content{
    max-width:100% !important;
    margin:0 auto;
    padding:0 0 18px !important;
  }

  body.fm-is-mobile .fm-header{
    grid-template-columns:1fr !important;
    gap:8px !important;
    padding:8px 10px !important;
    margin-bottom:10px !important;
  }

  body.fm-is-mobile .fm-title{
    font-size:18px !important;
  }

  body.fm-is-mobile .fm-org-context{
    margin-top: 2px;
  }

  body.fm-is-mobile .fm-org-context__name{
    max-width: calc(100vw - 170px);
    font-size: 11px;
  }

  body.fm-is-mobile .fm-headsearch{
    height:36px !important;
    padding:7px 10px !important;
  }

  body.fm-is-mobile .viewToggle .viewBtn,
  body.fm-is-mobile .fm-headright .fm-btn,
  body.fm-is-mobile .newMenu > summary.fm-btn{
    min-height:36px !important;
    height:36px !important;
    line-height:36px !important;
    font-size:12px !important;
    padding:0 10px !important;
  }

  body.fm-is-mobile #fmDrawer.fm-drawer,
  body.fm-is-mobile .fm-drawer{
    position:fixed !important;
    top:0 !important;
    left:0 !important;
    bottom:0 !important;
    width:min(280px,86vw) !important;
    min-width:min(280px,86vw) !important;
    height:100dvh !important;
    transform:translateX(-102%) !important;
    transition:transform .22s ease !important;
    z-index:1101 !important;
    border-right:1px solid rgba(15,46,77,.12) !important;
    border-bottom:0 !important;
    box-shadow:0 10px 24px rgba(15,46,77,.16);
    padding-top:14px !important;
  }

  body.fm-is-mobile #fmDrawer.fm-drawer.is-open,
  body.fm-is-mobile .fm-drawer.is-open{
    transform:translateX(0) !important;
  }

  body.fm-is-mobile .fm-app{
    display:block;
  }

  body.fm-is-mobile .fm-sidebar{
    display:flex;
    overflow-y:auto;
  }

  body.fm-is-mobile .fm-nav{
    overflow:auto;
    padding-bottom:20px;
  }

  body.fm-is-mobile .fm-fab{
    right:18px !important;
    bottom:calc(18px + env(safe-area-inset-bottom)) !important;
  }

  body.fm-is-mobile .fm-fab .fm-fab__panel{
    right:18px !important;
    bottom:calc(86px + env(safe-area-inset-bottom)) !important;
  }

  /* Pipeline exception: keep summary row only */
  body.fm-is-mobile[data-page="pipeline"] .mobileTabs{
    display:none !important;
  }
}

/* Detail pages: use the in-content title card as the primary header */
body[data-page="leads"] .fm-header,
body[data-page-title="Lead Detail"] .fm-header,
body[data-page-title="Project"] .fm-header {
  display:none !important;
}
body[data-page="leads"] .fm-main,
body[data-page-title="Lead Detail"] .fm-main,
body[data-page-title="Project"] .fm-main {
  padding-top:12px !important;
}

body[data-page="pipeline"] .fm-headleft{
  display:none !important;
}

/* FAB reliability hardening */
body .fm-fab{
  z-index:12000 !important;
}
body .fm-fab .fm-fab__main{
  position:relative;
  z-index:3;
}
body .fm-fab .fm-fab__panel{
  z-index:2;
}
body .fm-fab #fmFabBackdrop,
body .fm-fab [data-fm-fab-backdrop]{
  position:fixed;
  inset:0;
  display:none;
  z-index:1;
  background:rgba(15,46,77,.06);
}
body .fm-fab.is-open #fmFabBackdrop,
body .fm-fab.is-open [data-fm-fab-backdrop]{
  display:block;
}

/* Cleanup pass: canonical shell and component overrides */
html,
body {
  min-height: 100%;
  color: var(--fm-text) !important;
  background:
    radial-gradient(circle at top left, rgba(46, 163, 255, 0.06), transparent 24%),
    linear-gradient(180deg, #f7f9fc 0%, #f3f6fa 100%) !important;
}

a {
  color: #173a5c;
  text-decoration: none;
}

a:hover {
  color: #0f2e4d;
  text-decoration: none;
}

.fm-app {
  min-height: 100vh;
}

.fm-sidebar {
  gap: 16px;
  padding: 16px 12px;
  background: linear-gradient(180deg, #f9fbfd, #f4f7fb);
  border-right: 1px solid rgba(15,46,77,.09);
}

.fm-sidebar .fm-brand-plate {
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 8px 24px rgba(15,39,65,.05);
}

.fm-nav {
  gap: 18px;
}

.fm-nav-section {
  gap: 8px;
}

.fm-nav-section__label {
  padding: 0 10px;
  color: rgba(15,46,77,.50);
  font-size: 10px;
  letter-spacing: .12em;
}

.fm-navitem,
.fm-nav-item {
  min-height: 42px;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: #17324a;
  font-size: 14px;
  font-weight: 700;
  transition:
    background-color var(--fm-transition-fast),
    border-color var(--fm-transition-fast),
    box-shadow var(--fm-transition-fast),
    color var(--fm-transition-fast);
}

.fm-navitem:hover,
.fm-nav-item:hover {
  background: rgba(15,46,77,.055);
  border-color: rgba(15,46,77,.05);
}

.fm-navitem.active,
.fm-navitem.is-active,
.fm-nav-item.active {
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  border-color: rgba(23,58,92,.12);
  box-shadow: 0 10px 24px rgba(15,46,77,.10);
  color: #0f2e4d;
}

.fm-navitem:focus-visible,
.fm-nav-item:focus-visible,
.fm-org-switch:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(69,129,185,.16);
}

.fm-main {
  padding: 18px 20px 24px;
}

.fm-header,
.fm-topbar {
  padding: 12px 14px;
  border: 1px solid rgba(15,46,77,.08);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(15,39,65,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.98));
}

.fm-title {
  color: #102a43;
  font-size: 24px;
  font-weight: 800 !important;
  letter-spacing: -.03em;
}

.fm-headright {
  flex-wrap: wrap;
  white-space: normal;
  row-gap: 8px;
}

.fm-headsearch,
.fm-search,
input,
select,
textarea,
.fm-input,
.fm-select {
  border: 1px solid var(--fm-border);
  border-radius: 12px;
  background: #fff;
  color: var(--fm-text);
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.02);
}

.fm-headsearch,
.fm-search,
input,
select,
.fm-input,
.fm-select {
  min-height: var(--fm-control-h);
  padding: 0 12px;
}

textarea,
.fm-textarea {
  padding: 12px 14px;
}

.fm-headsearch:focus,
.fm-search:focus,
input:focus,
select:focus,
textarea:focus,
.fm-input:focus,
.fm-select:focus,
.fm-textarea:focus {
  outline: 0;
  border-color: #5a87b0 !important;
  box-shadow: 0 0 0 3px rgba(69,129,185,.16);
}

.fm-btn,
.btn,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-accent {
  min-height: var(--fm-control-h);
  height: auto;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--fm-border);
  background: #fff;
  color: #17324a;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  box-shadow: none;
  transition:
    background-color var(--fm-transition-fast),
    border-color var(--fm-transition-fast),
    color var(--fm-transition-fast),
    box-shadow var(--fm-transition-fast),
    transform var(--fm-transition-fast);
}

.fm-btn:hover,
.btn:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-danger:hover,
.btn-accent:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.fm-btn:focus-visible,
.btn:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(69,129,185,.16);
}

.fm-btn--primary,
.fm-btn.primary,
.btn-primary {
  background: linear-gradient(180deg, #173a5c, #0f2e4d);
  border-color: #173a5c;
  color: #fff;
  box-shadow: 0 10px 22px rgba(15,46,77,.16);
}

.fm-btn.secondary,
.btn-secondary {
  background: #fff;
  border-color: var(--fm-border);
  color: #17324a;
}

.fm-btn.danger,
.btn-danger {
  background: linear-gradient(180deg, #cf3f3f, #b42318);
  border-color: #b42318;
  color: #fff;
}

.fm-btn--ghost {
  background: transparent;
}

.fm-btn[disabled],
.btn[disabled],
button[disabled],
input[disabled],
select[disabled],
textarea[disabled] {
  opacity: .58;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.fm-card,
.card,
.panel,
.section {
  border: 1px solid var(--fm-border);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.98));
  box-shadow: 0 10px 24px rgba(15,39,65,.07);
}

.fm-pill,
.pill,
.badge,
.fm-badge {
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid #d9e3ee;
  background: #f8fafc;
  color: #3f556b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
}

.pill-approved,
.fm-pill--green {
  background: #edf7ef;
  border-color: #cce7d3;
  color: #1f6e45;
}

.pill-walk,
.pill-est,
.fm-pill--amber,
.fm-pill--gold {
  background: #fff8e8;
  border-color: #efdca0;
  color: #8a6500;
}

.pill-lost,
.pill-new,
.fm-pill--red {
  background: #fff4f4;
  border-color: #f2c2c2;
  color: #b42318;
}

.fm-table,
table,
.table {
  border-radius: 14px;
  overflow: hidden;
}

.fm-table th,
.fm-table td,
table th,
table td,
.table th,
.table td {
  padding: 11px 12px;
}

.fm-table th,
table th,
.table th {
  background: #f8fafc;
  color: #60758a;
  font-size: 12px;
  font-weight: 800;
}

.fm-table tbody tr:hover,
table tbody tr:hover,
.table tbody tr:hover {
  background: #fafcff;
}

.fm-admin-nav__link:focus-visible,
.amazon-admin-tab:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(69,129,185,.16);
}

@media (max-width: 900px) {
  body.fm-is-mobile .fm-header {
    border-radius: 14px;
  }

  body.fm-is-mobile .fm-headright {
    justify-content: flex-start;
  }
}
