/* Shared final layer: existing Rovno tokens, compact desktop, touch controls. */
:root{--ui-gap:12px;--ui-radius:8px;--ui-control:36px}
body{color:var(--text);background:var(--canvas,#f4f6f8)}
body main{min-width:0}
body .sr-only{position:absolute!important;left:0;top:0;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
body :is(.panel,.card,.fin-panel){border-radius:var(--ui-radius);box-shadow:none}
body :is(button,.button){font-family:inherit;font-weight:600;transition:background-color .12s,border-color .12s}
body :is(button,.button):disabled{cursor:not-allowed;opacity:.55}
body :is(input,select,textarea):not([type=hidden]):not([type=checkbox]):not([type=radio]){font-family:inherit}
body :is(input,select,textarea)[aria-invalid=true]{border-color:#ad2934}
body :is(.flash,.notice-error,.form-error){border-radius:6px;line-height:1.5;overflow-wrap:anywhere}
body :is(.flash.error,.notice-error,.form-error){color:#8e2230;background:#fff2f3;border:1px solid #e8b3b8}
body :is(.flash.success){color:#12624f;background:#eef8f3;border:1px solid #b7dacd}
body .heading{flex-wrap:wrap;gap:12px}
body :is(h1,h2,h3){text-wrap:balance}
body .status-groups{display:flex;flex-flow:row nowrap;overflow:auto;gap:4px;padding:8px 0;margin:0 0 12px;min-height:0;width:100%;max-width:100%;box-sizing:border-box;border:0;background:transparent;scrollbar-width:thin}
body .status-groups h2{display:none}
body .status-groups a{flex:0 0 auto;white-space:nowrap;min-height:36px;padding:8px 12px;border-radius:6px;font-size:12px}
body .status-groups a.selected{background:var(--brand-subtle);color:var(--brand)}
body table :is(.num,.money,.cash-balance){white-space:nowrap;font-variant-numeric:tabular-nums;overflow-wrap:normal;word-break:normal}
body .table-wrap{border-radius:6px;overscroll-behavior-x:contain}
body table :is(th,td){vertical-align:top}
body table th{color:var(--secondary);font-size:12px;line-height:1.4}
body table td small{display:block;color:var(--secondary);margin-top:3px;line-height:1.4}
body :is(.grid,.fields)>*{min-width:0}
body .fin-filter{display:flex;flex-wrap:wrap;gap:8px;align-items:end}
body .fin-filter label{flex:1 1 150px;min-width:0;margin:0}
body .fin-filter button{flex:0 0 auto}
body .cash-balance{display:block;font-size:34px;line-height:1.2;font-weight:700;letter-spacing:-.7px;font-variant-numeric:tabular-nums;white-space:nowrap}
body .cash-primary-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}
body .cash-primary-actions :is(button,.button){min-width:140px}
body .cash-overview{padding:16px}
body .cash-overview .fin-section-title{padding:0 0 12px;border:0}
body .cash-overview>p{margin:0}
body .fin-page>details.fin-panel>summary{padding:12px 16px;cursor:pointer;min-height:44px;box-sizing:border-box;font-weight:600}
body .fin-page>details.fin-panel>form{padding:0 16px 16px}
body .panel:has(.audit-filters){padding:16px}
body .stock-assignment-warning{font-size:12px;line-height:1.4;padding:8px;margin:6px 0;color:#7a4c10;background:#fff6e6;border-left:3px solid #c78d2d;white-space:normal}
body .audit-filters{display:flex;gap:8px;align-items:end;flex-wrap:wrap;margin:0 0 16px}
body .audit-filters label{flex:1 1 150px;min-width:0;margin:0}
body .audit-filters .check{flex:0 1 auto;display:flex;gap:6px;align-items:center;min-height:36px}
body .audit-pagination{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:12px 0 0}
body .audit-values{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;max-width:48rem}
body dialog{border:1px solid var(--divider);border-radius:10px;box-shadow:0 16px 48px #18232e26}
body dialog::backdrop{background:#18232e66}
@media(max-width:1100px){body .order-filters .filter-secondary{flex-wrap:wrap}body .order-filters .filter-secondary label{flex:1 1 130px}}
@media(max-width:767.98px){
 :root{--ui-control:44px}
 body main,body:has(.order-head) main{padding:12px 12px 32px}
 body :is(.panel,.card,.fin-panel){margin-bottom:12px}
 body :is(.page-header,.fin-header){align-items:flex-start;flex-wrap:wrap;gap:12px}
 body .page-header h1,body .heading h1,body .fin-header h1{font-size:26px}
 body :is(.fin-filter,.audit-filters) label{flex:1 1 140px}
 body .cash-primary-actions{display:grid;grid-template-columns:1fr 1fr}
 body .cash-primary-actions :is(button,.button){min-width:0;text-align:center}
 body .cash-primary-actions>.button:last-child{grid-column:1/-1}
 body .cash-balance{font-size:30px}
 body .fin-section-title{flex-wrap:wrap;gap:8px}
 body .fin-table{min-width:720px}
 body .status-groups a{min-height:44px;padding:12px}
 body .order-filters .filter-secondary label{flex:1 1 140px}
 body dialog{width:calc(100vw - 24px);max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:auto}
 body .actions{flex-wrap:wrap;gap:8px}
 body .workforce-table{min-width:0;width:100%}
 body .workforce-table thead{display:none}
 body .workforce-table tbody{display:block}
 body .workforce-table tr{display:grid;grid-template-columns:1fr 1fr;border-bottom:1px solid var(--divider);padding:12px;gap:8px}
 body .workforce-table td{display:block;padding:0;border:0;min-width:0;overflow-wrap:anywhere}
 body .workforce-table td:first-child,body .workforce-table .staff-controls{grid-column:1/-1}
 body .workforce-table [data-label]::before{content:attr(data-label);display:block;font-size:12px;color:var(--secondary);margin-bottom:4px}
 body .staff-controls summary{padding:10px 0;min-height:44px;box-sizing:border-box}
 body .staff-controls .grid{grid-template-columns:1fr}
 body .staff-controls .financial-form{padding:8px 0;min-width:0}
}
@media(prefers-reduced-motion:reduce){body :is(button,.button){transition:none}}

/* Align filters and keep related actions together across frame widths. */
body :is(.fin-filter,.audit-filters) :is(input:not([type=hidden]):not([type=checkbox]), select) {margin:0;width:100%}
body :is(.fin-filter,.audit-filters) > :is(button,.button),body .filter-actions > * {margin:0}
body .fin-filter > .filter-actions {display:flex;align-items:flex-end;gap:8px;flex-wrap:wrap;margin:0}
body .fin-filter > .filter-actions > .button {box-sizing:border-box;min-height:var(--ui-control);height:var(--ui-control)}
body .cash-overview {display:flex;justify-content:space-between;align-items:center;gap:12px 24px;flex-wrap:wrap}
body .cash-summary {display:grid;gap:4px;min-width:0}
body .cash-summary h2 {margin:0;font-size:14px;color:var(--secondary)}
body .cash-primary-actions {margin:0}
body .cash-primary-actions :is(button,.button) {min-width:0}
body .cash-journal-filter label:has([name=search]) {flex:2 1 230px}
body .cash-entry-dialog {width:min(560px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;padding:16px}
body .cash-entry-dialog .financial-form {padding:0;margin:0;background:transparent}
body .cash-entry-dialog .grid {gap:12px}
body .cash-entry-dialog .grid label {margin:0}
body .cash-dialog-header,body .cash-dialog-actions {display:flex;align-items:center;justify-content:space-between;gap:8px}
body .cash-dialog-header h2 {margin:0}
body .cash-dialog-header {margin-bottom:12px}
body .cash-dialog-actions {justify-content:flex-start;flex-wrap:wrap;margin-top:12px}
body .page-header > :is(button,.button) {flex-shrink:0}
@media(max-width:767.98px) {
 body .cash-overview {display:grid;grid-template-columns:minmax(0,1fr)}
 body .cash-journal-filter label:has([name=search]),body .cash-journal-filter .filter-actions {flex:1 0 100%}
 body .cash-entry-dialog .grid {grid-template-columns:1fr}
}
