:root{font-family:Arial,"Noto Sans Thai",sans-serif;color:#172a21;background:#f7f8f5}*{box-sizing:border-box}body{margin:0}.login-layout{min-height:100vh;display:grid;grid-template-columns:47% 53%}.brand-panel{background:linear-gradient(150deg,#173f30,#0b2b20);color:#fff;padding:clamp(30px,6vw,95px);display:flex;flex-direction:column;justify-content:center;position:relative;overflow:hidden}.brand-panel:after{content:"";position:absolute;border:1px solid #d4b87444;width:560px;height:560px;border-radius:50%;right:-340px;bottom:-230px}.brand-mark{font-family:Georgia,serif;font-size:46px;letter-spacing:-7px;font-weight:bold;margin-bottom:55px}.brand-mark span{color:#c8a65d;font-size:28px;vertical-align:top;letter-spacing:0}.eyebrow{font-size:11px;font-weight:700;letter-spacing:3px;color:#d4bb79}.brand-panel h1{font-family:Georgia,serif;font-size:clamp(48px,6.5vw,100px);letter-spacing:-3px;line-height:1.06;margin:16px 0 25px}.brand-desc{font-size:15px;line-height:1.9;color:#d4e1d8;max-width:400px}.brand-bottom{position:absolute;bottom:40px;left:clamp(30px,6vw,95px);font-size:11px;letter-spacing:1px;color:#a8c0b0}.brand-bottom span{margin-left:18px;color:#d4bb79}.form-panel{display:flex;align-items:center;justify-content:center;position:relative;padding:50px 25px}.login-card{width:min(100%,410px)}.mobile-brand{display:none}.dark{color:#a07f43}.login-card h2{font-size:36px;margin:12px 0 10px}.intro{font-size:14px;color:#7b8880;line-height:1.7;margin:0 0 40px}label{display:block;font-size:13px;font-weight:700;margin:19px 0 9px}input{width:100%;height:50px;padding:0 15px;border:1px solid #d6dfd8;border-radius:8px;background:white;font:inherit;font-size:14px;outline:none}input:focus{border-color:#236c4b;box-shadow:0 0 0 3px #236c4b20}.password-wrap{position:relative}.password-wrap input{padding-right:75px}.toggle{position:absolute;right:8px;top:7px;height:36px;border:0;background:transparent;color:#427257;cursor:pointer}.submit{width:100%;height:52px;border:0;border-radius:8px;background:#174b35;color:white;font:inherit;font-weight:bold;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:15px}.submit:hover{background:#0f3827}.message{font-size:13px;min-height:25px;margin:12px 0;color:#b34839}.note{margin-top:22px;text-align:center;font-size:12px;color:#8b9690}footer{position:absolute;bottom:25px;color:#9aa69e;font-size:11px}@media(max-width:760px){.login-layout{display:block}.brand-panel{display:none}.form-panel{min-height:100vh}.mobile-brand{display:block;font-weight:900;color:#174b35;letter-spacing:1px;margin-bottom:60px}.login-card h2{font-size:30px}}


/* MONÉ COMPANY V3 — Dashboard */
.dashboard[hidden] {
  display: none !important;
}

.dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  background: #f7f8f5;
  color: #183a2d;
  font-family: Arial, sans-serif;
}

.dashboard-sidebar {
  background: #103c2d;
  color: #fff;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.dashboard-brand {
  color: #e5bb64;
  font-size: 30px;
  font-weight: 700;
}

.dashboard-brand span {
  color: #fff;
  font-size: 15px;
  margin-left: 8px;
}

.dashboard-menu-title {
  color: #d8bc7b;
  font-size: 12px;
  letter-spacing: 2px;
}

.dashboard-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dashboard-nav a {
  color: #e6eee8;
  text-decoration: none;
  padding: 13px 15px;
  border-radius: 9px;
}

.dashboard-nav a:hover,
.dashboard-nav .dashboard-nav-active {
  background: #245c45;
  color: #fff;
}

.dashboard-logout {
  margin-top: auto;
  background: transparent;
  color: #fff;
  border: 1px solid #789487;
  border-radius: 9px;
  padding: 13px;
  cursor: pointer;
}

.dashboard-main {
  padding: 35px;
  min-width: 0;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}

.dashboard-header h1 {
  font-size: 28px;
  margin: 5px 0;
}

.dashboard-eyebrow {
  color: #ae873a;
  letter-spacing: 2px;
  font-size: 11px;
}

.dashboard-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.dashboard-role {
  background: #e8d6ad;
  padding: 8px 12px;
  border-radius: 20px;
}

.dashboard-welcome {
  background: linear-gradient(120deg, #154633, #0d3024);
  border-radius: 16px;
  padding: 30px;
  color: #fff;
  margin-bottom: 24px;
}

.dashboard-welcome h2 {
  font-size: 27px;
  margin: 8px 0 12px;
}

.dashboard-welcome span {
  color: #d2e0d7;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.dashboard-card,
.dashboard-section {
  background: #fff;
  border: 1px solid #e5e9e4;
  border-radius: 14px;
  padding: 24px;
}

.dashboard-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dashboard-card strong {
  font-size: 34px;
  color: #b18a42;
}

.dashboard-card small,
.dashboard-section p {
  color: #829087;
}

.dashboard-section {
  margin-top: 24px;
}

@media (max-width: 850px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    gap: 15px;
  }

  .dashboard-main {
    padding: 20px;
  }

  .dashboard-cards {
    grid-template-columns: 1fr;
  }

  .dashboard-header {
    flex-wrap: wrap;
  }
}

/* ซ่อนหน้า Login เมื่อเข้าสู่ Dashboard */
.login-layout[hidden] {
  display: none !important;
}

#usersSection[hidden] {
  display: none !important;
}

#usersTable th {
  text-align: left;
  padding: 12px;
  background: #eef3ee;
  color: #174b35;
  white-space: nowrap;
}

#refreshUsersButton {
  background: #174b35;
  color: white;
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
  cursor: pointer;
  margin-bottom: 14px;
}


/* MONÉ V3 — User Management */

#createUserForm[hidden],
#showCreateUserButton[hidden] {
  display: none !important;
}

#showCreateUserButton,
#saveUserButton {
  background: #174b35;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 11px 18px;
  cursor: pointer;
  margin-bottom: 12px;
}

#createUserForm {
  background: #f7f9f6;
  border: 1px solid #dce6dc;
  border-radius: 12px;
  padding: 22px;
  margin: 16px 0 22px;
}

#createUserForm h3 {
  margin: 0 0 18px;
  color: #174b35;
}

.user-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.user-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-weight: 600;
}

.user-form-grid input,
.user-form-grid select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 11px;
  border: 1px solid #cbd7cc;
  border-radius: 8px;
  background: white;
  font: inherit;
}

.user-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

#cancelCreateUserButton {
  background: #e7ebe7;
  border: none;
  border-radius: 8px;
  padding: 11px 18px;
  cursor: pointer;
}

@media (max-width: 650px) {
  .user-form-grid {
    grid-template-columns: 1fr;
  }
}



/* โลโก้บริษัทมุมซ้ายบน Sidebar */

.dashboard-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-company-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
}

.login-company-logo {
  display: block;
  width: 100%;
  max-width: 375px;
  height: auto;
  object-fit: contain;
}


/* MONÉ V3 — Sidebar Navigation */

.dashboard-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.dashboard-nav a {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 44px;
  padding: 11px 14px;
  border-radius: 9px;
  text-decoration: none;
  transition: background 0.2s ease;
}

.dashboard-nav a:hover {
  background: rgba(255,255,255,0.09);
}

.dashboard-nav a.dashboard-nav-active {
  background: rgba(255,255,255,0.13);
  border-left: 3px solid #c7a15a;
}

.dashboard-nav a[hidden] {
  display: none !important;
}

.nav-icon {
  width: 20px;
  flex-shrink: 0;
  text-align: center;
  font-size: 17px;
  color: #d9c18b;
}

.dashboard-sidebar {
  overflow-y: auto;
}


/* MONÉ COMPANY V3 — Dashboard Overview */

.mone-overview {
  display: flex;
  flex-direction: column;
  gap: 25px;
  padding-top: 22px;
}

.mone-overview .dashboard-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 30px;
  border-radius: 18px;
  background: linear-gradient(120deg, #123e2f, #23644b);
  color: #fff;
}

.mone-welcome-label {
  color: #e6c98c;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
}

.mone-overview .dashboard-welcome h2 {
  color: #fff;
  font-size: clamp(23px, 3vw, 34px);
  margin: 10px 0;
}

.mone-overview .dashboard-welcome p {
  color: #e3eee7;
}

.mone-welcome-symbol {
  color: #d6b775;
  font-size: 80px;
  line-height: 1;
}

.mone-overview-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.mone-overview-heading h2 {
  margin: 0 0 6px;
  color: #173f30;
}

.mone-overview-heading p {
  margin: 0;
  color: #78867d;
  font-size: 13px;
}

.mone-live-label {
  padding: 8px 14px;
  border-radius: 30px;
  background: #e9f1e9;
  color: #286044;
  font-size: 12px;
  font-weight: 700;
}

.mone-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 17px;
}

.mone-stat-card {
  background: #fff;
  border: 1px solid #e3e9e3;
  border-radius: 15px;
  padding: 22px;
  box-shadow: 0 5px 20px rgba(16, 52, 35, 0.04);
}

.mone-stat-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #eaf2eb;
  color: #1e6043;
  font-size: 24px;
  margin-bottom: 18px;
}

.mone-stat-card p {
  margin: 0 0 9px;
  font-size: 13px;
  color: #64766a;
}

.mone-stat-card strong {
  display: block;
  color: #173f30;
  font-size: 29px;
  margin-bottom: 7px;
}

.mone-stat-card span {
  font-size: 12px;
  color: #91a095;
}

.mone-dashboard-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
}

.mone-panel {
  background: #fff;
  border: 1px solid #e3e9e3;
  border-radius: 16px;
  padding: 24px;
  min-width: 0;
}

.mone-panel-header h3 {
  margin: 0 0 6px;
  color: #173f30;
}

.mone-panel-header p {
  margin: 0;
  font-size: 12px;
  color: #849389;
}

.mone-chart-placeholder,
.mone-empty-state {
  min-height: 225px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  color: #829287;
}

.mone-chart-icon,
.mone-empty-icon {
  font-size: 44px;
  color: #a5bca9;
}

.mone-chart-placeholder strong,
.mone-empty-state strong {
  color: #486452;
}

.mone-chart-placeholder p,
.mone-empty-state p {
  font-size: 12px;
  max-width: 290px;
}

@media (max-width: 1100px) {
  .mone-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 750px) {
  .mone-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .mone-overview .dashboard-welcome {
    padding: 22px;
  }

  .mone-welcome-symbol {
    font-size: 45px;
  }
}

@media (max-width: 480px) {
  .mone-stats-grid {
    grid-template-columns: 1fr;
  }
}


/* MONÉ V3 — Page Navigation */

#overviewSection[hidden],
#usersSection[hidden],
#monePlaceholderPage[hidden] {
  display: none !important;
}

.mone-placeholder-page {
  padding: 24px 0;
}

.mone-placeholder-content {
  min-height: 420px;
  background: #ffffff;
  border: 1px solid #e3e9e3;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 35px;
}

.mone-placeholder-icon {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  background: #eaf2eb;
  color: #1d6043;
  border-radius: 18px;
  font-size: 35px;
}

.mone-placeholder-content h2 {
  margin: 0;
  color: #173f30;
}

.mone-placeholder-content p {
  color: #728477;
  max-width: 420px;
}

.mone-placeholder-content span {
  color: #b09a6c;
  font-size: 12px;
  letter-spacing: 2px;
}


/* MONÉ V3 — Stores */

#storesSection[hidden] {
  display: none !important;
}

.mone-store-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0;
}

.mone-store-toolbar input {
  flex: 1;
  min-width: 220px;
  padding: 12px 14px;
  border: 1px solid #d8e3db;
  border-radius: 9px;
  font: inherit;
}

.mone-store-toolbar button {
  padding: 12px 18px;
  border: 0;
  border-radius: 9px;
  background: #19533c;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.mone-store-table-wrap {
  overflow-x: auto;
}

.mone-store-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.mone-store-table th,
.mone-store-table td {
  padding: 13px 12px;
  text-align: left;
  border-bottom: 1px solid #e6ece7;
  white-space: nowrap;
}

.mone-store-table th {
  background: #edf4ee;
  color: #174b35;
}

.mone-store-table tbody tr:hover {
  background: #f7faf7;
}

#storesMessage {
  color: #526d5a;
  font-size: 13px;
}


/* MONÉ V3 — Create Store Form */

#createStoreForm[hidden],
#showCreateStoreButton[hidden] {
  display: none !important;
}

#showCreateStoreButton {
  background: #19533c;
  color: white;
  border: 0;
  border-radius: 9px;
  padding: 12px 20px;
  font: inherit;
  cursor: pointer;
  margin: 16px 0;
}

#createStoreForm {
  background: #f8fbf8;
  border: 1px solid #dce8dd;
  border-radius: 14px;
  padding: 24px;
  margin: 18px 0;
}

#createStoreForm h3 {
  margin-top: 0;
  color: #174b35;
}

#createStoreMessage {
  font-size: 13px;
  margin-top: 14px;
}

/* MONÉ V3 — ซ่อนปุ่มเพิ่ม-ลดในช่องตัวเลขทุกหน้า */

/* Chrome, Edge, Safari */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* MONÉ V3 — Edit Store */

#editStoreForm[hidden] {
  display: none !important;
}

#editStoreForm {
  background: #f8fbf8;
  border: 1px solid #dce8dd;
  border-radius: 14px;
  padding: 24px;
  margin: 18px 0;
}

#editStoreForm h3 {
  margin-top: 0;
  color: #174b35;
}

.mone-edit-store-button {
  background: #19533c;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
}

/* MONÉ V3 — Products */

#productsSection[hidden] {
  display: none !important;
}

#productsSection .mone-store-table th:last-child,
#productsSection .mone-store-table td:last-child {
  text-align: right;
}

#productsMessage {
  margin: 12px 0;
}


/* MONÉ V3 — Create Product */

#createProductForm[hidden],
#showCreateProductButton[hidden] {
  display: none !important;
}

#showCreateProductButton {
  background: #19533c;
  color: #fff;
  border: 0;
  border-radius: 9px;
  padding: 12px 20px;
  font: inherit;
  cursor: pointer;
  margin: 16px 0;
}

#createProductForm {
  background: #f8fbf8;
  border: 1px solid #dce8dd;
  border-radius: 14px;
  padding: 24px;
  margin: 18px 0;
}

#createProductForm h3 {
  margin-top: 0;
  color: #174b35;
}

#createProductMessage {
  margin-top: 14px;
}

/* ไม่มีลูกศรเพิ่ม-ลดในช่องราคาขาย */
#createProductForm input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

#createProductForm input[type="number"]::-webkit-inner-spin-button,
#createProductForm input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* MONÉ V3 — Edit Product */

#editProductForm[hidden] {
  display: none !important;
}

#editProductForm {
  background: #f8fbf8;
  border: 1px solid #dce8dd;
  border-radius: 14px;
  padding: 24px;
  margin: 18px 0;
}

#editProductForm h3 {
  margin-top: 0;
  color: #174b35;
}

.mone-edit-product-button {
  background: #19533c;
  color: white;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
}

/* จัดปุ่มให้อยู่กลางคอลัมน์จัดการ */
#productsSection .mone-store-table th:last-child,
#productsSection .mone-store-table td:last-child {
  text-align: center;
}

/* MONÉ V3 — Delivery Order */

#deliverySection[hidden] {
  display: none !important;
}

#deliverySection .mone-store-table select,
#deliverySection .mone-store-table input {
  width: 100%;
  min-width: 110px;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid #d9e4dc;
  border-radius: 8px;
  font: inherit;
}

#deliverySection .mone-store-table select {
  min-width: 220px;
}

.delivery-remove-button {
  background: #fff1f0;
  color: #b42318;
  border: 1px solid #f3c6c2;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
}

/* ซ่อนลูกศรเพิ่ม-ลดจำนวน */
#deliverySection input[type="number"]::-webkit-inner-spin-button,
#deliverySection input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#deliverySection input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* =========================================
   MONÉ V3 — DELIVERY NOTE A4
   ========================================= */

.mone-delivery-paper {
  box-sizing: border-box;
  width: 100%;
  max-width: 210mm;
  min-height: 270mm;
  margin: 24px auto;
  padding: 18mm 15mm;
  background: #fff;
  color: #111;
  font-family: Arial, "Noto Sans Thai", sans-serif;
  font-size: 12px;
  line-height: 1.5;
}

.mone-delivery-paper * {
  box-sizing: border-box;
}

.mone-delivery-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #333;
}

.mone-delivery-header h2,
.mone-delivery-title h1 {
  margin: 0;
  font-size: 18px;
  color: #111;
}

.mone-delivery-header p {
  margin: 2px 0;
  font-size: 11px;
}

.mone-delivery-title {
  text-align: right;
  white-space: nowrap;
}

.mone-delivery-title h1 {
  font-size: 23px;
}

.mone-delivery-details {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 25px;
  margin: 18px 0 22px;
}

.mone-delivery-details h3 {
  margin: 0 0 8px;
  font-size: 13px;
}

.mone-delivery-details p {
  margin: 4px 0;
}

.mone-delivery-document-info > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid #ddd;
}

.mone-delivery-items {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.mone-delivery-items th,
.mone-delivery-items td {
  border: 1px solid #555;
  padding: 8px 6px;
  text-align: center;
  overflow-wrap: anywhere;
}

.mone-delivery-items th:nth-child(1) {
  width: 10%;
}

.mone-delivery-items th:nth-child(2) {
  width: 17%;
}

.mone-delivery-items th:nth-child(3) {
  width: 43%;
}

.mone-delivery-items th:nth-child(4) {
  width: 15%;
}

.mone-delivery-items th:nth-child(5) {
  width: 15%;
}

.mone-delivery-items td:nth-child(3) {
  text-align: left;
}

.mone-delivery-signatures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 25px;
  margin-top: 75px;
  text-align: center;
}

.mone-delivery-signature {
  min-width: 0;
  font-size: 11px;
}

.mone-delivery-signature .signature-line {
  height: 30px;
  border-bottom: 1px solid #333;
  margin-bottom: 8px;
}

.mone-delivery-signature p {
  margin-top: 8px;
  white-space: nowrap;
}

/* =========================================
   PRINT — แสดงเฉพาะใบส่งของ
   ========================================= */

@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  body * {
    visibility: hidden !important;
  }

  #deliveryPrintArea,
  #deliveryPrintArea *,
  #deliveryPrintArea *::before,
  #deliveryPrintArea *::after {
    visibility: visible !important;
  }

  #deliveryPrintArea {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 210mm !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .mone-delivery-paper {
    width: 210mm !important;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 18mm 15mm !important;
    border: none !important;
    box-shadow: none !important;
    background: white !important;
  }

  .mone-delivery-items tr,
  .mone-delivery-signatures {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  #deliveryPrintButton {
    display: none !important;
  }
}

/* =========================================
   MONÉ V3 — Accounting Button Design
   ========================================= */

#accountingSection button {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #14523d;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

#accountingSection button:hover:not(:disabled) {
  background: #0d3c2d;
  transform: translateY(-1px);
}

#accountingSection button:active:not(:disabled) {
  transform: translateY(0);
}

#accountingSection button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ปุ่มรีเฟรช — แบบขอบสีเขียว */
#accountingRefreshButton {
  background: #ffffff !important;
  color: #14523d !important;
  border: 1px solid #14523d !important;
}

#accountingRefreshButton:hover:not(:disabled) {
  background: #eaf3ed !important;
}

/* ปุ่มเพิ่มรายการบัญชี */
#accountingAddRowButton {
  background: #eaf3ed !important;
  color: #14523d !important;
}

/* ปุ่มยกเลิก */
#accountingCancelJournalButton {
  background: #edf0ed !important;
  color: #46574e !important;
}

/* จัดปุ่มให้ขึ้นบรรทัดใหม่บนจอเล็ก */
#accountingSection .user-form-actions {
  flex-wrap: wrap;
  align-items: center;
}

/* ช่องกรอกวันที่ */
#accountingJournalDate {
  border: 1px solid #cbd7cc;
  border-radius: 10px;
  padding: 11px 14px;
  font: inherit;
}

/* =========================================
   MONÉ V3 — Delivery Page Design
   ========================================= */

/* ปุ่มทั้งหมดภายในหน้าใบส่งของ */
#deliverySection button {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #14523d;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

#deliverySection button:hover:not(:disabled) {
  background: #0d3c2d;
  transform: translateY(-1px);
}

#deliverySection button:active:not(:disabled) {
  transform: translateY(0);
}

#deliverySection button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ปุ่มเพิ่มรายการสินค้า */
#deliverySection button[type="button"] {
  min-height: 42px;
}

/* ปุ่มลบรายการ */
#deliverySection .delivery-remove-button,
#deliverySection .remove-delivery-item {
  background: #fff0ee;
  color: #b42318;
  border-color: #f5c7c2;
}

#deliverySection .delivery-remove-button:hover,
#deliverySection .remove-delivery-item:hover {
  background: #ffe0dc;
}

/* ช่องหมายเหตุและช่องกรอกข้อมูล */
#deliverySection textarea,
#deliverySection input,
#deliverySection select {
  font: inherit;
  box-sizing: border-box;
  border: 1px solid #cbd7cc;
  border-radius: 10px;
  padding: 12px 14px;
  background: #ffffff;
  color: #123d2e;
}

#deliverySection textarea {
  display: block;
  width: 100%;
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
  margin-top: 8px;
}

/* ระยะห่างระหว่างป้ายชื่อกับช่องกรอก */
#deliverySection label {
  line-height: 1.6;
}

/* ปุ่มเมื่อใช้คีย์บอร์ด */
#deliverySection button:focus-visible,
#deliverySection input:focus-visible,
#deliverySection select:focus-visible,
#deliverySection textarea:focus-visible {
  outline: 3px solid #b5d8c2;
  outline-offset: 2px;
}

/* ปุ่มในหน้าจอขนาดเล็ก */
@media (max-width: 650px) {
  #deliverySection .user-form-actions {
    flex-wrap: wrap;
  }

  #deliverySection textarea {
    width: 100%;
  }
}

/* MONÉ V3 — Accounting journal delete button */
#accountingSection .accounting-delete-row {
  background: #fff0ee;
  color: #b42318;
  border: 1px solid #f5c7c2;
  border-radius: 9px;
  padding: 10px 16px;
  min-width: 58px;
}

#accountingSection .accounting-delete-row:hover {
  background: #ffe0dc;
  color: #912018;
}

/* MONÉ V3 — Accounting Journal Table Layout */

#accountingSection #accountingJournalPanel .mone-store-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

/* กำหนดความกว้างแต่ละคอลัมน์ */
#accountingJournalPanel th:nth-child(1) {
  width: 17%;
}

#accountingJournalPanel th:nth-child(2) {
  width: 31%;
}

#accountingJournalPanel th:nth-child(3),
#accountingJournalPanel th:nth-child(4) {
  width: 20%;
}

#accountingJournalPanel th:nth-child(5) {
  width: 12%;
}

/* จัดช่องกรอกให้อยู่ในขอบเขตตาราง */
#accountingJournalPanel td {
  padding: 10px 8px;
  vertical-align: middle;
}

#accountingJournalPanel td input {
  display: block;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid #d4dfd8;
  border-radius: 9px;
  font: inherit;
  background: #fff;
}

/* จัดปุ่มลบให้อยู่ตรงกลาง */
#accountingJournalPanel td:last-child {
  text-align: center;
}

/* รองรับหน้าจอขนาดเล็ก */
#accountingJournalPanel .mone-store-table-wrap {
  overflow-x: auto;
}

#accountingJournalPanel .mone-store-table {
  min-width: 720px;
}

/* MONÉ V3 — PEAK-style journal remove button */
#accountingSection .accounting-delete-row {
  background: transparent;
  color: #a4a8b2;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  min-width: 0;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  box-shadow: none;
}

#accountingSection .accounting-delete-row:hover:not(:disabled) {
  background: #f5f5f7;
  color: #c0392b;
  transform: none;
}

/* MONÉ V3 — Accounting Account Autocomplete */

.accounting-account-search {
  position: relative;
  width: 100%;
}

.accounting-account-search > input {
  width: 100%;
  box-sizing: border-box;
}

.accounting-account-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: max(280px, 100%);
  max-width: 380px;
  max-height: 240px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #d8dee8;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  padding: 5px;
}

.accounting-account-suggestions[hidden] {
  display: none !important;
}

.accounting-account-option {
  display: block;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  border: none;
  border-radius: 6px;
  background: #ffffff;
  color: #253247;
  font-size: 13px;
  cursor: pointer;
  white-space: normal;
  overflow-wrap: anywhere;
}

.accounting-account-option:hover,
.accounting-account-option:focus {
  background: #edf4ff;
  color: #174ea6;
}

/* MONÉ V3 — ให้รายการค้นหาบัญชีลอยพ้นตาราง */

#accountingJournalPanel .mone-store-table-wrap {
  overflow: visible;
}

#accountingJournalPanel .mone-store-table {
  position: relative;
}

#accountingJournalPanel .accounting-account-search {
  position: relative;
  z-index: 10;
}

#accountingJournalPanel .accounting-account-suggestions {
  z-index: 1000;
}

/* MONÉ V3 — ให้แถวที่กำลังค้นหาบัญชีอยู่ด้านบน */

#accountingJournalPanel tbody tr {
  position: relative;
  z-index: 1;
}

#accountingJournalPanel tbody tr:focus-within {
  z-index: 100;
}

#accountingJournalPanel .accounting-account-search:focus-within {
  z-index: 101;
}

#moneSalesSection[hidden]{display:none!important}.ms-card{background:white;padding:24px;border:1px solid #dce7df;border-radius:14px}.ms-card h2{margin:0 0 8px;color:#184d3b}.ms-card p{line-height:1.6}.ms-filters{display:flex;flex-wrap:wrap;align-items:end;gap:14px;margin:20px 0}.ms-filters label{flex:1;min-width:180px}.ms-filters input,.ms-filters select{width:100%;height:44px;border:1px solid #cbd8ce;border-radius:8px;padding:8px;background:white}.ms-card button{background:#184d3b;color:white;border:0;border-radius:8px;padding:12px 18px;cursor:pointer}.ms-card button:disabled{opacity:.45;cursor:not-allowed}.ms-scroll{overflow-x:auto}.ms-table{width:100%;border-collapse:collapse;min-width:650px}.ms-table th,.ms-table td{padding:12px;border-bottom:1px solid #e5e9e5;text-align:left}.ms-table th{background:#edf5f0}.ms-table input{width:110px;height:40px;padding:8px}.ms-summary{font-weight:700;margin:22px 0;line-height:1.8}#msMessage{min-height:24px}


/* MONÉ V3 — Stores table without horizontal scrolling */
#storesSection .mone-store-table-wrap {
  width: 100%;
  overflow-x: hidden;
}

#storesSection .mone-store-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

#storesSection .mone-store-table th,
#storesSection .mone-store-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  padding: 10px 6px;
  font-size: 12px;
  vertical-align: middle;
}

#storesSection .mone-store-table th:nth-child(1) { width: 7%; }
#storesSection .mone-store-table th:nth-child(2) { width: 11%; }
#storesSection .mone-store-table th:nth-child(3) { width: 15%; }
#storesSection .mone-store-table th:nth-child(4) { width: 9%; }
#storesSection .mone-store-table th:nth-child(5) { width: 9%; }
#storesSection .mone-store-table th:nth-child(6) { width: 10%; }
#storesSection .mone-store-table th:nth-child(7) { width: 9%; }
#storesSection .mone-store-table th:nth-child(8) { width: 9%; }
#storesSection .mone-store-table th:nth-child(9) { width: 6%; }
#storesSection .mone-store-table th:nth-child(10) { width: 15%; }

#storesSection .mone-store-table button {
  max-width: 100%;
  padding: 7px 5px;
  font-size: 12px;
}

@media (max-width: 1100px) {
  #storesSection .mone-store-table th:nth-child(3),
  #storesSection .mone-store-table td:nth-child(3),
  #storesSection .mone-store-table th:nth-child(6),
  #storesSection .mone-store-table td:nth-child(6) {
    display: none;
  }
}


/* MONÉ V3 — Consignment reports */
#moneReportsSection[hidden],.mr-filters label[hidden],#mrResult[hidden]{display:none!important}
.mr-section{margin-top:0}.mr-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin:24px 0}
.mr-choice{min-height:66px;padding:16px 18px;border:2px solid #d6e2d8;border-radius:11px;background:#f7faf7;color:#174b35;font:inherit;font-weight:700;cursor:pointer;text-align:center}
.mr-choice:hover{border-color:#174b35}.mr-choice.mr-active{background:#174b35;color:#fff;border-color:#174b35;box-shadow:0 4px 12px #174b3526}
.mr-filters{display:flex;flex-wrap:wrap;align-items:end;gap:15px;margin:16px 0 24px}.mr-filters label{flex:1;min-width:180px;margin:0;display:flex;flex-direction:column;gap:9px}
.mr-filters select,.mr-filters input{height:48px;width:100%;padding:10px;border:1px solid #cbd7cc;border-radius:8px;background:white;font:inherit}
#mrRun{min-height:48px;padding:11px 24px;background:#174b35;color:#fff;border:0;border-radius:8px;font:inherit;font-weight:700;cursor:pointer}#mrRun:disabled{opacity:.55;cursor:wait}
#mrMessage{min-height:22px}.mr-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;margin:20px 0}
.mr-stat{padding:18px;background:#f4f8f4;border:1px solid #e0e9e1;border-radius:10px;display:flex;flex-direction:column;gap:10px}.mr-stat span{font-size:12px;color:#62776b}.mr-stat strong{font-size:19px;color:#174b35}
.mr-table-wrap{overflow-x:auto;margin:15px 0 25px}.mr-table{width:100%;border-collapse:collapse;min-width:650px}.mr-table th,.mr-table td{text-align:left;padding:12px;border-bottom:1px solid #e2e9e3}.mr-table th{background:#edf5f0;color:#174b35;white-space:nowrap}
.mr-note{font-size:12px;line-height:1.6;color:#77877d!important;margin-top:22px}
@media(max-width:650px){.mr-choices{grid-template-columns:1fr;gap:12px}.mr-filters{flex-direction:column;align-items:stretch}.mr-filters label{width:100%}}

/* GRAVION COMPANY — Login Brand */
.brand-panel h1 {
  font-size: clamp(38px, 5vw, 76px);
  letter-spacing: -2px;
  line-height: 1.1;
}

/* GRAVION — Consignment reports: screen layout */
@media screen and (min-width: 1000px) {
  #moneReportsSection .mr-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: visible;
  }

  #moneReportsSection .mr-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    font-size: 12px;
  }

  #moneReportsSection .mr-table th,
  #moneReportsSection .mr-table td {
    padding: 8px 5px;
    white-space: normal;
    overflow-wrap: anywhere;
    vertical-align: top;
    line-height: 1.45;
  }

  #moneReportsSection .mr-table th {
    font-size: 11px;
  }
}

/* GRAVION — Report printing */
.mr-print-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}

.mr-print-controls[hidden] {
  display: none !important;
}

.mr-print-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media print {
  /* ใช้เฉพาะตอนสั่งพิมพ์รายงาน */
  body:is(.mr-print-portrait, .mr-print-landscape) * {
    visibility: hidden !important;
  }

  body:is(.mr-print-portrait, .mr-print-landscape)
  #deliveryPrintArea,
  body:is(.mr-print-portrait, .mr-print-landscape)
  #deliveryPrintArea * {
    visibility: hidden !important;
  }

  body:is(.mr-print-portrait, .mr-print-landscape)
  #moneReportsSection,
  body:is(.mr-print-portrait, .mr-print-landscape)
  #moneReportsSection #mrResult,
  body:is(.mr-print-portrait, .mr-print-landscape)
  #moneReportsSection #mrResult * {
    visibility: visible !important;
  }

  body:is(.mr-print-portrait, .mr-print-landscape)
  #moneReportsSection {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: white !important;
  }

  body:is(.mr-print-portrait, .mr-print-landscape)
  #moneReportsSection > :not(#mrResult) {
    display: none !important;
  }

  body:is(.mr-print-portrait, .mr-print-landscape)
  #mrResult {
    display: block !important;
    width: 100% !important;
  }

  body:is(.mr-print-portrait, .mr-print-landscape)
  .mr-table-wrap {
    overflow: visible !important;
  }

  body:is(.mr-print-portrait, .mr-print-landscape)
  .mr-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    font-size: 9px !important;
  }

  body:is(.mr-print-portrait, .mr-print-landscape)
  .mr-table th,
  body:is(.mr-print-portrait, .mr-print-landscape)
  .mr-table td {
    padding: 5px 3px !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  body:is(.mr-print-portrait, .mr-print-landscape)
  .mr-table thead {
    display: table-header-group !important;
  }

  body:is(.mr-print-portrait, .mr-print-landscape)
  .mr-table tr {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
}

/* GRAVION — A4 print orientation */

/* GRAVION — Report paper orientation */

@page {
  size: A4 portrait;
  margin: 12mm;
}

@page mr-landscape {
  size: A4 landscape;
  margin: 12mm;
}

@media print {
  body.mr-print-landscape #moneReportsSection {
    page: mr-landscape;
  }

  body.mr-print-landscape #mrResult {
    page: mr-landscape;
  }
}

/* GRAVION — Action buttons: keep both visible within the allocated column */
#storesSection .mone-store-table td:last-child,
#productsSection .mone-store-table td:last-child {
  white-space: nowrap;
}
#storesSection .mone-store-table td:last-child button,
#productsSection .mone-store-table td:last-child button {
  display: inline-block;
  vertical-align: middle;
  width: auto;
  min-width: 54px;
  max-width: none;
  padding: 8px 9px;
  margin-right: 4px;
}

/* GRAVION — store consignment report only */
.gravion-store-report{max-width:210mm;margin:18px auto;padding:14mm 12mm;background:#fff;color:#111;font:13px/1.65 Arial,"Noto Sans Thai",sans-serif;border:1px solid #ddd}
.gsr-header{text-align:center}.gsr-header h2{font-size:22px;margin:0;color:#111}.gsr-header h3{font-size:15px;margin:7px 0 0;color:#111}.gsr-meta{text-align:right;margin:20px 0 14px}.gsr-store{margin:12px 0 18px}.gsr-table{width:100%;border-collapse:collapse;table-layout:fixed}.gsr-table th,.gsr-table td{border:1px solid #444;padding:6px 8px;vertical-align:top;overflow-wrap:anywhere}.gsr-table th:nth-child(1){width:18%}.gsr-table th:nth-child(2){width:49%}.gsr-table th:nth-child(3){width:13%}.gsr-table th:nth-child(4){width:20%}.gsr-table th{text-align:center;background:#f1f1f1}.gsr-table .mr-num{text-align:right}.gsr-note{font-size:11px;color:#555!important}
@media print{.gravion-store-report{border:0;margin:0;padding:0;max-width:none}.gsr-table tr{break-inside:avoid}}

/* GRAVION — store consignment report v3: scoped to report only */
#mrResult .gsr-table .gsr-emphasis td { font-weight: 700; background: #f8faf8; }
#mrResult .gsr-table td:nth-child(2) { white-space: pre-wrap; }

/* MONÉ V3 — Print Report Button */
button[onclick*="print"],
button[onclick*="Print"] {
  background: #174b37;
  color: #ffffff;
  border: 1px solid #174b37;
  border-radius: 10px;
  padding: 11px 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

button[onclick*="print"]:hover,
button[onclick*="Print"]:hover {
  background: #236b4d;
  transform: translateY(-1px);
}

button[onclick*="print"]:active,
button[onclick*="Print"]:active {
  transform: translateY(0);
}

/* MONÉ V3 — ปุ่มพิมพ์รายงาน */

#mrPrintButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  min-height: 44px;
  padding: 11px 22px;

  background: #174b37;
  color: #ffffff;
  border: 1px solid #174b37;
  border-radius: 10px;

  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;

  cursor: pointer;
  transition: background 0.2s ease,
              box-shadow 0.2s ease,
              transform 0.2s ease;
}

#mrPrintButton:hover {
  background: #236b4d;
  border-color: #236b4d;
  box-shadow: 0 4px 12px rgba(23, 75, 55, 0.16);
  transform: translateY(-1px);
}

#mrPrintButton:active {
  transform: translateY(0);
  box-shadow: none;
}

#mrPrintButton:focus-visible {
  outline: 3px solid #a6d5ba;
  outline-offset: 3px;
}

#mrPrintButton:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* MONÉ V3 — Print Controls Layout */

@media screen {
  #mrPrintControls {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 14px;
    margin: 20px 0 24px;
  }

  #mrPrintControls[hidden] {
    display: none !important;
  }

  #mrPrintControls label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #34483e;
  }

  #mrPrintOrientation {
    min-width: 190px;
    min-height: 44px;
    padding: 10px 38px 10px 14px;
    border: 1px solid #d5e0d9;
    border-radius: 10px;
    background-color: #ffffff;
    color: #243c30;
    font: inherit;
    cursor: pointer;
  }

  #mrPrintOrientation:focus {
    outline: 2px solid #8dbba1;
    outline-offset: 2px;
  }

  #mrPrintButton {
    min-height: 44px;
    margin: 0;
  }

  @media (max-width: 480px) {
    #mrPrintControls {
      align-items: stretch;
      flex-direction: column;
    }

    #mrPrintControls label,
    #mrPrintOrientation,
    #mrPrintButton {
      width: 100%;
    }
  }
}

/* MONÉ V3 — Dashboard Chart Layout Fix */

#overviewSection .mone-dashboard-grid .mone-panel:first-child
.mone-chart-placeholder {
  height: auto !important;
  max-height: none !important;
  overflow-y: visible !important;
}

#overviewSection .mone-dashboard-grid .mone-panel:first-child {
  overflow-y: visible !important;
}

/* MONÉ V3 — เส้นตารางรายงานการฝากขายบน iPad และ PDF */
@media print {
  #moneReportsSection .gsr-table {
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    border: 1px solid #000 !important;
  }

  #moneReportsSection .gsr-table th,
  #moneReportsSection .gsr-table td {
    border: 1px solid #000 !important;
    box-shadow: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* MONÉ V3 — ป้องกันตารางรายงานการฝากขายถูกตัดขอบ */
#mrResult .gravion-store-report {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

#mrResult .gsr-table {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border-top: 1px solid #222 !important;
  border-left: 1px solid #222 !important;
}

#mrResult .gsr-table th,
#mrResult .gsr-table td {
  box-sizing: border-box !important;
  border: 0 !important;
  border-right: 1px solid #222 !important;
  border-bottom: 1px solid #222 !important;
  overflow-wrap: anywhere !important;
}

@media print {
  #mrResult,
  #mrResult .gravion-store-report,
  #mrResult .gsr-table {
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
  }

  #mrResult .gsr-table th,
  #mrResult .gsr-table td {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* MONÉ V3 — เพิ่มความหนาเส้นขอบขวาสุดของตาราง */
#mrResult .gsr-table th:last-child,
#mrResult .gsr-table td:last-child {
  border-right: 2px solid #222 !important;
}

@media print {
  #mrResult .gsr-table th:last-child,
  #mrResult .gsr-table td:last-child {
    border-right: 2px solid #222 !important;
  }
}

/* MONÉ V3 — เส้นปิดขอบขวาตารางรายงาน */
#mrResult .gravion-store-report .gsr-table {
  position: relative !important;
  border-right: 0 !important;
  box-shadow: inset -2px 0 0 #222 !important;
}

@media print {
  #mrResult .gravion-store-report .gsr-table {
    box-shadow: inset -2px 0 0 #222 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}