/* v0.5.2.13: unified, task-first workspace. No business logic lives in this file. */
:root{--ws-sidebar:#fff;--ws-line:#e3e7ef;--ws-ink:#233249;--ws-muted:#748398;--ws-gold:#e9c86e;--ws-gold-tint:#fff7e5;--ws-sidebar-width:254px;--ws-surface:#f5f6fa}
body:has(.workspace-layout){display:block;background:var(--ws-surface)}
.workspace-layout{display:grid;grid-template-columns:var(--ws-sidebar-width) minmax(0,1fr);min-height:100dvh;width:100%}
.workspace-sidebar{position:sticky;top:0;height:100dvh;max-height:100dvh;background:var(--ws-sidebar);border-right:1px solid var(--ws-line);display:flex;flex-direction:column;min-width:0;z-index:30}
.workspace-brand-row{min-height:100px;padding:20px 20px 17px;border-bottom:1px solid var(--ws-line);display:flex;align-items:center;justify-content:space-between;gap:8px;flex-shrink:0}
.workspace-brand{display:flex;width:100%;min-width:0;overflow:hidden;align-items:center;text-decoration:none}
.workspace-brand .brand-logo{width:210px;max-width:100%;height:auto;max-height:67px;object-fit:contain;object-position:left center}
.workspace-brand-icon{display:none;width:44px;height:44px;object-fit:contain}
.workspace-mobile-close{display:none;flex:none;border:0;border-radius:9px;background:#f4f6f8;color:#26354a;font-size:22px;width:36px;height:36px}
.workspace-sidebar-scroll{flex:1;min-height:0;overflow:auto;padding:21px 12px;scrollbar-width:thin}
.workspace-nav-caption{padding:0 14px;margin:0 0 11px;font-size:10px;letter-spacing:.13em;text-transform:uppercase;font-weight:850;color:#8b95a5}
.workspace-nav-secondary{margin-top:28px;padding-top:18px;border-top:1px solid #f0f1f4}
.workspace-nav{display:grid;gap:5px}
.workspace-nav-item{display:flex;align-items:center;gap:13px;min-height:46px;padding:10px 13px;border:1px solid transparent;border-radius:11px;color:#3d4d61;text-decoration:none;font-size:14px;font-weight:670;transition:background-color .13s,color .13s,border-color .13s;white-space:nowrap}
.workspace-nav-item svg{display:block;width:21px;height:21px;flex:0 0 21px;fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.8}
.workspace-nav-item:hover{background:#f6f7fa;color:#1f344a}
.workspace-nav-item[aria-current="page"]{background:var(--ws-gold-tint);border-color:#f2dba2;color:#654a12;font-weight:800;box-shadow:inset 3px 0 0 #d0a646}
.workspace-sidebar-bottom{border-top:1px solid var(--ws-line);padding:16px 12px 14px;display:grid;gap:9px;flex-shrink:0;background:#fff}
.workspace-new-action{display:flex;align-items:center;justify-content:center;gap:10px;min-height:44px;border-radius:10px;border:1px solid #d5b15a;background:var(--ws-gold);color:#28313d;text-decoration:none;font-size:13px;font-weight:820;white-space:nowrap;padding:10px}
.workspace-new-action>span:first-child{font-size:20px;line-height:16px}
.workspace-new-action:hover{background:#dfbc5e;color:#28313d}
.workspace-mobile-password{display:none}
.workspace-collapse{display:flex;align-items:center;justify-content:center;gap:8px;border:0;background:transparent;color:#8995a6;min-height:34px;border-radius:9px;font:inherit;font-size:12px;cursor:pointer}
.workspace-collapse:hover{background:#f4f6f9;color:#34445b}
.workspace-collapse-arrow{font-size:21px;line-height:1;transition:transform .2s}
.workspace-content{display:flex;flex-direction:column;min-width:0;min-height:100dvh}
.workspace-topbar{height:66px;min-height:66px;background:#fff;border-bottom:1px solid var(--ws-line);display:flex;align-items:center;justify-content:space-between;gap:20px;padding:0 clamp(20px,3vw,40px)}
.workspace-topbar-start{display:flex;align-items:center;gap:14px;min-width:0}
.workspace-topbar-title{color:#27364e;font-size:15px;font-weight:830;letter-spacing:-.02em;white-space:nowrap}
.workspace-topbar-title span{font-weight:500;color:#98a3b0}
.workspace-account{display:flex;align-items:center;gap:14px;min-width:0;flex-wrap:nowrap}
.workspace-user-avatar{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:#f2dfaa;color:#6f5519;font-size:13px;font-weight:840;flex:none}
.workspace-account .account-name{max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:660;color:#43556b}
.workspace-account .nav-link{font-size:13px;color:#66788d;text-decoration:none}
.workspace-account .logout-link{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;padding:8px 10px;border-radius:10px;line-height:1;white-space:nowrap;color:#6b7786}
.workspace-menu-toggle{display:none;width:42px;height:42px;border:1px solid #dee4eb;border-radius:11px;background:#fff;color:#33465a;font-size:20px;align-items:center;justify-content:center}
.workspace-layout .workspace-main.shell{width:min(calc(100% - clamp(36px,5.5vw,84px)),1460px);margin:0 auto;flex:1;min-width:0;padding:30px 0 64px}
.workspace-layout .workspace-footer.shell{width:min(calc(100% - clamp(36px,5.5vw,84px)),1460px);margin:0 auto;padding:18px 0 25px;font-size:11px;border-top:1px solid #e7e9f0}
.workspace-layout .page-heading{margin-bottom:23px}
.workspace-layout .page-heading h1{font-size:clamp(28px,2.6vw,37px);letter-spacing:-.03em}
.workspace-layout .page-heading .subtle{max-width:880px;line-height:1.55}
.workspace-layout .panel,.workspace-layout .tile{border-radius:15px;box-shadow:0 5px 20px #192a3c0b}
.workspace-layout .section-spaced{margin-top:20px}
.workspace-layout .breadcrumbs{font-size:12px;margin-bottom:20px}
.workspace-layout .crm-grid{gap:18px}
.workspace-layout .crm-detail-heading{gap:12px}
.workspace-layout .crm-intake-panel{max-width:1120px}
.workspace-layout .crm-client-profile{max-width:none;margin:0}
.workspace-layout .crm-form-generic{max-width:1000px;margin:0}
.workspace-layout .crm-filterbar{margin-top:4px}
.workspace-layout .crm-client-hero{margin-bottom:22px}
.workspace-layout .crm-tool-card{border-radius:12px}
.workspace-layout .form-stack :is(input,select,textarea){max-width:100%}
.workspace-layout .crm-detail-meta{row-gap:7px}
.workspace-layout .fabric-form-shell{max-width:1000px;margin:0}
.workspace-layout .fit-layout{grid-template-columns:minmax(305px,390px) minmax(0,1fr);gap:20px}
.workspace-layout .crm-form-generic .crm-form-actions{margin-top:12px;border-radius:10px}
.workspace-layout .crm-form-generic .panel{padding:29px 34px}
.workspace-layout .crm-client-hero h1{margin:6px 0 10px}
.workspace-layout .crm-contact-item:last-child{border-bottom:0}
.workspace-layout .crm-client-record{border-radius:10px}
.workspace-layout .section-bar .text-link{margin:0}
/* Readable page in compact desktop mode. */
@media(min-width:1025px){
  .workspace-layout.workspace-collapsed{grid-template-columns:76px minmax(0,1fr)}
  .workspace-collapsed .workspace-sidebar-scroll{padding:18px 9px}
  .workspace-collapsed .workspace-brand-row{padding:16px 15px;justify-content:center;min-height:83px}
  .workspace-collapsed .workspace-brand .brand-logo{display:none}
  .workspace-collapsed .workspace-brand-icon{display:block}
  .workspace-collapsed .workspace-nav-caption,.workspace-collapsed .workspace-nav-label{display:none}
  .workspace-collapsed .workspace-nav-secondary{display:block;font-size:0;border-top:1px solid #f1f1f3;padding:0;margin:15px 7px}
  .workspace-collapsed .workspace-nav-item{justify-content:center;min-height:49px;padding:11px}
  .workspace-collapsed .workspace-nav-item[aria-current="page"]{box-shadow:inset 3px 0 0 #d0a646}
  .workspace-collapsed .workspace-sidebar-bottom{padding:12px 9px}
  .workspace-collapsed .workspace-new-action{padding:9px 5px}
  .workspace-collapsed .workspace-new-action>span:first-child{font-size:24px}
  .workspace-collapsed .workspace-collapse-arrow{transform:rotate(180deg)}
}
.workspace-overlay[hidden]{display:none!important}
.workspace-overlay{position:fixed;inset:0;background:#0e19299c;border:0;z-index:35;cursor:pointer}
@media(max-width:1160px){
 .workspace-layout .fit-layout{grid-template-columns:minmax(0,1fr)}
 .workspace-account .account-name{max-width:125px}
}
@media(max-width:1024px){
 .workspace-layout,.workspace-layout.workspace-collapsed{display:block}
 .workspace-sidebar{position:fixed;top:0;left:0;height:100dvh;width:min(300px,88vw);max-height:100dvh;transform:translateX(-105%);transition:transform .2s ease;box-shadow:15px 0 45px #13263e2b;z-index:36}
 .workspace-menu-open .workspace-sidebar{transform:translateX(0)}
 .workspace-menu-open .workspace-overlay{display:block}
 .workspace-menu-toggle,.workspace-mobile-close{display:inline-flex;align-items:center;justify-content:center}
 .workspace-collapse{display:none}
 .workspace-mobile-password{display:block;font-size:12px;font-weight:650;text-decoration:none;padding:11px 14px;border-radius:8px;color:#536a7f;background:#f6f8fa}
 .workspace-layout .workspace-main.shell{width:min(calc(100% - 44px),1460px);padding-top:24px}
 .workspace-topbar{padding:0 22px}
}
@media(max-width:640px){
 .workspace-topbar{height:59px;min-height:59px;padding:0 15px}
 .workspace-layout .workspace-main.shell{width:calc(100% - 26px);padding-top:21px;padding-bottom:35px}
 .workspace-layout .workspace-footer.shell{width:calc(100% - 26px)}
 .workspace-account{gap:9px}
 .workspace-account .nav-link:not(.logout-link){display:none}
 .workspace-account .logout-link{font-size:12px;min-height:36px;padding:7px 8px}
 .workspace-topbar-title{font-size:14px}
 .workspace-layout .crm-grid{grid-template-columns:minmax(0,1fr)}
 .workspace-layout .crm-form-generic .panel{padding:20px}
 .workspace-layout .fit-layout{grid-template-columns:minmax(0,1fr)}
}
@media(prefers-reduced-motion:reduce){.workspace-sidebar,.workspace-collapse-arrow{transition:none}}
/* Compact home: real metrics are intentionally deferred to a later patch. */
.workspace-home-heading{display:flex;align-items:center;justify-content:space-between;gap:18px;flex-wrap:wrap}
.workspace-home-heading h1{margin:7px 0}
.workspace-home-heading .button{min-width:160px}
.workspace-home-shortcuts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:20px 0 36px}
.workspace-shortcut{display:flex;align-items:center;gap:12px;min-width:0;min-height:94px;padding:17px 14px;border:1px solid #e2e7ee;border-radius:14px;background:white;text-decoration:none;color:#25364d;box-shadow:0 3px 17px #192a3c0a;transition:transform .15s,border-color .15s,box-shadow .15s}
.workspace-shortcut:hover{color:#25364d;border-color:#e0be69;box-shadow:0 7px 22px #192a3c17;transform:translateY(-1px)}
.workspace-shortcut-icon{width:44px;height:44px;flex:0 0 44px;display:grid;place-items:center;border-radius:12px;background:#fbf3dd;color:#8e6818;font-size:24px;font-weight:750}
.workspace-shortcut>span:nth-child(2){display:grid;gap:6px;min-width:0}
.workspace-shortcut strong{display:block;font-size:14px;font-weight:780;line-height:1.2}
.workspace-shortcut small{font-size:11px;color:#8290a2;line-height:1.35}
.workspace-shortcut-arrow{margin-left:auto;color:#9aa5b2;align-self:flex-start;font-size:15px}
.workspace-dashboard-heading{display:flex;align-items:end;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-bottom:15px}
.workspace-dashboard-heading h2{font-size:24px;letter-spacing:-.03em;margin:4px 0 0}
.workspace-coming-soon{background:#f0f2f5;color:#6b7789;padding:8px 12px;border-radius:8px;font-size:11px;font-weight:700}
.workspace-dashboard-placeholder{min-height:340px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:44px 25px;background:#fff;border:1px dashed #ccd5e0;border-radius:16px}
.workspace-dashboard-placeholder-icon{width:60px;height:60px;border-radius:17px;display:grid;place-items:center;background:#f6f8fb;color:#a4afbd;font-size:30px;margin-bottom:15px}
.workspace-dashboard-placeholder h3{font-size:18px;margin:0 0 9px;color:#3d5066}
.workspace-dashboard-placeholder p{font-size:13px;color:#7a8a9c;line-height:1.65;max-width:510px;margin:0}
.workspace-service-links{margin-top:22px;border:1px solid #e5e9ee;background:white;border-radius:12px;padding:15px 19px}
.workspace-service-links summary{font-size:13px;font-weight:750;color:#52677b;cursor:pointer}
.workspace-service-grid{display:flex;gap:14px;flex-wrap:wrap;margin-top:15px;font-size:13px}
@media(max-width:1250px){.workspace-home-shortcuts{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.workspace-home-heading .button{width:100%}.workspace-home-shortcuts{gap:9px;margin-bottom:27px}.workspace-shortcut{min-height:91px;padding:12px 10px;gap:8px}.workspace-shortcut-icon{width:34px;height:34px;flex-basis:34px;font-size:18px}.workspace-shortcut strong{font-size:12px}.workspace-shortcut small{font-size:10px}.workspace-shortcut-arrow{display:none}.workspace-dashboard-placeholder{min-height:290px;padding:35px 17px}}
/* Record cards: quick anchors lower scroll friction without hiding any actions. */
.workspace-section-nav{position:sticky;top:0;z-index:10;display:flex;gap:6px;overflow-x:auto;padding:10px;margin:0 0 19px;background:#f5f6fafa;border:1px solid #e2e7ee;border-radius:12px;scrollbar-width:thin;overscroll-behavior-x:contain}
.workspace-section-nav a{color:#506378;text-decoration:none;white-space:nowrap;padding:9px 12px;min-height:37px;border-radius:8px;font-size:12px;font-weight:740;display:inline-flex;align-items:center}
.workspace-section-nav a:hover,.workspace-section-nav a:focus-visible{color:#735414;background:#fff3d4}
.workspace-detail-actions{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap}
.workspace-card-heading{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:17px;border-bottom:1px solid #edf0f4;padding-bottom:15px}
.workspace-card-heading h2{margin:0}
.workspace-card-heading .subtle{font-size:12px}
.workspace-layout [id^="application-"],.workspace-layout [id^="client-"],.workspace-layout [id^="fabric-"]{scroll-margin-top:76px}
.workspace-layout .crm-form-generic .workspace-edit-panel{max-width:1000px}
.workspace-edit-form{margin:0;gap:19px}
.workspace-edit-form>div:not(.crm-form-actions):not(.notice){display:grid;gap:6px;min-width:0}
.workspace-edit-form>div>label{margin:0}
.workspace-edit-form>div>small{max-width:640px;color:#8390a0;line-height:1.5}
.workspace-edit-form textarea{min-height:94px}
.workspace-edit-form .crm-form-actions{margin:8px -2px 0;position:sticky;bottom:12px;z-index:4;background:#fffdf7;box-shadow:0 8px 25px #26323e18;border:1px solid #eadfc8}
.workspace-layout .crm-intake-panel{overflow:clip}
.workspace-layout .crm-form-actions{position:sticky;bottom:10px;z-index:5;box-shadow:0 5px 24px #27324020;background:#fffefb;border-radius:0 0 14px 14px}
.workspace-layout .crm-intake-panel .crm-form-actions{border-top:1px solid #e0e5eb}
.workspace-layout .crm-client-create-panel{overflow:visible}
.workspace-layout .crm-client-create-panel .crm-form-actions{margin-bottom:-1px}
.workspace-layout .fabric-form-shell>.crm-local-form-heading{border-bottom:1px solid #e9edf1;padding-bottom:16px;margin-bottom:19px}
.workspace-layout .fabric-form-shell .fabric-form-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:11px;padding:14px 0 0;border-top:1px solid #eceff2}
.workspace-layout .fabric-form-shell form.form-stack{max-width:800px}
@media(max-width:640px){
  .workspace-section-nav{margin-bottom:14px;padding:5px;top:0}
  .workspace-section-nav a{padding:8px 9px;font-size:11px}
  .workspace-edit-form .crm-form-actions{bottom:0;margin:4px -8px -7px;flex-direction:column-reverse;align-items:stretch}
  .workspace-layout .crm-intake-panel .crm-form-actions{bottom:0}
  .workspace-layout .crm-detail-heading .workspace-detail-actions{justify-content:flex-start}
}

/* v0.5.2.14: staff profile — the brand appears only in the left navigation. */
.workspace-profile-link{display:inline-flex;align-items:center;gap:9px;min-height:44px;min-width:0;padding:5px 9px;border:1px solid transparent;border-radius:11px;text-decoration:none;color:#34485c;transition:background-color .15s,border-color .15s}
.workspace-profile-link:hover{background:#fff7e6;border-color:#e8d4a4;color:#624710}
.workspace-profile-link:focus-visible{outline:2px solid #b38c3b;outline-offset:2px}
.workspace-profile-link .workspace-user-avatar{overflow:hidden}
.workspace-user-avatar img{display:block;width:100%;height:100%;object-fit:cover;border-radius:50%}
.workspace-profile-link .account-name{font-size:13px;font-weight:740;color:inherit}
.workspace-logout-form{display:inline-flex;align-items:center;flex:none}.workspace-account .logout-link:hover{background:#f5f7fa;color:#445465}.workspace-account .logout-link:focus-visible{outline:2px solid #b38c3b;outline-offset:2px}.workspace-account .logout-link svg{width:18px;height:18px;fill:currentColor;flex:none;opacity:.92}
.workspace-mobile-profile{display:none}
.staff-profile-grid{display:grid;grid-template-columns:minmax(240px,320px) minmax(0,1fr);gap:20px;align-items:start;max-width:1120px}
.staff-profile-avatar-panel{display:flex;flex-direction:column;align-items:center;text-align:center;gap:7px;padding:29px 23px}
.staff-profile-avatar-panel h2{align-self:stretch;text-align:left;font-size:17px;margin:0 0 14px}
.staff-profile-avatar-preview{width:148px;height:148px;display:grid;place-items:center;overflow:hidden;border-radius:50%;background:#f6e4b3;border:5px solid #fff;box-shadow:0 0 0 1px #e4d9b8,0 12px 29px #20344b13;margin:0 0 9px}
.staff-profile-avatar-preview img{width:100%;height:100%;object-fit:cover;display:block}
.staff-profile-avatar-preview span{font-size:66px;font-weight:850;color:#755a1d}
.staff-profile-display-name{font-size:19px;line-height:1.35;overflow-wrap:anywhere}
.staff-profile-subtitle{font-size:13px;color:#79899b;overflow-wrap:anywhere}
.staff-profile-photo-hint{font-size:12px;line-height:1.65;max-width:260px;margin:13px 0 15px}
.staff-profile-password-link{background:#f6f7fa;color:#34465d;border:1px solid #dce3e9;font-size:13px;width:100%;max-width:260px}
.staff-profile-password-link:hover{background:#fff5dd;color:#6d501a}
.staff-profile-settings-panel{padding:31px 35px}
.staff-profile-settings-heading{display:flex;gap:14px;justify-content:space-between;align-items:center;border-bottom:1px solid #e9edf2;padding-bottom:18px}
.staff-profile-settings-heading h2{margin:0}
.staff-profile-settings-heading .subtle{font-size:12px}
.staff-profile-form{margin-top:23px;gap:24px}
.staff-profile-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.staff-profile-field{min-width:0}
.staff-profile-span{grid-column:1/-1}
.staff-profile-field label,.staff-profile-upload-block>label:first-child{font-size:13px;font-weight:750;margin-bottom:8px;display:block}
.staff-profile-field input{width:100%;border:1px solid #cbd6e1;border-radius:10px;min-height:47px;padding:11px 13px;background:#fff;color:#26364b}
.staff-profile-field input:focus-visible{outline:2px solid #c39b4c;outline-offset:1px}
.staff-profile-field small{display:block;font-size:12px;margin-top:7px;line-height:1.5}
.staff-profile-upload-block{display:grid;gap:10px;border-top:1px solid #edf0f4;padding-top:22px}
.staff-profile-upload-block>label:first-child{margin:0}
.staff-profile-upload-block input[type=file]{width:100%;min-width:0;border:1px dashed #cbd6e1;border-radius:10px;background:#fbfcfd;padding:13px;font-size:13px}
.staff-profile-upload-block input[type=file]::file-selector-button{background:#fff1cb;border:1px solid #e6ce90;padding:8px 12px;border-radius:8px;font-weight:700;color:#624710;margin-right:13px;cursor:pointer}
.staff-profile-upload-block .staff-profile-remove-label{display:flex;align-items:center;gap:9px;font-size:13px;font-weight:550;cursor:pointer;color:#627487;margin:2px 0 0}
.staff-profile-remove-label input{width:17px;height:17px;accent-color:#ac8535}
.staff-profile-form-actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap;border-top:1px solid #edf0f4;padding-top:22px}
.staff-profile-form-actions .button:not(.primary){border:1px solid #e1e6ed;background:#f7f8fa;color:#435368}
.staff-profile-form-actions .button{min-height:43px;display:inline-flex;align-items:center;justify-content:center;font-size:13px}
@media(max-width:1050px){.staff-profile-grid{grid-template-columns:minmax(220px,270px) minmax(0,1fr)}}
@media(max-width:800px){.staff-profile-grid{grid-template-columns:minmax(0,1fr)}.staff-profile-avatar-panel{align-items:center}.staff-profile-settings-panel{padding:23px}}
@media(max-width:640px){.workspace-profile-link .account-name{display:inline;max-width:115px;font-size:12px}.workspace-mobile-profile{display:block;font-size:12px;font-weight:650;text-decoration:none;padding:11px 14px;border-radius:8px;color:#556779}.workspace-mobile-profile:hover{background:#fff8e5}.staff-profile-fields{grid-template-columns:1fr}.staff-profile-settings-heading{align-items:flex-start}.staff-profile-form-actions .button{flex:1;min-width:140px}}
