/* Styles of the sheet page views: tabs, สรุป, กลุ่ม, ตั้งค่า, ผู้ใช้. Uses the colour variables of sheet.html. */
.tabs { display: inline-flex; gap: 4px; background: var(--sunk); border-radius: 12px; padding: 3px; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; border-radius: 9px; padding: 6px 14px; }
.tabs button[aria-pressed="true"] { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); font-weight: 600; }
.tabs button[hidden] { display: none; }
body:not([data-mode="sheet"]) #sheetView { display: none; }
body[data-mode="sheet"] #viewBox { display: none; }
body[data-mode="cat"] .dnav, body[data-mode="cat"] #todayB, body[data-mode="set"] .dnav, body[data-mode="set"] #todayB,
body[data-mode="users"] .dnav, body[data-mode="users"] #todayB { display: none; }
.vnote { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.vnote b { color: var(--fg); }
.vmsg { padding: 26px; text-align: center; color: var(--muted); }
.vscroll { overflow: auto; max-height: calc(100vh - 240px); margin-bottom: 10px; }
.n { text-align: right; font-family: var(--font-data); }
.dim { color: var(--muted); } .ok { color: var(--ok); } .bad { color: var(--warn); font-weight: 600; }
.sumsec { margin-bottom: 14px; }
.sumh { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin: 6px 2px; }
.sumh h3 { margin: 0; font-size: 15px; } .sumh span { color: var(--muted); font-size: 12px; }
.sumt thead th, .st thead th { text-align: right; position: sticky; top: 0; }
.ctable thead th { text-align: left; position: sticky; top: 0; z-index: 2; }
.sumt thead th:first-child, .ctable thead th:first-child, .st thead th:first-child { text-align: left; }
.sumt thead th u { display: block; text-decoration: none; font-weight: 400; font-size: 10.5px; }
.sumt td:first-child, .ctable td:first-child { font-family: var(--font-body); text-align: left; }
.sumt tr.tot td { font-weight: 700; background: var(--sunk); }
.capbar { display: inline-block; width: 70px; height: 6px; border-radius: 3px; background: var(--sunk); margin-left: 6px; vertical-align: middle; overflow: hidden; }
.capbar i { display: block; height: 100%; background: var(--ok); } .capbar i.over { background: var(--warn); }
/* flow layout: dimension cards on the left, details on the right */
.flow { display: grid; grid-template-columns: 260px 1fr; gap: 12px; margin-bottom: 12px; align-items: start; }
@media (max-width: 800px) { .flow { grid-template-columns: 1fr; } }
.fl-l { display: grid; gap: 8px; }
.node { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.node b { display: block; } .node small { color: var(--muted); font-size: 12px; }
.node[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.node.fl-root { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); cursor: default; }
.node.fl-root small { color: inherit; opacity: .85; }
.warn { color: var(--warn); } .fine { color: var(--ok); }
.fl-r { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; align-content: start; }
.fl-r.one { display: block; } .fl-r.blank { display: grid; place-items: center; min-height: 140px; color: var(--muted); text-align: center; border: 1.5px dashed var(--line); border-radius: 12px; }
.move-tools { grid-column: 1 / -1; }
.gcard { background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 12px; }
.gcard.empty { opacity: .6; } .gcard.unassigned { border: 1.5px solid var(--warn); }
.gcard b { display: flex; justify-content: space-between; gap: 8px; }
.cnt { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 0 8px; font-size: 12px; font-family: var(--font-data); }
.cnt.zero { background: var(--sunk); color: var(--muted); }
.gcard ol { margin: 6px 0 0; padding-left: 20px; font-size: 12.5px; } .gcard li { margin: 2px 0; } .gcard li span { color: var(--muted); font-family: var(--font-data); font-size: 11px; margin-left: 6px; }
.gcard p { color: var(--muted); margin: 6px 0 0; font-size: 12px; }
.card-move { margin-left: 6px; padding: 2px 6px; font-size: 12px; }
/* product list */
.vtools { display: flex; gap: 10px; align-items: center; margin: 6px 0; } .vtools .sp { color: var(--muted); font-size: 12px; }
.vtools input[type=search], .ctable input[type=text], .ctable input[type=number], .st input, .user-add input { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.ctable td { font-family: var(--font-body); text-align: left; vertical-align: middle; }
.ctable td.nm2 { min-width: 220px; white-space: normal; } .ctable .code { color: var(--muted); font-family: var(--font-data); font-size: 11px; }
.ctable select.none { color: var(--warn); border-color: var(--warn); }
.ctable tr.addrow td { background: var(--accent-soft); }
.pimg { display: grid; place-items: center; width: 64px; height: 48px; border: 1.5px dashed var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--sunk); }
.pimg img { width: 100%; height: 100%; object-fit: cover; } .pimg .ph { font-size: 11px; color: var(--muted); }
.imgdel { display: block; margin-top: 3px; padding: 1px 6px; font-size: 11px; border-radius: 6px; }
.addb, .miniadd { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); border-color: transparent; }
.delb, .ib { padding: 2px 8px; } .ib.x, .delb { color: var(--warn); }
button:disabled, select:disabled, input:disabled { opacity: .5; cursor: not-allowed; }
/* settings */
.setpanel { background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 12px; }
.setpanel h3 { margin: 0 0 8px; font-size: 15px; } .setpanel h3 span { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 8px; }
.st td, .st th { white-space: normal; } .st td.r, .st th.r { text-align: right; }
.st td input[type=text] { width: 100%; min-width: 160px; } .st td input[type=number] { width: 110px; }
.st .addrow td { background: var(--accent-soft); } .acts { display: inline-flex; gap: 4px; }
/* users */
.user-add { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 10px; align-items: center; }
.user-add input[type=email] { min-width: 240px; }
.users-table td { white-space: normal; font-family: var(--font-body); text-align: left; vertical-align: middle; } .users-table th { text-align: left; }
.users-table .email { font-weight: 600; } .state { display: block; font-size: 11.5px; color: var(--muted); } .state.ok { color: var(--ok); } .state.off { color: var(--warn); }
.users-table input[data-note] { width: 100%; min-width: 160px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
