/* Shared business workspace: readable data, clear actions, accessible focus. */
:root { --ux-focus:0 0 0 3px rgba(47,107,255,.22); }
body { font-size:14px; line-height:1.5; }
button,input,select,textarea { font-family:inherit; }
:is(button,a,input,select,textarea,summary,[tabindex]):focus-visible { outline:2px solid var(--c-primary); outline-offset:3px; }
.page-head { gap:20px; align-items:flex-start; padding-bottom:18px; margin-bottom:18px; border-bottom:1px solid var(--c-border); }
.page-head .page-title { font-size:23px; line-height:1.35; letter-spacing:0; }
.page-head .muted { margin-top:5px; max-width:76ch; font-size:13px; line-height:1.7; }
.page-head .row-actions { flex-shrink:0; justify-content:flex-end; flex-wrap:wrap; gap:8px; }
.btn { min-height:34px; padding:7px 13px; font-size:13px; font-weight:500; border-radius:6px; box-shadow:none; }
.btn-sm { min-height:29px; padding:4px 9px; font-size:12px; }
.btn-primary { font-weight:600; }
.row-actions { gap:6px; }
.field label { font-size:13px; color:var(--c-text); font-weight:500; line-height:1.5; }
.field :is(input,select,textarea) { min-height:36px; font-size:14px; padding:8px 10px; border-color:var(--c-border-strong); }
.field :is(input,textarea)[readonly] { color:var(--c-muted); background:var(--c-surface-2); }
.field textarea { min-height:76px; line-height:1.6; }
.field :is(input,select,textarea)[aria-invalid=true] { border-color:var(--c-danger); box-shadow:0 0 0 2px var(--c-danger-bg); }
.form-row { gap:14px; flex-wrap:wrap; }
.form-row>.field { min-width:150px; }
.form-section-title { font-size:15px; margin:22px 0 12px; padding-bottom:8px; border-bottom:1px solid var(--c-border); }
.notice { line-height:1.7; }
.notice.info { border-left:3px solid var(--c-info); }
.stat-row { gap:12px; }
.stat-card { box-shadow:none; border:1px solid var(--c-border); }
.stat-card b { font-variant-numeric:tabular-nums; }
.pill { font-weight:500; line-height:1.5; white-space:nowrap; }

/* Navigation: task groups and personal favorites retain the complete menu. */
#sidebar { width:232px; min-width:232px; flex-basis:232px; }
#nav { padding:6px 12px 16px; }
.nav-group-label { margin-top:10px; padding:14px 12px 6px; color:var(--c-muted); font-size:10.5px; font-weight:600; letter-spacing:.08em; border-top:1px solid var(--c-border); }
.nav-group-label:first-of-type { margin-top:2px; border-top:0; }
.nav-item { min-height:40px; gap:4px; padding:8px 9px 8px 12px; border-radius:6px; position:relative; }
.nav-item>span { flex:1; font-size:13px; line-height:1.5; }
.nav-item.active { font-weight:600; }
.nav-item.active::before { content:''; position:absolute; left:0; width:3px; height:20px; background:var(--c-primary); border-radius:2px; }
.nav-favorite { flex:0 0 26px; width:26px; height:28px; padding:0; border:0; background:transparent; color:var(--c-muted); border-radius:4px; cursor:pointer; font-size:17px; opacity:.45; }
.nav-item:hover .nav-favorite,.nav-favorite:focus-visible,.nav-favorite[aria-pressed=true] { opacity:1; }
.nav-favorite[aria-pressed=true] { color:var(--c-primary); }
.nav-favorite:hover { background:var(--c-nav-active-bg); }
.ux-nav-favorites { border-bottom:1px solid var(--c-border); padding-bottom:9px; margin-bottom:4px; }
.ux-nav-favorites a { display:flex; justify-content:space-between; align-items:center; color:var(--c-nav-text); padding:8px 12px; font-size:13px; text-decoration:none; border-radius:6px; }
.ux-nav-favorites a:hover { background:var(--c-nav-hover); }
.ux-nav-favorites small { color:var(--c-muted); font-size:11px; }
.ux-breadcrumb { display:flex; gap:8px; align-items:center; padding:12px 20px 0; color:var(--c-muted); font-size:12px; }
.ux-breadcrumb strong { color:var(--c-text); font-weight:500; }
.tab-chip { min-height:38px; font-size:13px; }
.tab-chip .tab-x { display:inline-flex; justify-content:center; align-items:center; width:24px; height:24px; border-radius:4px; }
.tab-chip .tab-x:hover { background:var(--c-danger-bg); color:var(--c-danger); }
.tab-chip[data-dirty=true]::before { content:'•'; color:var(--c-warning); }
.tab-form-footer { position:sticky; bottom:0; z-index:10; background:var(--c-surface); border-top:1px solid var(--c-border); box-shadow:0 -4px 12px rgba(20,35,60,.04); }
.tab-form-panel { padding:20px; gap:16px; grid-template-columns:repeat(3,minmax(180px,1fr)); }
.tab-form-panel .field,.form-section .field { gap:6px; margin-bottom:4px; }
.tab-form-panel .field label,.form-section .field label { min-height:20px; font-size:13px; line-height:20px; color:var(--c-text); }
.tab-form-panel .field :is(input:not([type=checkbox]):not([type=radio]),select,textarea),.form-section .field :is(input:not([type=checkbox]):not([type=radio]),select,textarea) { min-height:36px; padding:8px 10px; font-size:14px; }
.tab-form-panel>.ux-form-message,.tab-form-panel>.ux-close-prompt,.tab-form-panel>.notice { grid-column:1/-1; }
.tab-form-panel>.tab-form-footer { margin-top:4px; }

/* Table utilities never apply to editable detail grids. */
.ux-table-tools { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; background:var(--c-surface); border:1px solid var(--c-border); border-bottom:0; border-radius:8px 8px 0 0; }
.ux-table-tools+.table-scroll { border-radius:0 0 8px 8px; margin-top:0; }
.ux-table-search,.ux-table-options { display:flex; gap:10px; align-items:center; }
.ux-table-search { flex:1; min-width:160px; }
.ux-table-search input { width:230px; max-width:100%; height:34px; border:1px solid var(--c-border-strong); border-radius:6px; background:var(--c-surface); color:var(--c-text); padding:6px 10px; font-size:13px; }
.ux-table-count { color:var(--c-muted); font-size:12px; white-space:nowrap; }
.ux-columns { position:relative; }
.ux-columns summary { list-style:none; user-select:none; }
.ux-columns-panel { position:absolute; right:0; top:calc(100% + 6px); width:260px; max-height:360px; overflow:auto; z-index:40; border:1px solid var(--c-border); background:var(--c-surface); padding:10px; border-radius:8px; box-shadow:0 12px 30px rgba(10,25,50,.16); }
.ux-columns-panel label { display:flex; align-items:center; gap:10px; padding:7px 8px; color:var(--c-text); font-size:13px; cursor:pointer; }
.ux-columns-panel input { accent-color:var(--c-primary); }
.ux-filter-hidden,.ux-column-hidden { display:none!important; }
table.grid[data-ux-density=comfortable] :is(th,td) { padding-top:11px; padding-bottom:11px; font-size:14px; }
table.grid[data-ux-density=compact] :is(th,td) { padding-top:6px; padding-bottom:6px; font-size:13px; }
table.grid th.ux-sortable { cursor:pointer; user-select:none; }
table.grid th.ux-sortable::after { content:' ↕'; color:var(--c-muted); font-size:11px; }
table.grid th[aria-sort=ascending]::after { content:' ↑'; color:var(--c-primary); }
table.grid th[aria-sort=descending]::after { content:' ↓'; color:var(--c-primary); }
table.grid.erp-smart-grid td.erp-col-number { font-variant-numeric:tabular-nums; }
table.grid[data-ux-density] { overflow:visible; }
table.grid[data-ux-density] :is(th,td).erp-col-action { position:sticky; right:0; z-index:3; background:var(--c-surface); box-shadow:-1px 0 0 var(--c-border); }
table.grid[data-ux-density] th.erp-col-action { z-index:5; background:var(--c-head-bg); }
table.grid tbody tr:focus-within td { background:var(--c-primary-soft); }
.table-scroll { overscroll-behavior-x:contain; }

/* Form feedback is local, readable, and preserves all entered values. */
.modal { display:flex; flex-direction:column; max-height:calc(100dvh - 48px); padding:0; overflow:hidden; border:1px solid var(--c-border); border-radius:12px; }
.modal>h3 { flex:none; padding:18px 22px; margin:0; border-bottom:1px solid var(--c-border); font-size:18px; }
.modal>.modal-body { flex:1; min-height:0; max-height:none; overflow:auto; padding:20px 22px; }
.modal>.modal-actions { flex:none; padding:14px 22px; margin:0; border-top:1px solid var(--c-border); background:var(--c-surface-2); }
.modal.wide-detail-form { width:1200px; }
.ux-form-message { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; padding:12px 14px; margin:0 0 16px; border:1px solid var(--c-danger); border-left-width:4px; border-radius:6px; background:var(--c-danger-bg); color:var(--c-danger); font-size:14px; white-space:pre-wrap; }
.ux-form-message span { flex:1; }
.ux-close-prompt { display:flex; align-items:center; flex-wrap:wrap; gap:10px; position:sticky; top:0; z-index:20; padding:14px; margin-bottom:16px; border:1px solid var(--c-warning); border-radius:8px; color:var(--c-text); background:var(--c-warning-bg); }
.ux-close-prompt strong { font-size:15px; }
.ux-close-prompt span { flex:1; min-width:180px; font-size:13px; }
.ux-toast { padding:12px 18px; margin-bottom:8px; border-radius:8px; background:var(--c-text); color:var(--c-surface); box-shadow:0 6px 24px rgba(10,25,50,.16); font-size:14px; }

/* Login: practical assistance without introducing another credential flow. */
.login-aside-inner { max-width:440px; }
.login-card { width:400px; max-width:100%; }
.login-card .field-label { font-size:14px; color:var(--c-text); }
.login-card .field-input input { font-size:16px; }
.login-help { margin-top:22px; padding-top:18px; border-top:1px solid var(--c-border); color:var(--c-muted); font-size:13px; }
.login-help summary { cursor:pointer; color:var(--c-primary); font-weight:500; }
.login-help p { margin:10px 0 0; line-height:1.8; }
#login-caps-hint { color:var(--c-warning); font-size:13px; margin:8px 0; }
.login-card .field-icon svg { width:18px; height:18px; stroke:currentColor; fill:none; stroke-width:1.7; }
.login-card .password-toggle { min-height:32px; align-items:center; }
@media(max-width:1300px){#sidebar{width:210px;min-width:210px;flex-basis:210px}.page-head{flex-wrap:wrap}.page-head .row-actions{justify-content:flex-start}.ux-table-tools{flex-wrap:wrap}.theme-switch-label{display:none}}
@media(max-width:900px){.ux-table-search input{width:180px}.ux-table-count{display:none}.modal{max-width:calc(100vw - 20px);max-height:calc(100dvh - 20px)}.modal>.modal-body{padding:16px}.form-row>.field{min-width:180px}.login-help{border-color:var(--c-border)}}
@media(max-width:1100px){.tab-form-panel{grid-template-columns:repeat(2,minmax(160px,1fr))}}
@media(max-width:860px){.login-main{background:var(--c-bg)}.login-card-head h1{color:var(--c-text)}.login-card-head p{color:var(--c-muted)}}
@media(max-width:700px){.tab-form-panel{grid-template-columns:1fr;padding:14px}.tab-form-panel>.form-row>.field{grid-column:1/-1}}
