/* Working-application layout. Loaded last: compact, full-width screens; the sidebar and the
   top bar identify the current section, so pages carry no large titles or explanations. */
.workspace-main{font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;font-size:13px}
.workspace-main button,.workspace-main input,.workspace-main select,.workspace-main textarea,.crm-dialog{font-family:inherit}

/* Shell */
@media(min-width:861px){
  .sidebar{width:216px;padding:16px 10px 14px;position:sticky;top:0;align-self:flex-start;height:calc(100svh / var(--ui-zoom,1));overflow-y:auto}
  .sidebar .brand,.sidebar .brand.logo-surface{margin:0 8px 12px;max-width:150px}
  .sidebar .brand img{max-width:150px}
  .nav-caption{margin:14px 10px 4px;font-size:9px}
  .nav-item{padding:7px 10px;font-size:13px;gap:10px;border-radius:4px}
  .sidebar-bottom{margin:14px 4px 0;padding-top:12px}
}
.workspace-header{padding:8px 16px;min-height:44px;box-sizing:border-box;font-size:12px}
.workspace-header>div{gap:14px}
.workspace-content,.workspace-content.order-entry-active,.workspace-content.planner-active{max-width:none;margin:0;padding:12px 16px 24px}

/* Page titles and descriptions: the sidebar and breadcrumb already say where you are. */
#workspace-title,.workspace-content>.workspace-subtitle{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.ops-toolbar{margin:0 0 10px;justify-content:flex-end;min-height:0}
.ops-toolbar>div:first-child{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.ops-toolbar:not(:has(.ops-actions > *)){display:none}
.order-entry-active h1{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}

/* Section headings inside a screen: small labels, not banners. */
#operations-content h3,#catalog-content h3,#customer-content h3,.access-heading{font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:#3d6470;margin:18px 0 6px}
#operations-content h2,#catalog-content h2{font-size:15px;margin:0 0 6px}
.ops-help,.access-hint,.plan-hint{font-size:12px;margin:2px 0 8px;line-height:1.45}
.ops-message:empty,.crm-message:empty{display:none}

/* Tabs */
.ops-tabs{margin:0 0 10px;padding-bottom:0;gap:2px;border-bottom:1px solid var(--line)}
.ops-tabs button{padding:7px 12px;border-radius:0;border-bottom:2px solid transparent;font-size:13px}
.ops-tabs button.active{background:none;color:var(--ink);font-weight:600;border-bottom-color:var(--brand-blue)}
.access-tabs{margin-bottom:10px}.access-tabs button{padding:7px 12px}
.plan-steps{margin:0 0 10px}.plan-steps button{padding:7px 14px;font-size:13px}

/* Buttons */
.crm-primary,.crm-secondary{min-height:32px;padding:6px 12px;font-size:12.5px;border-radius:4px}

/* Tables: denser rows, readable headers. */
.crm-table-scroll{border-radius:6px}
.crm-table th{padding:8px 10px;font-size:10.5px;letter-spacing:.04em}
.crm-table td{padding:7px 10px;font-size:12.5px}
.crm-table td:first-child{min-width:160px}
.crm-toolbar{margin:0 0 10px;gap:10px}

/* Overview cards */
.module-grid{grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:10px}
.module-card{padding:14px 16px}
.module-card h3{margin:8px 0 0;font-size:13px}
.planned-panel{padding:20px}

/* Order list metrics and filters */
.order-metric{padding:10px 14px}


/* Form controls at normal application height (login page keeps its own sizes). */
.workspace-main input:not([type=checkbox]):not([type=radio]),.workspace-main select,.crm-dialog input:not([type=checkbox]):not([type=radio]),.crm-dialog select{height:32px;min-height:0;padding:4px 8px;font-size:12.5px;box-sizing:border-box}
.workspace-main textarea,.crm-dialog textarea{font-size:12.5px;padding:6px 8px}
.workspace-main label,.crm-dialog label{margin-bottom:4px}

/* Order list counters: compact strip. */
.order-metric{padding:8px 12px;border-radius:6px}
.order-metric span{font-size:11.5px}
.order-metric strong{margin-top:2px;font-size:20px;font-weight:600}

/* Empty lists: a quiet line, not a large box. */
.ops-empty{padding:14px 16px;border-radius:6px;font-size:12px}
.crm-empty{padding:24px 16px}
#operations-content select,#operations-content input:not([type=checkbox]):not([type=radio]),#operations-content .crm-secondary,#operations-content .crm-primary{height:32px;min-height:0}

/* Planner: whole week fits the window; only a busy day's column scrolls. */
.workspace-content.planner-active{padding-bottom:8px}
.plan-panel-section h3,#operations-content .plan-panel-section h3{margin:0;font-size:12px}
.plan-nav{margin-bottom:6px}.plan-legend{margin-bottom:6px}

/* Display size selector in the top bar */
.ui-scale{display:flex;align-items:center;gap:6px;margin:0;font-size:11px;color:#587e84}
.workspace-main .ui-scale select{height:26px;padding:0 4px;font-size:11.5px;width:auto}

/* Orders list: everything above the table stays put; only the order rows scroll, under fixed column headings. */
.workspace-main:has(.orders-list-active:not(.order-entry-active)){height:calc(100svh / var(--ui-zoom,1));display:flex;flex-direction:column;min-height:0}
.workspace-content.orders-list-active:not(.order-entry-active){flex:1;min-height:0;display:flex;flex-direction:column;padding-bottom:8px}
.orders-list-active:not(.order-entry-active) #operations-content{flex:1;min-height:0;display:flex;flex-direction:column}
.orders-list-active:not(.order-entry-active) #order-browser-results{flex:1;min-height:0;overflow:auto;border:1px solid #d3e6eb;border-radius:6px;background:#fff}
.orders-list-active:not(.order-entry-active) #order-browser-results .crm-table-scroll{overflow:visible;border:0;border-radius:0}
.orders-list-active:not(.order-entry-active) #order-browser-results thead th{position:sticky;top:0;z-index:2}
.orders-list-active:not(.order-entry-active) #order-browser-pagination{flex:none}

/* Signed-in person at the bottom of the sidebar */
@media(min-width:861px){.sidebar-bottom{margin-top:auto}}
.order-metrics{margin:0 0 8px}
.order-view-toolbar,.order-compact-toolbar{margin:0 0 6px}
.orders-list-active .ops-toolbar{margin-bottom:6px}

/* Settings */
.settings-tabs{margin-bottom:12px}
.settings-card{background:#fff;border:1px solid var(--line);border-radius:6px;padding:14px 16px;margin:0 0 12px;max-width:820px}
.settings-card h2{margin:0 0 4px;font-size:14px}
.settings-hint{margin:0 0 10px;font-size:12px;color:#6a7e83}
.settings-field{display:flex;flex-direction:column;gap:4px;font-size:12px;color:#40555b;margin:0}
.settings-form{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 14px}
.settings-form .wide{grid-column:1/-1}
.settings-card>.settings-field select{max-width:260px}
.settings-actions{grid-column:1/-1;display:flex;align-items:center;justify-content:flex-end;gap:12px}
.settings-status{font-size:12px;color:#2f6f5e}.settings-status.settings-error{color:#a3352b}
.settings-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 16px;margin:0}
.settings-facts dt{font-size:11px;color:#6a7e83}.settings-facts dd{margin:2px 0 0;font-size:13.5px;color:var(--ink)}
#password-change-form{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:700px){.settings-form,.settings-facts,#password-change-form{grid-template-columns:1fr}}
[data-settings-tab][hidden],.settings-pane[hidden]{display:none!important}

/* Sidebar icons: line drawings in the text colour (current section uses the highlight colour). */
.nav-icon{width:17px;height:17px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;opacity:.9}
.nav-item.selected .nav-icon{opacity:1}
/* Presentation polish: empty states, section titles, consistent tabs, status capitalization */
.ops-empty{display:flex;flex-direction:column;gap:6px;align-items:center;padding:34px 20px;background:var(--panel,#fff);border:1px dashed #c9d9dd;border-radius:10px;color:#5c757c}
.ops-empty strong{font-size:14px;font-weight:600;color:#1d4652}.ops-empty span{font-size:12.5px;max-width:560px;line-height:1.6}
.ops-section-title{font-size:13px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:#2c5764;margin:18px 0 8px}
.catalog-tabs{gap:2px;border-bottom:1px solid var(--line,#d6e2e4);padding-bottom:0;margin-bottom:12px}
.catalog-tabs button{padding:7px 12px!important;border-radius:0!important;border-bottom:2px solid transparent!important;font-size:13px!important;color:#45616a}
.catalog-tabs button.selected{background:none!important;color:var(--ink,#123f4a)!important;font-weight:600;border-bottom-color:var(--brand-blue,#1286a0)!important}
.crm-badge{text-transform:capitalize}
.ops-summary-wait{opacity:.55}.ops-summary strong small{font-size:11px;font-weight:400;text-align:right}
.nav-item[hidden]{display:none!important}
/* Page actions share the tab row instead of sitting alone above it */
.ops-toolbar:has(+ .ops-tabs){position:relative;z-index:2;margin:0 0 -46px;height:46px;align-items:center;pointer-events:none}
.ops-toolbar:has(+ .ops-tabs) .ops-actions{pointer-events:auto}
.ops-toolbar:has(+ .ops-tabs)+.ops-tabs{min-height:46px;align-items:flex-end;padding-right:320px}
/* Shipping settings: day / area pickers */
.ship-days{display:flex;flex-wrap:wrap;gap:6px}
.ship-days label{display:inline-flex;align-items:center;gap:6px;margin:0;padding:6px 10px;border:1px solid #cbdadd;border-radius:7px;background:#fff;font-weight:400;font-size:13px;cursor:pointer}
.ship-days input{width:auto!important;margin:0}
.ship-areas label small{color:#6a7e83;font-size:11px}
.ship-areas label.ship-area-today{border-color:#1286a0;background:#eaf6f9}
/* Quick status and delete in lists */
.rec-status{border:1px solid #cbdadd;border-radius:14px;padding:3px 8px;font:inherit;font-size:12px;background:#e9f6ee;color:#21613f;cursor:pointer}
.rec-status-archived,.rec-status-inactive{background:#f1f1f1;color:#6a6a6a}
.rec-delete{border:1px solid transparent;background:none;border-radius:6px;padding:4px;cursor:pointer;color:#8aa0a6;line-height:0}
.rec-delete svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.rec-delete:hover{color:#a3352b;border-color:#f0c9c4;background:#fdf3f2}
.rec-danger{background:#a3352b!important;border-color:#a3352b!important}
.rec-message{color:#a3352b}
/* Send email window */
.em-dialog{max-width:760px}.em-from{display:block;color:#6a7e83;font-size:12px;margin-top:3px}
.em-preview{border:1px solid #d6e2e4;border-radius:8px;padding:10px 12px;max-height:260px;overflow:auto;background:#fbfdfd;margin-top:6px}
.em-ok{color:#21613f}.em-off{color:#946b2d}
.em-preview table{width:100%;border-collapse:collapse;font-size:12.5px}.em-preview th{background:#123f4a;color:#fff;text-align:left;padding:5px 7px}.em-preview td{padding:5px 7px;border-bottom:1px solid #e3ecee}.em-preview p{margin:6px 0}
