/* Monika Desk presentation: native ERPNext-inspired working surfaces.
   The legacy filename is retained for existing previews and cached references.
   No workflow state, data requests, permissions or control ownership live here.
   Phone geometry belongs to mobile.css; module navigation to erpDesk.css. */
:root{
 --ui-canvas:#f7f8fa;--ui-surface:#fff;--ui-surface-alt:#f1f3f7;
 --ui-text:#252c3b;--ui-muted:#596476;--ui-border:#dce1e9;--ui-control-border:#8a96a9;
 --ui-accent:#334ac7;--ui-accent-hover:#263aa5;--ui-on-accent:#fff;
 --ui-selected:#e9edff;--ui-focus:#334ac7;--brand-text:#3348b6;
 --ui-radius:8px;--ui-control-radius:6px;--ui-control-height:34px;--ui-row-height:36px;
 --radius-sm:6px;--radius-md:8px;--radius-lg:10px;
 --ui-shadow:0 3px 12px #1d254312;--shadow-lg:0 16px 48px #17213a26;
 --table-head:#e1e7f1;--table-head-text:#26334a;--table-grid:#dce3ed;
 --table-stripe:#f0f3f9;--table-total:#e4e9fb;--table-total-text:#293b76;
 --apple-sidebar:#f2f3f6;--apple-sidebar-text:#30394c;--apple-sidebar-muted:#5e687b;
 --apple-sidebar-hover:#e7eaf2;--apple-active:#e4e9ff;--apple-active-text:#3045b3;
 --ink-900:#252c3b;--ink-800:#30394c;--ink-700:#465268;--ink-600:#515d72;
 --ink-500:#596476;--ink-400:#748197;--ink-300:#acb7c9;--ink-200:#dce1e9;--ink-100:#edf0f6;--ink-50:#f7f8fb;
 --brand-900:#263471;--brand-800:#2e3f9c;--brand-700:#3348b6;--brand-600:#334ac7;--brand-500:#4b61d4;--brand-100:#e4e9fb;--brand-50:#f0f3ff;
 --workspace-accent:var(--work-blue);--workspace-tint:var(--work-blue-tint);--workspace-line:var(--work-blue-line);
}
:root[data-theme=dark]{
 --ui-canvas:#171b24;--ui-surface:#222834;--ui-surface-alt:#2a3241;
 --ui-text:#edf0f7;--ui-muted:#bac4d6;--ui-border:#424d60;--ui-control-border:#7e8ca4;
 --ui-accent:#becaff;--ui-accent-hover:#d7dfff;--ui-on-accent:#25336e;
 --ui-selected:#34436a;--ui-focus:#b8c8ff;--brand-text:#c2ceff;
 --table-head:#354158;--table-head-text:#f1f4ff;--table-grid:#46546c;
 --table-stripe:#2c3546;--table-total:#3b4970;--table-total-text:#e5ebff;
 --apple-sidebar:#1d2430;--apple-sidebar-text:#e4eafa;--apple-sidebar-muted:#b8c5dc;
 --apple-sidebar-hover:#303b50;--apple-active:#34436a;--apple-active-text:#d4deff;
 --ink-900:#edf0f7;--ink-800:#e4eafa;--ink-700:#d2dced;--ink-600:#c1cde0;
 --ink-500:#bac4d6;--ink-400:#9cacc5;--ink-300:#6e809e;--ink-200:#424d60;--ink-100:#2e3a50;--ink-50:#283347;
 --brand-900:#e7edff;--brand-800:#d5dfff;--brand-700:#c2ceff;--brand-600:#becaff;--brand-500:#aabdff;--brand-100:#34436a;--brand-50:#2b3756;
}
#app-shell,#modal-root,.ss-panel,#login-screen{--font:'Inter Field',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;--font-display:var(--font);font-family:var(--font);font-optical-sizing:auto;}
#app-shell .topbar{background:var(--ui-surface);border-bottom-color:var(--ui-border);box-shadow:none;}
#app-shell :is(.theme-pill,.layout-pill,.fy-pill,.support-bell-pill,.maintenance-pill){border-radius:6px;}
#app-shell .user-avatar{background:var(--ui-selected);color:var(--brand-text);}
#app-shell .brand-logo-mark{box-shadow:none;border:1px solid var(--ui-border);}
:is(#app-shell,#modal-root) :is(.btn,.ss-trigger){border-radius:var(--ui-control-radius);}
:is(#app-shell,#modal-root) .btn-secondary{color:var(--ui-text);background:var(--ui-surface);}
:is(#app-shell,#modal-root) .btn-primary{background:var(--ui-accent);color:var(--ui-on-accent);border-color:var(--ui-accent);}
:is(#app-shell,#modal-root) .btn-primary:hover{background:var(--ui-accent-hover);border-color:var(--ui-accent-hover);}
:is(#app-shell,#modal-root) :is(.badge,.erp-status){border-radius:5px;font-weight:600;}
:is(#app-shell,#modal-root) :is(input,select,textarea){accent-color:var(--ui-accent);}
:is(#app-shell,#modal-root) :focus-visible,.ss-panel :focus-visible{outline:3px solid var(--ui-focus);outline-offset:2px;}
#page-content :is(.card,.filter-bar,.bd-card,.bd-filters,.erp-panel,.erp-metric,.erp-performance-card,.erp-master-link,.report-card,.library-card){box-shadow:none;}
#page-content :is(.erp-panel-head,.erp-home-header){background:var(--ui-surface);}
#page-content .erp-metric-featured{background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-border);border-top:2px solid var(--ui-accent);}
#page-content .erp-metric-featured :is(small,.erp-metric-arrow){color:var(--ui-muted);}
#page-content :is(.erp-metric,.bd-kpi,.kpi,.sfc-prices){font-variant-numeric:tabular-nums;}
#page-content #module-grid .module-card{box-shadow:none;}
#page-content #module-grid .module-card:hover{transform:none;box-shadow:none;}
#modal-root .modal{border-radius:10px;box-shadow:var(--shadow-lg);border-color:var(--ui-border);}
#modal-root :is(.modal-head,.modal-foot){background:var(--ui-surface-alt);border-color:var(--ui-border);}
#modal-root .modal-head h3{font-size:17px;font-weight:650;letter-spacing:-.02em;}
.ss-panel{border-radius:8px;box-shadow:var(--shadow-lg);background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-control-border);}
.ss-search{border-color:var(--ui-control-border);background:var(--ui-surface);color:var(--ui-text);font-family:var(--font);}
.ss-option{color:var(--ui-text);}
.ss-option:hover,.ss-option-highlighted,.ss-option.highlighted{background:var(--ui-selected);color:var(--brand-text);}
.ss-option-disabled{color:var(--ui-muted);opacity:.7;}
/* Opaque, legible headers retain the owning table's sticky positioning. */
:is(#app-shell,#modal-root) .data-table:not(.cov-matrix) thead th{background:var(--table-head);color:var(--table-head-text);}
:is(#app-shell,#modal-root) .data-table:not(.cov-matrix) thead th :is(a,button){color:inherit;}
#page-content .excel-studio{border-radius:8px;border-color:var(--ui-border);}
#page-content .excel-studio .studio-toolbar{background:var(--ui-surface);}
/* Desktop presentation: work surfaces fill the page, while dialogs, reading
   copy, focused forms and internal columns keep their deliberate limits. */
@media(min-width:761px){
 #page-content{max-width:none;padding:20px 20px 28px;}
 #page-content>:is(.erp-home,.erp-masters,.outlet-master,.outlet-setup,
   .ic-workspace,.rp,.library-workspace,.sales-insights,.sp-workspace,
   .field-home,.sfa-attendance,.sfa-commerce,.sfa-price-list,.sfa-work,
   .sfa-planning,.sfa-assignments,.sfa-readiness,.sfa-settings,.sfa-universe,
   .sfa-visits){width:100%;max-width:none;min-width:0;margin-inline:0;}
 #app-shell[data-nav-pos=top]>.topbar{z-index:30;}
 #app-shell .sidebar,#app-shell[data-nav-pos=top] .sidebar,#app-shell[data-nav-pos=top] .nav-group-children{background:var(--apple-sidebar);color:var(--apple-sidebar-text);border-color:var(--ui-border);}
 #app-shell .sidebar-brand{min-height:64px;border-color:var(--ui-border);padding:12px;}
 #app-shell .sidebar-brand-text b{color:var(--apple-sidebar-text);font-size:12px;font-weight:650;}
 #app-shell .sidebar-brand-text span,#app-shell .nav-section-label{color:var(--apple-sidebar-muted);}
 #app-shell .nav-link{color:var(--apple-sidebar-text);border-radius:6px;min-height:34px;}
 #app-shell .nav-link :is(.ico,.nav-chevron),#app-shell .nav-link.sub .ico{color:var(--apple-sidebar-muted);}
 #app-shell .nav-link:hover{background:var(--apple-sidebar-hover);color:var(--apple-sidebar-text);}
 #app-shell .nav-link.active{background:var(--apple-active);color:var(--apple-active-text);box-shadow:inset 3px 0 var(--ui-accent);}
 #app-shell .nav-link.active :is(.ico,.nav-chevron){background:transparent;color:var(--apple-active-text);}
 #app-shell .nav-group-children{border-color:var(--ui-border);}
 #app-shell .sidebar-toggle{background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-control-border);border-radius:6px;}
 #app-shell .topbar{min-height:56px;padding:8px 20px;}
 #app-shell .topbar-title{font-weight:650;letter-spacing:-.015em;}
 /* One heading rhythm for lists, forms, commercial and field workspaces. */
 #page-content :is(.page-header,.sp-header,.ic-header,.bd-header,.si-header,.hub-header,.studio-toolbar,.rp-header,.cr-header,.om-header,.oo-header,.sfc-heading,.sfe-heading,.sfv-heading,.sfp-heading,.sfa-a-header,.sfr-heading,.sfu-heading){border:0;border-bottom:1px solid var(--ui-border);border-radius:0;background:transparent;padding:0 0 14px;margin:0 0 16px;box-shadow:none;}
 #page-content :is(.page-title,.page-context h1,.page-header h1,.page-header h2,.bd-header h2,.si-header h2,.hub-header h2,.studio-heading h2,.om-header h2,.sfc-heading h2,.sfe-heading h2,.sfv-heading h2,.sfp-heading h2,.sfa-a-header h2,.sfr-heading h2,.sfu-heading h2){font-size:24px;line-height:1.25;font-weight:650;letter-spacing:-.025em;}
 #page-content :is(.page-header,.om-header,.sfc-heading,.sfe-heading,.sfv-heading,.sfp-heading,.sfa-a-header,.sfr-heading,.sfu-heading) p{font-size:12px;line-height:1.5;margin:5px 0 0;color:var(--ui-muted);}
 #page-content :is(.card,.erp-metric,.erp-performance-card,.erp-panel,.erp-master-link,.library-card,.report-card,.bd-card,.bd-kpi,.sfa-card,.sfp-card,.sfv-card,.sfc-product,.sfe-card,.sfr-card,.sfu-card,.sfa-a-results,.sfa-a-start,.om-feedback,.om-connection){border-radius:8px;box-shadow:none;border-color:var(--ui-border);}
 #page-content :is(.card-pad,.sfa-card,.sfp-card,.sfv-card,.sfe-card,.sfr-card,.sfu-card){padding:16px;}
 #page-content :is(.filter-bar,.bd-filters,.si-filters,.sp-record-filters,.om-filters,.oo-filters,.sfc-filters,.sfe-filters,.sfv-filters,.sfp-filters,.sfa-a-filters,.sfr-filters,.sfu-filters){gap:10px;padding:12px;border:1px solid var(--ui-border);border-radius:8px;background:var(--ui-surface);box-shadow:none;}
 #page-content :is(.filter-bar,.bd-filters,.si-filters,.sp-record-filters,.om-filters,.sfc-filters,.sfa-a-filters) label{font-size:11px;font-weight:550;color:var(--ui-muted);}
 :is(#app-shell,#modal-root) :is(.field input:not([type=checkbox]):not([type=radio]),.field select,.ss-trigger){min-height:34px;padding:7px 10px;font-size:13px;border-radius:6px;}
 :is(#app-shell,#modal-root) .field textarea{font-size:13px;border-radius:6px;line-height:1.5;}
 :is(#app-shell,#modal-root) .btn{min-height:34px;font-size:12px;padding:6px 11px;}
 :is(#app-shell,#modal-root) .btn-sm{min-height:28px;padding:4px 8px;font-size:11px;}
 #page-content :is(.sfc-filters,.sfa-a-filters) :is(input,select){min-height:34px;font-size:13px;}
 #page-content :is(.tabs,.tab-bar,.om-tabs,.sfa-nav){gap:4px;margin-bottom:14px;}
 #page-content :is(.tab,.tab-btn,.om-tabs .tab,.sw-tabs button){min-height:36px;padding:8px 12px;border-radius:0;font-size:12px;}
 #page-content :is(.tab.active,.tab-btn.active,.om-tabs .tab.active,.sw-tabs button[aria-selected=true]){background:transparent;color:var(--brand-text);box-shadow:inset 0 -2px var(--ui-accent);}
 :is(#app-shell,#modal-root) .table-wrap{border-radius:8px;box-shadow:none;}
 :is(#app-shell,#modal-root) .data-table:not(.cov-matrix) :is(th,td){padding:8px 11px;font-size:12px;line-height:1.4;}
 :is(#app-shell,#modal-root) .data-table:not(.cov-matrix) :is(th,td).cell-select{padding-inline:6px;}
 :is(#app-shell,#modal-root) .data-table:not(.cov-matrix) thead th{font-size:11px;font-weight:650;border-bottom:1px solid var(--ui-control-border);}
 :is(#app-shell,#modal-root) .data-table:not(.cov-matrix) :is(th,td){text-align:left!important;}
 :is(#app-shell,#modal-root) .data-table:not(.cov-matrix) :is(th,td).cell-number{ text-align:right!important;}
 :is(#app-shell,#modal-root) .data-table:not(.cov-matrix) :is(th,td):is(.cell-select,.cell-actions){text-align:center!important;}
 :is(#app-shell,#modal-root) .data-table:not(.cov-matrix) tbody tr:nth-child(even):not(.row-selected):not(.sec-row) td{background-color:var(--table-stripe);}
 :is(#app-shell,#modal-root) .data-table:not(.cov-matrix) tbody tr:hover:not(.row-selected) td{background-color:var(--ui-selected);}
 #page-content :is(.table-pager,.om-toolbar,.om-selection){font-size:12px;}
 #modal-root .modal-head{padding:16px 20px;}
 #modal-root .modal-body{padding:20px;}
 #modal-root .modal-foot{padding:12px 20px;gap:8px;}
 /* Spreadsheet grids retain their cell geometry, frozen panes and formulas. */
 #page-content .sw-focus-bar{flex-wrap:wrap;}
 #page-content .sw-focus-bar>span{min-width:0;}
 #page-content .excel-studio .studio-toolbar{padding:10px 12px;margin:0;border-bottom:1px solid var(--ui-border);}
 #page-content .excel-studio .studio-heading h2{font-size:16px;}
 #page-content .excel-studio :is(.studio-inspector,.studio-context,.studio-inspector-head){background:var(--ui-surface-alt);}
 #page-content .excel-studio .pivot-dropzone{border-color:var(--ui-control-border);border-radius:6px;background:var(--ui-surface);}
 #page-content .excel-studio .pivot-zone-item{border-radius:4px;background:var(--ui-selected);color:var(--ui-text);border-color:var(--ui-border);}
 #page-content .excel-studio .pivot-chip{min-height:28px;}
}
/* Login geometry and colours are owned by agave-login.css; mobile.css
   supplies phone gutters. Keep workspace overrides out of the sign-in form. */
@media(prefers-reduced-motion:reduce){
 #page-content #module-grid .module-card{transition:none;}
}
@media(forced-colors:active){
 #app-shell .nav-link.active{outline:2px solid Highlight;outline-offset:-2px;}
 :is(#app-shell,#modal-root) .data-table:not(.cov-matrix) thead th{background:Canvas;color:CanvasText;border-color:CanvasText;}
 :is(#app-shell,#modal-root) .data-table:not(.cov-matrix) tbody tr:nth-child(even):not(.row-selected):not(.sec-row) td{background:Canvas;}
}
/* The contextual dock leaves less room at the tablet boundary. Reflow the
   directory's real controls instead of allowing fixed track minima to spill. */
@media(min-width:761px) and (max-width:1100px){
 #page-content .erp-masters-controls{grid-template-columns:repeat(2,minmax(0,1fr));padding:12px;}
 #page-content .erp-masters-controls .btn{justify-self:start;}
 #page-content .erp-masters-controls .field{min-width:0;}
}
@media(min-width:761px) and (max-width:900px){
 #page-content .erp-masters-controls{grid-template-columns:minmax(0,1fr);}
}
/* Utility controls shrink deliberately before headings or button labels wrap. */
@media(min-width:761px){
 #app-shell .topbar-left{min-width:0;flex:1 1 auto;gap:10px;}
 #app-shell .topbar-left>div{min-width:0;}
 #app-shell .topbar-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
 #app-shell .workspace-search-open{flex-shrink:0;white-space:nowrap;margin-left:8px;}
 #app-shell .workspace-search-open svg{flex-shrink:0;}
 #app-shell .topbar-right{flex:0 1 auto;min-width:0;}
 #app-shell .topbar-right :is(button,a){white-space:nowrap;}
}
@media(min-width:761px) and (max-width:1500px){
 #app-shell .user-meta{display:none;}
 #app-shell .workspace-search-open>span{display:none;}
 #app-shell .workspace-search-open kbd{display:none;}
 #app-shell .workspace-search-open{width:34px;min-height:34px;padding:8px;justify-content:center;}
}
@media(min-width:761px) and (max-width:1100px){
 #app-shell .topbar{flex-wrap:wrap;gap:8px;}
 #app-shell .topbar-left{flex-basis:100%;}
 #app-shell .topbar-right{margin-left:auto;justify-content:flex-end;}
}
/* Task-dialog actions remain comfortably clickable; compact spreadsheet cell
   controls are intentionally outside this selector. Phones retain 44px. */
@media(min-width:761px){
 #modal-root :is(.modal-foot,.sfc-form,.sfa-task,.sfa-a-form,.sfp-form,.om-form-actions) .btn{min-height:36px;}
}
