/* Shared final layout rules. Loaded after legacy styles and module styles. */
:root{--surface:#fff;--surface-soft:#faf7fa;--text:#302438;--text-muted:#756879;--brand:#722960;--border:#e9dfe8}
html{scroll-padding-top:90px}body{overflow-wrap:break-word}button,a,input,select,textarea{touch-action:manipulation}button{min-height:44px}svg{flex-shrink:0}input,select,textarea{font-size:16px}dialog{overscroll-behavior:contain}body:has(dialog[open]){overflow:hidden}
.executive.global-command{grid-template-columns:232px minmax(0,1fr)}
.executive.global-command .exec-content{max-width:1600px;padding:30px clamp(20px,3vw,44px) 56px}
.executive.global-command .exec-top{height:72px;padding:12px clamp(20px,3vw,44px);gap:16px;background:#fff}
.executive .exec-top-actions{gap:18px;min-width:0}.workspace-user{font-size:13px;color:var(--text-muted);max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.workspace-logout,.mobile-app #logout-commercial{display:inline-flex!important;align-items:center;justify-content:center;gap:8px;border:1px solid var(--border)!important;border-radius:10px!important;background:#fff!important;color:var(--brand)!important;font-size:13px!important;font-weight:700;padding:10px 14px!important;min-height:44px;white-space:nowrap}
.workspace-logout:hover,.mobile-app #logout-commercial:hover{background:#faf2f8!important}.workspace-menu,.workspace-mobile-logo{display:none}
.executive.global-command .exec-aside-bottom{margin-top:auto;padding:16px;background:#ffffff0c;border-color:#ffffff20}.executive .exec-aside-bottom b{line-height:1.5}.executive .exec-nav-label{margin:26px 12px 12px}.executive .exec-nav button{line-height:1.4}.executive .exec-kicker{display:none}.executive .exec-hero{margin-bottom:26px}.executive .exec-hero h1{font-size:clamp(26px,2.6vw,36px);letter-spacing:-1px}.executive .exec-hero p:not(.exec-kicker){font-size:14px;margin-top:9px}
.command-metrics article,.executive .metric{border:1px solid var(--border);box-shadow:0 4px 18px #36183103;border-radius:16px;min-width:0;min-height:152px;padding:22px;display:flex;flex-direction:column;justify-content:center;align-items:flex-start}
.command-metrics article{display:grid;grid-template-columns:minmax(0,1fr) 36px;grid-template-rows:auto 1fr auto;column-gap:8px;row-gap:8px}
.command-metrics .command-icon{position:static;grid-column:2;grid-row:1;display:flex;align-items:center;justify-content:center;padding:8px;margin:0;width:36px;height:36px}
.command-metrics small{grid-column:1;grid-row:1;align-self:center;max-width:none;font-size:13px;line-height:1.45}
.command-metrics strong{grid-column:1/-1;font-size:clamp(26px,2.4vw,34px);line-height:1.2;letter-spacing:-1px;margin:0;font-variant-numeric:tabular-nums}
.command-metrics p{grid-column:1/-1;margin:0;font-size:12px;line-height:1.5;color:var(--text-muted)}
.executive .metric small{padding-right:34px;font-size:13px;line-height:1.5}.executive .metric strong{font-size:30px;margin:14px 0 8px}.executive .metric em{font-size:12px}.executive .metric-icon{top:20px;right:18px;width:30px;height:30px}
.command-modules{align-items:stretch}.command-modules article{padding:26px;border-radius:18px;min-width:0}.command-modules h2{font-size:27px;margin:8px 0}.command-modules p{font-size:14px;line-height:1.6;margin:0}.command-modules .command-eyebrow{font-size:10px;line-height:1.5;letter-spacing:1px}.command-module-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:24px 0}.command-module-stats b{font-size:25px;font-variant-numeric:tabular-nums}.command-module-stats small{font-size:12px;max-width:none;line-height:1.5;font-weight:500}.command-modules button{font-size:13px;border-radius:10px;justify-content:space-between;align-self:stretch;gap:12px;padding:13px 16px}.command-panel{border-radius:16px;min-width:0}.command-panel h2{font-size:17px}.command-panel>p{font-size:13px}.command-alert small{font-size:12px;line-height:1.5}.command-alert strong{font-size:14px}.command-text-button{font-size:13px;line-height:1.5}.command-toolbar{align-items:center;font-size:12px}.command-toolbar button{font-size:12px;min-height:44px}
.executive .card-head{gap:12px;flex-wrap:wrap}.executive .card-head h2{font-size:16px;line-height:1.4}.executive .card-head p{font-size:12px}.executive .donut-wrap{align-items:center;justify-content:center}.executive .donut-legend div{display:flex;align-items:center;gap:8px}.executive .donut-legend b{margin-left:auto}.executive .line-caption{font-size:12px;line-height:1.5}.executive .viz-card{border-radius:16px}.executive .medical-count{white-space:nowrap}.executive .medical-directory>header{gap:16px;align-items:flex-start}.directory-tools{min-width:0}.directory-tools .medical-search{min-width:0}.executive .medical-doctor,.executive .pulse{min-width:0}.medical-doctor strong,.access-person strong{overflow-wrap:anywhere}.executive .medical-totals strong{font-variant-numeric:tabular-nums}
.users-center .access-summary article{padding:22px;border-radius:16px}.users-center .access-summary strong{font-size:30px;margin-top:10px}.users-center .access-actions button{min-height:44px}.access-dialog input,.access-dialog select,.access-filters input,.access-filters select{font-size:16px!important}.access-dialog header button{min-width:44px}.access-dialog footer button{min-height:46px}.access-dialog .access-error:empty{display:none}.access-dialog{max-height:calc(100dvh - 32px)}
.global-operator-workspace>header{position:sticky;top:0;z-index:25;padding:12px 24px;min-height:72px;flex-wrap:nowrap;gap:12px}.global-operator-workspace>header>div{min-width:0}.global-operator-workspace>header img{max-width:130px}.global-operator-workspace>header b{font-size:13px;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.global-operator-workspace>main{padding:28px 24px;max-width:1360px}.global-operator-workspace h1{font-size:30px;letter-spacing:-1px;margin:4px 0 22px}.operator-greeting{font-size:13px;color:var(--text-muted);margin:0 0 6px}.global-module-frame{min-width:0;width:100%;border:0}
.mobile-app{background:#faf7fa}.mobile-app>header{position:sticky;top:0;z-index:20;border-bottom:1px solid var(--border);padding:12px max(16px,calc((100vw - 900px)/2));min-height:72px}.mobile-app header img{max-width:130px}.mobile-app main{max-width:900px;padding:28px 24px 116px}.mobile-app .doctor-list{gap:12px}.mobile-app .doctor{align-items:center;gap:16px;min-height:84px;padding:18px;border-radius:14px}.mobile-app .doctor>span{min-width:0}.mobile-app .doctor strong{font-size:15px;line-height:1.5}.mobile-app .doctor small{font-size:13px}.mobile-app .doctor>b{display:grid;place-items:center;border-radius:50%;background:#faf2f8;width:30px;height:30px;flex-shrink:0}.mobile-app .recorder{padding:20px}.mobile-app #record-status{font-size:13px}.mobile-app .recorder button{min-height:116px}.mobile-app .search{min-height:50px}.mobile-app nav{max-width:900px;margin:auto;border:1px solid var(--border);border-bottom:0;border-radius:16px 16px 0 0;background:#fff;padding:4px 6px max(6px,env(safe-area-inset-bottom));z-index:30}.mobile-app nav button{font-size:13px;min-height:62px;gap:5px;padding:10px 5px;border-radius:10px}.mobile-app nav button.active{background:#f8edf4}.mobile-app .visit-preview{padding:20px;border-radius:16px}.mobile-app .preview-head>span{flex-shrink:0}.mobile-app .preview-head h2{font-size:17px}.mobile-app .followup{border-radius:16px}.mobile-app .followup strong{line-height:1.5}.mobile-app .preview-field label{font-size:12px}.mobile-app .preview-field input,.mobile-app .preview-field textarea,.mobile-app .preview-field select{font-size:16px}.mobile-app .transcript-label small{font-size:12px}.mobile-app .intro{font-size:14px}.mobile-app .eyebrow{font-size:12px;letter-spacing:.3px;text-transform:none;font-family:inherit}.mobile-app .visit-history{border-radius:14px;padding:18px}.mobile-app .visit-history summary{font-size:14px;line-height:1.6}.mobile-app .visit-history p{font-size:14px}.mobile-app .visit-history small{font-size:12px;line-height:1.6}
.login-card input{font-size:16px;min-height:48px}.login-card button{min-height:48px}.login-card label{font-size:13px}.login-card #login-error{line-height:1.5;font-size:13px}.login-art span{max-width:420px}.toast{font-size:13px;line-height:1.5;z-index:90}
.workspace-drawer{position:fixed;inset:0 auto 0 0;margin:0;width:min(340px,calc(100vw - 32px));height:100dvh;max-height:100dvh;max-width:none;border:0;border-radius:0 20px 20px 0;padding:24px;background:#fff;color:var(--text);box-shadow:12px 0 60px #2d102b30}.workspace-drawer::backdrop{background:#26112770;backdrop-filter:blur(3px)}.workspace-drawer header{display:flex;align-items:flex-start;gap:14px;justify-content:space-between;border-bottom:1px solid var(--border);padding-bottom:20px;margin-bottom:18px}.workspace-drawer h2{font-size:19px;margin:0;line-height:1.4;letter-spacing:-.5px}.workspace-drawer header p{font-size:13px;color:var(--text-muted);margin:6px 0 0}.workspace-drawer .drawer-close{display:grid;place-items:center;min-width:44px;background:#f8eff5;border:0;color:var(--brand);border-radius:10px}.workspace-drawer nav{display:grid;gap:8px}.workspace-drawer nav button{display:flex;align-items:center;gap:12px;background:white;border:0;border-radius:12px;font-size:14px;color:var(--text);padding:15px 12px;text-align:left;min-height:52px}.workspace-drawer nav button>span{display:flex;color:var(--brand)}.workspace-drawer nav button.active{background:#f6e8f1;color:var(--brand);font-weight:750}
@media(min-width:1001px){.mobile-app #doctor-list{grid-template-columns:repeat(2,minmax(0,1fr))}.mobile-app #capture-screen,.mobile-app #followup-screen,.mobile-app #history-screen{max-width:640px;margin:auto}}
@media(max-width:1100px){.executive.global-command{grid-template-columns:210px minmax(0,1fr)}.executive.global-command .exec-content{padding:26px 22px 44px}.command-metrics,.executive .metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.command-detail-grid,.command-modules,.executive .viz-grid,.executive .viz-grid.bottom{grid-template-columns:minmax(0,1fr)}.workspace-user{display:none}}
@media(max-width:800px){
  .executive.global-command{display:block}.executive.global-command>.executive-aside{display:none!important}.executive.global-command .exec-top{position:sticky;top:0;z-index:30;padding:10px 16px;height:68px;min-height:68px;flex-wrap:nowrap;gap:10px;box-shadow:0 2px 12px #55235304}.executive .exec-crumb{display:none}.workspace-menu{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--border);border-radius:10px;padding:10px;background:#fff;color:var(--brand);font-size:13px;min-height:44px}.workspace-mobile-logo{display:block;max-width:102px;max-height:40px;object-fit:contain;margin-right:auto}.executive .exec-top-actions{margin-left:auto}.workspace-logout,.mobile-app #logout-commercial{padding:10px!important;font-size:12px!important;gap:6px}.workspace-logout svg{width:18px;height:18px}.executive.global-command .exec-content{padding:24px 16px 40px}.executive .exec-hero{margin-bottom:22px}.executive .exec-hero h1{font-size:27px}.executive .exec-hero p:not(.exec-kicker){font-size:13px}.command-metrics article,.executive .metric{padding:16px;min-height:146px}.command-metrics article{grid-template-columns:minmax(0,1fr);gap:8px}.command-metrics .command-icon{display:none}.command-metrics small{min-height:38px;align-self:start;font-size:12px}.command-metrics strong{font-size:28px}.command-metrics p{font-size:11px;line-height:1.5}.command-metrics{gap:10px}.command-modules article{padding:22px}.command-module-stats small{font-size:11px}.command-panel{padding:19px}.command-stage{grid-template-columns:110px minmax(0,1fr) 24px;gap:8px;font-size:12px}.logistics-entry{flex-direction:column;align-items:stretch;gap:12px}.logistics-entry .command-text-button{margin:0;width:100%;display:flex;align-items:center;justify-content:space-between}.logistics-entry h2{font-size:19px}.executive .viz-card{padding:18px}.executive .metric strong{font-size:27px}.executive .metric small{padding-right:24px;font-size:12px}.executive .metric-icon{width:24px;height:24px;right:12px;top:14px;font-size:13px}.executive .metric em{font-size:11px}.executive .legend{font-size:11px}.executive .donut-wrap{padding:22px 0 12px;gap:24px}.executive .donut-legend{flex:none;width:100%;max-width:360px}.executive .funnel{gap:8px}.executive .funnel-item i{width:100%;max-width:44px}.executive .funnel-item small{font-size:10px;word-break:normal}.executive .funnel-item strong{font-size:11px}.executive .line-chart{min-height:150px}.executive .line-caption{margin:8px 0 0;padding:12px 0 0}.executive .medical-totals{grid-template-columns:1fr;gap:0}.medical-totals>div{display:flex;justify-content:space-between;align-items:center;padding:12px 0;border-bottom:1px solid #f2e9f0}.medical-totals strong{margin:0;font-size:22px}.executive .medical-directory>header{display:flex;flex-direction:column}.directory-tools{width:100%}.directory-tools .medical-search{width:100%;min-width:0}.directory-add{white-space:normal}.medical-directory,.medical-profile,.medical-evidence{padding:18px}.executive .portfolio-row>span{line-height:1.6}.executive .pulse{padding:16px 0}.executive .ai-finding button{width:100%;grid-column:1/-1}.executive .ai-analysis-panel{width:100%;padding:22px 18px}
  .users-center .access-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.users-center .access-summary article{padding:16px}.users-center .access-summary span{font-size:12px}.users-center .access-summary strong{font-size:27px}.users-center .access-panel{padding:18px}.users-center .access-panel>header{align-items:stretch;flex-direction:column;gap:12px}.users-center .access-panel h2{font-size:18px}.users-center .access-panel>header p{margin:7px 0}.users-center .access-primary{min-height:46px}.users-center .access-filters{flex-direction:column}.users-center .access-filters label{max-width:none}.users-center .access-row{grid-template-columns:38px minmax(0,1fr);gap:10px;padding:20px 0}.users-center .access-profile,.users-center .access-row>div:nth-child(4),.users-center .access-actions{grid-column:2}.users-center .access-actions{justify-content:flex-start}.users-center .access-profile{font-size:12px}.users-center .access-person strong{font-size:14px}.users-center .access-roles{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.users-center .access-roles article{padding:16px}.users-center .access-roles h3{line-height:1.5}.access-dialog{padding:22px;width:calc(100vw - 24px)}.access-dialog>header h2{font-size:21px}.access-dialog footer{gap:8px}.access-dialog footer button{flex:1;padding:12px}.directory-dialog{width:calc(100vw - 24px);padding:20px}.directory-dialog form{gap:16px}
  .global-operator-workspace>header{padding:10px 16px;min-height:68px}.global-operator-workspace>header img{max-width:110px}.global-operator-workspace>header b{display:none}.global-operator-workspace>main{padding:24px 16px}.global-operator-workspace h1{font-size:27px;margin-bottom:18px}.mobile-app>header{padding:10px 16px;min-height:68px}.mobile-app header img{max-width:115px}.mobile-app main{padding:24px 16px 112px}.mobile-app h1{font-size:27px;line-height:1.25}.mobile-app nav{border-radius:0;min-height:74px}.mobile-app .preview-row{grid-template-columns:1fr}.mobile-app .transcript-label{flex-direction:column;align-items:flex-start;gap:4px}.mobile-app .transcript-label small{max-width:none;text-align:left}.mobile-app .followup form{grid-template-columns:1fr}.mobile-app .followup button{width:100%}.mobile-app .selected-doctor{padding:15px}.mobile-app .visit-preview{padding:18px}.mobile-app .primary{font-size:14px;min-height:50px}.mobile-app .preview-head small{font-size:10px}.mobile-app .recorder button small{font-size:12px}.login-art{min-height:0;padding:24px}.login-art>div{display:none}.login-art img{width:150px}.login-card{max-width:440px;padding:30px 24px}.login-card h2{font-size:28px}.login{min-height:100dvh}.login-card>.eyebrow{font-size:11px;line-height:1.6}
  .logistics .lg-toolbar{align-items:stretch;flex-direction:column;gap:12px}.logistics .lg-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.logistics .lg-tabs button{white-space:normal;font-size:12px;padding:10px;min-height:44px}.logistics .lg-kpi{padding:16px;min-width:0}.logistics .lg-kpi strong{font-size:27px}.logistics .lg-kpi small{font-size:11px;line-height:1.5}.logistics .lg-kpi>div>span{font-size:12px}.logistics .lg-tools{width:100%;flex-wrap:wrap}.logistics .lg-search{width:100%;min-width:0}.logistics input,.logistics select,.lg-dialog input,.lg-dialog select,.lg-dialog textarea{font-size:16px}.lg-dialog{width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:20px}.lg-dialog header{align-items:flex-start}.lg-dialog h2{font-size:21px}.lg-dialog .lg-metadata{grid-template-columns:1fr}.logistics .lg-network h2{font-size:22px}.logistics .lg-network-tag{display:none}.logistics .lg-dispatch{flex-wrap:wrap}.logistics .lg-tools button{min-height:44px}
}
.mobile-app nav{display:grid;grid-template-columns:repeat(5,minmax(0,1fr))}.mobile-app nav button{min-width:0}.mobile-app nav button span{white-space:normal;line-height:1.2;text-align:center}
#commercial.mobile-app #history-screen{max-width:1120px;margin:0 auto}.history-example-notice{padding:14px 18px;background:#f4e9f1;border:1px solid #e4cedd;border-radius:12px;color:#805f78;font-size:13px;line-height:1.6}.history-example{margin:12px 0;background:#fff;border:1px solid #eadce6}.history-example>summary{cursor:pointer}.history-example>summary small{display:block;margin-top:6px;color:#8a6b82}
@media(min-width:1100px){
  .mobile-app{display:grid;grid-template-areas:"commercial-header" "commercial-nav" "commercial-content";grid-template-rows:80px auto 1fr}
  .mobile-app>header{grid-area:commercial-header;height:80px;min-height:80px;padding:12px max(32px,calc((100vw - 1416px)/2))}
  .mobile-app>header img{max-height:52px;max-width:145px;width:auto;object-fit:contain}
  .mobile-app>main{grid-area:commercial-content;width:100%;max-width:1480px;padding:32px 32px 56px;min-width:0;margin:0 auto;align-self:start}
  .mobile-app>nav{grid-area:commercial-nav;position:sticky;top:80px;bottom:auto;left:auto;right:auto;max-width:none;width:100%;margin:0;border:0;border-bottom:1px solid #eadce6;border-radius:0;padding:8px max(32px,calc((100vw - 1416px)/2));grid-template-columns:repeat(5,minmax(0,180px));justify-content:start;gap:8px;box-shadow:none}
  .mobile-app>nav button{flex-direction:row;gap:10px;min-height:44px;padding:10px 16px;font-size:13px}
  .mobile-app>nav button svg{flex-shrink:0}
}
@media(max-width:480px){.mobile-app nav button{font-size:11px;padding:9px 2px}.mobile-app nav i{font-size:10px;padding:1px 4px}}
@media(max-width:360px){.workspace-menu span{display:none}.workspace-menu{min-width:44px}.workspace-mobile-logo{max-width:90px}.workspace-logout{font-size:11px!important}.command-module-stats{gap:8px}.users-center .access-roles{grid-template-columns:1fr}.executive .funnel{gap:5px}.mobile-app .preview-head h2{font-size:15px}}
.activity-chart{margin-top:20px;padding-top:8px}.activity-columns{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:12px;background:repeating-linear-gradient(to top,transparent 0,transparent 39px,#f1e9f0 40px,transparent 41px);padding:0 4px}.activity-column{min-width:0;text-align:center}.activity-track{height:165px;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:8px;border-bottom:1px solid #e8dce6}.activity-track strong{font-size:13px;line-height:1.2;color:#722960;font-variant-numeric:tabular-nums}.activity-track i{display:block;max-width:42px;width:70%;background:linear-gradient(180deg,#c15a93,#722960);border-radius:6px 6px 0 0;flex-shrink:0}.activity-column small{display:block;padding:10px 0 2px;font-size:12px;color:#756879;white-space:nowrap;background:#fff}.activity-column:hover i{filter:brightness(1.12)}@media(max-width:800px){.activity-columns{gap:6px}.activity-column small{font-size:10px}.activity-track strong{font-size:12px}}
@media(max-width:800px){.users-center .access-summary{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.users-center .access-summary article{padding:14px 12px;display:flex;flex-direction:column}.users-center .access-summary article:nth-child(4){display:none}.users-center .access-summary span{font-size:11px;min-height:32px;line-height:1.45}.users-center .access-summary strong{font-size:25px;margin-top:6px}}
.workspace-logout span,.global-operator-workspace>header .workspace-logout span{display:inline!important;font:inherit!important;letter-spacing:normal!important;color:inherit!important}@media(min-width:801px){.global-operator-workspace .operator-greeting{display:none}}
.executive.global-command .session-profile{display:block!important;flex-shrink:0}.executive.global-command .session-profile .workspace-logout{width:100%;margin-top:14px}.workspace-drawer[open]{display:flex;flex-direction:column;box-sizing:border-box;overflow-y:auto}.workspace-drawer header,.workspace-drawer nav{flex-shrink:0}.executive.global-command .workspace-drawer .session-profile{margin-top:auto;padding:18px 16px;background:#f7eff5;border:1px solid #e8d5e2;border-radius:14px}.executive.global-command .workspace-drawer .session-profile small{color:#8a7085;display:block;font-size:12px}.executive.global-command .workspace-drawer .session-profile b{color:#552353;display:block;font-size:16px;margin-top:5px}.workspace-drawer nav{margin-bottom:24px}
