
/* Operational CRM density / wide work area */
main{width:100%;max-width:1920px;padding:14px clamp(12px,1.4vw,26px)}
.panel{padding:clamp(12px,1.2vw,20px);margin:12px 0;border-radius:11px;box-shadow:0 2px 8px #14294a08}
#workspace-banner{margin-top:8px;padding:13px 18px}
#workspace-banner h1{font-size:clamp(23px,2.4vw,30px)}
#workspace-banner p{margin:0}
#app>.crm-tabs{width:178px;margin:12px 12px 12px 0;padding:9px;gap:3px}
#app>.crm-tabs button{padding:9px 10px;font-size:13px;line-height:1.25}
#app>.crm-view,#app>.crm-client-section{margin-left:190px;min-width:0}
#app>.crm-client-section .row{gap:9px}
#app>.crm-client-section .row>*{min-width:145px}
#app>.crm-client-section label{margin:4px 0;font-size:13px}
#app>.crm-client-section input,#app>.crm-client-section select{padding:8px 10px;font-size:13px}
#app>.crm-client-section .statbar{gap:8px;margin:10px 0}
#app>.crm-client-section .statbar>div{padding:10px;min-width:110px}
#app>.crm-client-section .statbar strong{font-size:21px}
.crm-view .table-wrap,.crm-client-section .table-wrap{overflow:auto;width:100%;max-width:100%}
#client-table{width:max-content;min-width:100%;font-size:12.5px;color:#24344d}
#client-table th,#client-table td{padding:8px 10px;min-width:unset;max-width:250px;white-space:nowrap;vertical-align:middle;border-bottom:1px solid #e0e7ef}
#client-table thead th{position:sticky;top:0;background:#eef2f7;color:#26384c;z-index:2}
#client-table th button{font-size:12px;color:#26384c;font-weight:700;background:transparent;border:0;padding:0;border-radius:0;box-shadow:none}
#client-table tr:nth-child(even){background:#f8fafc}
#client-table tbody tr:hover{background:#edf3fa}
#client-table th:first-child,#client-table td:first-child{position:sticky;left:0;min-width:160px;max-width:210px;z-index:1;background:#fff;box-shadow:1px 0 #e0e7ef}
#client-table thead th:first-child{z-index:3;background:#eef2f7}
#client-table tr:nth-child(even) td:first-child{background:#f8fafc}
#client-table tbody tr:hover td:first-child{background:#edf3fa}
#client-table [data-col="actions"]{min-width:178px}
#client-table .mini{padding:5px 7px}
#client-table .crm-col-hidden{display:none!important}
#client-table caption{padding:8px 10px;text-align:left}
.crm-table-controls{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:10px;margin:7px 0}
.crm-table-controls summary{border:1px solid var(--border);border-radius:7px;padding:7px 10px;background:#fff;font-size:13px}
.crm-column-options{display:grid;grid-template-columns:repeat(2,minmax(120px,1fr));gap:5px 10px;padding:12px;border:1px solid var(--border);border-radius:8px;background:#fff}
.crm-column-options label{display:flex!important;gap:7px;align-items:center;font-weight:500}
.crm-column-options input{width:auto!important}
.crm-table-help{font-size:13px;color:#526377}
.crm-team-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(185px,1fr));gap:9px}
.crm-team-fields label{margin:4px 0;font-size:13px}
.crm-team-fields input,.crm-team-fields select{padding:9px}
.crm-team-table{min-width:840px}
.crm-team-table td,.crm-team-table th,.crm-finance-clients td,.crm-finance-clients th{min-width:0;padding:9px 10px}
.crm-finance-clients{min-width:750px}
.crm-finance-clients td:not(:first-child),.crm-finance-clients th:not(:first-child){text-align:right;font-variant-numeric:tabular-nums}
.crm-future-note{padding:12px 14px;background:#f1f5fa;border-left:3px solid #42678c;border-radius:7px}
@media(max-width:840px){#app>.crm-tabs{width:100%;margin:8px 0 16px}#app>.crm-view,#app>.crm-client-section{margin-left:0}main{padding:12px}#client-table th:first-child,#client-table td:first-child{min-width:135px;max-width:160px}}


/* Keep dashboard grid contents and CRM chrome within the mobile viewport. */
.crm-dual{grid-template-columns:minmax(0,2fr) minmax(0,1fr)}
.crm-dual>*{min-width:0;max-width:100%}
.crm-dual .table-wrap{min-width:0;max-width:100%;width:100%;overflow:auto}
.crm-dual table{width:max-content;min-width:100%}
@media(max-width:750px){
 .crm-dual{grid-template-columns:minmax(0,1fr)}
 .crm-header{flex-wrap:wrap;gap:9px}
 .crm-header-end{width:100%;max-width:100%;min-width:0;justify-content:space-between;gap:8px}
 .crm-header-end>*{max-width:100%;min-width:0}
 .crm-owner-link{min-width:0;white-space:normal}
 .aging-row{grid-template-columns:minmax(72px,100px) minmax(0,1fr) minmax(85px,120px);gap:8px}
}

/* 2026-10-26: Compact, top-aligned CRM navigation, no permanent sidebar.
   All existing buttons, active states and tenant checks remain unchanged. */
.crm-header{padding:10px clamp(12px,1.5vw,25px);gap:10px}
#crm-nav-toggle{display:none!important}
#app>.crm-tabs{
  position:sticky;top:0;z-index:11;float:none;
  width:100%;max-height:none;overflow-x:auto;overflow-y:hidden;
  display:flex!important;flex-direction:row;flex-wrap:wrap;
  justify-content:flex-start;align-items:center;gap:5px;
  padding:7px;margin:9px 0 10px;
  border:1px solid var(--border);border-radius:10px;
  background:#fff;box-shadow:0 2px 8px #14294a09;
  scrollbar-width:thin;overscroll-behavior-inline:contain
}
#app>.crm-tabs button,#app>.crm-tabs a.secondary{
  flex:0 0 auto;width:auto;min-height:36px;max-width:none;
  padding:7px 11px;font-size:13px;line-height:1.3;
  text-align:center;white-space:nowrap;border-radius:7px;
  justify-content:center;align-items:center
}
#app>.crm-tabs button[aria-current="page"]{
  background:var(--crm-primary,#143e86);color:#fff;
  border-color:var(--crm-primary,#143e86)
}
#app>.crm-view,#app>.crm-client-section{
  float:none;clear:both;margin:10px 0;min-width:0
}
#app>.crm-view.panel{padding:clamp(12px,1.1vw,18px)}
#app .financial-cards{gap:8px;margin:12px 0}
#app .financial-card{padding:11px 13px;border-radius:9px}
#app .dashboard-cols{gap:12px;margin-top:12px}
#app .dashboard-cols>section{padding:13px}
#app .statbar{gap:8px}
#app .statbar>div{padding:10px}
#app .table-wrap{margin:10px 0}
#app .crm-ops-grid{gap:12px}
#workspace-banner{padding:12px 17px}
#app>.help{margin:6px 0 8px;font-size:12px}
@media(max-width:840px){
 #app>.crm-tabs{display:flex!important;flex-wrap:nowrap;position:sticky;
   max-width:100%;width:100%;margin:8px 0 10px;padding:6px;gap:5px}
 #app>.crm-tabs button,#app>.crm-tabs a.secondary{min-height:40px}
 #app>.crm-view,#app>.crm-client-section{margin:8px 0}
}


/* 2026-10-27 — Density pass v2: compact app chrome.
   Keep project identity and all CRM actions while eliminating stacked, bulky banners. */
header.crm-header{
  min-height:44px;padding:5px clamp(10px,1.1vw,18px);
  gap:8px;flex-wrap:nowrap
}
.crm-header .crm-owner-link{font-size:13px;line-height:1.15;font-weight:750;flex:0 0 auto}
.crm-header .crm-owner-link small{display:inline;margin-left:5px;font-size:10px;font-weight:650;color:#d4e2f3}
.crm-header .crm-header-end{gap:9px;flex-wrap:nowrap;min-width:0;margin-left:auto}
.crm-header #workspace-brand{gap:7px;min-width:0}
.crm-header #workspace-brand>a{min-width:0;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.crm-header #workspace-name{font-size:13px;line-height:1.1;white-space:nowrap}
.crm-header #workspace-brand small{display:none}
.crm-header #workspace-icon{width:25px;height:25px;padding:2px;border-radius:5px}
.crm-header #workspace-logo{max-width:80px;max-height:28px;padding:2px;border-radius:5px}
.crm-header #logout{padding:6px 10px;font-size:12px;min-height:32px;white-space:nowrap}
main{padding:9px clamp(10px,1.1vw,18px);max-width:1920px}
#workspace-banner{
  margin:4px 0 0;padding:7px 12px;border-radius:8px;gap:6px;
  min-height:36px;box-shadow:none
}
#workspace-banner>div{display:flex;align-items:center;min-width:0;gap:7px}
#workspace-banner>div>p,#workspace-banner .status-label{display:none}
#workspace-banner h1,#workspace-banner #workspace-heading{
  font-size:16px;line-height:1.2;font-weight:750;margin:0;letter-spacing:-.02em
}
#app>.help{margin:3px 0 5px;font-size:11px;line-height:1.3}
#app>.crm-tabs{
  position:sticky;top:0;z-index:12;
  display:flex!important;flex-wrap:nowrap;align-items:center;
  gap:4px;padding:4px 5px;margin:5px 0 8px;
  overflow-x:auto;overflow-y:hidden;border-radius:8px;
  scrollbar-width:thin;overscroll-behavior-x:contain
}
#app>.crm-tabs button,#app>.crm-tabs a.secondary{
  flex:0 0 auto;min-height:32px;padding:5px 10px;
  border-radius:6px;font-size:12px;line-height:1.3;white-space:nowrap
}
#app>.crm-view,#app>.crm-client-section{margin:7px 0}
#app>.crm-view.panel,#app>.crm-client-section.panel{padding:11px 13px}
#app>.crm-view>h2,#app>.crm-client-section>h2{font-size:18px;line-height:1.25;margin:0 0 5px}
#app>.crm-view>p.muted{margin:0 0 7px;font-size:13px}
#app .financial-cards{gap:7px;margin:8px 0}
#app .financial-card{padding:9px 11px;border-radius:8px}
#app .financial-card strong{font-size:clamp(18px,1.65vw,24px)}
#app .dashboard-cols{gap:10px;margin-top:9px}
#app .dashboard-cols>section{padding:11px}
#app .crm-ops-metrics{gap:8px}
#app .crm-ops-metrics>div{padding:10px 12px;border-radius:8px}
#app .crm-stage-grid>div{padding:11px}
#app .crm-dual{gap:10px}
#app .table-wrap{margin:7px 0}
#app th,#app td{padding:8px 9px}
#app .toolbar{gap:8px}
#app .panel{border-radius:10px;box-shadow:0 1px 4px #14294a06}
@media(max-width:840px){
 header.crm-header{padding:6px 10px;gap:6px;flex-wrap:wrap}
 .crm-header .crm-owner-link{font-size:12px}
 .crm-header .crm-header-end{width:auto;min-width:0;max-width:100%;margin-left:auto;gap:6px}
 .crm-header #workspace-name{font-size:12px;max-width:145px;display:inline-block;overflow:hidden;text-overflow:ellipsis;vertical-align:middle}
 .crm-header #workspace-logo{max-width:52px;max-height:24px}
 #app>.crm-tabs{flex-wrap:nowrap;max-width:100%;padding:4px;gap:4px}
 #app>.crm-tabs button,#app>.crm-tabs a.secondary{min-height:40px;padding:8px 10px}
 #app>.crm-view.panel,#app>.crm-client-section.panel{padding:10px}
 #workspace-banner{padding:7px 10px}
}
@media(max-width:420px){
 .crm-header .crm-owner-link small{display:none}
 .crm-header #workspace-logo{display:none}
 .crm-header #workspace-brand{gap:4px}
 .crm-header #workspace-name{max-width:118px}
}


/* Team operations: dense, practical staffing overview with workspace-scoped records. */
#crm-team-view{--team-line:#dce4ee;--team-muted:#52657b}
#crm-team-view [hidden]{display:none!important}
#crm-team-view h2,#crm-team-view h3{margin:0;line-height:1.3}
#crm-team-view h2{font-size:20px}
#crm-team-view h3{font-size:15px}
#crm-team-view .help{color:var(--team-muted);font-size:12px;margin:3px 0}
#crm-team-view .crm-team-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
#crm-team-view .crm-team-heading>button{min-height:36px}
#crm-team-view .crm-team-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin:12px 0}
#crm-team-view .crm-team-kpi{display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left;min-width:0;border:1px solid var(--team-line);background:#fff;color:#20354b;padding:10px 12px;border-radius:9px;box-shadow:none;cursor:pointer}
#crm-team-view .crm-team-kpi:hover,#crm-team-view .crm-team-kpi:focus-visible{border-color:var(--crm-accent,#0f8c99);background:#f3faff}
#crm-team-view .crm-team-kpi strong{font-variant-numeric:tabular-nums;font-size:25px;line-height:1.2}
#crm-team-view .crm-team-kpi span{font-weight:700;font-size:12px}
#crm-team-view .crm-team-kpi small{font-size:11px;color:var(--team-muted)}
#crm-team-view .crm-team-coverage{padding:11px 12px;background:#f7f9fc;border:1px solid var(--team-line);border-radius:9px}
#crm-team-view .crm-team-coverage-title{display:flex;gap:8px;flex-wrap:wrap;justify-content:space-between;align-items:start}
#crm-team-view #team-unset{color:#84491c;font-size:12px;font-weight:600}
#crm-team-view .crm-team-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;margin-top:8px}
#crm-team-view .crm-team-day{display:grid;justify-items:center;gap:1px;min-width:0;padding:7px 3px;background:#fff;color:#24394f;border:1px solid var(--team-line);border-radius:7px;box-shadow:none}
#crm-team-view .crm-team-day span{font-size:12px}
#crm-team-view .crm-team-day strong{font-size:21px;font-variant-numeric:tabular-nums;line-height:1.25}
#crm-team-view .crm-team-day small{font-size:10px;color:var(--team-muted)}
#crm-team-view .crm-team-day.is-today{border-color:#177888;background:#ecf7f8}
#crm-team-view .crm-team-day.is-selected{outline:2px solid var(--crm-accent,#0f8c99);outline-offset:0}
#crm-team-view .crm-team-filters{display:grid;grid-template-columns:minmax(160px,2fr) repeat(3,minmax(130px,1fr)) auto;align-items:end;gap:8px;margin:12px 0 7px}
#crm-team-view .crm-team-filters>div{min-width:0}
#crm-team-view .crm-team-filters label{display:block;font-weight:650;font-size:11px;margin-bottom:3px}
#crm-team-view .crm-team-filters input,#crm-team-view .crm-team-filters select{width:100%;max-width:100%;min-height:36px;padding:7px 9px;font-size:12px}
#crm-team-view .crm-team-filters>button{min-height:36px}
#crm-team-view .crm-team-layout{display:grid;grid-template-columns:minmax(0,1.85fr) minmax(290px,.95fr);gap:10px;align-items:start}
#crm-team-view .crm-team-list{min-width:0}
#crm-team-view #team-count{margin:0 0 5px}
#crm-team-view .table-wrap{margin:0}
#crm-team-view .crm-team-table{width:100%;min-width:680px;border-collapse:collapse}
#crm-team-view .crm-team-table th{background:#edf2f7;font-weight:700;color:#2e4358;font-size:11px;white-space:nowrap;text-align:left;position:sticky;top:0}
#crm-team-view .crm-team-table th,#crm-team-view .crm-team-table td{padding:9px 8px;min-width:0;border-bottom:1px solid #e3eaf1;vertical-align:middle;font-size:12px}
#crm-team-view .crm-team-table td:nth-child(3){max-width:145px}
#crm-team-view .crm-team-table tbody tr:hover,#crm-team-view .crm-team-table tbody tr.is-selected{background:#eef7f9}
#crm-team-view .crm-team-table small{display:block;font-size:11px;color:var(--team-muted);line-height:1.4;margin-top:2px;overflow-wrap:anywhere}
#crm-team-view .crm-team-name{border:none;background:none!important;color:#125f9d!important;box-shadow:none;padding:1px 0;font-weight:750;text-align:left;font-size:13px;text-decoration:underline;text-underline-offset:2px}
#crm-team-view .crm-team-status{display:inline-block;border-radius:20px;padding:3px 7px;background:#e9eff4;color:#374b5e;font-size:11px;font-weight:750}
#crm-team-view .crm-team-status.is-active{background:#def3e7;color:#185936}
#crm-team-view .crm-team-detail{border:1px solid var(--team-line);border-radius:9px;background:#fff;padding:13px;min-width:0}
#crm-team-view .crm-team-profile-head{display:flex;align-items:center;gap:10px;margin-bottom:8px}
#crm-team-view .crm-team-profile-head h3{font-size:16px}
#crm-team-view .crm-team-profile-head p{font-size:12px;color:var(--team-muted);margin:1px 0;text-transform:capitalize}
#crm-team-view .crm-team-avatar{width:40px;height:40px;flex:0 0 40px;display:grid;place-items:center;background:#e1ebf3;border-radius:50%;font-weight:750;font-size:14px;color:#234363}
#crm-team-view .crm-team-profile-actions{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0}
#crm-team-view .crm-team-profile-actions>*{font-size:12px;padding:7px 9px;text-decoration:none;border-radius:6px;display:inline-flex;align-items:center;justify-content:center;min-height:33px}
#crm-team-view .crm-team-meta{margin:12px 0;display:grid;gap:6px}
#crm-team-view .crm-team-meta-row{display:grid;grid-template-columns:100px minmax(0,1fr);gap:6px;padding-bottom:5px;border-bottom:1px solid #eff2f6;font-size:12px}
#crm-team-view .crm-team-meta dt{color:var(--team-muted)}
#crm-team-view .crm-team-meta dd{margin:0;font-weight:650;overflow-wrap:anywhere}
#crm-team-view .crm-team-needs{font-size:12px;padding:8px;background:#fff4e5;color:#7b4413;border-radius:6px}
#crm-team-view .crm-team-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
#crm-team-view .crm-team-fields label{display:block}
#crm-team-view .crm-team-fields input,#crm-team-view .crm-team-fields select{width:100%;min-width:0;min-height:36px}
#crm-team-view .crm-team-week{min-width:0;margin:12px 0;padding:9px;border:1px solid var(--team-line);border-radius:8px}
#crm-team-view .crm-team-week legend{font-size:12px;font-weight:750;padding:0 4px}
#crm-team-view .crm-team-day-checks{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px}
#crm-team-view .crm-team-day-checks label{display:grid;justify-items:center;gap:2px;font-size:11px;cursor:pointer}
#crm-team-view .crm-team-day-checks input{margin:3px 0;width:16px;height:16px}
#crm-team-view .crm-team-form-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}
#crm-team-view :is(button,a,input,select):focus-visible{outline:3px solid #1a679c;outline-offset:2px}
@media(max-width:1150px){
 #crm-team-view .crm-team-layout{grid-template-columns:minmax(0,1fr)}
 #crm-team-view .crm-team-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
 #crm-team-view .crm-team-filters{grid-template-columns:repeat(3,minmax(0,1fr))}
 #crm-team-view .crm-team-filters>div:first-child{grid-column:span 2}
}
@media(max-width:720px){
 #crm-team-view .crm-team-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
 #crm-team-view .crm-team-filters{grid-template-columns:repeat(2,minmax(0,1fr))}
 #crm-team-view .crm-team-filters>div:first-child{grid-column:span 2}
 #crm-team-view .crm-team-days{gap:3px}
 #crm-team-view .crm-team-day{padding:7px 1px}
 #crm-team-view .crm-team-day span{font-size:11px}
 #crm-team-view .crm-team-day small{font-size:9px}
 #crm-team-view .crm-team-table{min-width:650px}
}
@media(max-width:440px){
 #crm-team-view .crm-team-fields{grid-template-columns:minmax(0,1fr)}
 #crm-team-view .crm-team-kpi strong{font-size:22px}
 #crm-team-view .crm-team-day strong{font-size:17px}
}
