/* แบบ C: operational board — เปลี่ยนเฉพาะ presentation และคง action/flow เดิม */
body.theme-c{
 --c-bg:#eceef2;--c-surface:#fff;--c-surface-2:#f6f7f9;--c-line:#dde1e7;--c-line-strong:#c3cad3;
 --c-ink:#18212d;--c-muted:#4a5565;--c-primary:#1f4fd1;--c-primary-hover:#1940ad;
 background:var(--c-bg);color:var(--c-ink)
}
body.theme-c.glass-ui{background:var(--c-bg)}
body.theme-c .app-shell{background:var(--c-bg);color:var(--c-ink)}
body.theme-c .main{min-width:0}
body.theme-c .page-content{width:100%;max-width:none;margin:0;padding:16px 20px 28px}
body.theme-c.glass-ui :is(.surface,.inventory,.cart,.catalog,.ledger-card,.ledger-card-top,.ledger-toolbar,.ledger-bottom,.list-toolbar,.detail-panel,.kpi-card,.kpi-panel){
 background-color:var(--c-surface);border-color:var(--c-line);backdrop-filter:none;
 box-shadow:0 1px 2px #1018280f,0 1px 3px #10182814
}

/* แถบเมนู C: desktop เป็น rail ย่อและขยายทับพื้นที่งานเมื่อชี้/โฟกัส */
@media(min-width:1020px){
 body.theme-c .app-shell{grid-template-columns:68px minmax(0,1fr)}
 body.theme-c.glass-ui .sidebar{width:68px;padding:12px 10px;background:#141b25;border:0;color:#c9d1dc;overflow:hidden;z-index:20;transition:width .2s cubic-bezier(.2,.8,.2,1),box-shadow .2s;backdrop-filter:none;box-shadow:none}
 body.theme-c.glass-ui .sidebar:is(:hover,:focus-within){width:220px;box-shadow:0 16px 40px #10182838}
 body.theme-c .brand{justify-content:flex-start;gap:12px;min-height:48px;padding:2px 6px 10px;color:#fff;font-size:18px;white-space:nowrap}
 body.theme-c .brand img{width:36px;height:36px;border-radius:9px;background:#fff;flex:0 0 36px}
 body.theme-c .brand>span,body.theme-c .sidebar .nav>span,body.theme-c .sidebar-bottom{opacity:0;transition:opacity .15s;white-space:nowrap}
 body.theme-c .sidebar:is(:hover,:focus-within) :is(.brand>span,.nav>span,.sidebar-bottom){opacity:1}
 body.theme-c .sidebar nav{gap:4px;margin-top:6px}
 body.theme-c.glass-ui .sidebar .nav{position:relative;justify-content:flex-start;gap:14px;width:200px;min-height:46px;padding:0 13px;border-radius:9px;color:#c9d1dc;font-size:14px;font-weight:500}
 body.theme-c.glass-ui .sidebar .nav:is(:hover,:focus-visible){background:#212b39;color:#fff}
 body.theme-c.glass-ui .sidebar .nav.active{background:#2b3a52;color:#fff;box-shadow:inset 3px 0 #7aa2ff}
 body.theme-c .sidebar .nav.active:before{display:none}
 body.theme-c .sidebar-bottom{width:200px;color:#c9d1dc}
 body.theme-c .staff{border-color:#344052;padding:14px 6px 8px;color:#fff}
 body.theme-c .staff small,body.theme-c .sidebar-note{color:#9da8b8}
 body.theme-c .staff .account-desktop{background:#2b3a52;border-color:#46566d;color:#fff;box-shadow:none}
}

/* header และสรุป ใช้พื้นผิวเรียบแบบ mockup C */
body.theme-c .page-heading,body.theme-c .ledger-admin .ledger-lifecycle-header{
 min-height:64px;margin-bottom:12px;padding:10px 14px;background:var(--c-surface);border:1px solid var(--c-line);border-radius:12px;
 box-shadow:0 1px 2px #1018280f
}
body.theme-c .admin-page-title>img{display:none}
body.theme-c .admin-page-title h1,body.theme-c .ledger-admin .ledger-lifecycle-header h1{font-size:20px;letter-spacing:0;font-weight:650}
body.theme-c .eyebrow{margin-bottom:2px;color:#657185;letter-spacing:1.5px}
body.theme-c .summary{gap:12px;margin-bottom:12px}
body.theme-c .summary .metric{
 --stock-tone:#2563eb;min-height:76px;padding:12px 14px;background:var(--c-surface);color:var(--c-ink);
 border:1px solid var(--c-line);border-top:4px solid var(--stock-tone);border-radius:12px;box-shadow:0 1px 2px #1018280f,0 1px 3px #10182814
}
body.theme-c .summary .metric-green{--stock-tone:#16a34a}
body.theme-c .summary .metric-blue{--stock-tone:#2563eb}
body.theme-c .summary .tracking-card{--stock-tone:#dc2626}
body.theme-c .summary .low-stock-card{--stock-tone:#c2620a}
body.theme-c .summary .metric small{color:var(--c-muted);font-size:12px}
body.theme-c .summary .metric strong{color:var(--stock-tone);font-size:28px}
body.theme-c .summary .metric strong span{color:var(--c-muted)}

/* คลังแบบ C: toolbar เดิม + การ์ด responsive; selectors/actions เดิมทั้งหมด */
body.theme-c .stock-grid,body.theme-c.glass-ui .stock-grid{
 display:block;background:transparent;border:0;border-radius:0;box-shadow:none;backdrop-filter:none;overflow:visible;min-height:0
}
body.theme-c .stock-grid .inventory-list{min-width:0}
body.theme-c .stock-grid .list-toolbar,body.theme-c.glass-ui .stock-grid .list-toolbar{
 margin-bottom:10px;padding:10px 12px;background:var(--c-surface);border:1px solid var(--c-line);border-radius:12px;box-shadow:0 1px 2px #1018280f
}
body.theme-c .stock-grid .search{background:var(--c-surface-2);border-color:var(--c-line-strong)}
body.theme-c .stock-grid .stock-filter-trigger{background:var(--c-surface);border-color:var(--c-line-strong);color:var(--c-ink)}
body.theme-c .stock-grid .stock-filter-trigger.selected{background:#e8edff;border-color:#819be8;color:#1e3a8a}
body.theme-c .stock-view-switch{display:flex;flex:0 0 auto;gap:2px;padding:3px;border:1px solid var(--c-line-strong);border-radius:10px;background:var(--c-surface-2)}
body.theme-c .stock-view-switch button{min-width:70px;height:40px;min-height:40px;padding:6px 10px;border-radius:7px;color:var(--c-muted);font-size:12px}
body.theme-c .stock-view-switch button.selected{background:var(--c-surface);color:var(--c-primary);box-shadow:0 1px 3px #1018281f}
body.theme-c .stock-view-switch .icon{width:17px;height:17px}
body.theme-c .stock-column-head{justify-content:flex-start;min-height:40px;padding:0 4px 8px;background:transparent;border:0;color:var(--c-muted)}
body.theme-c .stock-column-head>span{display:none}
body.theme-c .stock-column-sorts:before{content:"เรียง:";align-self:center;font-size:12px;color:var(--c-muted)}
body.theme-c .app-shell .stock-column-filter{color:var(--c-muted);border:1px solid var(--c-line);border-radius:999px;background:var(--c-surface);padding:0 11px}
body.theme-c .app-shell .stock-column-filter[aria-pressed=true]{color:#1e3a8a;background:#dbeafe;border-color:#93b4ee}
body.theme-c .stock-grid :is(.desktop-table,.tablet-list){grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px;align-content:start;padding:0 0 12px}
body.theme-c .stock-grid .stock-card{
 --stock-tone:#16a34a;--stock-soft:#dcfce7;--stock-text:#14532d;
 display:flex;flex-direction:column;align-items:stretch;gap:10px;width:100%;min-width:0;min-height:208px;padding:12px;
 background:var(--c-surface);border:1px solid var(--c-line);border-left:4px solid var(--stock-tone);border-radius:12px;
 box-shadow:0 1px 2px #1018280f,0 1px 3px #10182814;text-align:left
}
body.theme-c .stock-grid .stock-card.stock-low{--stock-tone:#c2620a;--stock-soft:#fef3c7;--stock-text:#7a3b05}
body.theme-c .stock-grid .stock-card.stock-out{--stock-tone:#dc2626;--stock-soft:#fee2e2;--stock-text:#7f1d1d}
body.theme-c .stock-grid .stock-card.stock-pending{--stock-tone:#0284c7;--stock-soft:#e0f2fe;--stock-text:#075985}
body.theme-c .stock-grid .stock-card.stock-hidden{--stock-tone:#6b7280;--stock-soft:#e5e7eb;--stock-text:#374151}
body.theme-c .stock-grid .stock-card.selected{background:linear-gradient(90deg,color-mix(in srgb,var(--stock-soft) 45%,#fff),#fff 45%);box-shadow:0 0 0 2px color-mix(in srgb,var(--stock-tone) 30%,transparent),0 4px 12px #10182812}
body.theme-c.glass-ui .stock-grid .stock-card:is(:hover,:focus-within){background-color:#fff;border-color:color-mix(in srgb,var(--stock-tone) 45%,var(--c-line));box-shadow:0 4px 12px #1018281f}
body.theme-c .stock-grid .row-select{flex:1;align-items:flex-start;gap:10px;border-radius:8px}
body.theme-c .stock-grid .row-select>.device-art{width:48px;height:48px;padding:4px;border:1px solid var(--c-line);border-radius:8px;background:var(--c-surface-2)}
body.theme-c .stock-grid .item-copy strong{font-size:15px;line-height:1.45;color:var(--c-ink)}
body.theme-c .stock-grid .item-copy>small{margin-top:2px;font-size:13px;color:var(--c-muted)}
body.theme-c .stock-grid .row-balance{display:block;margin-top:8px;text-align:left}
body.theme-c .stock-grid .row-balance b{display:inline-flex;width:max-content;max-width:100%;padding:2px 9px;border-radius:999px;background:var(--stock-soft);color:var(--stock-text);font-size:13px;line-height:1.55}
body.theme-c .stock-grid .row-balance small{display:block;margin-top:5px;color:var(--c-muted);font-size:12px}
body.theme-c .stock-grid .row-actions{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(98px,1fr));gap:8px;width:100%;margin-top:auto}
body.theme-c .stock-grid .row-actions button{width:100%!important;min-width:0!important;min-height:44px;height:44px;flex:auto!important;padding:8px 10px;font-size:13px}
body.theme-c .stock-grid .row-actions .row-issue{background:var(--c-primary);border-color:var(--c-primary);color:#fff}
body.theme-c .stock-grid .row-actions .row-edit{background:#fff7e8;border-color:#e4b86d;color:#7a4304}
body.theme-c .stock-grid .list-footer{padding:10px 2px;color:var(--c-muted)}
body.theme-c .stock-grid .data-pager{background:var(--c-surface);border:1px solid var(--c-line);border-radius:12px;padding:8px}

/* โหมดตารางใช้ข้อมูลและปุ่มชุดเดิม แต่จัดเป็นแถวอ่านเร็ว */
body.theme-c .stock-view-table .stock-column-head{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;padding:0 12px 8px}
body.theme-c .stock-view-table .stock-column-head>span{display:block;min-width:216px;text-align:center}
body.theme-c .stock-view-table :is(.desktop-table,.tablet-list){grid-template-columns:minmax(0,1fr);gap:0;padding:0;background:var(--c-surface);border:1px solid var(--c-line);border-radius:12px;overflow:hidden}
body.theme-c .stock-view-table .stock-card{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:16px;min-height:86px;padding:10px 12px;border:0;border-left:4px solid var(--stock-tone);border-bottom:1px solid var(--c-line);border-radius:0;box-shadow:none}
body.theme-c .stock-view-table .stock-card:last-child{border-bottom:0}
body.theme-c .stock-view-table .row-select{display:grid;grid-template-columns:48px minmax(0,1fr);align-items:center;min-width:0}
body.theme-c .stock-view-table .row-select>.device-art{grid-column:1;grid-row:1}
body.theme-c .stock-view-table .item-copy{grid-column:2;grid-row:1;display:grid;grid-template-columns:minmax(0,1fr) minmax(150px,.45fr);column-gap:18px;align-items:center;min-width:0}
body.theme-c .stock-view-table .item-copy>strong,body.theme-c .stock-view-table .item-copy>small{grid-column:1}
body.theme-c .stock-view-table .item-copy .row-balance{grid-column:2;grid-row:1/3;margin:0}
body.theme-c .stock-view-table .row-actions{width:216px;margin:0}
body.theme-c .stock-view-table .list-footer{margin-top:10px}

@media(min-width:1020px){
 body.theme-c .stock-grid .desktop-table{display:grid}
 /* ตัดกรอบมุมโค้งโดยไม่สร้างกล่อง scroll ซ้อน ให้ wheel เลื่อนหน้าหลักได้ */
 body.theme-c .stock-view-table .desktop-table{overflow:clip}
 body.theme-c .stock-grid .tablet-list{display:none}
}
@media(max-width:1019px){
 body.theme-c.glass-ui .sidebar{background:#141b25;border-color:#2c3746;backdrop-filter:none;box-shadow:0 -1px 0 #2c3746}
 body.theme-c.glass-ui .sidebar .nav{color:#c9d1dc;background:transparent}
 body.theme-c.glass-ui .sidebar .nav.active{background:#2b3a52;color:#fff;box-shadow:inset 0 3px #7aa2ff}
 body.theme-c.glass-ui .sidebar .nav:is(:hover,:focus-visible){background:#212b39;color:#fff}
 body.theme-c .page-content{padding:12px 16px}
 body.theme-c .stock-grid{display:flex;flex:1;min-height:0;overflow:hidden}
 body.theme-c .stock-grid .inventory-list{display:flex;height:100%;min-height:0;overflow:hidden}
 body.theme-c .stock-grid .desktop-table{display:none}
 body.theme-c .stock-grid .tablet-list{display:grid;flex:1;min-height:0;overflow:auto;padding-right:3px}
 body.theme-c .stock-grid .detail-panel{display:none}
 body.theme-c .stock-grid.show-detail .inventory-list{display:none}
 body.theme-c .stock-grid.show-detail .detail-panel{display:flex;height:100%;overflow:hidden;background:var(--c-surface);border:1px solid var(--c-line);border-radius:12px}
}
@media(max-width:620px){
 body.theme-c .page-content{padding:8px 10px}
 body.theme-c .page-heading,body.theme-c .ledger-admin .ledger-lifecycle-header{min-height:56px;padding:8px 10px;border-radius:10px}
 body.theme-c .admin-page-title h1,body.theme-c .ledger-admin .ledger-lifecycle-header h1{font-size:18px}
 body.theme-c .summary{gap:6px;margin-bottom:8px}
 body.theme-c .summary .metric{min-height:58px;padding:7px 9px;border-top-width:3px}
 body.theme-c .summary .metric strong{font-size:21px}
 body.theme-c .stock-grid .list-toolbar,body.theme-c.glass-ui .stock-grid .list-toolbar{padding:8px;margin-bottom:8px}
 body.theme-c .stock-grid :is(.desktop-table,.tablet-list){grid-template-columns:minmax(0,1fr);gap:9px}
 body.theme-c .stock-grid .stock-card{min-height:194px;padding:11px}
 body.theme-c .stock-grid .row-actions button{font-size:13px}
 body.theme-c .stock-grid .row-actions button span{display:inline}
 body.theme-c .stock-view-switch{padding:0;border:0;background:transparent}
 body.theme-c .stock-view-switch button{display:none;min-width:48px;width:48px;height:48px;min-height:48px;padding:8px;border:1px solid var(--c-line-strong);background:var(--c-surface)}
 body.theme-c .stock-view-switch button:not(.selected){display:inline-flex}
 body.theme-c .stock-view-switch button span{display:none}
 body.theme-c .stock-filter-trigger{width:48px;min-width:48px;padding:8px}
 body.theme-c .stock-filter-trigger>span:not(.filter-indicator){display:none}
 body.theme-c .stock-view-table .stock-column-head>span{display:none}
 body.theme-c .stock-view-table .stock-card{grid-template-columns:minmax(0,1fr) auto;gap:8px;min-height:92px;padding:9px}
 body.theme-c .stock-view-table .row-select{grid-column:1;grid-row:1;grid-template-columns:38px minmax(0,1fr);gap:8px}
 body.theme-c .stock-view-table .row-select>.device-art{width:38px;height:38px}
 body.theme-c .stock-view-table .item-copy{display:block}
 body.theme-c .stock-view-table .item-copy .row-balance{margin-top:4px}
 body.theme-c .stock-view-table .row-actions{display:flex!important;grid-column:2;grid-row:1;align-self:center;justify-self:end;width:auto}
 body.theme-c .stock-view-table .row-actions button{width:44px!important;height:44px;min-height:44px;padding:7px;font-size:0}
 body.theme-c .stock-view-table .row-actions button span{display:none}
}
@media(prefers-reduced-motion:reduce){body.theme-c .sidebar,body.theme-c .sidebar *{transition:none!important}}
