:root{--muted:#53665c}
body{font-size:15px}
button:disabled{cursor:not-allowed;opacity:.65}
button[aria-busy="true"]{cursor:wait}
button[aria-busy="true"]:before{content:'';width:13px;height:13px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;display:inline-block;animation:spin .8s linear infinite;margin-right:6px}
@keyframes spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){button[aria-busy="true"]:before{animation:none}}
.btn,.btn.small,input,select,textarea,.field{font-size:14px}
.btn,.btn.small{min-height:36px}.btn.small{padding:6px 10px}
table,td.name strong,.item-link{font-size:14px}
th{font-size:12px;color:#53665c}.tag{font-size:12px}
.tag.green{color:#3b5c29}.tag.red{color:#913d2b}.tag.amber{color:#795509}.tag.gray{color:#526057}.tag.in{color:#256046}.tag.out{color:#81522e}
.positive{color:#2b6140}.negative{color:#993d27}
.page-head p,.panel-head p,.profile small,.field,.form-hint,.filter-caption,.auth-card>p,.auth-options small,.help-panel p{font-size:13px;color:var(--muted)}
.kpi .hint,.kpi .k-top,.table-bottom,td.name small,.unit-card small,.footer,.legend,.alert-name small,.alert-qty small{color:var(--muted);font-size:12px}
.nav button{font-size:14px}.item-link{text-align:left;white-space:normal;color:#174e42;text-decoration:underline;text-underline-offset:3px;line-height:1.6}
.content{max-width:1660px}.page-head{flex-wrap:wrap}.page-head .actions{flex-wrap:wrap}
.notice{border:1px solid #b8c9bb;background:#edf4ed;color:#244334;padding:14px 18px;border-radius:9px;margin-bottom:18px;font-size:14px;overflow-wrap:anywhere}
.notice.error{background:#fff0e9;color:#853c28;border-color:#dbb7a7}.notice.success{background:#eaf4e9;color:#235330}
.notice p{margin:4px 0 10px}.notice .btn{margin:5px 0}.notice[hidden]{display:none}
#sync-status{font-size:12px;color:#315c43;max-width:280px}#sync-status[data-state="error"],#sync-status[data-state="stale"]{color:#8a4427}
.range-shortcuts{display:flex;gap:8px;flex-wrap:wrap;padding:12px 20px}.filter-caption{padding:10px 20px}.empty p{margin:10px 0}.empty .range-shortcuts{justify-content:center}
.toolbar{gap:12px}.table-scroll{scrollbar-gutter:stable}th{position:sticky;top:0;z-index:1}.form-hint{margin-top:18px}
input[readonly]{background:#f0f3ee;color:#526057;cursor:default}
.statistics{margin:20px 0}.unit-details{margin:20px 0}.unit-details summary{cursor:pointer;padding:12px;background:white;border:1px solid var(--line);border-radius:8px;font-weight:500}.unit-details .unit-summary{margin:14px 0}
.trend-scroll{overflow-x:auto;margin:18px 22px 24px}.trend-chart{display:flex;gap:6px;height:220px;align-items:stretch;border-bottom:1px solid var(--line)}
.trend-column{flex:1;min-width:36px;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;background:transparent;padding:4px 0;color:var(--ink)}
.trend-column:hover{background:#eef3ea}.trend-bars{height:170px;width:100%;display:flex;align-items:flex-end;justify-content:center;gap:2px}.trend-bars>span{width:45%;max-width:36px;min-width:10px;border-radius:3px 3px 0 0;font-size:10px;overflow:visible;color:white;font-variant-numeric:tabular-nums}.trend-in{background:#2c6958}.trend-out{background:#647238}.trend-label{height:32px;font-size:10px;white-space:nowrap;padding-top:10px}.legend span+span:before{background:#647238}
.ranking{padding:0 24px 20px 45px}.ranking li{padding:10px;border-bottom:1px solid var(--line)}.ranking strong{float:right;white-space:nowrap;padding-left:12px}
.wide-modal{width:min(1100px,calc(100% - 30px))}.auth-card h2{margin-top:12px}.auth-options .actions{justify-content:center;flex-wrap:wrap}.auth-card .notice{font-size:13px}.online{white-space:normal}
@media(max-width:900px){.page-head .actions{justify-content:flex-start}.top-tools{max-width:50%}.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.kpi{min-width:0}.kpi .value{font-size:27px}}
@media(max-width:700px){.toolbar>.field{flex:1;min-width:120px}.toolbar .range-shortcuts{padding:0}.topbar{height:auto;min-height:65px;padding-block:10px}.notice{padding:12px}.actions{flex-wrap:wrap}.auth-options .actions>.btn{flex:1}.trend-scroll{margin:12px}.table-scroll{max-width:100%}.unit-card{min-width:120px}.kpi .hint{font-size:11px}}
@media print{.notice,.range-shortcuts,.statistics,.report-kpis,.unit-details,.filter-caption{display:none!important}.panel{overflow:visible}th{position:static}thead{display:table-header-group}tr{break-inside:avoid}.panel-head{break-after:avoid}td.name{max-width:none}td,th{font-size:10px;color:#111!important}.page-head h1{font-size:22px}@page{size:A4 landscape;margin:12mm}}

/* v1.2.1: align complete labelled fields and keep row actions in fixed columns. */
.filter-toolbar{display:grid;align-items:end;gap:12px}
.inventory-filters{grid-template-columns:minmax(220px,1fr) 132px 160px auto auto}
.history-filters{grid-template-columns:minmax(220px,1fr) 132px 172px 144px 144px auto}
.report-filters{grid-template-columns:144px 144px 140px minmax(220px,1fr)}
.filter-toolbar .field{min-width:0;gap:8px;line-height:20px;grid-column:auto}
.filter-toolbar .search{min-width:0;width:100%;height:44px;flex:none}
.filter-toolbar input,.filter-toolbar select,.filter-toolbar>.btn{box-sizing:border-box;height:44px;min-height:44px;min-width:0;width:100%;margin:0;line-height:20px}
.filter-toolbar input,.filter-toolbar select{padding-block:10px}
.filter-toolbar select{flex:none;max-height:44px}
.filter-toolbar input[type=date]{padding-inline:10px}
.filter-toolbar .search svg{top:50%;transform:translateY(-50%)}
.filter-toolbar>.btn{padding:10px 14px;align-self:end}
.range-shortcuts{gap:8px;padding:12px 22px}.range-shortcuts .btn{height:38px;min-height:38px}
.inventory-table{table-layout:fixed;min-width:940px}
.inventory-table .col-type{width:94px}.inventory-table .col-balance{width:82px}.inventory-table .col-unit{width:64px}.inventory-table .col-minimum{width:92px}.inventory-table .col-status{width:124px}.inventory-table .col-actions{width:224px}
.inventory-table td,.inventory-table th{padding:16px 12px;vertical-align:middle}
.inventory-table td:first-child,.inventory-table th:first-child{padding-left:22px}
.inventory-table td.name{min-width:0;max-width:none;overflow-wrap:anywhere}
.inventory-table .item-link{padding:0;line-height:1.7}
.inventory-actions{display:grid;grid-template-columns:repeat(3,60px);gap:8px;align-items:center;width:196px}
.inventory-actions>span{display:flex;min-width:0}
.inventory-actions .btn{width:60px;min-width:60px;height:38px;min-height:38px;padding:6px;line-height:20px}
.inventory-actions button:disabled{opacity:1;background:#f4f5f2;color:#67736b;border-color:#e1e5de}
@media(max-width:1450px){.history-filters{grid-template-columns:repeat(4,minmax(0,1fr))}.history-filters .search-field{grid-column:span 2}.history-filters>[data-action=export-history]{grid-column:span 2;width:auto;justify-self:end;min-width:132px}}
@media(max-width:1250px){.inventory-filters{grid-template-columns:repeat(4,minmax(0,1fr))}.inventory-filters .search-field{grid-column:span 2}.inventory-filters>.btn{width:auto;justify-self:start}.report-filters{grid-template-columns:132px 132px 132px minmax(150px,1fr)}}
@media(max-width:1000px){.inventory-filters,.history-filters,.report-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.filter-toolbar .search-field{grid-column:1/-1;order:-1}.history-filters>[data-action=export-history]{grid-column:1/-1}.report-filters .type-field{grid-column:1/-1}.inventory-filters>.btn{width:100%}}
@media(max-width:700px){.filter-toolbar>.field{min-width:0}.filter-toolbar{padding:16px;gap:12px}.filter-toolbar select{min-width:0}.range-shortcuts{padding:12px 16px}.filter-caption{padding:10px 16px}}
