:root{--bg:#f5f6f2;--surface:#fff;--ink:#18392e;--muted:#60766b;--green:#12664c;--deep:#0a4433;--mint:#e9f3ed;--line:#dfe7e0;--amber:#956216;--amber-bg:#fff5df;--red:#a43f34;--red-bg:#fff0ed}*{box-sizing:border-box}html{font-family:Tahoma,"Noto Sans Thai",sans-serif;-webkit-font-smoothing:antialiased;scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--ink);font-size:15px;line-height:1.65}button,input,select{font:inherit}a{color:var(--green)}button,a,input,select{touch-action:manipulation}button{cursor:pointer}button:disabled{opacity:.6;cursor:wait}a,button,input,select{outline-offset:4px}a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #55977a}h1,h2,h3,p{margin:0}h1,h2,h3{text-wrap:balance}p{text-wrap:pretty}.skip{position:absolute;left:15px;top:-70px;z-index:99;background:var(--deep);color:white;padding:12px}.skip:focus{top:0}.topbar{height:76px;display:flex;align-items:center;justify-content:space-between;padding:0 4%;border-bottom:1px solid var(--line);background:var(--surface)}.brand{display:flex;align-items:center;gap:12px;text-decoration:none;font-weight:700;letter-spacing:2px;font-size:19px}.brand-icon{display:grid;place-items:center;width:37px;height:37px;border-radius:10px;color:white;background:var(--green);font-size:23px;letter-spacing:-2px}.brand-sub{font-size:13px;letter-spacing:0;font-weight:400;color:var(--muted);border-left:1px solid var(--line);padding-left:14px}.topbar nav{display:flex;gap:28px}.topbar nav a{font-size:14px;text-decoration:none;color:var(--muted)}.topbar nav a:hover{color:var(--green)}main{max-width:1540px;padding:36px 4% 64px;margin:auto}.page-heading{display:flex;justify-content:space-between;gap:24px;align-items:flex-end;margin-bottom:30px}.eyebrow{color:var(--muted);font-size:13px;letter-spacing:.6px}h1{font-size:34px;line-height:1.5;font-weight:700;letter-spacing:-.7px;margin:6px 0}h1 span{color:var(--green);margin-left:8px}.page-heading p{color:var(--muted);font-size:14px}.toolbar{display:flex;align-items:flex-end;gap:12px}.toolbar label{font-size:12px;color:var(--muted);display:grid;gap:5px}select{background:var(--surface);border:1px solid var(--line);border-radius:9px;padding:10px 34px 10px 12px;color:var(--ink);min-width:160px}.button{display:inline-flex;align-items:center;justify-content:center;padding:10px 16px;border-radius:9px;min-height:44px;text-decoration:none;font-size:14px;white-space:nowrap;border:1px solid var(--line);background:var(--surface);color:var(--ink);font-weight:600}.button:hover{border-color:#89b69d}.button.primary{background:var(--green);border-color:var(--green);color:#fff}.loading{background:var(--surface);padding:50px;border:1px solid var(--line);border-radius:16px;color:var(--muted)}#workspace:not([hidden]){display:grid;grid-template-columns:228px minmax(0,1fr);gap:28px;align-items:start}.farm-sidebar{position:sticky;top:24px}.sidebar-heading{display:flex;align-items:center;justify-content:space-between;margin:3px 5px 15px}.sidebar-heading h2{font-size:15px}.sidebar-heading span{font-size:12px;color:var(--muted)}#farm-list{display:grid;gap:8px}.farm-button{text-align:left;width:100%;background:transparent;border:1px solid transparent;border-radius:11px;padding:12px 14px;color:var(--ink);display:grid;gap:3px}.farm-button:hover{background:#edf1eb}.farm-button[aria-pressed=true]{background:var(--deep);color:#fff;box-shadow:0 5px 12px #153e2b12}.farm-button .code{font-weight:700;font-size:14px;letter-spacing:.3px}.farm-button .name{font-size:13px;opacity:.9}.farm-button .farm-meta{font-size:11px;opacity:.7;display:flex;gap:7px}.farm-button .alert-dot{color:#e8ba62}.sidebar-note{margin:22px 12px;font-size:12px;color:var(--muted);line-height:1.8}.farm-content{min-width:0}.farm-heading{display:flex;justify-content:space-between;gap:15px;align-items:center}.farm-code{font-size:12px;letter-spacing:1px;color:var(--green);font-weight:700}.farm-heading h2{font-size:26px;line-height:1.6;margin-top:3px}.farm-heading p{font-size:13px;color:var(--muted)}.freshness{display:flex;align-items:center;gap:7px;font-size:12px;color:var(--muted);margin:17px 0 23px;flex-wrap:wrap}.dot{width:6px;height:6px;background:#3c9368;border-radius:50%}.freshness .unit{margin-left:auto;background:var(--mint);color:var(--green);padding:4px 9px;border-radius:5px}.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:22px}.metric{border:1px solid var(--line);border-radius:12px;padding:17px 18px;background:var(--surface);display:grid;align-content:start}.feed-label{font-size:14px;font-weight:700}.feed-label small{color:var(--muted);font-size:12px;font-weight:400;margin-left:4px}.metric strong{font-size:32px;line-height:1.5;letter-spacing:-.7px;font-variant-numeric:tabular-nums}.metric>span:last-child{font-size:12px;color:var(--muted)}.metric.total{background:var(--mint);border-color:#c9dfd0}.notice{padding:12px 16px;border-left:3px solid #c5943c;background:var(--amber-bg);color:var(--amber);font-size:13px;border-radius:6px;margin:0 0 18px}.table-panel{background:var(--surface);border:1px solid var(--line);border-radius:14px;overflow:hidden}.table-heading{padding:20px 22px;display:flex;justify-content:space-between;align-items:center;gap:16px}.table-heading h3{font-size:17px}.table-heading p{font-size:12px;color:var(--muted);margin-top:3px}.filter{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--muted);white-space:nowrap}.filter input{accent-color:var(--green);width:16px;height:16px}.table-scroll{overflow:auto;max-height:720px}table{width:100%;border-collapse:separate;border-spacing:0;font-size:13px;font-variant-numeric:tabular-nums}th,td{padding:11px 12px;text-align:right;border-bottom:1px solid #edf0eb;white-space:nowrap}thead th{font-size:12px;font-weight:600;text-align:center;background:#eff4ef;color:var(--ink)}thead tr:first-child th{position:sticky;top:0;z-index:3}thead tr:nth-child(2) th{position:sticky;top:43px;z-index:3}.group-head th{height:43px}.group-head span,th small{font-size:10px;font-weight:400;color:var(--muted)}thead th.paper-head{background:#faf7ee}th:first-child,td:first-child{position:sticky;left:0;z-index:2;background:var(--surface);text-align:left;min-width:110px;border-right:1px solid #edf0eb}thead th:first-child{background:#eff4ef;z-index:5!important}td:nth-child(5){background:#f6faf6;font-weight:700}td:last-child{min-width:190px;text-align:left}.paper-value{color:var(--muted);background:#fdfcf8}tbody tr.missing td{background:var(--amber-bg)}tbody tr.different td:first-child{box-shadow:inset 3px 0 var(--red)}.missing td:first-child{color:var(--amber)}.badge{display:inline-flex;border-radius:5px;padding:3px 7px;font-size:11px;background:#f0f2ee;color:var(--muted);vertical-align:middle}.badge.matched{color:var(--green);background:var(--mint)}.badge.missing,.badge.partial{color:var(--amber);background:#faeacb}.badge.different{color:var(--red);background:var(--red-bg)}.day-actions{display:flex;align-items:center;gap:8px}.text-button{font-size:11px;background:none;border:0;color:var(--green);padding:7px 2px;text-decoration:underline;text-underline-offset:3px;min-height:30px}.text-button:disabled{color:#849289;text-decoration:none;cursor:default}.date-day{font-size:10px;color:var(--muted);margin-left:5px}.diff{font-weight:700;color:var(--red)}tfoot td{background:#edf5ef;font-weight:700;border-top:1px solid var(--line);position:sticky;bottom:0;z-index:3}tfoot td:first-child{background:#edf5ef;z-index:4}tfoot td:nth-child(5){background:#edf5ef}.table-footer{padding:14px 20px;display:flex;justify-content:space-between;gap:12px;border-top:1px solid var(--line);font-size:11px;color:var(--muted);flex-wrap:wrap}.bottom-context{display:flex;justify-content:space-between;gap:18px;margin-top:15px;font-size:11px;color:var(--muted)}.bottom-context a{white-space:nowrap}#message:not(:empty){background:var(--red-bg);border-radius:8px;padding:12px 16px;margin-bottom:20px;color:var(--red);font-size:13px}dialog{border:1px solid var(--line);border-radius:16px;padding:26px;max-width:850px;width:calc(100% - 32px);max-height:85vh;color:var(--ink);box-shadow:0 24px 90px #142e2333}dialog::backdrop{background:#132e2370}.dialog-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:20px}.dialog-heading h2{font-size:20px}.icon-button{width:36px;height:36px;border:0;background:#f0f3ee;border-radius:50%;font-size:24px;color:var(--muted)}#details-body{overflow:auto}#details-body table{min-width:620px}#details-body th:first-child,#details-body td:first-child{position:static}.source-note{font-size:12px;color:var(--muted);margin:10px 0 16px}.document-number{font-size:12px;color:var(--green);font-weight:600;margin-top:20px}.form-help{color:var(--muted);font-size:13px;margin-bottom:22px}.paper-inputs{display:grid;grid-template-columns:repeat(3,1fr);gap:15px}.paper-inputs label,.reference-label{display:grid;gap:7px;font-size:13px}.paper-inputs input,.reference-label input{width:100%;border:1px solid #cad8cc;border-radius:7px;padding:11px;color:var(--ink);background:var(--surface);font-variant-numeric:tabular-nums}.reference-label{margin-top:20px}.form-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:22px}#save-error{color:var(--red);font-size:13px;margin-top:12px}.login-link{font-size:12px}.empty-row{text-align:center!important;padding:36px!important;color:var(--muted)}@media(max-width:1050px){main{padding:24px 3% 40px}#workspace:not([hidden]){grid-template-columns:185px minmax(0,1fr);gap:18px}.metric{padding:14px}.metric strong{font-size:27px}.table-heading{padding:16px}.brand-sub{display:none}.toolbar{flex-wrap:wrap;justify-content:flex-end}}@media(max-width:760px){body{font-size:14px}.topbar{height:65px;padding:0 4%}.brand{font-size:15px;letter-spacing:1px}.topbar nav{gap:13px}.topbar nav a{font-size:11px}.topbar nav a:last-child{display:none}.page-heading{display:block;margin-bottom:24px}h1{font-size:28px}.toolbar{justify-content:flex-start;margin-top:18px}.toolbar label{flex:1}.toolbar select{width:100%}#workspace:not([hidden]){display:block}.farm-sidebar{position:static;margin-bottom:20px}.sidebar-heading,.sidebar-note{display:none}#farm-list{display:flex;gap:8px;overflow:auto;padding-bottom:9px}.farm-button{width:172px;flex-shrink:0;border-color:var(--line);background:var(--surface);padding:10px 12px}.farm-button .farm-meta{display:none}.farm-heading h2{font-size:22px}.metrics{gap:8px;grid-template-columns:repeat(2,minmax(0,1fr));margin-bottom:16px}.metric{padding:13px 16px}.metric strong{font-size:30px}.freshness{font-size:11px;gap:5px;margin-bottom:16px}.freshness .unit{margin-left:0}.table-heading{flex-wrap:wrap;gap:10px}.table-scroll{max-height:65vh}.bottom-context{flex-wrap:wrap}.paper-inputs{gap:8px}dialog{padding:20px}.farm-heading .button{padding:9px 11px;font-size:12px}}@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

.stock-review{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:20px;margin-bottom:20px}.stock-review p{color:var(--muted);font-size:13px;margin:6px 0}.stock-review .table-scroll{max-height:none;margin-top:12px}.stock-review li{font-size:13px}.stock-review .stock-warning{color:var(--amber);font-weight:700}td.cell-different,.stock-review tr.different td{background:#ffe2dc!important;color:#842b22;font-weight:700}td.cell-pending,.stock-review tr.partial td{background:#fff0ce!important;color:#76500e}.stock-review tr.matched td{background:#edf7ef}
.sap-toolbar{display:flex;justify-content:space-between;flex-wrap:wrap;gap:12px;margin:16px 0;font-size:13px}#sap-review td small{font-size:11px}#sap-review th{white-space:normal;min-width:65px}#sap-review .table-scroll{max-height:450px}#sap-review td:last-child{font-size:12px;overflow-wrap:anywhere;max-width:220px}
#daily table{min-width:1550px}#daily .sap-head{background:#e4ecf7;color:#263e64}#daily td:nth-child(11){border-left:2px solid #9aaec8}#daily th:first-child,#daily td:first-child{position:sticky;left:0;z-index:2;background:var(--surface)}#daily thead th:first-child{z-index:4}#sap-review summary{cursor:pointer;color:var(--green);font-weight:600;padding:10px 0}
/* Keep the first daily records and all seven farms visible on desktop. */
@media(min-width:761px){.topbar{height:64px}main{padding-top:24px}.page-heading{margin-bottom:20px}h1{font-size:30px;line-height:1.35;margin:4px 0}.farm-button{grid-template-columns:48px minmax(0,1fr);padding:10px 12px;column-gap:6px}.farm-button .code{grid-row:1/3;align-self:center}.farm-button .name,.farm-button .farm-meta{grid-column:2}.farm-button .name{font-size:12px;white-space:nowrap}.farm-button .farm-meta{font-size:10px}.farm-heading h2{font-size:24px}.freshness{margin:12px 0 16px}.metric{padding:14px 16px}.metric strong{font-size:30px;line-height:1.35}.metrics{margin-bottom:18px}.table-heading{padding:15px 20px}.sidebar-note{margin-top:16px}}
