:root{--ink:#171715;--paper:#f4f2e9;--white:#fffdf7;--red:#990c19;--gold:#b6802d;--teal:#247b78;--muted:#68665f;--line:#d8d2c7;--soft:#ebe7dc;--danger:#a82923;--warning:#a66b12}
*{box-sizing:border-box}
html{color-scheme:light}
body{margin:0;background:var(--paper);color:var(--ink);font-family:"IBM Plex Sans Thai",system-ui,sans-serif}
button,input,select,textarea{font:inherit;color:inherit}
button,a{-webkit-tap-highlight-color:transparent}
button{cursor:pointer}
[hidden]{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.eyebrow{margin:0 0 9px;color:var(--red);font:600 12px/1 Oswald,sans-serif;letter-spacing:.08em}
.login-view{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 20% 15%,rgba(86,143,184,.19),transparent 30%),radial-gradient(circle at 85% 85%,rgba(153,12,25,.13),transparent 34%),var(--paper)}
.login-card{width:min(440px,100%);padding:42px;background:var(--white);border:1px solid var(--line);box-shadow:0 22px 70px rgba(29,27,23,.12)}
.login-brand{display:inline-flex;align-items:center;gap:12px;margin-bottom:30px;color:var(--red);text-decoration:none;font:700 24px/1 Oswald,sans-serif}
.login-brand img{width:62px;height:62px;object-fit:contain}
.login-card h1{margin:0;font:600 42px/1.05 Oswald,"IBM Plex Sans Thai",sans-serif}
.login-card>p:not(.eyebrow){margin:15px 0 26px;color:var(--muted);line-height:1.6}
.login-card label{display:grid;gap:8px;font-weight:600}
.login-card input{width:100%;height:50px;padding:0 14px;background:white;border:1px solid var(--line);outline:0}
.login-card input:focus{border-color:var(--red);box-shadow:0 0 0 3px rgba(153,12,25,.1)}
.login-card button{width:100%;height:50px;margin-top:14px;border:0;background:var(--red);color:white;font-weight:700}
.login-card button:hover{background:#760812}
.form-error{min-height:24px;margin:9px 0 0;color:var(--danger);font-size:13px}
.admin-app{min-height:100vh}
.topbar{position:sticky;z-index:30;top:0;height:72px;display:flex;align-items:center;justify-content:space-between;padding:0 28px;background:rgba(244,242,233,.97);border-bottom:1px solid var(--line);backdrop-filter:blur(10px)}
.topbar-brand{display:flex;align-items:center;gap:10px}
.topbar-brand img{width:48px;height:48px;object-fit:contain}
.topbar-brand strong,.topbar-brand span{display:block}
.topbar-brand strong{color:var(--red);font:700 20px/1 Oswald,sans-serif}
.topbar-brand span{margin-top:5px;color:var(--muted);font:600 10px/1 Oswald,sans-serif;letter-spacing:.08em}
.topbar-actions{display:flex;align-items:center;gap:8px}
.topbar-actions a,.topbar-actions button{min-height:38px;display:inline-flex;align-items:center;padding:0 13px;border:1px solid var(--line);background:transparent;color:var(--ink);text-decoration:none;font-size:13px;font-weight:600}
.topbar-actions a:hover,.topbar-actions button:hover{border-color:var(--red);color:var(--red)}
.workspace{display:grid;grid-template-columns:220px minmax(0,1fr);min-height:calc(100vh - 72px)}
.sidebar{padding:28px 18px;background:var(--ink);color:white}
.sidebar button{width:100%;min-height:52px;display:flex;align-items:center;gap:14px;padding:0 14px;border:0;border-left:3px solid transparent;background:transparent;color:#d5d1c8;text-align:left;font-weight:600}
.sidebar button span{color:#77746e;font:600 18px/1 Oswald,sans-serif}
.sidebar button:hover,.sidebar button.active{border-left-color:#e1ae57;background:#292825;color:white}
.sidebar button.active span{color:#e1ae57}
.sidebar p{margin:30px 12px 0;color:#aaa69e;font-size:12px;line-height:1.65}
.content{min-width:0;padding:46px clamp(20px,4vw,56px) 80px}
.page-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin-bottom:28px}
.page-heading h1{margin:0;font:600 clamp(32px,4vw,48px)/1.05 Oswald,"IBM Plex Sans Thai",sans-serif}
.page-heading>div>p:last-child{margin:10px 0 0;color:var(--muted);font-size:13px}
.primary-button,.secondary-button{min-height:44px;padding:0 17px;font-weight:700;border:1px solid var(--red)}
.primary-button{background:var(--red);color:white}
.primary-button:hover{background:#760812}
.primary-button:disabled{opacity:.55;cursor:wait}
.secondary-button{background:transparent;color:var(--red)}
.secondary-button:hover{background:#fff}
.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.metrics article{min-width:0;padding:20px;background:var(--white);border:1px solid var(--line);border-top:4px solid var(--teal)}
.metrics article.warning{border-top-color:var(--warning)}
.metrics article.danger{border-top-color:var(--danger)}
.metrics span,.metrics small{display:block;color:var(--muted)}
.metrics span{font-size:12px;font-weight:700}
.metrics strong{display:block;margin:10px 0 8px;font:600 34px/1 Oswald,sans-serif}
.metrics small{font-size:11px;line-height:1.4}
.unit-summary{min-height:24px;margin:14px 0 0;color:var(--muted);font-size:13px}
.source-status{margin:12px 0;padding:14px 16px;border:1px solid #c6dad0;background:#eef5f0;font-size:13px;line-height:1.7;color:#275741}
.source-status.stale{border-color:#decba3;background:#fff5df;color:#79591c}
.source-status a{color:inherit;font-weight:700;text-underline-offset:3px}
.source-actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px 16px;margin-top:12px}
.source-pull-button{flex-shrink:0;min-height:44px;font-size:13px}
.source-pull-button:disabled{opacity:.6;cursor:wait;background:var(--soft)}
.source-pull-result{flex:1 1 260px;min-width:0;margin:0;font-size:13px;line-height:1.7;overflow-wrap:anywhere}
.source-pull-result.error{color:var(--danger);font-weight:600}
.source-detail{display:block;margin-top:5px;color:var(--teal);font-size:11px}
.source-detail.stale{color:var(--warning)}
.toolbar{display:flex;align-items:center;gap:9px;margin:24px 0 14px}
.toolbar input,.toolbar select{height:44px;min-width:150px;padding:0 12px;background:white;border:1px solid var(--line);outline:0}
.toolbar input:focus,.toolbar select:focus{border-color:var(--red);box-shadow:0 0 0 2px rgba(153,12,25,.08)}
.search-field{flex:1}
.search-field input{width:100%}
.table-card{overflow-x:auto;background:var(--white);border:1px solid var(--line)}
table{width:100%;min-width:920px;border-collapse:collapse}
th,td{padding:14px 16px;border-bottom:1px solid #e6e1d7;text-align:left;vertical-align:middle}
th{background:#ece8df;color:#5d5a54;font-size:11px;text-transform:uppercase;letter-spacing:.03em}
td{font-size:13px}
tbody tr:hover{background:#faf8f2}
tbody tr:last-child td{border-bottom:0}
.product-cell{display:flex;align-items:center;gap:12px;min-width:230px}
.product-cell img{width:76px;height:52px;object-fit:cover;background:#eee;border:1px solid var(--line)}
.product-cell strong,.product-cell small{display:block}
.product-cell strong{font:600 16px/1.2 Oswald,"IBM Plex Sans Thai",sans-serif}
.product-cell small{margin-top:5px;color:var(--muted);font-size:11px}
.stock-value{display:flex;align-items:baseline;gap:5px}
.stock-value strong{font:600 25px/1 Oswald,sans-serif}
.stock-value span{color:var(--muted);font-size:11px}
.status{display:inline-flex;align-items:center;min-height:27px;padding:0 9px;border-radius:20px;background:#e1eee5;color:#23633a;font-size:11px;font-weight:700;white-space:nowrap}
.status.low{background:#f6e8c8;color:#85530a}
.status.out{background:#f4d9d6;color:#8b211c}
.status.untracked{background:#e5e4e1;color:#5c5a55}
.status.hidden{background:#e5e4e1;color:#5c5a55}
.lot-list{min-width:180px;color:var(--muted);font-size:11px;line-height:1.5}
.lot-list strong{color:var(--ink)}
.row-actions{display:flex;gap:6px;justify-content:flex-end}
.row-actions button{min-height:34px;padding:0 10px;background:white;border:1px solid var(--line);font-size:11px;font-weight:700;white-space:nowrap}
.row-actions button:first-child{border-color:var(--red);color:var(--red)}
.row-actions button:hover{background:var(--soft)}
.delta{font:600 16px/1 Oswald,sans-serif}
.delta.positive{color:#1f7043}
.delta.negative{color:var(--danger)}
.movement-note{max-width:260px;color:var(--muted);font-size:11px;line-height:1.45}
.movement-note strong{color:var(--ink)}
.empty-state{margin:0;padding:44px;text-align:center;color:var(--muted)}
dialog{width:min(650px,calc(100% - 28px));max-height:calc(100vh - 28px);padding:0;background:var(--white);border:1px solid var(--line);box-shadow:0 28px 100px rgba(0,0,0,.25)}
dialog::backdrop{background:rgba(20,19,17,.68);backdrop-filter:blur(3px)}
dialog form{padding:26px}
.dialog-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:18px}
.dialog-heading h2{margin:0;font:600 30px/1.1 Oswald,"IBM Plex Sans Thai",sans-serif}
.close-button{width:38px;height:38px;border:1px solid var(--line);background:transparent;font-size:25px;line-height:1}
.selected-product{display:flex;align-items:center;gap:12px;margin-bottom:18px;padding:12px;background:var(--soft)}
.selected-product img{width:86px;height:59px;object-fit:cover;border:1px solid var(--line)}
.selected-product strong,.selected-product small{display:block}
.selected-product strong{font:600 18px/1.2 Oswald,"IBM Plex Sans Thai",sans-serif}
.selected-product small{margin-top:5px;color:var(--muted)}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.form-grid label{display:grid;gap:6px;font-size:12px;font-weight:700}
.form-grid .wide{grid-column:1/-1}
.form-grid input,.form-grid select,.form-grid textarea{width:100%;min-height:44px;padding:9px 11px;background:white;border:1px solid var(--line);outline:0}
.form-grid textarea{resize:vertical}
.form-grid input:focus,.form-grid select:focus,.form-grid textarea:focus{border-color:var(--red);box-shadow:0 0 0 2px rgba(153,12,25,.08)}
.stock-preview{display:grid;grid-template-columns:1fr 1fr;margin-top:16px;border:1px solid var(--line)}
.stock-preview span{padding:14px;color:var(--muted);font-size:12px}
.stock-preview span+span{border-left:1px solid var(--line)}
.stock-preview strong{display:block;margin-top:5px;color:var(--ink);font:600 24px/1 Oswald,sans-serif}
.dialog-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:18px}
.switches{display:grid;gap:10px;margin-top:18px}
.switches label{display:flex;align-items:flex-start;gap:10px;padding:12px;background:var(--soft);font-size:13px;font-weight:600}
.switches input{width:18px;height:18px;margin:1px 0 0;accent-color:var(--red)}
.form-note{margin:14px 0 0;color:var(--muted);font-size:11px}
.notice{position:fixed;z-index:100;right:22px;bottom:22px;max-width:390px;padding:14px 18px;background:var(--ink);color:white;box-shadow:0 12px 40px rgba(0,0,0,.24);font-size:13px;font-weight:600}
.notice.error{background:var(--danger)}
:focus-visible{outline:3px solid rgba(86,143,184,.5);outline-offset:2px}
@media(max-width:900px){.workspace{grid-template-columns:1fr}.sidebar{position:sticky;z-index:20;top:72px;display:flex;gap:6px;padding:9px 14px}.sidebar button{width:auto;min-height:42px;padding:0 12px;border-left:0;border-bottom:3px solid transparent}.sidebar button.active{border-left:0;border-bottom-color:#e1ae57}.sidebar p{display:none}.metrics{grid-template-columns:1fr 1fr}.content{padding-top:30px}}
@media(max-width:640px){.login-card{padding:28px 24px}.login-card h1{font-size:36px;white-space:nowrap}.topbar{height:auto;min-height:68px;padding:8px 13px}.topbar-brand img{width:42px;height:42px}.topbar-actions{gap:4px}.topbar-actions a,.topbar-actions button{min-height:36px;padding:0 8px;font-size:11px}.workspace{min-height:calc(100vh - 68px)}.sidebar{top:68px;overflow-x:auto}.sidebar button{flex:0 0 auto}.content{padding:25px 13px 60px}.page-heading{align-items:flex-start;flex-direction:column}.page-heading>button{width:100%}.metrics{gap:8px}.metrics article{padding:15px}.toolbar{align-items:stretch;flex-direction:column}.toolbar input,.toolbar select{width:100%}.form-grid{grid-template-columns:1fr}.form-grid .wide{grid-column:auto}.stock-preview{grid-template-columns:1fr}.stock-preview span+span{border-left:0;border-top:1px solid var(--line)}dialog form{padding:20px}.dialog-heading h2{font-size:28px;white-space:nowrap}.dialog-actions button{flex:1}}
@media(max-width:640px){.source-actions{align-items:stretch;gap:10px}.source-pull-button{width:100%}.source-pull-result{flex-basis:100%}}
.featured-controls{display:grid;grid-template-columns:1fr auto;gap:12px 24px;align-items:center;margin:20px 0;padding:20px;border:1px solid var(--line);background:var(--white)}
.featured-controls h2{margin:0 0 7px;font-size:18px}
.featured-controls p{margin:4px 0 0;font-size:13px;line-height:1.6;color:var(--muted)}
.featured-controls #featuredCount{font-weight:700;color:var(--ink)}
.featured-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
.featured-status{grid-column:1/-1;min-height:1.6em}
.featured-controls .featured-status.error{color:var(--danger)}
.featured-toggle{display:flex;align-items:center;gap:7px;min-height:44px;font-size:12px;white-space:nowrap;cursor:pointer}
.featured-toggle input{width:19px;height:19px;margin:0;accent-color:var(--red)}
.featured-toggle:has(input:disabled){color:var(--muted);cursor:default}
@media(max-width:640px){.featured-controls{grid-template-columns:1fr;padding:16px;gap:12px}.featured-actions{justify-content:stretch}.featured-actions button{width:100%}.featured-status{grid-column:auto}}

.featured-content{max-width:1220px;margin:auto;padding:42px 28px 60px}.featured-content .page-heading h1{font-family:"IBM Plex Sans Thai",sans-serif;font-size:32px}.featured-summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px 18px;margin-bottom:24px;background:#ece7dc;border-left:3px solid var(--red)}#selectionCount{font-weight:600;white-space:nowrap}#saveStatus{margin:0;font-size:14px;line-height:1.7}.error{color:#982c28}.featured-search{display:block;max-width:400px;margin-bottom:20px;font-size:14px}.featured-search input{display:block;width:100%;margin-top:7px;padding:12px;border:1px solid var(--line);background:white;font:inherit}.featured-content table{width:100%;min-width:700px}.featured-toggle{display:flex;align-items:center;gap:10px;min-height:44px;cursor:pointer;font-size:14px}.featured-toggle input{width:21px;height:21px;accent-color:var(--red);margin:0}.featured-toggle:has(input:disabled){color:#777;cursor:default}.featured-content .product-cell img{width:96px;height:66px;object-fit:contain}.featured-content tr.selected{background:#f3efe5}.featured-note{font-size:14px;color:var(--muted);margin-top:20px}.featured-note a{text-decoration:underline}.featured-content button:disabled{cursor:default;opacity:.5}.featured-content td{vertical-align:middle}
@media(max-width:640px){.featured-content{padding:28px 15px 45px}.featured-content .page-heading h1{font-size:26px}.featured-summary{align-items:flex-start;flex-direction:column;gap:6px;padding:14px}.featured-search{max-width:none}.topbar-actions{flex-wrap:wrap;justify-content:flex-end}.topbar{gap:8px}.topbar-brand{flex-shrink:0}.topbar-actions a,.topbar-actions button{font-size:10px;padding:0 6px}}
@media(max-width:640px){.featured-content{padding-bottom:105px}.featured-content table{min-width:0}.featured-content thead{display:none}.featured-content tbody{display:grid;gap:12px;padding:12px}.featured-content tr{display:grid;grid-template-columns:1fr 1fr;border:1px solid var(--line)}.featured-content td{padding:12px;border:0}.featured-content td:nth-child(2){grid-column:1/-1;grid-row:1}.featured-content td:first-child{grid-column:1/-1;grid-row:3;border-top:1px solid var(--line)}.featured-content td:nth-child(3),.featured-content td:nth-child(4){grid-row:2;font-size:13px}.featured-content td:nth-child(3)::before,.featured-content td:nth-child(4)::before{display:block;font-size:11px;color:var(--muted);margin-bottom:4px}.featured-content td:nth-child(3)::before{content:'ลิตรคงเหลือ'}.featured-content td:nth-child(4)::before{content:'กระป๋องคงเหลือ'}.featured-content .product-cell img{width:76px;height:53px}.featured-content #saveFeatured{position:fixed;bottom:15px;left:15px;right:15px;width:calc(100% - 30px);z-index:50;box-shadow:0 6px 20px #0003}}
.description-help{font-size:14px;line-height:1.8;color:var(--muted);max-width:850px;margin:0 0 18px}.featured-reload{display:flex;align-items:center;gap:16px;margin:0 0 20px}.featured-reload button{border:1px solid var(--line);padding:10px 14px;background:transparent;color:var(--ink);font:inherit;cursor:pointer;white-space:nowrap}.featured-reload p{margin:0;font-size:13px;line-height:1.7;color:#982c28}.featured-content .product-description-cell{width:48%;min-width:280px}.description-editor{margin-top:14px}.description-editor label{display:block;font-size:13px;font-weight:600;margin-bottom:6px}.description-editor textarea{display:block;width:100%;min-height:88px;resize:vertical;border:1px solid var(--line);padding:10px 12px;background:#fff;font:400 14px/1.7 "IBM Plex Sans Thai",sans-serif;color:var(--ink);box-sizing:border-box}.description-editor textarea:focus{outline:2px solid var(--red);outline-offset:2px}.description-editor textarea[aria-invalid="true"]{border-color:#982c28}.description-count{display:block;text-align:right;margin-top:5px;font-size:12px;color:var(--muted)}.description-count.over-limit{color:#982c28;font-weight:600}
@media(max-width:640px){.featured-content .product-description-cell{width:auto;min-width:0}.featured-reload{align-items:flex-start;flex-direction:column;gap:8px}.description-editor textarea{font-size:16px}.description-help{font-size:13px}.featured-content #saveFeatured{font-size:14px;padding:15px 10px}}

/* One product list combines the stock overview and storefront editing. */
.admin-notice:empty{display:none}.admin-notice:not(:empty){font-size:14px;line-height:1.7;padding:12px 15px;border-left:3px solid #9e8c62;background:#ece7dc;margin:0 0 20px}
.featured-content{max-width:1440px}.dashboard-updated{font-size:13px;color:var(--muted);margin:0}.inventory-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:0 0 18px}.inventory-metrics article{background:#fffdf7;border:1px solid var(--line);border-top:3px solid #345d50;padding:17px 20px}.inventory-metrics article:nth-child(2){border-top-color:#a47724}.inventory-metrics article:nth-child(3){border-top-color:var(--red)}.inventory-metrics article span{display:block;font-size:14px;color:var(--muted)}.inventory-metrics article strong{display:block;font:600 35px/1.25 "Oswald",sans-serif;margin-top:7px}.stock-overview{display:flex;justify-content:space-between;align-items:flex-start;gap:15px 30px;flex-wrap:wrap;margin:0 0 24px}.stock-overview p{margin:0;font-size:14px;line-height:1.8}#accountStatus{font-size:13px;color:var(--muted)}.stale{color:#9d5d18!important}.admin-tabs{display:flex;border-bottom:1px solid var(--line);gap:7px;margin-bottom:28px}.admin-tabs button{font:500 15px "IBM Plex Sans Thai",sans-serif;background:transparent;color:var(--muted);border:0;border-bottom:3px solid transparent;padding:13px 18px;min-height:50px;cursor:pointer}.admin-tabs button[aria-selected="true"]{border-bottom-color:var(--red);color:var(--ink);font-weight:600}.admin-tabs button:focus-visible{outline:2px solid var(--red);outline-offset:2px}.feature-heading{display:flex;justify-content:space-between;align-items:center;gap:22px;margin-bottom:22px}.feature-heading h2{font-size:22px;margin:0 0 6px}.feature-heading p{font-size:14px;line-height:1.8;color:var(--muted);margin:0}.feature-heading button{flex-shrink:0}.featured-summary{margin-bottom:14px}.featured-reload{margin-bottom:22px}.product-filters,.history-filters{display:grid;grid-template-columns:minmax(200px,2fr) minmax(130px,1fr) minmax(130px,1fr);gap:14px;margin-bottom:20px}.product-filters label,.history-filters label{font-size:13px;color:var(--muted)}.product-filters .featured-search{margin:0;max-width:none}.product-filters input,.product-filters select,.history-filters input,.history-filters select{display:block;width:100%;min-width:0;min-height:45px;margin-top:7px;padding:10px 12px;background:white;border:1px solid var(--line);font:400 14px "IBM Plex Sans Thai",sans-serif;color:var(--ink);box-sizing:border-box}.product-table table{min-width:1000px}.featured-content .product-description-cell{width:36%;min-width:280px}.product-table td{vertical-align:top}.product-table td>strong{display:block;font-size:15px;white-space:nowrap}.product-table td small,.lot-list small,.history-table td small{display:block;color:var(--muted);font-size:12px;line-height:1.7;margin-top:4px}.product-table .product-cell img{width:80px;height:58px}.product-table .featured-toggle{font-size:12px;gap:8px;min-width:85px}.product-table .featured-toggle span{max-width:56px;line-height:1.5}.source-detail{font-size:12px;color:#345d50!important}.lot-list{font-size:12px;line-height:1.7;min-width:145px}.lot-list>div+div{margin-top:8px}.description-editor{margin-top:12px}.description-editor summary{display:inline-block;font-size:13px;font-weight:500;color:#8e2930;cursor:pointer;min-height:28px;line-height:1.8;text-decoration:underline;text-underline-offset:3px}.description-editor summary::before{content:"+ ";text-decoration:none}.description-editor[open] summary::before{content:"− "}.description-editor label{margin-top:10px}.description-editor p{font-size:11px;line-height:1.7;color:var(--muted);margin:7px 0 0}.history-filters{grid-template-columns:minmax(150px,1.5fr) repeat(4,minmax(120px,1fr))}.history-count{font-size:13px;color:var(--muted);margin:0 0 13px}.history-table table{min-width:950px}.history-table td{vertical-align:top;font-size:13px;line-height:1.8}.history-table td:last-child{max-width:300px;overflow-wrap:anywhere}.history-table .positive{color:#345d50}.history-table .negative{color:#9e302c}
@media(max-width:1000px){.feature-heading{align-items:flex-start;flex-direction:column;gap:14px}.history-filters{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:640px){.featured-content{padding-top:25px;padding-bottom:135px}.featured-content .page-heading{margin-bottom:22px}.featured-content .page-heading h1{font-size:25px}.dashboard-updated{font-size:12px}.inventory-metrics{gap:8px;margin-bottom:14px}.inventory-metrics article{padding:13px 11px}.inventory-metrics article span{font-size:12px}.inventory-metrics article strong{font-size:30px}.stock-overview{gap:6px;margin-bottom:20px}.stock-overview p{font-size:13px}.stock-overview #accountStatus{font-size:12px}.admin-tabs{gap:0;margin-bottom:22px}.admin-tabs button{font-size:14px;padding:12px 10px;flex:1}.feature-heading h2{font-size:20px}.feature-heading p{font-size:13px}.product-filters{grid-template-columns:1fr 1fr;gap:12px}.product-filters .featured-search{grid-column:1/-1}.product-filters input,.product-filters select,.history-filters input,.history-filters select{font-size:16px}.product-table table{min-width:0}.featured-content .product-table tr{grid-template-columns:1fr 1fr;position:relative;background:#fffdf8}.featured-content .product-table td{grid-row:auto;grid-column:auto;padding:12px}.featured-content .product-table .product-description-cell{grid-column:1/-1;grid-row:1;width:auto;min-width:0;padding-top:44px}.featured-content .product-table .status-cell{grid-column:1/-1;grid-row:1;position:absolute;right:10px;top:10px;padding:0;border:0}.featured-content .product-table .liter-cell{grid-column:1;grid-row:2;border-top:1px solid var(--line)}.featured-content .product-table .can-cell{grid-column:2;grid-row:2;border-top:1px solid var(--line)}.featured-content .product-table .liter-cell::before,.featured-content .product-table .can-cell::before{display:block;font-size:11px;color:var(--muted);margin-bottom:6px}.featured-content .product-table .liter-cell::before{content:"ลิตรคงเหลือ"}.featured-content .product-table .can-cell::before{content:"กระป๋องคงเหลือ"}.featured-content .product-table .lot-cell{grid-column:1/-1;grid-row:3;border-top:1px solid var(--line)}.featured-content .product-table .lot-cell::before{content:"ล็อต / หมดอายุ";display:block;font-size:11px;color:var(--muted);margin-bottom:5px}.featured-content .product-table .recommendation-cell{grid-column:1/-1;grid-row:4;border-top:1px solid var(--line)}.product-table .featured-toggle{font-size:14px}.product-table .featured-toggle span{max-width:none}.product-table td>strong{font-size:15px;white-space:normal}.product-table .product-cell img{width:76px;height:54px}.product-table .description-editor textarea{font-size:16px}.lot-list{min-width:0}.featured-content #saveFeatured{bottom:12px;min-height:54px;padding:12px 10px;font-size:13px}.history-filters{grid-template-columns:1fr 1fr;gap:12px}.history-filters>label:first-child{grid-column:1/-1}.history-table table{min-width:0}.featured-content .history-table tr{display:block;background:#fffdf8}.featured-content .history-table td{display:grid;grid-template-columns:88px minmax(0,1fr);gap:6px 12px;padding:9px 12px;max-width:none}.featured-content .history-table td::before{content:attr(data-label);font-size:11px;color:var(--muted);grid-column:1;grid-row:1/5}.featured-content .history-table td>*{grid-column:2}.featured-content .history-table td:first-child{border:0}.featured-content .history-table td:nth-child(3)::before,.featured-content .history-table td:nth-child(4)::before{content:attr(data-label)}.featured-content .history-table td:nth-child(2){grid-row:auto;grid-column:auto}.featured-content .history-table td:nth-child(3),.featured-content .history-table td:nth-child(4){grid-row:auto}.history-table small{margin-top:0}}
@media(max-width:640px){.featured-content #saveFeatured:not(.has-unsaved):not([aria-busy="true"]){display:none}}
@media(max-width:640px){.history-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.history-filters>label,.product-filters>label{min-width:0}}

/* Live stock actions in the combined product list. */
.account-actions{display:flex;align-items:center;gap:10px 15px;flex-wrap:wrap}.account-actions button{min-height:42px;border:1px solid var(--line);padding:8px 13px;background:transparent;font:inherit;font-size:13px}.account-actions #personalStockPullResult{width:100%;font-size:12px}.operation-cell .row-actions{display:flex;gap:7px;flex-wrap:wrap}.operation-cell button{min-height:40px;border:1px solid var(--line);background:transparent;padding:8px 12px;font:inherit;font-size:13px}.operation-cell button:disabled{opacity:.5}.product-table table{min-width:1140px}.page-heading #newMovementButton{white-space:nowrap}.selected-product small{display:block}
@media(max-width:640px){.product-table table{min-width:0}.featured-content .product-table .operation-cell{grid-column:1/-1;grid-row:5;border-top:1px solid var(--line)}.operation-cell .row-actions{display:grid;grid-template-columns:1fr 1fr}.account-actions{gap:8px}.page-heading #newMovementButton{width:100%}.account-actions button{width:100%}.featured-content .product-table tbody{min-width:0}.featured-content .product-table tr,.featured-content .product-table td{min-width:0}}

.partner-form {
  padding: 18px;
  margin-bottom: 20px;
  background: var(--white);
  border: 1px solid var(--line);
}
.partner-form fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
.partner-form legend { font-weight: 700; margin-bottom: 12px; }
.partner-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 14px;
  margin-bottom: 16px;
}
.partner-inputs label { color: var(--muted); font-size: 14px; }
.partner-inputs input {
  display: block;
  width: 100%;
  min-height: 45px;
  margin-top: 6px;
  padding: 10px 12px;
  background: white;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 16px;
}
.partner-photo-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin: 0 0 16px; }
.partner-photo-fields > label { color: var(--muted); font-size: 14px; min-width: 0; }
.partner-photo-fields input[type="file"] { display: block; max-width: 100%; margin: 6px 0; color: var(--ink); }
.partner-photo-fields small { display: block; }
.partner-current-photo { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 14px; }
.partner-current-photo img, .partner-list .partner-photo { object-fit: cover; border: 1px solid var(--line); }
.partner-list .partner-with-photo { display: flex; align-items: center; gap: 12px; min-width: 0; }
.partner-list .partner-photo { flex: none; }
.partner-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#reloadPartners { margin-bottom: 16px; }
.partner-list { padding: 0; margin: 0; list-style: none; }
.partner-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}
.partner-list li:last-child { border-bottom: 1px solid var(--line); }
.partner-identity { min-width: 0; overflow-wrap: anywhere; }
.partner-identity a { display: block; color: var(--red); margin-top: 4px; }

@media (max-width: 640px) {
  .partner-inputs { grid-template-columns: minmax(0, 1fr); }
}
.event-inputs { grid-template-columns: minmax(0, 2fr) minmax(150px, 1fr) minmax(0, 2fr); }
.event-date { display: block; color: var(--muted); margin-top: 5px; }
#reloadEvents { margin-bottom: 16px; }
@media (max-width: 640px) {
  .event-inputs { grid-template-columns: minmax(0, 1fr); }
  .admin-tabs { flex-wrap: wrap; }
  .admin-tabs button { flex-basis: 45%; }
}
