  :root {
    /* สีตามดีไซน์ Stitch เป๊ะๆ (คัดลอกค่าจริงมาเป็น CSS ของเราเอง ไม่พึ่ง Tailwind CDN) */
    --primary: #3525cd;
    --primary-container: #4f46e5;
    --on-primary: #ffffff;
    --on-primary-container: #dad7ff;
    --primary-fixed: #e2dfff;
    --primary-fixed-dim: #c3c0ff;
    --secondary: #006591;
    --secondary-container: #39b8fd;
    --tertiary: #7e3000;
    --tertiary-container: #a44100;
    --background: #f8f9ff;
    --surface: #f8f9ff;
    --surface-container-low: #eff4ff;
    --surface-container: #e5eeff;
    --surface-container-high: #dce9ff;
    --surface-container-highest: #d3e4fe;
    --surface-container-lowest: #ffffff;
    --on-surface: #0b1c30;
    --on-surface-variant: #464555;
    --outline: #777587;
    --outline-variant: #c7c4d8;
    --error: #ba1a1a;
    --error-container: #ffdad6;
    --on-error-container: #93000a;

    /* เดิม (คงไว้เผื่อโค้ดส่วนอื่นยังอ้างอิงอยู่) */
    --primary-dark: #303f9f;
    --bg: var(--background);
    --card-bg: var(--surface-container-lowest);
    --text: var(--on-surface);
    --border: var(--outline-variant);
    --danger: var(--error);
  }

  * { box-sizing: border-box; }

  body {
    margin: 0;
    font-family: 'Inter', 'Noto Sans Lao', 'Noto Sans Thai', sans-serif;
    background: var(--background);
    color: var(--on-surface);
  }

  h1, h2, h3, h4, .font-headline {
    font-family: 'Geist', 'Noto Sans Lao', 'Noto Sans Thai', sans-serif;
  }

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

  /* Sidebar (ดีไซน์ใหม่: พื้นหลังสว่าง ตัวหนังสือเข้ม ไอเทมที่เลือกไฮไลต์สีม่วง-น้ำเงิน) */
  .sidebar {
    width: 240px;
    background: var(--surface-container-low);
    color: var(--on-surface);
    flex-shrink: 0;
    padding: 16px 12px;
    border-right: 1px solid var(--outline-variant);
  }
  .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-family: 'Geist', 'Noto Sans Lao', 'Noto Sans Thai', sans-serif;
    font-size: 19px;
    color: var(--primary);
    padding: 6px 8px 18px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--outline-variant);
  }
  .logo-badge {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--primary);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
  }
  .staff-badge {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    background: var(--surface-container);
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--on-surface-variant);
  }
  .staff-badge button {
    background: none; border: 1px solid var(--outline-variant); border-radius: 6px;
    padding: 3px 8px; font-size: 11px; cursor: pointer; color: var(--on-surface-variant);
  }
  .menu { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
  .menu li {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s;
    color: var(--on-surface-variant);
  }
  .menu li:hover { background: var(--surface-container-high); }
  .menu li.active { background: var(--primary-container); color: var(--on-primary-container); font-weight: 600; }

  /* Content */
  .content { flex: 1; padding: 24px 32px; overflow-y: auto; }
  .page { display: none; }
  .page.active { display: block; }
  h1 { margin-top: 0; }

  /* Dashboard cards */
  .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
  .card {
    background: var(--surface-container);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(11,28,48,0.06);
    position: relative;
    overflow: hidden;
  }
  .card-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; margin-bottom: 16px;
    background: var(--surface-container-lowest);
    color: var(--primary);
  }
  .card-label { font-size: 13px; color: var(--on-surface-variant); margin-bottom: 6px; }
  .card-value { font-size: 26px; font-weight: 700; font-family: 'Geist', 'Noto Sans Lao', 'Noto Sans Thai', sans-serif; color: var(--on-surface); }
  .card-value.warn { color: var(--error); }

  /* ไอคอน Material Symbols */
  .material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    vertical-align: middle;
  }

  /* แถบบนสุด (Top bar) */
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    margin-bottom: 20px; flex-wrap: wrap;
  }
  .topbar-search {
    flex: 1; min-width: 200px; max-width: 420px; position: relative;
  }
  .topbar-search input {
    width: 100%; padding: 10px 14px 10px 40px; margin-bottom: 0 !important;
    border-radius: 10px; border: 1px solid var(--outline-variant);
    background: var(--surface-container-low); font-size: 14px;
  }
  .topbar-search .material-symbols-outlined {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--on-surface-variant); font-size: 18px;
  }
  .global-search-results {
    display: none;
    position: absolute; top: 46px; left: 0; right: 0;
    background: var(--surface-container-lowest);
    border: 1px solid var(--outline-variant);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(11,28,48,0.15);
    max-height: 60vh; overflow-y: auto;
    z-index: 200;
  }
  .global-search-results.show { display: block; }
  .gsr-category {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--on-surface-variant); padding: 10px 14px 4px;
  }
  .gsr-item {
    display: flex; align-items: center; gap: 12px; padding: 8px 14px; cursor: pointer;
  }
  .gsr-item:hover { background: var(--surface-container-high); }
  .gsr-item-icon {
    width: 32px; height: 32px; border-radius: 8px; background: var(--surface-container);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--primary);
  }
  .gsr-item-title { font-size: 13px; font-weight: 600; color: var(--on-surface); }
  .gsr-item-sub { font-size: 12px; color: var(--on-surface-variant); }
  .gsr-empty { padding: 20px 14px; text-align: center; font-size: 13px; color: var(--on-surface-variant); }
  .topbar-right { display: flex; align-items: center; gap: 14px; }
  .topbar-notif {
    width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-container-low); position: relative; cursor: pointer;
    border: none;
  }
  .topbar-notif .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--error); }
  .topbar-user { display: flex; align-items: center; gap: 10px; }
  .topbar-user-avatar {
    width: 34px; height: 34px; border-radius: 50%; background: var(--primary);
    color: white; display: flex; align-items: center; justify-content: center; font-size: 16px;
  }
  .topbar-user-name { font-size: 13px; font-weight: 600; color: var(--on-surface); line-height: 1.3; }
  .topbar-user-role { font-size: 10px; color: var(--on-surface-variant); text-transform: uppercase; letter-spacing: 0.04em; }

  /* เมนูย่อยของบัญชีผู้ใช้ (ตั้งค่า/ออกจากระบบ) — เปิดจากการคลิกชื่อ/อวาตาร์มุมขวาบน */
  .topbar-user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--surface-container-lowest);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(11,28,48,0.15);
    border: 1px solid var(--outline-variant);
    min-width: 170px;
    z-index: 300;
    overflow: hidden;
  }
  .topbar-user-dropdown.active { display: block; }
  .topbar-user-dropdown button {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    text-align: left;
    font-size: 13px;
    color: var(--on-surface);
    cursor: pointer;
    font-family: 'Inter', 'Noto Sans Lao', 'Noto Sans Thai', sans-serif;
  }
  .topbar-user-dropdown button:hover { background: var(--surface-container-high); }

  /* Dashboard: สองคอลัมน์ */
  .dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }
  @media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }
  .panel-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; font-family: 'Geist', 'Noto Sans Lao', 'Noto Sans Thai', sans-serif; margin-bottom: 12px; color: var(--on-surface); }
  .panel-box { background: var(--surface-container); border-radius: 14px; padding: 14px; }
  .alert-group-title {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--on-surface); padding: 6px 8px; margin-bottom: 4px;
  }
  .alert-count-badge { background: var(--error-container); color: var(--on-error-container); padding: 1px 8px; border-radius: 10px; margin-left: 6px; font-size: 11px; }
  .alert-item, .pending-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 10px;
  }
  .alert-item:hover, .pending-item:hover { background: var(--surface-container-high); }
  .alert-item-icon {
    width: 36px; height: 36px; border-radius: 8px; background: var(--surface-container-highest);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--on-surface-variant);
  }
  .alert-item-name { font-size: 13px; color: var(--on-surface); }
  .alert-item-sub { font-size: 12px; color: var(--on-surface-variant); }
  .alert-item-right { margin-left: auto; text-align: right; font-size: 13px; font-weight: 700; color: var(--error); }
  .alert-item-right .sub { font-size: 11px; color: var(--on-surface-variant); font-weight: 400; }
  .pending-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
  .pending-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
  .pending-tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; background: var(--surface-container-highest); color: var(--on-surface-variant); }
  .empty-hint { font-size: 13px; color: var(--on-surface-variant); padding: 16px 8px; text-align: center; }

  /* ปุ่มลอย (FAB) */
  .fab-btn {
    position: fixed; bottom: 24px; right: 24px; width: 56px; height: 56px; border-radius: 50%;
    background: var(--primary); color: white; border: none; box-shadow: 0 4px 14px rgba(53,37,205,0.35);
    display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 60;
    font-size: 26px;
  }

  /* POS layout */
  .pos-layout { display: flex; gap: 20px; align-items: flex-start; }
  .pos-left { flex: 2; }
  .pos-right {
    flex: 1;
    background: var(--surface-container-lowest);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(11,28,48,0.08);
    position: sticky;
    top: 0;
  }
  #pos-search {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border: 1px solid var(--outline-variant);
    border-radius: 10px;
    margin-bottom: 0;
  }
  .product-list {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px;
    max-height: 65vh; overflow-y: auto; padding: 4px 2px;
  }
  .product-item {
    background: var(--surface-container-lowest);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(11,28,48,0.08);
    cursor: pointer;
    display: flex; flex-direction: column;
    overflow: hidden;
    transition: transform 0.1s, box-shadow 0.1s;
  }
  .product-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(11,28,48,0.12); background: var(--surface-container-lowest); }
  .product-item .p-thumb {
    height: 64px; background: var(--surface-container); position: relative;
    display: flex; align-items: center; justify-content: center; color: var(--outline);
  }
  .product-item .p-stock-badge {
    position: absolute; top: 6px; left: 6px; font-size: 10px; font-weight: 700;
    padding: 2px 8px; border-radius: 10px; background: var(--primary); color: white;
  }
  .product-item .p-stock-badge.low { background: var(--error); }
  .product-item .p-body { padding: 10px 12px 12px; }
  .product-item .p-name { font-size: 13px; font-weight: 600; color: var(--on-surface); line-height: 1.3; margin-bottom: 4px; min-height: 34px; }
  .product-item .p-stock { font-size: 11px; color: var(--on-surface-variant); margin-bottom: 4px; }
  .product-item .p-price { font-size: 14px; font-weight: 700; color: var(--primary); font-family: 'Geist', 'Noto Sans Lao', 'Noto Sans Thai', sans-serif; }

  .cart-items { max-height: 40vh; overflow-y: auto; margin-bottom: 12px; }
  .cart-line-editable {
    padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px;
  }
  .cart-line-top {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px;
  }
  .cart-line-name { font-weight: 500; }
  .cart-line-remove {
    background: none; border: none; color: var(--danger); cursor: pointer; font-size: 16px; padding: 0 4px;
  }
  .cart-line-bottom {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  }
  .cart-line-price-label { font-size: 11px; color: #888; }
  .cart-price-input {
    width: 70px !important; padding: 4px 6px !important; margin-bottom: 0 !important;
    font-size: 13px; border: 1px solid var(--border); border-radius: 4px;
  }
  .cart-original-price {
    font-size: 11px; color: var(--on-surface-variant); text-decoration: line-through;
  }
  .cart-line-subtotal {
    margin-left: auto; font-weight: bold; color: var(--primary);
  }
  .cart-total { font-size: 18px; font-weight: bold; margin: 10px 0; text-align: right; }

  select, input[type=text], input[type=number], input[type=password], input[type=date], input[type=file] {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 10px;
    border: 1px solid var(--outline-variant);
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Inter', 'Noto Sans Lao', 'Noto Sans Thai', sans-serif;
    background: var(--surface-container-lowest);
    color: var(--on-surface);
  }
  select:focus, input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(53,37,205,0.1); }

  .btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    font-family: 'Geist', 'Noto Sans Lao', 'Noto Sans Thai', sans-serif;
    transition: background 0.15s;
  }
  .btn-primary:hover { background: var(--primary-container); }

  /* Tables */
  .data-table { width: 100%; border-collapse: collapse; margin-top: 16px; background: var(--surface-container-lowest); border-radius: 12px; overflow: hidden; }
  .data-table th, .data-table td { padding: 12px 14px; border-bottom: 1px solid var(--outline-variant); text-align: left; font-size: 13px; }
  .data-table th { background: var(--surface-container); font-weight: 600; color: var(--on-surface-variant); text-transform: uppercase; font-size: 11px; letter-spacing: 0.03em; }
  .data-table tbody tr:hover { background: var(--surface-container-low); }
  .data-table button {
    background: var(--surface-container); border: 1px solid var(--outline-variant); border-radius: 8px;
    padding: 6px 12px; font-size: 12px; cursor: pointer; color: var(--on-surface);
  }
  .data-table button:hover { background: var(--surface-container-high); }

  #btn-add-product, #btn-add-customer { width: auto; padding: 10px 16px; }

  .filter-row { margin: 14px 0; }
  .filter-row select { max-width: 220px; display: inline-block; }

  /* งานซ่อมจักรยาน (Kanban) */
  .repair-topbar { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-bottom: 18px; }
  .repair-stat-label { font-size: 12px; color: var(--on-surface-variant); }
  .repair-stat-value { font-size: 24px; font-weight: 700; font-family: 'Geist', 'Noto Sans Lao', 'Noto Sans Thai', sans-serif; color: var(--on-surface); }
  .repair-stat-value.warn { color: var(--error); }

  .repair-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--outline-variant); padding-bottom: 10px; }
  .repair-tab {
    background: none; border: none; padding: 8px 14px; border-radius: 20px; font-size: 13px;
    font-weight: 600; color: var(--on-surface-variant); cursor: pointer; font-family: 'Inter', 'Noto Sans Lao', 'Noto Sans Thai', sans-serif;
  }
  .repair-tab:hover { background: var(--surface-container-high); }
  .repair-tab.active { background: var(--primary-container); color: var(--on-primary-container); }

  .kanban-board { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 16px; align-items: flex-start; }
  .kanban-column { background: var(--surface-container-low); border-radius: 14px; padding: 12px; min-width: 280px; flex-shrink: 0; }
  .kanban-column-header { display: flex; align-items: center; gap: 8px; padding: 6px 6px 12px; font-weight: 600; font-size: 14px; color: var(--on-surface); }
  .kanban-column-header .dot { width: 8px; height: 8px; border-radius: 50%; }
  .kanban-column-count { background: var(--surface-container-highest); color: var(--on-surface-variant); font-size: 11px; padding: 1px 8px; border-radius: 10px; }
  .kanban-card {
    background: var(--surface-container-lowest); border-radius: 12px; padding: 12px; margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(11,28,48,0.08); cursor: pointer; border-left: 3px solid var(--outline-variant);
  }
  .kanban-card:hover { box-shadow: 0 4px 12px rgba(11,28,48,0.12); }
  .kanban-card.overdue { border-left-color: var(--error); }
  .kanban-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
  .kanban-card-id { font-size: 11px; color: var(--on-surface-variant); font-weight: 600; }
  .kanban-card-title { font-size: 14px; font-weight: 600; color: var(--on-surface); margin-bottom: 4px; }
  .kanban-card-sub { font-size: 12px; color: var(--on-surface-variant); margin-bottom: 10px; line-height: 1.4; }
  .kanban-card-footer { display: flex; justify-content: space-between; align-items: center; }
  .kanban-card-customer { font-size: 12px; color: var(--on-surface); background: var(--surface-container); padding: 2px 8px; border-radius: 10px; }
  .kanban-card-total { font-size: 13px; font-weight: 700; color: var(--primary); font-family: 'Geist', 'Noto Sans Lao', 'Noto Sans Thai', sans-serif; }
  .kanban-empty { font-size: 12px; color: var(--on-surface-variant); text-align: center; padding: 20px 8px; }

  /* สินค้า/สต๊อก */
  .stock-cell { display: flex; align-items: center; gap: 8px; }
  .stock-bar-track { width: 60px; height: 5px; background: var(--surface-container-high); border-radius: 3px; overflow: hidden; }
  .stock-bar-fill { height: 100%; background: var(--primary); border-radius: 3px; }
  .stock-bar-fill.low { background: var(--error); }
  .product-row-icon {
    width: 36px; height: 36px; border-radius: 8px; background: var(--surface-container);
    display: flex; align-items: center; justify-content: center; color: var(--on-surface-variant); flex-shrink: 0;
  }
  .product-row-info { display: flex; align-items: center; gap: 10px; }
  .product-row-name { font-weight: 600; font-size: 13px; color: var(--on-surface); }
  .product-row-sku { font-size: 11px; color: var(--on-surface-variant); }
  .status-instock { background: #e6f4ea; color: #1e7e34; }
  .status-lowstock { background: #fef7e0; color: #a86400; }
  .status-outstock { background: #fce8e6; color: #c5221f; }

  /* พนักงาน (Team) */
  .staff-cards { display: flex; flex-direction: column; gap: 12px; }
  .staff-card {
    background: var(--surface-container-lowest); border-radius: 14px; padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(11,28,48,0.06); display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  }
  .staff-avatar {
    width: 46px; height: 46px; border-radius: 50%; background: var(--primary-container);
    color: var(--on-primary-container); display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px; flex-shrink: 0; position: relative;
  }
  .staff-avatar .status-dot { position: absolute; bottom: 0; right: 0; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--surface-container-lowest); }
  .staff-avatar .status-dot.on { background: #43a047; }
  .staff-avatar .status-dot.off { background: #9e9e9e; }
  .staff-name { font-size: 15px; font-weight: 700; font-family: 'Geist', 'Noto Sans Lao', 'Noto Sans Thai', sans-serif; color: var(--on-surface); }
  .staff-role { font-size: 12px; color: var(--on-surface-variant); text-transform: uppercase; letter-spacing: 0.03em; }
  .staff-meta { font-size: 12px; color: var(--on-surface-variant); margin-top: 2px; }
  .staff-actions { margin-left: auto; display: flex; gap: 8px; }

  /* Finance */
  .fin-profit-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-container));
    color: white; border-radius: 14px; padding: 20px;
  }
  .fin-profit-label { font-size: 12px; opacity: 0.85; margin-bottom: 6px; }
  .fin-profit-value { font-size: 30px; font-weight: 700; font-family: 'Geist', 'Noto Sans Lao', 'Noto Sans Thai', sans-serif; }
  .fin-profit-margin { font-size: 12px; margin-top: 8px; background: rgba(255,255,255,0.18); display: inline-block; padding: 3px 10px; border-radius: 10px; }
  .txn-item { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 10px; }
  .txn-item:hover { background: var(--surface-container-high); }
  .txn-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .txn-icon.in { background: #e6f4ea; color: #1e7e34; }
  .txn-icon.out { background: #fce8e6; color: #c5221f; }
  .txn-title { font-size: 13px; font-weight: 600; color: var(--on-surface); }
  .txn-sub { font-size: 11px; color: var(--on-surface-variant); }
  .txn-amount { margin-left: auto; font-weight: 700; font-size: 13px; font-family: 'Geist', 'Noto Sans Lao', 'Noto Sans Thai', sans-serif; }
  .txn-amount.in { color: #1e7e34; }
  .txn-amount.out { color: #c5221f; }

  /* กราฟกระแสเงินสด (Trajectory) */
  .trajectory-chart {
    display: flex; align-items: flex-end; gap: 4px; height: 140px; padding: 8px 4px;
  }
  .traj-bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; height: 100%; justify-content: flex-end; }
  .traj-bars { display: flex; align-items: flex-end; gap: 2px; height: 110px; width: 100%; justify-content: center; }
  .traj-bar { width: 40%; border-radius: 2px 2px 0 0; min-height: 2px; }
  .traj-bar.in { background: var(--primary); }
  .traj-bar.out { background: var(--error); }
  .traj-label { font-size: 9px; color: var(--on-surface-variant); }
  .trajectory-legend { display: flex; gap: 16px; font-size: 12px; color: var(--on-surface-variant); margin-top: 8px; }
  .legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
  .legend-dot.in { background: var(--primary); }
  .legend-dot.out { background: var(--error); }

  /* Multi-Payment (หน้า POS) */
  .pay-add-btn {
    background: var(--surface-container); border: 1px solid var(--outline-variant); border-radius: 8px;
    padding: 5px 10px; font-size: 12px; cursor: pointer; color: var(--primary); font-weight: 600;
  }
  .pay-add-btn:hover { background: var(--surface-container-high); }
  .pay-row {
    background: var(--surface-container); border-radius: 10px; padding: 10px; margin-bottom: 8px;
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  }
  .pay-row select { flex: 1; min-width: 90px; margin-bottom: 0 !important; padding: 8px !important; font-size: 13px; }
  .pay-row .pay-amount-input { flex: 1; min-width: 90px; margin-bottom: 0 !important; padding: 8px !important; font-size: 13px; }
  .pay-row .pay-remove-btn {
    background: none; border: none; color: var(--error); cursor: pointer; font-size: 18px; padding: 0 4px; flex-shrink: 0;
  }
  .pay-row .pay-converted { width: 100%; font-size: 11px; color: var(--on-surface-variant); }
  .pay-summary { background: var(--surface-container-low); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
  .pay-summary-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; color: var(--on-surface-variant); }
  .pay-summary-row.remaining { font-weight: 700; color: var(--on-surface); border-top: 1px solid var(--outline-variant); margin-top: 4px; padding-top: 6px; }
  .pay-summary-row.remaining.zero { color: #1e7e34; }
  .pay-summary-row.change { color: #1e7e34; font-weight: 600; }

  /* Settings */
  .settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
  @media (max-width: 900px) { .settings-grid { grid-template-columns: 1fr; } }
  .settings-card {
    background: var(--surface-container-lowest); border-radius: 14px; padding: 20px;
    box-shadow: 0 1px 3px rgba(11,28,48,0.06);
  }
  .settings-card-title {
    display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700;
    font-family: 'Geist', 'Noto Sans Lao', 'Noto Sans Thai', sans-serif; color: var(--on-surface); margin-bottom: 12px;
  }
  /* ขายบนเว็บ: ช่องติ๊กในรายละเอียดสินค้า + ปุ่มในตารางคลังสินค้า */
  .pdd-web { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; margin: 10px 0 8px; border-radius: 10px;
    background: var(--surface-container-low, #f2f4f8); cursor: pointer; font-size: 13px; line-height: 1.4; }
  .pdd-web input { width: 18px; height: 18px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--primary); }
  .pdd-web small { color: var(--on-surface-variant); font-size: 11.5px; }
  .pdd-web.disabled { opacity: .6; cursor: default; }
  .web-chip { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 1px 8px; border-radius: 10px; border: 1px solid transparent;
    font-size: 11px; font-weight: 600; cursor: pointer; vertical-align: 1px; white-space: nowrap; font-family: inherit; line-height: 1.6; }
  .web-chip.on { background: #e6f4ea; color: #1e7e34; border-color: #b7dfc2; }
  .web-chip.off { background: #f1f1f4; color: #6b6f7a; border-color: #d9dbe2; text-decoration: line-through; }
  .web-chip:disabled { opacity: .5; cursor: wait; }
  .settings-security { margin-top: 24px; padding-top: 20px; border-top: 1px dashed var(--outline-variant); }
  .sec-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  @media (max-width: 900px) { .sec-grid { grid-template-columns: minmax(0, 1fr); } }
  .sec-note { font-size: 12px; color: var(--on-surface-variant); margin: 0 0 10px; }
  .sec-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
  .sec-filters select, .sec-filters input[type=text] { width: auto; min-width: 0; flex: 0 1 auto; margin: 0; }
  .sec-filters input[type=text] { flex: 1 1 160px; }
  .sec-filters button { width: auto; margin: 0; padding-left: 18px; padding-right: 18px; }
  .sec-chk { display: flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
  .sec-chk input { width: auto; margin: 0; }
  .sec-table { max-height: 460px; overflow: auto; border: 1px solid var(--outline-variant); border-radius: 10px; }
  .sec-table table { width: 100%; border-collapse: collapse; font-size: 12px; }
  .sec-table th, .sec-table td { padding: 7px 9px; border-bottom: 1px solid var(--outline-variant); text-align: left; vertical-align: top; }
  .sec-table th { position: sticky; top: 0; background: var(--surface-container-low, #f2f4f8); font-weight: 700; z-index: 1; }
  .sec-table td.when { white-space: nowrap; color: var(--on-surface-variant); }
  .sec-table .args { color: var(--on-surface-variant); font-size: 11px; word-break: break-all; margin-top: 2px; }
  .sec-badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
  .sec-badge.ok { background: #e6f4ea; color: #1e7e34; }
  .sec-badge.bad { background: #fde8e8; color: #b3261e; }
  .sec-badge.warn { background: #fff4e0; color: #8a5300; }
  .sec-empty { padding: 18px; text-align: center; color: var(--on-surface-variant); font-size: 13px; }
  .settings-diagnostics {
    margin-top: 24px; padding-top: 20px; border-top: 1px dashed var(--outline-variant);
  }

  /* แท็บย่อยภายในหน้า (Sale, Inventory) */
  .subpage-tabs { display: flex; gap: 6px; margin: 4px 0 18px; flex-wrap: wrap; border-bottom: 1px solid var(--outline-variant); padding-bottom: 10px; }
  .subpage-tab {
    background: none; border: none; padding: 8px 16px; border-radius: 20px; font-size: 13px;
    font-weight: 600; color: var(--on-surface-variant); cursor: pointer; font-family: 'Inter', 'Noto Sans Lao', 'Noto Sans Thai', sans-serif;
    display: flex; align-items: center; gap: 6px;
  }
  .subpage-tab:hover { background: var(--surface-container-high); }
  .subpage-tab.active { background: var(--primary-container); color: var(--on-primary-container); }
  .subpage-panel { display: none; }
  .subpage-panel.active { display: block; }

  .status-badge {
    display: inline-block; padding: 4px 12px; border-radius: 20px;
    font-size: 11px; font-weight: 700; color: white; letter-spacing: 0.02em;
  }
  .status-รับเรื่อง { background: #9e9e9e; }
  .status-กำลังซ่อม { background: #ff9800; }
  .status-รออะไหล่ { background: var(--error); }
  .status-เสร็จแล้ว { background: #43a047; }
  .status-รับรถคืนแล้ว { background: #3f51b5; }

  /* สถานะ Pre-order / ลูกหนี้ */
  .status-ยืนยันแล้ว { background: #9e9e9e; }
  .status-สั่งซื้อแล้ว { background: #ff9800; }
  .status-สั่งซื้อ { background: #9e9e9e; }
  .status-รับสินค้าบางส่วน { background: #ff9800; }
  .status-รับครบแล้ว { background: #43a047; }
  .status-สินค้ามาถึง { background: #3f51b5; }
  .status-รอลูกค้ารับ { background: #7b1fa2; }
  .status-เสร็จสิ้น { background: #43a047; }
  .status-ยกเลิก { background: #757575; }
  .status-ค้างชำระ { background: var(--error); }
  .status-ชำระบางส่วน { background: #ff9800; }
  .status-ชำระครบ { background: #43a047; }
  .status-เกินกำหนด { background: #b71c1c; }

  .modal-box.modal-box-wide { width: min(92vw, 640px); max-height: 85vh; overflow-y: auto; }
  .modal-box.modal-box-xl { width: min(94vw, 860px); max-height: 88vh; overflow-y: auto; }
  /* กันตารางล้นกรอบ modal เสมอ (ไม่ใช่แค่บนมือถือ) เผื่อคอลัมน์เยอะกว่าที่คาดไว้ */
  .modal-box-wide .data-table-wrap, .modal-box-xl .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .add-part-row { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }

  /* Pre-order: ปุ่มมัดจำด่วน + ปุ่มจัดการสถานะ */
  .deposit-quick-row { display: flex; gap: 6px; margin-bottom: 8px; }
  .deposit-quick-btn {
    flex: 1; padding: 8px; border: 1px solid var(--primary); background: white;
    color: var(--primary); border-radius: 6px; cursor: pointer; font-size: 13px;
  }
  .deposit-quick-btn:hover { background: var(--surface-container-high); }
  .pod-action-row { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
  .pod-action-row button {
    flex: 1; min-width: 140px; padding: 10px; border-radius: 6px;
    border: 1px solid var(--primary); background: white; color: var(--primary); cursor: pointer;
  }
  .pod-action-row button:hover { background: var(--surface-container-high); }

  /* ไทม์ไลน์ Pre-order */
  .timeline { border-left: 2px solid var(--border); padding-left: 14px; margin: 10px 0; }
  .timeline-item { position: relative; padding-bottom: 14px; font-size: 13px; }
  .timeline-item::before {
    content: ''; position: absolute; left: -19px; top: 3px;
    width: 8px; height: 8px; border-radius: 50%; background: var(--primary);
  }
  .timeline-item .ti-event { font-weight: bold; }
  .timeline-item .ti-meta { font-size: 11px; color: var(--on-surface-variant); }

  .type-badge {
    display: inline-block; padding: 2px 8px; border-radius: 10px;
    font-size: 11px; font-weight: bold;
  }
  .type-product { background: #e3f2fd; color: #1565c0; }
  .type-service { background: #fff3e0; color: #e65100; }

  /* ใบเสร็จ (80mm thermal receipt เป็นค่าเริ่มต้น) */
  .receipt-paper {
    width: 80mm;
    margin: 0 auto;
    padding: 2mm 1.5mm; /* ลด padding ด้านข้างจาก 4mm → 1.5mm ให้ content กว้างขึ้น */
    background: white;
    font-family: 'Courier New', monospace;
    font-size: 11px; /* ลดจาก 12px → 11px ป้องกันตัวอักษรล้น */
    box-sizing: border-box;
    border: 1px solid #ddd;
    /* word-wrap ป้องกันข้อความยาวล้นขอบขวา */
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
  }
  .receipt-paper.size-58 {
    width: 58mm;
    font-size: 9px;
    padding: 1mm;
  }
  .receipt-paper svg { display: block; margin: 4px auto; width: 100%; height: auto; max-width: 100%; }
  .repair-blank-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
  .repair-blank-table th, .repair-blank-table td {
    border: 1px solid #999; padding: 6px 4px; font-size: 11px; text-align: left;
  }
  .repair-blank-table td { height: 22px; }
  .receipt-logo {
    max-width: 50mm;
    max-height: 20mm;
    margin-bottom: 4px;
  }
  .receipt-paper.size-58 .receipt-logo {
    max-width: 36mm;
    max-height: 15mm;
  }
  .receipt-center { text-align: center; }
  .receipt-shop-name { font-size: 15px; font-weight: bold; margin-bottom: 2px; }
  .receipt-shop-sub { font-size: 10px; color: #444; }
  .receipt-paper.size-58 .receipt-shop-name { font-size: 12px; }
  .receipt-small { font-size: 11px; line-height: 1.5; }
  .receipt-paper.size-58 .receipt-small { font-size: 9px; }
  .ri-line { display: flex; justify-content: space-between; font-size: 11px; padding: 2px 0; }
  .receipt-divider { border-top: 1px dashed #000; margin: 6px 0; }
  .receipt-items { width: 100%; border-collapse: collapse; font-size: 11px; }
  .receipt-paper.size-58 .receipt-items { font-size: 9px; }
  .receipt-items td { padding: 2px 0; vertical-align: top; }
  .receipt-items .ri-name { width: 55%; }
  .receipt-items .ri-qty { width: 15%; text-align: center; }
  .receipt-items .ri-amount { width: 30%; text-align: right; }
  .receipt-total { font-size: 14px; font-weight: bold; text-align: right; margin: 6px 0; }
  .receipt-paper.size-58 .receipt-total { font-size: 12px; }
  .receipt-thankyou { font-size: 12px; font-weight: bold; margin-top: 6px; }
  .receipt-paper.size-58 .receipt-thankyou { font-size: 10px; }

  /* ปุ่มสแกนกล้องข้างช่องค้นหา */
  .search-with-scan { display: flex; gap: 6px; margin-bottom: 14px; }
  .search-with-scan input { margin-bottom: 0 !important; flex: 1; }
  .scan-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
  }
  .scan-btn:hover { background: var(--primary-dark); }

  /* หน้าต่างกล้องสแกน */
  .scanner-box { width: 340px; max-width: 92vw; }
  .scanner-video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin: 10px 0;
  }
  #scanner-video { width: 100%; height: 100%; object-fit: cover; }
  .scanner-frame {
    position: absolute;
    top: 15%; left: 15%; right: 15%; bottom: 15%;
    border: 3px solid #4caf50;
    border-radius: 8px;
    box-shadow: 0 0 0 2000px rgba(0,0,0,0.35);
  }
  .scanner-status { text-align: center; font-size: 13px; color: #666; min-height: 18px; }

  /* พรีวิวโลโก้ในหน้าตั้งค่า */
  #shop-logo-preview img { max-width: 120px; max-height: 60px; border: 1px solid var(--border); border-radius: 4px; padding: 4px; }

  /* หน้าจอล็อกอินพนักงาน */
  .login-screen {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  }
  .login-box {
    background: white; border-radius: 14px; padding: 32px 28px;
    width: 320px; max-width: 90vw; text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  }
  .login-logo { font-size: 40px; margin-bottom: 6px; }
  .login-box h2 { margin: 0 0 4px 0; color: var(--primary-dark); }
  .login-box select, .login-box input {
    width: 100%; padding: 12px; margin-top: 12px; margin-bottom: 0;
    border: 1px solid var(--border); border-radius: 8px; font-size: 15px; box-sizing: border-box;
  }
  .login-box .btn-primary { margin-top: 16px; }
  .login-error { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 16px; }

  /* ป้ายแสดงพนักงานปัจจุบันในแถบเมนู */
  .staff-badge {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(255,255,255,0.08); margin: 0 16px 14px; padding: 10px 12px;
    border-radius: 8px; font-size: 13px;
  }
  .staff-badge #logout-btn {
    background: rgba(255,255,255,0.15); color: white; border: none;
    padding: 4px 8px; border-radius: 6px; font-size: 11px; cursor: pointer;
  }

  /* ---------- Mobile responsive ---------- */
  .hamburger-btn {
    display: none;
    background: var(--primary-dark);
    color: white;
    border: none;
    font-size: 22px;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 12px;
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 90;
  }
  .sidebar-overlay.active { display: block; }

  @media (max-width: 768px) {
    .app { position: relative; overflow-x: hidden; }
    .hamburger-btn { display: block; }
    .sidebar {
      position: fixed;
      top: 0; left: 0; bottom: 0;
      width: 240px;
      transform: translateX(-100%);
      transition: transform 0.25s ease;
      z-index: 100;
      overflow-y: auto;
    }
    .sidebar.open { transform: translateX(0); }
    .content { padding: 16px; width: 100%; }
    .pos-layout { flex-direction: column; }
    .pos-right { position: static; width: 100%; box-sizing: border-box; }
    .cards { grid-template-columns: 1fr; }
    .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .data-table { min-width: 600px; }
    .modal-box, .modal-box-wide, .modal-box-xl { width: 92vw !important; max-width: 420px !important; max-height: 85vh; overflow-y: auto; }
    .topbar-search { max-width: none; order: 3; flex-basis: 100%; }
    .topbar-user-name, .topbar-user-role { display: none; }
    .staff-card { flex-direction: column; align-items: flex-start; }
    .staff-actions { margin-left: 0; width: 100%; }
    .product-list { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .scan-btn { padding: 12px 14px; font-size: 18px; }
  }

  @media print {
    /* ค่าเริ่มต้น: ซ่อนทุกอย่าง ยกเว้นโหมดที่ระบุผ่าน body class ด้านล่าง */
    body:not(.printing-barcode):not(.printing-receipt) { display: none; }

    /* โหมดพิมพ์ใบเสร็จ (80mm thermal) — ใช้ร่วมกับเอกสาร Booking/Invoice/ใบเสร็จรับเงิน/Trade-In/งานซ่อม/Void-Refund/ขายเครดิต ด้วย */
    body.printing-receipt * { visibility: hidden; }
    body.printing-receipt #receipt-print-area,
    body.printing-receipt #receipt-print-area *,
    body.printing-receipt #booking-print-area,
    body.printing-receipt #booking-print-area *,
    body.printing-receipt #tradein-print-area,
    body.printing-receipt #tradein-print-area *,
    body.printing-receipt #repair-print-area,
    body.printing-receipt #repair-print-area *,
    body.printing-receipt #void-print-area,
    body.printing-receipt #void-print-area *,
    body.printing-receipt #credit-print-area,
    body.printing-receipt #credit-print-area * { visibility: visible; }
    body.printing-receipt #receipt-print-area,
    body.printing-receipt #booking-print-area,
    body.printing-receipt #tradein-print-area,
    body.printing-receipt #repair-print-area,
    body.printing-receipt #void-print-area,
    body.printing-receipt #credit-print-area {
      position: absolute; top: 0; left: 0; border: none;
    }

    /* โหมดพิมพ์บาร์โค้ด (96mm x 25mm แถวละ 3 ดวง) */
    body.printing-barcode .sidebar,
    body.printing-barcode .no-print { display: none !important; }
    body.printing-barcode .content { padding: 0; }
    body.printing-barcode .page { display: none !important; }
    body.printing-barcode #page-barcode { display: block !important; }
    body.printing-barcode #page-barcode h1 { display: none; }
    body.printing-barcode .barcode-grid { gap: 0; }
    body.printing-barcode .barcode-label { border: none; }
  }

  /* Modal */
  .modal { display: none; position: fixed; inset: 0; background: rgba(11,28,48,0.45); align-items: center; justify-content: center; z-index: 500; }
  .modal.active { display: flex; }
  .modal-box {
    background: var(--surface-container-lowest); padding: 24px; border-radius: 16px; width: 320px;
    box-shadow: 0 12px 32px rgba(11,28,48,0.2);
  }
  .modal-actions { display: flex; gap: 10px; margin-top: 10px; }
  .modal-actions button { flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--outline-variant); cursor: pointer; font-family: 'Inter', 'Noto Sans Lao', 'Noto Sans Thai', sans-serif; }

  /* Toast */
  .toast {
    position: fixed; bottom: 20px; right: 20px;
    background: var(--on-surface); color: white; padding: 12px 18px;
    border-radius: 10px; font-size: 14px; opacity: 0; transform: translateY(20px);
    transition: all 0.25s; z-index: 1000;
    pointer-events: none;
  }
  .toast.show { opacity: 1; transform: translateY(0); }

  /* Form box (รับสินค้าเข้า / บาร์โค้ด / ตั้งค่า) */
  .form-box {
    background: var(--surface-container-lowest);
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(11,28,48,0.06);
    max-width: 420px;
    margin-bottom: 20px;
  }
  .small-label { font-size: 12px; color: var(--on-surface-variant); display: block; margin-bottom: 4px; }
  .selected-box {
    background: var(--surface-container); padding: 10px 12px; border-radius: 10px;
    margin-bottom: 10px; font-size: 14px;
  }
  .converted-total {
    text-align: right; font-size: 16px; font-weight: bold; color: var(--primary);
    margin-bottom: 10px;
  }
  .btn-secondary {
    background: var(--surface-container-lowest); color: var(--primary); border: 1px solid var(--primary);
    padding: 12px 18px; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; width: 100%;
    margin-top: 8px; font-family: 'Geist', 'Noto Sans Lao', 'Noto Sans Thai', sans-serif;
  }
  .btn-secondary:hover { background: var(--primary-fixed); }
  .btn-danger {
    background: var(--error); color: white; border: none;
    padding: 12px 18px; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; width: 100%;
    margin-top: 8px; font-family: 'Geist', 'Noto Sans Lao', 'Noto Sans Thai', sans-serif;
  }
  .btn-danger:hover { background: #a01515; }
  .btn-outline-danger {
    background: var(--surface-container-lowest); color: var(--error); border: 1.5px solid var(--error);
    padding: 10px 18px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer;
    font-family: 'Geist', 'Noto Sans Lao', 'Noto Sans Thai', sans-serif; width: auto;
  }
  .btn-outline-danger:hover { background: var(--error-container); }

  h1 { font-family: 'Geist', 'Noto Sans Lao', 'Noto Sans Thai', sans-serif; font-weight: 700; font-size: 28px; color: var(--on-surface); }
  h3, h4 { font-family: 'Geist', 'Noto Sans Lao', 'Noto Sans Thai', sans-serif; font-weight: 600; color: var(--on-surface); }

  /* Barcode print grid - ขนาดจริงตรงกับม้วนสติกเกอร์ 3.2x2.5 ซม. แถวละ 3 ดวง */
  .barcode-grid {
    display: grid;
    grid-template-columns: repeat(3, 3.2cm);
    grid-auto-rows: 2.5cm;
    gap: 1mm;
    margin-top: 16px;
  }
  .barcode-label {
    width: 3.2cm;
    height: 2.5cm;
    box-sizing: border-box;
    padding: 1mm;
    border: 1px dashed #bbb;
    background: white;
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }
  .barcode-label .label-name {
    font-size: 6.5px;
    line-height: 1.1;
    margin-bottom: 1px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .barcode-label svg { display: block; margin: 0 auto; width: 26mm; height: 10mm; }
  .barcode-label .label-price { font-size: 7.5px; font-weight: bold; margin-top: 1px; }

  /* ================================================================
     PRINT TYPOGRAPHY — ใช้ร่วมกันทุกใบพิมพ์ (Sale/Credit/Booking/Trade-In/Repair/Void)
     และทุก Barcode Sticker/Label — Bold ชัด สีดำเข้มเสมอ เพื่อความคมชัดบน Thermal Printer
     ครอบคลุมทั้ง Print Preview บนจอ และตอนพิมพ์จริง (ไม่ผูกไว้ใน @media print เฉยๆ)
     หมายเหตุ: ไม่แตะ .receipt-paper svg (ขนาด/สัดส่วน/Quiet Zone ของบาร์โค้ดเดิมทั้งหมด) —
     กฎด้านล่างมีผลแค่สี/น้ำหนักตัวอักษร ไม่กระทบเรขาคณิตของแท่งบาร์โค้ด
     ================================================================ */
  .receipt-paper, .receipt-paper *,
  .barcode-label, .barcode-label * {
    font-weight: 700 !important;
    color: #000 !important;
    -webkit-font-smoothing: antialiased;
    print-color-adjust: exact !important;
    -webkit-print-color-adjust: exact !important;
    color-adjust: exact !important;
    /* ป้องกันข้อความล้นขอบขวา */
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    max-width: 100% !important;
  }

  /* ข้อความสำคัญ: ชื่อสินค้า/SKU/รหัส/ราคา/จำนวน/ยอดเงิน/เลขที่บิล — Bold หนาพิเศษ
     (จำลองน้ำหนักเกิน 700 ด้วย text-shadow เพราะฟอนต์ monospace ของใบเสร็จไม่มีน้ำหนัก 800/900 จริงให้เรียกใช้) */
  .receipt-shop-name,
  .receipt-total,
  #rcpt-bill-number,
  .ri-name, .ri-qty, .ri-amount,
  .ri-line span:last-child,
  .label-name, .label-price,
  .repair-blank-table th {
    text-shadow: 0.35px 0 0 currentColor, -0.35px 0 0 currentColor, 0 0.35px 0 currentColor, 0 -0.35px 0 currentColor !important;
  }

  /* กันสีจางตอนพิมพ์จริงบนเครื่อง Thermal */
  @media print {
    body.printing-receipt, body.printing-barcode {
      -webkit-print-color-adjust: exact !important;
      print-color-adjust: exact !important;
      color-adjust: exact !important;
      margin: 0 !important;
      padding: 0 !important;
    }
  }

  /* @page ต้องอยู่ระดับ top-level (ไม่ใช่ข้างใน @media) ตาม CSS spec */
  @page { margin: 0; }
