:root { font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color: #17211d; background: #edf0ec; --green:#173c2d; --green2:#245b43; --gold:#f4bf4f; --red:#a43b3b; --line:#d8ded9; --muted:#66736d; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #edf0ec; }
button,input,select { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
h1,h2,h3,p { margin-top: 0; }
.login { min-height: 100vh; padding: max(28px,env(safe-area-inset-top)) 18px 28px; background: linear-gradient(160deg,#10251d,#1f503b); color:#fff; }
.login-card { max-width: 480px; margin: auto; }
.login-brand { display:grid;gap:9px;margin-bottom:24px; }
.login-brand-logo { display:block;width:min(100%,260px);height:auto;border-radius:5px;background:#000; }
.login-brand small { color:#b8ccc2; }
.login h1 { font-size:30px;margin-bottom:8px; }
.login .muted { color:#b8ccc2; }
.accounts { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:22px 0; }
.account { min-height:62px;border:2px solid #ffffff25;border-radius:14px;background:#ffffff0c;color:#fff;font-weight:850; }
.account.active { border-color:var(--gold);background:#f4bf4f20; }
.field { display:grid;gap:7px;margin:14px 0; }
.field span { color:var(--muted);font-size:13px;font-weight:800; }
.mobile-directory-error { min-height:20px;color:#a62323;font-size:13px;font-weight:800; }
.login .field span { color:#c2d3ca; }
input,select { width:100%;min-height:54px;border:1px solid #cbd3ce;border-radius:13px;background:#fff;padding:10px 13px;color:#17211d;font-size:18px; }
input:focus,select:focus { outline:3px solid #f4bf4f55;border-color:#c28d1d; }
.primary,.secondary,.quiet { border:0;border-radius:13px;min-height:54px;padding:11px 17px;font-weight:900; }
.primary { background:var(--gold);color:#17211d;width:100%; }
.secondary { background:var(--green);color:#fff; }
.quiet { background:#e7ece8;color:#26372f; }
button:disabled { opacity:.5;cursor:wait; }
.app-header { position:sticky;top:0;z-index:4;background:#10251d;color:#fff;padding:max(12px,env(safe-area-inset-top)) 15px 12px;box-shadow:0 5px 20px #0003; }
.header-line { display:flex;align-items:center;justify-content:space-between;gap:12px; }
.header-brand { display:flex;align-items:center;gap:10px;min-width:0; }
.header-brand .brand-logo { display:block;width:114px;height:auto;flex:0 0 auto;border-radius:3px;background:#000; }
.print-brand { align-items:center; }
.print-brand-logo { display:block;width:150px;height:auto;flex:0 0 auto;border-radius:4px;background:#000; }
.header-brand small { display:block; }
.header-brand small { color:#a9bfb4; }
.identity strong { display:block;font-size:18px; }.identity small { color:#a9bfb4; }
.connection { border:0;border-radius:999px;padding:8px 11px;font-size:12px;font-weight:900;white-space:nowrap; }
.connection.online { background:#dff1e5;color:#196039; }.connection.offline { background:#fff0c7;color:#74520c; }
.sync-bar { margin-top:10px;display:flex;align-items:center;justify-content:space-between;gap:10px;color:#bad0c5;font-size:13px; }
.sync-bar button { border:0;background:#ffffff13;color:#fff;border-radius:9px;padding:7px 10px;font-weight:800; }
.tabs { position:sticky;top:91px;z-index:3;background:#fff;border-bottom:1px solid var(--line);display:flex;overflow-x:auto;padding:8px;gap:7px; }
.tabs button { flex:1;min-width:105px;border:0;border-radius:11px;background:#eef1ef;padding:11px;font-weight:850;color:#536159;white-space:nowrap; }
.tabs button.active { background:var(--green);color:#fff; }
main { max-width:620px;margin:auto;padding:16px 14px 90px; }
.card { background:#fff;border:1px solid var(--line);border-radius:18px;padding:17px;margin-bottom:15px;box-shadow:0 3px 12px #10251d0a; }
.card h2 { font-size:20px;margin-bottom:5px; }.muted { color:var(--muted); }
.grid { display:grid;grid-template-columns:1fr 1fr;gap:10px; }.grid .field { margin:0; }.wide { grid-column:1/-1; }
.type-switch { display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:14px 0; }
.type-switch button { min-height:48px;border:1px solid var(--line);border-radius:12px;background:#f2f5f3;font-weight:850; }.type-switch button.active { background:#e4f0e9;border-color:var(--green2);color:var(--green); }
.history-head { display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px; }.history-head h2 { margin:0; }
.document { border:1px solid #e2e7e3;border-radius:14px;padding:13px;margin:9px 0;background:#fafbfa; }
.document-top { display:flex;justify-content:space-between;align-items:flex-start;gap:10px; }.document strong { display:block; }.document small { color:var(--muted);display:block;margin-top:4px; }
.document-actions { display:flex;justify-content:flex-end;gap:8px;margin-top:11px; }
.document-actions button { min-height:42px;padding:8px 14px; }
.badge { display:inline-flex;border-radius:999px;padding:5px 8px;font-size:11px;font-weight:900;white-space:nowrap; }.badge.green { background:#dff1e5;color:#196039; }.badge.yellow { background:#fff0c7;color:#74520c; }.badge.red { background:#f4dede;color:#8d2929; }
.empty { padding:25px;text-align:center;color:var(--muted);border:1px dashed #cbd4ce;border-radius:13px; }
.stock-head { display:flex;align-items:flex-start;justify-content:space-between;gap:12px; }
.stock-head p { margin-bottom:0;font-size:12px; }.stock-refresh { min-height:42px;padding:8px 12px; }
.stock-total { display:flex;align-items:center;justify-content:space-between;gap:12px;background:#e5f0e9;color:var(--green);border-radius:13px;padding:12px 14px;margin:14px 0; }
.stock-total span { font-size:12px;font-weight:800; }.stock-total strong { text-align:right; }
.stock-list { display:grid;gap:8px; }.stock-row { display:flex;align-items:center;justify-content:space-between;gap:14px;border:1px solid #e0e6e2;border-radius:13px;padding:12px;background:#fafbfa; }
.stock-row strong,.stock-row small { display:block; }.stock-row small { color:var(--muted);margin-top:3px; }.stock-quantity { text-align:right;white-space:nowrap; }.stock-quantity>strong { color:var(--green);font-size:18px; }
.stock-summary-grid { display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:14px 0 18px; }
.stock-summary { min-width:0;border:1px solid #dfe7e1;border-radius:14px;background:#f6faf7;padding:13px; }
.stock-summary span,.stock-summary small { display:block;color:var(--muted);font-size:12px; }
.stock-summary strong { display:block;margin:6px 0;font-size:20px;color:var(--green); }
.stock-row.negative { border-color:#e5b5b5;background:#fff4f4; }.stock-row.negative .stock-quantity>strong { color:var(--red); }
.inventory-preview,.inventory-add { width:100%;margin-bottom:14px; }
.roundwood-inventory,.inventory-line { border:1px solid #dfe6e1;border-radius:14px;padding:13px;margin:10px 0;background:#fafcfa; }
.roundwood-inventory>div:first-child strong,.roundwood-inventory>div:first-child small,.inventory-line>div:first-child strong,.inventory-line>div:first-child small { display:block; }
.roundwood-inventory small,.inventory-line small { color:var(--muted);margin-top:3px; }
.inventory-line .field,.roundwood-inventory .field { margin:10px 0; }
.inventory-difference { color:#196039;font-size:13px;font-weight:900; }.inventory-difference.mismatch { color:#9a2f2f; }
.inventory-value { margin-top:4px;color:#196039;font-size:13px;font-weight:900; }.inventory-value.mismatch { color:#9a2f2f; }
.inventory-mismatch-summary { margin:14px 0 72px;padding:12px;border-radius:12px;background:#fff3cf;color:#654b0c;font-weight:850;text-align:center; }
.inventory-new { background:#fffaf0;border-color:#e7c363; }
.footer-action { position:fixed;left:0;right:0;bottom:0;padding:10px 14px max(10px,env(safe-area-inset-bottom));background:#ffffffeb;backdrop-filter:blur(10px);border-top:1px solid var(--line);z-index:4; }
.footer-action .primary { max-width:592px;display:block;margin:auto; }
.toast { position:fixed;left:16px;right:16px;bottom:82px;z-index:10;background:#10251d;color:#fff;padding:13px 16px;border-radius:13px;opacity:0;transform:translateY(8px);pointer-events:none;transition:.2s;text-align:center;font-weight:800; }.toast.show { opacity:1;transform:none; }
.account-settings-overlay { position:fixed;inset:0;z-index:40;display:grid;place-items:center;padding:16px;background:#07140fcc; }
.account-settings-card { width:min(100%,430px);max-height:calc(100vh - 32px);overflow:auto;padding:20px;border-radius:18px;background:#fff;box-shadow:0 24px 70px #0007; }
.account-settings-actions { display:grid;grid-template-columns:1fr 1.4fr;gap:9px;margin-top:18px; }
.account-settings-actions .primary { min-height:54px; }
.mobile-invoice-overlay { position:fixed;inset:0;z-index:30;padding:10px;background:#081b14cc;overflow:auto; }
.mobile-invoice-dialog { width:min(980px,100%);margin:auto;border-radius:16px;background:#edf1ee;overflow:hidden; }
.mobile-invoice-toolbar { position:sticky;top:0;z-index:2;padding:12px;background:#fff;border-bottom:1px solid var(--line); }
.mobile-invoice-toolbar>strong { display:block;margin-bottom:10px; }
.mobile-invoice-toolbar>div { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px; }
.mobile-invoice-toolbar button,.mobile-invoice-toolbar .primary { width:auto;min-height:44px;padding:8px 10px; }
.mobile-invoice-sheet { min-width:720px;margin:10px;padding:22px;color:#17221d;background:#fff;font:13px/1.35 Arial,sans-serif; }
.mobile-invoice-sheet .print-brand { display:flex;justify-content:space-between;align-items:baseline;margin-bottom:14px;padding-bottom:8px;border-bottom:2px solid var(--green2); }
.mobile-invoice-sheet .print-brand strong { color:var(--green2);font-size:24px; }
.mobile-invoice-sheet .print-brand span { font-size:18px;font-weight:800; }
.mobile-invoice-sheet .invoice-meta { display:grid;grid-template-columns:1fr 2fr 1fr;gap:12px;margin-bottom:14px; }
.mobile-invoice-sheet .invoice-meta div { display:grid;gap:3px; }.mobile-invoice-sheet .invoice-meta small { color:var(--muted); }
.mobile-invoice-sheet table { width:100%;border-collapse:collapse; }.mobile-invoice-sheet th,.mobile-invoice-sheet td { padding:7px 6px;border:1px solid #b8c4bd;text-align:left; }
.mobile-invoice-sheet thead th,.mobile-invoice-sheet tfoot th { background:#eef3ef; }.mobile-invoice-sheet .invoice-signatures { display:flex;justify-content:space-between;margin-top:32px;font-weight:700; }
@media print { @page { size:A4 portrait;margin:12mm; } body.printing-mobile-invoice * { visibility:hidden!important; } body.printing-mobile-invoice .mobile-invoice-overlay,body.printing-mobile-invoice .mobile-invoice-sheet,body.printing-mobile-invoice .mobile-invoice-sheet * { visibility:visible!important; } body.printing-mobile-invoice .mobile-invoice-overlay { position:absolute;inset:0;display:block;padding:0;background:#fff;overflow:visible; } body.printing-mobile-invoice .mobile-invoice-dialog { width:100%;border-radius:0;background:#fff;overflow:visible; } body.printing-mobile-invoice .mobile-invoice-toolbar { display:none!important; } body.printing-mobile-invoice .mobile-invoice-sheet { width:100%;min-width:0;margin:0;padding:0; } body.printing-mobile-invoice tr { break-inside:avoid; } }
@media(max-width:380px){ .grid{grid-template-columns:1fr}.wide{grid-column:auto}.accounts{grid-template-columns:1fr 1fr}.tabs{top:103px} }

/* Единая визуальная система Пять48 — как в кабинете руководителя. */
.login.login-page { width:100%;max-width:none;min-height:100vh;margin:0;display:grid;place-items:center;padding:max(24px,env(safe-area-inset-top)) 18px 24px;background:radial-gradient(circle at top left,#2a6249,#10251d 55%);color:#17211d; }
.login.login-page .login-card { width:min(440px,100%);max-width:none;margin:0;padding:30px;border-radius:24px;background:#fff;box-shadow:0 24px 70px #07140e80; }
.login-brand { gap:0;margin:0 0 18px; }
.login-brand-logo { width:min(100%,310px); }
.login-brand small { display:none; }
.login.login-page h1 { margin:22px 0 8px;font-size:30px; }
.login.login-page .muted,.login-description { color:var(--muted);line-height:1.45; }
.login.login-page .field span { color:var(--muted); }
.login.login-page input { min-height:44px;border-radius:10px;font-size:16px; }
.login.login-page .primary { min-height:44px;border-radius:10px; }
.login-page .session-recovery { margin-top:18px;border:1px solid var(--line);border-radius:12px;background:#f5f7f4;overflow:hidden; }
.login-page .session-recovery summary { display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:48px;padding:12px 14px;color:var(--green);font-size:14px;font-weight:700;line-height:1.4;list-style:none;cursor:pointer;touch-action:manipulation; }
.login-page .session-recovery summary::-webkit-details-marker { display:none; }
.login-page .session-recovery summary::after { content:"";width:8px;height:8px;flex:0 0 8px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);margin:0 3px 4px 0; }
.login-page .session-recovery[open] summary::after { transform:rotate(225deg);margin-bottom:-4px; }
.login-page .session-recovery summary:focus-visible { outline:2px solid var(--green);outline-offset:-4px;border-radius:12px; }
.login-page .session-recovery > .muted { margin:0;padding:0 14px;font-size:13px;line-height:1.5; }
.login-page .session-recovery .field { margin:14px; }
.login-page .session-recovery .secondary { width:calc(100% - 28px);min-height:44px;margin:0 14px 14px;border-radius:10px;font-size:14px;font-weight:700; }
.login-page #changeUser { min-height:44px;border-radius:10px;background:transparent;color:var(--muted);font-size:14px;font-weight:600; }
.app-header { background:linear-gradient(180deg,#10251d 0%,#0b1d16 100%); }
.tabs button.active { background:var(--gold);color:#17211d; }
.card { border-radius:16px;box-shadow:none; }
@media(max-width:480px){.login.login-page .login-card{padding:24px}.login.login-page h1{font-size:27px}}
.sync-bar .important-events-button{display:inline-flex;align-items:center;gap:5px;border:1px solid #e5b849;background:#fff6d8;color:#6f4d06}.sync-bar .important-events-button strong{display:inline-grid;place-items:center;min-width:21px;height:21px;border-radius:999px;background:#efc34f;color:#203128}.sync-bar .important-events-button.active{background:#efc34f}.important-events-popover{position:fixed;top:max(68px,env(safe-area-inset-top));right:8px;z-index:50;width:min(760px,calc(100vw - 16px));max-height:calc(100vh - 80px);padding:42px 8px 8px;overflow:auto;border:1px solid #d9c173;border-radius:16px;background:#f1f5f2;box-shadow:0 22px 65px #07140e66}.important-events-popover-close{position:absolute;top:8px;right:10px;display:grid;place-items:center;width:32px;height:32px;padding:0;border:1px solid var(--line);border-radius:9px;background:#fff;color:var(--ink);font-size:22px}.important-events-popover-content .card{margin-bottom:9px}.important-events-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:12px}.important-events-head h2{margin:0}.important-events-list{display:grid;gap:8px}.important-event-item{display:grid;grid-template-columns:115px minmax(0,1fr) auto;gap:10px;align-items:center;padding:11px;border:1px solid #ecd28a;border-left:5px solid #e0ad27;border-radius:12px;background:#fffaf0}.important-event-item p{margin:5px 0}.important-event-body{min-width:0}.important-event-action{display:flex;justify-content:flex-end}.important-event-status{display:inline-flex;align-items:center;min-height:30px;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:850}.important-event-status.pending{background:#e8f0fb;color:#24548a}.important-event-status.confirmed{background:#dff1e5;color:#24633b}.important-events-archive{margin-top:10px}.important-event-item.archived{border-color:#dce4de;border-left-color:#78a287;background:#f7faf8}@media(max-width:640px){.sync-bar{flex-wrap:wrap}.sync-bar>span{width:100%}.sync-bar button{flex:1}.important-event-item{grid-template-columns:1fr}.important-event-action{justify-content:flex-start}.important-events-popover{top:8px;max-height:calc(100vh - 16px)}}

.warehouse-review-notice { border-color:#d6b660;background:#fff9e5; }
.warehouse-review-notice p { margin:6px 0 0;font-size:13px;line-height:1.45; }

.warehouse-total-values .stock-summary { min-width:0; }
.warehouse-total-values strong { font-size:20px;overflow-wrap:anywhere; }
@media (max-width:480px) { .warehouse-total-values { grid-template-columns:1fr; } }

.warehouse-shop-lumber-only .stock-summary-grid { grid-template-columns:minmax(0,1fr); }

.shop-stock-balances { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin-top:18px; }
.shop-stock-balance { display:grid;gap:10px;align-content:start;min-width:0; }
.shop-stock-balance h3 { margin:0; }
.shop-stock-balance > span { color:var(--muted);font-size:12px; }
.shop-stock-balance > strong { font-size:22px;overflow-wrap:anywhere; }
/* Movement-only mobile workspace, matching the drums cabinet. */
.warehouse-movement-app { background:#edf0ec; }
.movement-header { display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;background:linear-gradient(180deg,#10251d,#0b1d16); }
.movement-header .brand-logo { width:82px; }
.movement-header .header-brand { gap:8px; }
.movement-header .header-brand strong { font-size:15px; }
.movement-header .header-brand small { max-width:135px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px; }
.movement-header-actions { display:flex;align-items:center;gap:5px;flex-shrink:0; }
.movement-header-actions button { border:0;border-radius:9px;min-width:32px;height:32px;padding:5px;background:#244534;color:#f4bf4f; }
.movement-header-actions .connection { font-size:12px;color:#c7e9d0; }
.movement-header-actions .offline { color:#f4bf4f; }
.movement-main { padding:12px 12px 78px;max-width:620px; }
.movement-entry { padding:14px;margin:0;border-radius:16px;box-shadow:none; }
.movement-title { display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:8px; }
.movement-title h1,.movement-history h1 { font-size:21px;line-height:1.2;margin:0; }
.text-button { background:none;border:0;color:#245b43;font-size:13px;font-weight:800;padding:5px; }
#movementForm { display:grid;gap:10px; }
#movementForm .field { margin:0;gap:4px;min-width:0; }
#movementForm .field > span { font-size:11px;line-height:1.2; }
#movementForm input:not([type="hidden"]),#movementForm select { min-height:42px;height:42px;padding:8px 9px;font-size:17px;border-radius:10px;min-width:0; }
#movementForm input[type="datetime-local"] { font-size:15px; }
#movementForm .primary { min-height:46px;height:46px;padding:10px;font-size:16px;border-radius:11px; }
.movement-route { display:flex;align-items:center;gap:8px;padding:8px 10px;border:1px solid #d8e3da;background:#f1f6f2;border-radius:10px; }
.movement-route > span { display:flex;align-items:center;gap:7px;flex:1;font-size:12px;font-weight:750;line-height:1.25; }
.movement-route b { color:#39714b; }
.movement-route button { border:0;border-radius:8px;background:#dce9df;color:#245b43;min-width:34px;height:32px;font-size:22px; }
.movement-dimensions { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px; }
.movement-choice { display:grid;grid-template-columns:48px minmax(0,1fr);align-items:center;gap:8px; }
.movement-choice > span { font-size:12px;color:var(--muted);font-weight:800; }
.movement-choice > div { display:grid;grid-template-columns:1fr 1fr;gap:8px; }
.movement-choice button { min-height:38px;border:1px solid #d8ded9;border-radius:10px;background:#f3f6f3;color:#4a6053;font-weight:800; }
.movement-choice button.active { background:#173c2d;color:#fff;border-color:#173c2d; }
.movement-quantity { display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:end; }
.movement-quantity > div { display:grid;gap:5px;padding:7px 0; }
.movement-quantity > div span { font-size:11px;color:var(--muted); }
.movement-quantity strong { font-size:21px;overflow-wrap:anywhere;font-variant-numeric:tabular-nums; }
.movement-bottom-nav { position:fixed;bottom:0;left:0;right:0;z-index:5;display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:7px 12px calc(7px + env(safe-area-inset-bottom));background:#10251df7;border-top:1px solid #244b3b; }
.movement-bottom-nav button { border:0;background:transparent;color:#a8bfb2;font-weight:850;border-radius:10px;min-height:44px; }
.movement-bottom-nav button.active { background:#f4bf4f1f;color:#f4bf4f; }
.movement-main .warehouse-review-notice { padding:6px 9px;border:1px solid #e0bd61;border-radius:8px;font-size:11px;line-height:1.2;margin:0 0 8px;background:#fff5d9;color:#72520c; }
.movement-history .history-head { margin:0 0 12px; }
.movement-history .history-head button { min-height:38px;padding:8px 12px;font-size:13px; }
.movement-document { padding:13px;margin:0 0 10px;background:#fff; }
.movement-document p { font-size:12px;line-height:1.4;margin:8px 0;color:var(--muted); }
.movement-history-values { display:grid;grid-template-columns:1fr auto;gap:7px;font-size:14px; }
.movement-history-values b { grid-column:1/-1;color:#245b43; }
.movement-document .document-actions { align-items:center;justify-content:space-between;border-top:1px solid #e4e9e5;padding-top:8px; }
.movement-document .document-actions small { margin:0;line-height:1.35; }
.history-warning { color:#8a5f10!important;font-size:12px; }
@media(max-height:700px) {
 .movement-main { padding-top:8px; }
 .movement-entry { padding:10px; }
 .movement-title { margin-bottom:7px; }
 #movementForm { gap:7px; }
 #movementForm input:not([type="hidden"]) { min-height:38px;height:38px; }
 .movement-choice button { min-height:34px; }
 .movement-route { padding:5px 8px; }
}

.movement-header .header-brand > div { min-width:0; }

/* Keep controls below the phone status area, including the installed PWA. */
:root { --warehouse-safe-top:env(safe-area-inset-top,0px); }
@media(display-mode:standalone) { :root { --warehouse-safe-top:max(24px,env(safe-area-inset-top,0px)); } }
.warehouse-movement-app { min-height:100dvh; }
.movement-header { padding:calc(10px + var(--warehouse-safe-top)) max(12px,env(safe-area-inset-right)) 10px max(12px,env(safe-area-inset-left)); }
.movement-main { margin:0 auto;padding-bottom:calc(78px + env(safe-area-inset-bottom));text-align:center; }
.movement-title { justify-content:center;margin:0;flex-wrap:wrap; }
.movement-route > span { justify-content:center; }
.movement-choice { display:block; }
.movement-mode { display:grid;grid-template-columns:1fr 1fr;gap:8px; }
.movement-mode button { min-height:40px;border:1px solid #d8ded9;border-radius:10px;background:#f3f6f3;color:#4a6053;font-weight:800; }
.movement-mode button.active { background:#173c2d;color:white;border-color:#173c2d; }
.movement-mode button:disabled { opacity:1; }
.movement-four-fields { grid-template-columns:repeat(4,minmax(0,1fr));gap:6px; }
#movementForm .field > span { text-align:center; }
#movementForm input:not([type="hidden"]) { text-align:center;padding-left:4px;padding-right:4px; }
.movement-volume { display:grid;justify-items:center;gap:4px;padding:8px 0; }
.movement-volume > span { color:var(--muted);font-size:12px; }
.movement-volume > strong { font-size:25px;font-variant-numeric:tabular-nums; }

.movement-bottom-nav{grid-template-columns:repeat(auto-fit,minmax(0,1fr));gap:2px;padding-left:4px;padding-right:4px}.movement-bottom-nav button{font-size:11px;padding:6px 2px;min-width:0}.warehouse-timesheet .grid{grid-template-columns:1fr 1fr}.warehouse-timesheet input,.warehouse-timesheet select{text-align:center;min-width:0}.warehouse-timesheet .wide{grid-column:1/-1}

.movement-main .footer-action{position:static;padding:12px 0 0;border:0;background:transparent;backdrop-filter:none}.movement-main .type-switch:has([data-sale-type]){grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}.movement-main [data-sale-type]{font-size:12px;padding:6px 3px}.warehouse-timesheet fieldset{border:0;padding:0;margin:10px 0}.warehouse-timesheet .primary{width:100%}

/* Compact warehouse forms share the transfer typography and spacing. */
.compact-sales .movement-mode{margin:8px 0 12px}.compact-sale-form{display:grid;gap:9px}.sale-row{display:grid;gap:7px;align-items:end}.sale-row.two{grid-template-columns:repeat(2,minmax(0,1fr))}.sale-row.buyer-vat{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr)}.sale-row.four{grid-template-columns:repeat(4,minmax(0,1fr))}.sale-row.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.compact-sale-form .field,.warehouse-timesheet .field{min-width:0;margin:0;gap:4px}.compact-sale-form .field>span,.warehouse-timesheet .field>span,.sale-value>span{font-size:11px;font-weight:700;line-height:1.2;color:var(--muted);text-align:center}.compact-sale-form input,.compact-sale-form select,.warehouse-timesheet input,.warehouse-timesheet select{width:100%;min-width:0;max-width:100%;box-sizing:border-box;min-height:38px;height:38px;padding:5px 4px;text-align:center;font-size:14px;border-radius:9px;background:#f8faf8;color:#173c2d}.compact-sale-form input[type=date],.warehouse-timesheet input[type=date]{display:block;appearance:none;-webkit-appearance:none}.compact-sale-form input::-webkit-date-and-time-value,.warehouse-timesheet input::-webkit-date-and-time-value{text-align:center;margin:0}.sale-value{min-width:0;display:grid;gap:4px;text-align:center}.sale-value strong{min-height:38px;display:flex;align-items:center;justify-content:center;overflow-wrap:anywhere;font-size:15px;color:#173c2d;font-variant-numeric:tabular-nums}
#saleAddLine{justify-self:start;position:static;margin:3px 0;padding:5px 0;background:transparent;color:#245b43;font-size:13px;min-height:30px;text-align:left}#saleTotal{font-size:13px;margin:0;padding:5px;line-height:1.4}.compact-sale-form .footer-action{padding-top:3px}.compact-sale-form .primary,.warehouse-timesheet .primary{min-height:42px;font-size:14px}.sale-extra-line{display:grid;gap:9px;border-top:1px solid #d8ded9;padding-top:12px;margin-top:3px}.sale-extra-heading{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted)}.sale-extra-heading select{width:85px}.sale-extra-heading button{margin-left:auto}.sale-history-filter{margin:10px 0 12px}.mobile-sale-document .document-top{gap:8px;flex-wrap:wrap}.mobile-sale-document .badge{font-size:11px;white-space:normal}.warehouse-timesheet>label{margin:10px 0}.warehouse-timesheet .grid{gap:9px}.warehouse-timesheet .muted{font-size:11px;line-height:1.4}
@media screen{.mobile-invoice-overlay{padding:calc(12px + var(--warehouse-safe-top)) max(10px,env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));overflow:hidden}.mobile-invoice-dialog{display:flex;flex-direction:column;max-height:calc(100dvh - 24px - var(--warehouse-safe-top) - env(safe-area-inset-bottom))}.mobile-invoice-toolbar{position:relative;flex-shrink:0}.mobile-invoice-scroll{overflow:auto;min-height:0}.mobile-invoice-sheet{width:720px}}
@media print{.mobile-invoice-scroll{overflow:visible}}

.sale-row.four .field>span{min-height:26px;display:flex;align-items:flex-end;justify-content:center}.sale-row.three .field>span,.sale-row.three .sale-value>span{min-height:26px;display:flex;align-items:flex-end;justify-content:center}
/* Center native controls, including the separate editable sale date. */
#app input:not([type=checkbox]):not([type=radio]),#app select,#app option{ text-align:center;text-align-last:center; }
.sale-date{width:180px;max-width:100%;margin:0 auto 12px;}
.sale-date input{width:100%;min-width:0;height:38px;box-sizing:border-box;border:1px solid #cad9ce;border-radius:9px;background:#f8faf8;color:#173c2d;font:inherit;appearance:none;padding:5px 8px;}
#app input[type=date]::-webkit-date-and-time-value{text-align:center;width:100%;margin:0;}
#app input[type=date]::-webkit-datetime-edit{display:block;text-align:center;}
@media screen{
 .mobile-invoice-dialog,.mobile-invoice-scroll{max-width:100%;min-width:0;}
 .mobile-invoice-sheet{width:auto;min-width:0;margin:0;padding:12px;overflow-wrap:anywhere;}
 .mobile-invoice-sheet table{table-layout:fixed;}
 .mobile-invoice-sheet th,.mobile-invoice-sheet td{white-space:normal;overflow-wrap:anywhere;}
 .mobile-invoice-toolbar>strong{min-width:0;overflow-wrap:anywhere;}
}
@media screen and (max-width:600px){
 .mobile-invoice-toolbar{padding:10px;gap:8px;}
 .mobile-invoice-toolbar>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;gap:6px;}
 .mobile-invoice-toolbar button{min-width:0;padding:8px 4px;font-size:12px;}
 .mobile-invoice-sheet{padding:8px;font-size:10px;}
 .mobile-invoice-sheet .print-brand{gap:8px;margin-bottom:10px;align-items:center;}
 .mobile-invoice-sheet .print-brand-logo{width:70px;max-width:30%;height:auto;}
 .mobile-invoice-sheet .print-brand span{font-size:14px;text-align:right;}
 .mobile-invoice-sheet .invoice-meta{grid-template-columns:1fr 1fr;gap:8px;}
 .mobile-invoice-sheet .invoice-meta>div:nth-child(2){grid-column:1 / -1;grid-row:2;}
 .mobile-invoice-sheet th,.mobile-invoice-sheet td{padding:5px 2px;font-size:9px;text-align:center;}
 .mobile-invoice-sheet th:first-child{width:19%;}
 .mobile-invoice-sheet th:nth-child(2),.mobile-invoice-sheet th:nth-child(3){width:8%;}
 .mobile-invoice-sheet .invoice-signatures{display:grid;gap:16px;margin-top:20px;}
}

/* Make editable controls distinct from calculated values on mobile forms. */
.compact-sale-form .sale-row:has(> .field > #slSpecies){grid-template-columns:minmax(0,1.5fr) minmax(0,1fr)}
.compact-sales input:not([type=hidden]),.compact-sales select,
.warehouse-timesheet input,.warehouse-timesheet select{
 background:#eef6f0;border:2px solid #789b86;color:#123c28;font-weight:650;
 box-shadow:inset 0 1px 2px #163d2910;
}
.compact-sales select,.warehouse-timesheet select{background-color:#e4f0e7}
.compact-sales input::placeholder,.warehouse-timesheet input::placeholder{color:#587362;opacity:1;font-weight:400}
.compact-sales input:focus,.compact-sales select:focus,
.warehouse-timesheet input:focus,.warehouse-timesheet select:focus{
 outline:2px solid #245b43;outline-offset:2px;border-color:#245b43;background-color:#fff;
}
.compact-sales .field>span,.warehouse-timesheet .field>span{color:#355440}
.compact-sale-form .sale-value strong{background:#f2f3f2;border-radius:9px;color:#33473a}
.compact-sales input:disabled,.compact-sales select:disabled,
.warehouse-timesheet input:disabled,.warehouse-timesheet select:disabled{background:#edf0ed;border-color:#bdc8c0;color:#6c786f;box-shadow:none}
.time-employee-picker{position:relative;min-width:0}
.time-employee-picker>label{font-size:12px;font-weight:600;text-align:center;color:var(--muted)}
.time-employee-options{position:absolute;top:100%;left:0;right:0;z-index:65;max-height:min(220px,35dvh);overflow-y:auto;overscroll-behavior:contain;background:#fff;border:1px solid #cad9ce;border-radius:10px;box-shadow:0 6px 18px #173c2d25;padding:4px}
.time-employee-options[hidden],#timeEmployee[hidden]{display:none!important}
.time-employee-options button{display:block;width:100%;min-height:44px;padding:9px 8px;border:0;border-radius:6px;background:#fff;color:#173c2d;text-align:center;font:inherit;white-space:normal;overflow-wrap:anywhere}
.time-employee-options button:hover,.time-employee-options button[aria-selected=true]{background:#e5f0e9}
#timeEmployeeMatches:empty{display:none}

/* Warehouse footer keeps collaboration below the primary sections. */
.warehouse-bottom-bars{position:fixed;bottom:0;left:0;right:0;z-index:5;background:#10251df7;padding-bottom:env(safe-area-inset-bottom)}
.warehouse-bottom-bars .movement-bottom-nav{position:static;padding-bottom:4px}
.warehouse-team-bottom{border-top:1px solid #244b3b;padding:3px 12px}
.warehouse-team-bottom .team-tabs{display:flex;width:100%;border:0;border-radius:0;padding:0;background:transparent;gap:8px}
.warehouse-team-bottom .team-tabs button{flex:1;min-width:0;min-height:44px;padding:7px 10px}
.movement-main{padding-bottom:calc(132px + env(safe-area-inset-bottom))}
.time-employee-input{position:relative;min-width:0}
.time-employee-input input{width:100%;padding-left:44px;padding-right:44px}
#timeEmployeeSearch::-webkit-search-cancel-button{display:none}
#timeEmployeeClear{position:absolute;right:0;top:0;bottom:0;width:44px;min-height:44px;padding:0;border:0;background:transparent;color:#466453;font-size:26px;line-height:1}
#timeEmployeeClear[hidden]{display:none!important}

@media(max-height:700px){
 #movementForm{grid-template-columns:1fr 1fr}
 #movementForm>*{grid-column:1/-1}
 #movementForm>.movement-choice{grid-column:auto}
 #movementForm .movement-choice>div{gap:4px}
 #movementForm .movement-volume{padding:2px 0}
 .movement-entry-screen{padding-bottom:calc(116px + env(safe-area-inset-bottom))}
}

.movement-recent{margin-top:14px;padding:12px;background:#fff;border:1px solid #d8ded9;border-radius:14px}
.movement-recent h2{font-size:15px;margin:0 0 8px}
.movement-recent .movement-document{padding:10px 0;border-bottom:1px solid #e4e9e5}
.movement-recent .movement-history-values{display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:12px;white-space:nowrap;font-variant-numeric:tabular-nums}
.movement-recent .movement-history-values>*{min-width:0}
.movement-recent .movement-help{font-size:12px;color:var(--muted);margin:10px 0 0}
.movement-recent .muted{font-size:12px}

.movement-bottom-nav[hidden]{display:none!important}
#app:has(#warehouseTeamWorkspace){display:flex;flex-direction:column;height:100dvh;min-height:0}
.movement-main:has(#warehouseTeamWorkspace){flex:1;min-height:0;width:100%;padding:8px 8px calc(60px + env(safe-area-inset-bottom))}
.warehouse-team-workspace{height:100%;min-height:0;text-align:left}
.warehouse-team-workspace .team-dialog.team-inline{position:static;width:100%;max-width:none;height:100%;max-height:none;margin:0;border-radius:14px;box-shadow:none}
.warehouse-team-bottom [aria-current=page]{background:#244b38;color:#f4bf4f}

.warehouse-team-workspace .team-dialog.team-inline .team-detail{overflow-y:auto}

/* Visible connection state on the dark application header. */
.movement-header-actions .connection.online{background:#173e2c;color:#4ade80;box-shadow:inset 0 0 0 1px #328252}
.movement-header-actions .connection.offline{background:#482326;color:#ff6b6b;box-shadow:inset 0 0 0 1px #a64848}
