/* ระบบจัดการคลังสินค้า — stylesheet
 * Tokens and measurements come straight from the Claude Design source
 * "Inventory Management.dc.html"; the inline styles there are collected into
 * classes here so screens stay readable. */

:root {
  color-scheme: light;

  --accent: #0ea5a4;
  --accent-hover: #0c8988;
  --accent-soft: rgba(14, 165, 164, 0.10);
  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.10);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.10);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.10);
  --purple: #7c3aed;
  --yellow: #eab308;              /* ใช้กับแท่ง/จุดสี ต้องสดพอให้เห็นชัด */
  --yellow-text: #a16207;         /* ใช้กับตัวอักษร เข้มกว่าเพื่อให้อ่านออกบนพื้นขาว */
  --yellow-soft: rgba(234, 179, 8, 0.16);

  --page: #f7f8f9;
  --surface: #ffffff;
  --surface-subtle: #fafbfb;
  --border: #e5e7eb;
  --border-input: #d9dce0;
  --rule: #f0f1f2;
  --rule-light: #f6f7f7;
  --rule-mid: #f2f3f4;

  --text: #161a1d;
  --text-strong: #111827;
  --text-soft: #6b7280;
  --text-label: #4b5563;
  --muted: #9ca3af;
  --faint: #c1c5cb;

  --radius-card: 14px;
  --radius-control: 9px;
  --radius-sm: 6px;
  --sidebar-w: 240px;
  --topbar-h: 68px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: 'Inter', 'Noto Sans Thai', 'Sarabun', system-ui, -apple-system,
    'Segoe UI', sans-serif;
}

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
::placeholder { color: var(--muted); }
input, select, textarea, button { font-family: inherit; }

/* ---------- shell ---------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 8px 8px 20px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--accent);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand-mark i { width: 14px; height: 14px; border-radius: 3px; background: #fff; }
.brand-name { font-size: 15px; font-weight: 700; line-height: 1.2; }
.brand-sub { font-size: 11px; color: var(--muted); line-height: 1.2; }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: 8px; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--text-soft);
  background: transparent; border: none; width: 100%; text-align: left;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--accent-soft); }
.nav-item .dot {
  width: 6px; height: 6px; border-radius: 3px; background: #d1d5db; flex-shrink: 0;
}
.nav-item.is-active { background: var(--accent-soft); color: var(--accent); }
.nav-item.is-active .dot { background: var(--accent); }

.sidebar-foot {
  margin-top: auto; padding: 12px 8px 4px; border-top: 1px solid var(--rule);
}
.sidebar-foot .l1 { font-size: 11px; color: var(--muted); }
.sidebar-foot .l2 { font-size: 11px; color: var(--faint); margin-top: 2px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h); flex-shrink: 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
}
.topbar-title { font-size: 19px; font-weight: 700; }
.topbar-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 20px; }
.topbar-sep { width: 1px; height: 28px; background: var(--border); }

.bell { position: relative; cursor: pointer; background: none; border: none; padding: 0; }
.bell:hover { opacity: .7; }
.bell-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--page); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.bell-count {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.who { display: flex; align-items: center; gap: 10px; }
.who-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent);
  color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.who-name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.who-role { font-size: 11px; color: var(--muted); line-height: 1.2; }

.content { flex: 1; overflow: auto; padding: 28px 32px 60px; }

/* ---------- building blocks ---------- */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 20px;
}
.card-pad-lg { padding: 22px; }
.card-warn { border-color: #fde3cf; }
.card-danger { border-color: #fecaca; }
.card-accent { border-color: #cdeeed; }
.card-clickable { cursor: pointer; transition: box-shadow .2s, transform .2s; }
.card-clickable:hover { box-shadow: 0 8px 20px rgba(0, 0, 0, .06); transform: translateY(-2px); }

.card-title { font-size: 15px; font-weight: 700; }
.card-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px;
}
.link-more {
  font-size: 13px; color: var(--accent); cursor: pointer; font-weight: 500;
  background: none; border: none; padding: 0; white-space: nowrap;
}
.link-more:hover { text-decoration: underline; }

.kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi-value { font-size: 28px; font-weight: 800; margin-top: 8px; }
.kpi-value small { font-size: 13px; font-weight: 500; color: var(--muted); }
.kpi-warn .kpi-label, .kpi-warn .kpi-value { color: var(--warning); }
.kpi-warn .kpi-value small { color: inherit; }
.kpi-danger .kpi-label, .kpi-danger .kpi-value { color: var(--danger); }
.kpi-danger .kpi-value small { color: inherit; }

.badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.badge-sm { padding: 3px 9px; font-size: 11.5px; font-weight: 700; }
.badge-ok { background: var(--success-soft); color: var(--success); }
.badge-warn { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-off { background: #f1f2f3; color: var(--muted); }
.badge-yellow { background: var(--yellow-soft); color: var(--yellow-text); }

.btn {
  border: none; border-radius: var(--radius-control); cursor: pointer;
  font-size: 14px; font-weight: 700; padding: 12px;
  transition: background .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-dark { background: var(--text); color: #fff; }
.btn-dark:hover { background: #333a40; }
.btn-ghost { background: var(--rule-mid); color: var(--text-label); }
.btn-ghost:hover { background: var(--border); }
.btn-block { width: 100%; margin-top: 6px; }
.btn-sm { padding: 9px 18px; font-size: 13.5px; }
.btn-xs { padding: 6px 10px; font-size: 12px; border-radius: var(--radius-sm); white-space: nowrap; }
.btn-outline {
  background: var(--surface); border: 1px solid var(--border-input);
  color: #374151; padding: 9px 16px; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.btn-outline:hover { background: #f7f8f8; }

/* หัวข้อคั่นกลุ่มในฟอร์มรับเข้า */
.form-section {
  font-size: 12px; font-weight: 700; color: var(--muted);
  letter-spacing: .02em; margin-top: 4px; padding-top: 12px;
  border-top: 1px solid var(--rule);
}

.btn-slip { padding: 5px 8px; font-size: 11.5px; border-radius: var(--radius-sm); }

.field-label {
  font-size: 12.5px; font-weight: 600; color: var(--text-label); margin-bottom: 6px;
}
.field-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
.field-note { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }

.input, .select {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-control);
  border: 1px solid var(--border-input); font-size: 13.5px; background: var(--surface);
}
.input:focus, .select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.input-inline { width: 56px; padding: 6px 8px; border-radius: var(--radius-sm); font-size: 12px; }
.input-edit {
  width: 100%; margin-top: 4px; padding: 6px 8px; border-radius: 7px;
  border: 1px solid var(--accent); font-size: 14px; font-weight: 700;
}

/* date / month pickers sit inside a bordered shell with a clear button */
.picker {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border-input);
  border-radius: var(--radius-control); padding: 0 4px 0 10px;
}
.picker-soft { background: var(--surface-subtle); border-color: var(--border); }
.picker input {
  padding: 9px 4px; border: none; outline: none; font-size: 12.5px;
  background: transparent; color: var(--muted);
}
.picker.is-set input { color: var(--text); }
.picker-lg { padding: 0 4px 0 14px; }
.picker-lg input { padding: 10px 6px; font-size: 13.5px; }
.picker-icon { font-size: 13px; color: var(--muted); }
.picker-clear {
  width: 18px; height: 18px; border-radius: 50%; border: none;
  background: var(--rule-mid); color: var(--text-soft); font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; padding: 0;
}
.picker-clear:hover { background: var(--border); color: var(--text-strong); }
.picker-lg .picker-clear { width: 22px; height: 22px; font-size: 13px; }

.toolbar { display: flex; gap: 12px; margin-bottom: 16px; align-items: center; }
.toolbar .input { flex: 1; max-width: 340px; }
.toolbar .select { width: auto; }
.toolbar-count { margin-left: auto; font-size: 13px; color: var(--muted); }
.toolbar-hint { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- lists and tables ---------- */

.table-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); overflow-x: auto;
}
.table-min { min-width: 960px; }
/* Column tracks are set per table via --cols on the wrapper. */
.row {
  display: grid; grid-template-columns: var(--cols); gap: 6px; align-items: center;
  padding: 13px 16px; font-size: 13px;
  border-bottom: 1px solid var(--rule-light); white-space: nowrap;
}
.row-head {
  padding: 12px 16px; font-size: 11.5px; font-weight: 700; color: var(--muted);
  background: var(--surface-subtle); border-bottom: 1px solid var(--rule);
}
.row-click { cursor: pointer; transition: background .12s; }
.row-click:hover { background: var(--page); }
.row:last-child { border-bottom: none; }
.cell-muted { color: var(--muted); font-size: 12px; }
.cell-soft { color: var(--text-soft); font-size: 12.5px; }
.cell-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.cell-in { color: var(--success); font-weight: 700; }
.cell-out { color: var(--danger); font-weight: 700; }
.cell-waste { color: var(--warning); font-weight: 700; }

/* compact grid lists used inside cards (histories, product movements) */
.mini-head {
  display: grid; grid-template-columns: var(--cols); gap: 8px; padding: 0 4px 10px; white-space: nowrap;
  font-size: 11.5px; font-weight: 700; color: var(--muted);
  border-bottom: 1px solid var(--rule);
}
.mini-row {
  display: grid; grid-template-columns: var(--cols); gap: 8px; align-items: center; padding: 11px 4px;
  font-size: 13px; border-bottom: 1px solid var(--rule-light);
}

.feed-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0; border-bottom: 1px solid var(--rule-mid);
}
.feed-row:last-child { border-bottom: none; }
.feed-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.feed-title {
  font-size: 13.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.feed-meta { font-size: 11.5px; color: var(--muted); }
.feed-qty { font-weight: 700; font-size: 13.5px; }
.type-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* status tones — shared by dots, level bars and quantity figures */
.tone-ok { background: var(--success); }
.tone-yellow { background: var(--yellow); }
.tone-accent { background: var(--accent); }
.tone-warn { background: var(--warning); }
.tone-danger { background: var(--danger); }
.qty-ok { color: var(--success); }
.qty-accent { color: var(--accent); }
.qty-yellow { color: var(--yellow-text); }
.qty-warn { color: var(--warning); }
.qty-danger { color: var(--danger); }

.empty { padding: 20px 0; text-align: center; color: var(--muted); font-size: 13px; }

.grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin-top: 16px; }
.grid-form { display: grid; grid-template-columns: 380px 1fr; gap: 16px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.mt-16 { margin-top: 16px; }

/* ---------- product detail ---------- */

.back-link {
  font-size: 13.5px; color: var(--accent); cursor: pointer; font-weight: 600;
  margin-bottom: 16px; background: none; border: none; padding: 0;
}
.back-link:hover { text-decoration: underline; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; }
.detail-code { font-size: 12px; color: var(--muted); }
.detail-name { font-size: 22px; font-weight: 800; margin-top: 4px; }
.level-label {
  display: flex; justify-content: space-between;
  font-size: 12.5px; color: var(--text-soft); margin-bottom: 6px;
}
.level-track { height: 10px; border-radius: 6px; background: var(--rule); overflow: hidden; }
.level-fill { height: 100%; border-radius: 6px; transition: width .3s; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 24px; }
.fact { padding: 14px; background: var(--surface-subtle); border-radius: 10px; }
.fact-label { font-size: 11.5px; color: var(--muted); }
.fact-value { font-size: 15px; font-weight: 700; margin-top: 4px; }
.fact-value-sm { font-size: 14px; }
.fact-action { cursor: pointer; }
.fact-action:hover { background: var(--rule); }
.fact-editable { cursor: pointer; }
.fact-editable:hover { color: var(--accent); }
.fact-cta { color: var(--accent); }
.edit-actions { display: flex; gap: 10px; margin-top: 16px; }

/* ---------- แผนภูมิรับเข้า-จ่ายออก รายสินค้า ---------- */

.chart-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.chart-legend {
  display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--text-soft);
  margin: -4px 0 14px;
}
.chart-legend i {
  /* จุดสีในคำอธิบายใช้คลาส tone-* ชุดเดียวกับแท่ง */
  display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: 6px; vertical-align: -1px;
}
.chart { display: flex; flex-direction: column; gap: 14px; }
.chart-row { display: grid; grid-template-columns: 190px 1fr; gap: 14px; align-items: center; }
.chart-name {
  font-size: 12.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chart-bars { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.chart-track {
  position: relative; display: flex; align-items: center; gap: 8px;
  height: 16px;
}
.chart-bar {
  height: 100%; border-radius: 4px; min-width: 2px;
  transition: width .3s ease;
}
.chart-value { font-size: 11.5px; font-weight: 700; white-space: nowrap; }

@media (max-width: 860px) {
  .chart-row { grid-template-columns: 1fr; gap: 6px; }
}

/* ---------- movement report ---------- */

.summary-strip { display: flex; gap: 24px; margin-bottom: 18px; flex-wrap: wrap; }
.summary-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 22px;
}
.summary-label { font-size: 11.5px; color: var(--muted); }
.summary-value { font-size: 20px; font-weight: 800; margin-top: 2px; }
.summary-in { color: var(--success); }
.summary-out { color: var(--danger); }
.summary-waste { color: var(--warning); }
.section-title { font-size: 15px; font-weight: 700; margin: 24px 0 12px; }

/* ---------- low stock ---------- */

.stack { display: flex; flex-direction: column; gap: 10px; }
.low-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.low-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.low-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.low-name { font-size: 14px; font-weight: 700; }
.low-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.low-actions { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }

.rule-card { margin-bottom: 0; }
.rule-row { display: flex; flex-direction: column; gap: 10px; }
.rule-line {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-label);
}
.rule-line b { margin-left: auto; font-weight: 700; color: var(--text); white-space: nowrap; }
.rule-line .badge { min-width: 92px; text-align: center; }
.select-inline {
  width: auto; display: inline-block; padding: 4px 8px;
  font-size: 13px; border-radius: var(--radius-sm);
}

/* ---------- categories ---------- */

.role-admin { font-size: 12.5px; font-weight: 600; color: var(--accent); }
.role-manager { font-size: 12.5px; font-weight: 600; color: var(--purple); }
.role-staff { font-size: 12.5px; font-weight: 600; color: var(--text-soft); }

.cat-card { display: flex; flex-direction: column; }
.cat-body { cursor: pointer; border-radius: 8px; margin: -6px; padding: 6px; transition: background .12s; }
.cat-body:hover { background: var(--surface-subtle); }
.cat-actions {
  display: flex; gap: 8px; margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--rule);
  flex-wrap: wrap;
}
.cat-actions .btn-xs { flex-shrink: 0; }
.cat-name { font-size: 15px; font-weight: 700; }
.cat-stats { display: flex; gap: 20px; margin-top: 14px; }
.cat-stat-value { font-size: 20px; font-weight: 800; }
.cat-stat-label { font-size: 11.5px; color: var(--muted); }
.cat-add { max-width: 460px; }
.cat-add-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- จัดการสินค้า / นำเข้า / สำรองข้อมูล ---------- */

.product-form {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.product-form .input:disabled,
.product-form .select:disabled { background: var(--surface-subtle); color: var(--text-soft); }

.row-off { background: var(--surface-subtle); }
.row-off .cell-name { color: var(--text-soft); font-weight: 500; }

.btn-delete { color: var(--danger); }
.btn-delete:hover { background: var(--danger-soft); }

.import-stats { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 12px; }
.import-stats > div { display: flex; flex-direction: column; }
.import-stats b { font-size: 22px; font-weight: 800; line-height: 1.2; }
.import-stats span { font-size: 11.5px; color: var(--muted); }
.import-stats .stat-bad b { color: var(--danger); }
.import-note {
  font-size: 12.5px; color: var(--text-label); background: var(--surface-subtle);
  border-radius: 8px; padding: 8px 12px; margin-bottom: 8px;
}
.import-errors {
  font-size: 12.5px; color: var(--danger); background: var(--danger-soft);
  border-radius: 8px; padding: 8px 12px; margin-bottom: 8px;
}
.import-list { font-size: 12.5px; color: var(--text-label); margin-bottom: 6px; word-break: break-word; }

.data-counts { display: flex; gap: 24px; flex-wrap: wrap; }
.data-counts > div { display: flex; flex-direction: column; }
.data-counts b { font-size: 22px; font-weight: 800; line-height: 1.2; }
.data-counts span { font-size: 11.5px; color: var(--muted); }
.data-help { font-size: 12.5px; color: var(--text-soft); margin-bottom: 14px; line-height: 1.6; }

/* ---------- toast ---------- */

.toast {
  position: fixed; bottom: 28px; right: 28px;
  padding: 14px 22px; border-radius: 12px;
  font-size: 13.5px; font-weight: 600; color: #fff; background: var(--text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2); z-index: 1000;
  animation: toast-in .18s ease-out;
}
.toast-error { background: var(--danger); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .grid-2, .grid-form { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .product-form { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static;
    border-right: none; border-bottom: 1px solid var(--border);
  }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-item { width: auto; }
  .sidebar-foot { display: none; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .product-form { grid-template-columns: 1fr; }
}

/* ---------- ใบบ่งชี้บรรจุภัณฑ์เข้าคลัง ---------- */

/* ปกติซ่อนไว้ จะโผล่เฉพาะตอน body ติดคลาส printing-slip ในหน้ากระดาษ */
#print-slip { display: none; }

.slip {
  width: 148mm; max-width: 100%; margin: 0 auto; padding: 8mm 10mm;
  background: #fff; color: #000;
  font-family: 'Noto Sans Thai', 'Sarabun', 'Inter', system-ui, sans-serif;
  font-size: 13px; line-height: 1.5;
}
.slip-title { text-align: center; font-size: 17px; font-weight: 700; }
.slip-company { text-align: center; font-size: 13px; margin-top: 4px; }
.slip-address { text-align: center; font-size: 12px; margin-bottom: 10px; }
.slip-table { width: 100%; border-collapse: collapse; }
.slip-table th,
.slip-table td {
  border: 1px solid #000; padding: 6px 8px; font-size: 13px; font-weight: 400;
}
.slip-table th { text-align: left; white-space: nowrap; width: 1%; }
.slip-table td { text-align: center; }
.slip-note { margin-top: 8px; font-size: 12px; }
.slip-form-no { margin-top: 8px; text-align: right; font-size: 11px; }

/* ---------- print ---------- */

@media print {
  /* โหมดปกติ: สั่งพิมพ์จากหน้ารายงานความเคลื่อนไหว เอาเฉพาะตาราง */
  body:not(.printing-slip) * { visibility: hidden; }
  body:not(.printing-slip) #movement-report-table,
  body:not(.printing-slip) #movement-report-table * { visibility: visible; }
  body:not(.printing-slip) #movement-report-table {
    position: absolute; top: 0; left: 0; width: 100%; border: none;
  }
  body:not(.printing-slip) #movement-report-table .table-min { min-width: 0; }

  /* โหมดใบบ่งชี้: ซ่อนตัวแอปทั้งหมด เหลือเฉพาะใบ */
  body.printing-slip .app { display: none !important; }
  body.printing-slip #print-slip { display: block; }
  .slip { padding: 0; width: auto; }

  @page { margin: 12mm; }
}
