:root {
  /* Theme Colors Default */
  --w3-theme: #2196f3;
  --w3-theme-text: #fff;
  --w3-theme-light: #f1f1f1;
  --w3-theme-light-text: #000;
  --w3-theme-dark: #074b83;
  --w3-theme-dark-text: #fff;
  --w3-text-theme: #074b83;
  --w3-text2-theme: #ff8900;

  /* App Shell Colors */
  --app-bg: #f0f2f5;
  --app-text: #333;
  --card-bg: #ffffff;
  --border-color: rgba(0, 0, 0, 0.1);
  --input-bg: #ffffff;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.3);

  /* Alert / Panel background tokens */
  --alert-info-bg: #e8f4fd;
  --alert-info-text: #0d47a1;
  --alert-info-border: #90caf9;
  --alert-success-bg: #e8f5e9;
  --alert-success-text: #1b5e20;
  --alert-success-border: #a5d6a7;
  --alert-warning-bg: #fffde7;
  --alert-warning-text: #f57f17;
  --alert-warning-border: #fff59d;
  --alert-danger-bg: #ffebee;
  --alert-danger-text: #b71c1c;
  --alert-danger-border: #ef9a9a;

  /* Export Action Cards */
  --export-card-excel-bg: #F1F8E9;
  --export-card-excel-border: #C8E6C9;
  --export-card-excel-text: #1B5E20;
  --export-card-pdf-bg: #FFEBEE;
  --export-card-pdf-border: #FFCDD2;
  --export-card-pdf-text: #B71C1C;
  --export-card-qr-bg: #F3E5F5;
  --export-card-qr-border: #E1BEE7;
  --export-card-qr-text: #4A148C;
  --export-card-cloud-bg: #FFF3E0;
  --export-card-cloud-border: #FFE0B2;
  --export-card-cloud-text: #BF360C;
}

[data-theme='dark'] {
  --app-bg: #121212;
  --app-text: #e0e0e0;
  --card-bg: #1e1e1e;
  --border-color: rgba(255, 255, 255, 0.12);
  --input-bg: #2d2d2d;
  --shadow-color: rgba(0, 0, 0, 0.4);
  --glass-bg: rgba(40, 40, 40, 0.85);
  --glass-border: rgba(255, 255, 255, 0.08);

  /* Ghi đè màu text theme trong chế độ tối để dễ nhìn hơn */
  --w3-theme-light: #2d2d2d;
  --w3-theme-light-text: #e0e0e0;

  /* Alert / Panel tokens for Dark Mode */
  --alert-info-bg: #0d273d;
  --alert-info-text: #90caf9;
  --alert-info-border: #1565c0;
  --alert-success-bg: #102d18;
  --alert-success-text: #a5d6a7;
  --alert-success-border: #2e7d32;
  --alert-warning-bg: #332b00;
  --alert-warning-text: #fff59d;
  --alert-warning-border: #fbc02d;
  --alert-danger-bg: #371414;
  --alert-danger-text: #ef9a9a;
  --alert-danger-border: #c62828;

  /* Export Action Cards Dark Mode */
  --export-card-excel-bg: #142e18;
  --export-card-excel-border: #2e7d32;
  --export-card-excel-text: #a5d6a7;
  --export-card-pdf-bg: #371414;
  --export-card-pdf-border: #c62828;
  --export-card-pdf-text: #ef9a9a;
  --export-card-qr-bg: #291238;
  --export-card-qr-border: #7b1fa2;
  --export-card-qr-text: #ce93d8;
  --export-card-cloud-bg: #381f08;
  --export-card-cloud-border: #e65100;
  --export-card-cloud-text: #ffcc80;
}

/* Thích ứng alert/panel trong Dark Mode */
[data-theme='dark'] .w3-pale-blue {
  background-color: var(--alert-info-bg) !important;
  color: var(--alert-info-text) !important;
  border-color: var(--alert-info-border) !important;
}

[data-theme='dark'] .w3-pale-green {
  background-color: var(--alert-success-bg) !important;
  color: var(--alert-success-text) !important;
  border-color: var(--alert-success-border) !important;
}

[data-theme='dark'] .w3-pale-yellow {
  background-color: var(--alert-warning-bg) !important;
  color: var(--alert-warning-text) !important;
  border-color: var(--alert-warning-border) !important;
}

[data-theme='dark'] .w3-pale-red {
  background-color: var(--alert-danger-bg) !important;
  color: var(--alert-danger-text) !important;
  border-color: var(--alert-danger-border) !important;
}

[data-theme='dark'] table th,
[data-theme='dark'] table td {
  border-color: var(--border-color) !important;
}

[data-theme='dark'] .swal2-popup {
  background: var(--card-bg) !important;
  color: var(--app-text) !important;
}


/* Ghi đè class W3-CSS để dùng biến */
.w3-theme {
  background-color: var(--w3-theme) !important;
  color: var(--w3-theme-text) !important;
}

.w3-theme-light {
  background-color: var(--w3-theme-light) !important;
  color: var(--w3-theme-light-text) !important;
}

.w3-theme-dark {
  background-color: var(--w3-theme-dark) !important;
  color: var(--w3-theme-dark-text) !important;
}

.w3-text-theme {
  color: var(--w3-text-theme) !important;
}

.w3-text2-theme {
  color: var(--w3-text2-theme) !important;
}

.w3-border-theme {
  border-color: var(--w3-theme) !important;
}

.w3-hover-theme:hover {
  background-color: var(--w3-theme) !important;
  color: var(--w3-theme-text) !important;
}

body {
  background-color: var(--app-bg);
  color: var(--app-text);
  font-family: 'Saira Condensed', Geneva, Verdana, sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Cập nhật background cho Card và Modal */
.w3-card,
.w3-card-2,
.w3-card-4,
.w3-modal-content {
  background-color: var(--card-bg);
  color: var(--app-text) !important;
  box-shadow: 0 2px 5px var(--shadow-color) !important;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Cập nhật background cho Input và Select */
.w3-input,
.w3-select {
  background-color: var(--input-bg);
  color: var(--app-text);
  border-bottom: 1px solid var(--border-color) !important;
  transition: background-color 0.3s ease, color 0.3s ease;

}

/* Điều chỉnh màu nền sidebar và dialog swal */
.w3-sidebar,
.swal2-popup {
  background-color: var(--card-bg) !important;
  color: var(--app-text) !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  /* background: linear-gradient(#29b6f6, #fff ); */
  /* background-size: 200% 200%; */
  /* animation: gradient 15s ease infinite; */
  /* background-attachment: fixed; */

  /* background-repeat: no-repeat; */
  /* background-image: url(../imgs/hoadao-left.png), */
  /* url(../imgs/hoamai-right.png); */
  /* background-position: 0 56px, 100% 56px; */
  font-family: 'Saira Condensed', Geneva, Verdana, sans-serif;
}

/* thu nho thung chua */
.container {
  max-width: 900px;
  margin: 0 auto;
}

/* diem ngat tuy chinh chieu rong lon hon*/
@media only screen and (min-width: 901px) {}

/* diem ngat tuy chinh chieu rong nho hon*/
@media only screen and (max-width: 1200px) {

  /*sua loi dropdown-content man hinh lon*/
  .w3-dropdown-content {
    right: 0;
  }
}

/* khi chieu cao lon hon 800 */
@media only screen and (min-height:901px) {

  /* co dinh chan trang */
  .ht-fix-large {
    bottom: 0;
    position: fixed;
    width: 100%;
    z-index: 1;
  }
}

/* xoa gach duoi link */
a {
  text-decoration: none;
}

/* icon */
.material-icons {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
}

.icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
  vertical-align: middle;
}

/* khai bao ca nhan */
/* bo goc */
.ht-bottom-radius {
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}

/*kich thuoc icon svg*/
.ht-icon-em {
  width: 1em;
  height: 1em;
}

.ht-icon-tiny {
  width: 16px;
  height: 16px;
}

.ht-icon-small {
  width: 20px;
  height: 20px;
}

.ht-icon-medium {
  width: 24px;
  height: 24px;
}

.ht-icon-large {
  width: 32px;
  height: 32px;
}

.ht-icon-xlarge {
  width: 48px;
  height: 48px;
}

.ht-icon-xxlarge {
  width: 64px;
  height: 64px;
}

.ht-icon-xxxlarge {
  width: 96px;
  height: 96px;
}

.ht-icon-jumbo {
  width: 128px;
  height: 128px;
}

.nav-user-background {
  background-image: url("../imgs/background.jpg");
  background-size: 470px 200px;
}

#layout,
#banner {
  max-width: 600px;
  margin: auto;
  min-height: 180px;
}

#layout a {
  box-sizing: border-box;
  display: block;
  height: 120px;
  padding: 110px 12px 20px;
  position: relative;
  text-decoration: none;
  font-weight: 600;
  background-repeat: no-repeat;
  background-size: 5rem;
  background-position: center;
}

/* SIDEBAR & NAV USER */
#mySidebar {
  border: none !important;
  border-radius: 0 20px 20px 0;
  box-shadow: 5px 0 25px rgba(0, 0, 0, 0.1) !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  max-width: 85vw !important;
}

#mySidebar,
#mySidebar *,
#mySidebar *::before,
#mySidebar *::after {
  box-sizing: border-box !important;
}

.nav-user-background {
  background: linear-gradient(135deg, var(--w3-theme-dark), var(--w3-theme)) !important;
  /* Gradient thay cho màu phẳng */
  padding: 24px 14px !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Xóa bỏ text-shadow đen dày ở tiêu đề cũ */
.w3-xxlarge,
.nav-user-background div {
  text-shadow: none !important;
  letter-spacing: 0.5px;
}

.ht-icon-xxxlarge {
  border: 3px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* BANNER LỊCH */
#banner {
  border: none !important;
  border-radius: 16px !important;
  background: var(--card-bg) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
  margin-top: 15px !important;
}

#banner .w3-jumbo,
#banner .w3-xxlarge {
  text-shadow: none !important;
  font-weight: 700 !important;
  color: var(--w3-text-theme) !important;
}

.w3-col.s12.w3-text-theme {
  background-color: var(--card-bg);
  border-radius: 0 0 16px 16px;
  font-style: italic;
  color: var(--app-text) !important;
}

/* HỆ THỐNG ICON (LAYOUT) */
/* #layout .w3-row {
  margin-bottom: 10px;
} */

#layout .w3-col {
  padding: 6px !important;
  /* Tạo khoảng cách giữa các ô */
}

#layout a {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  /* Đẩy chữ xuống dưới */
  background-color: var(--card-bg) !important;
  border-radius: 16px !important;
  height: 110px;
  /* padding-bottom: 12px !important; */
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.04);
  text-decoration: none;
  color: var(--app-text) !important;
  font-weight: 600;
  font-size: 14px !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  /* Xử lý icon của bạn */
  background-repeat: no-repeat !important;
  background-position: center 15px !important;
  /* background-size: 45px !important; */
}

/* Hiệu ứng khi bấm cho cảm giác app thật */
#layout a:active {
  transform: scale(0.92);
  background-color: var(--glass-bg) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* CHỈNH SỬA CÁC NÚT TRONG SIDEBAR */
#mySidebar .w3-bar-item {
  width: calc(100% - 16px) !important;
  max-width: calc(100% - 16px) !important;
  margin: 4px 8px !important;
  padding: 10px 14px !important;
  border-radius: 10px;
  font-size: 15px !important;
  color: var(--app-text) !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center;
  word-break: break-word;
  white-space: normal;
  overflow: hidden;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

#mySidebar .w3-bar-item .material-icons {
  flex-shrink: 0;
  font-size: 22px;
}

#mySidebar .w3-opacity {
  width: calc(100% - 16px) !important;
  max-width: calc(100% - 16px) !important;
  margin: 14px 8px 4px 8px !important;
  padding: 4px 10px !important;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1px;
  background: transparent !important;
  display: block !important;
  box-sizing: border-box !important;
  opacity: 0.75;
}

/* CỬA SỔ MÁY TÍNH NỔI (FLOATING CALCULATOR WINDOW) */
#floating-calculator {
  position: fixed;
  z-index: 10005;
  width: 330px;
  max-width: calc(100vw - 16px);
  background: var(--card-bg, #ffffff);
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28), 0 0 0 1px var(--border-color, rgba(0, 0, 0, 0.08));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  font-family: inherit;
  transition: transform 0.2s ease, width 0.25s ease, height 0.25s ease, border-radius 0.2s ease;
}

/* Thanh tiêu đề có thể kéo thả */
.calc-window-header {
  height: 44px;
  background: var(--w3-theme, #2196f3);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 12px;
  user-select: none;
  cursor: move;
  touch-action: none;
  flex-shrink: 0;
}

.calc-window-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  pointer-events: none;
}

.calc-window-title .material-icons {
  font-size: 20px;
}

.calc-window-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.calc-action-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.15s ease;
}

.calc-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.calc-action-btn:active {
  background: rgba(255, 255, 255, 0.3);
}

.calc-action-btn.calc-close-btn:hover {
  background: #f44336;
}

.calc-action-btn .material-icons {
  font-size: 19px;
  pointer-events: none;
}

/* Nội dung bên trong máy tính */
.calc-window-body {
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 8px;
  flex: 1;
  background: var(--card-bg, #ffffff);
  box-sizing: border-box;
}

/* Màn hình hiển thị số */
.calc-screen {
  background: var(--input-bg, rgba(0, 0, 0, 0.04));
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.06));
  border-radius: 14px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 90px;
  box-sizing: border-box;
}

.calc-screen-sub {
  font-size: 13px;
  color: #888888;
  text-align: right;
  min-height: 18px;
  word-break: break-all;
}

.calc-screen-main-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
}

.calc-copy-btn {
  display: none;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--w3-theme, #2196f3);
  background: rgba(33, 150, 243, 0.12);
  border: none;
  border-radius: 6px;
  padding: 3px 6px;
  cursor: pointer;
  flex-shrink: 0;
}

.calc-screen-main {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--app-text, #222222);
  text-align: right;
  line-height: 1.1;
  word-break: break-all;
  flex: 1;
}

/* Bàn phím máy tính 4 cột */
.calc-keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  flex: 1;
}

.calc-key {
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.05));
  background: var(--card-bg, #ffffff);
  color: var(--app-text, #222222);
  font-size: 19px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.08s ease, background-color 0.15s ease, filter 0.15s ease;
  outline: none;
}

.calc-key:active {
  transform: scale(0.94);
  filter: brightness(0.92);
}

.calc-key-op {
  background: var(--w3-theme, #2196f3) !important;
  color: #ffffff !important;
  font-size: 21px;
  font-weight: 700;
  border: none !important;
}

.calc-key-equal {
  background: linear-gradient(135deg, #ff9800, #f57c00) !important;
  color: #ffffff !important;
  font-size: 24px;
  font-weight: 800;
  border: none !important;
  box-shadow: 0 2px 8px rgba(245, 124, 0, 0.35);
}

.calc-key-ac {
  background: rgba(244, 67, 54, 0.12) !important;
  color: #d32f2f !important;
  font-weight: 800;
  font-size: 16px;
  border: none !important;
}

.calc-key-del {
  background: rgba(255, 152, 0, 0.12) !important;
  color: #e65100 !important;
  border: none !important;
}

.calc-key-fn {
  background: var(--input-bg, rgba(0, 0, 0, 0.05)) !important;
  color: var(--app-text, #444444);
  border: none !important;
}

/* Ngăn kéo lịch sử trong máy tính */
.calc-history-drawer {
  position: absolute;
  top: 44px;
  left: 0;
  width: 100%;
  height: calc(100% - 44px);
  background: var(--card-bg, #ffffff);
  z-index: 10;
  display: none;
  flex-direction: column;
  box-sizing: border-box;
}

.calc-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
  font-weight: 700;
  font-size: 14px;
  color: var(--app-text, #222222);
}

.calc-history-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
}

/* Trạng thái thu nhỏ (Minimized) */
#floating-calculator.calc-minimized {
  height: 44px !important;
  width: 260px !important;
  border-radius: 22px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
}

#floating-calculator.calc-minimized .calc-window-body,
#floating-calculator.calc-minimized .calc-history-drawer {
  display: none !important;
}

/* Trạng thái phóng to toàn màn hình (Maximized) */
#floating-calculator.calc-maximized {
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  border-radius: 0 !important;
}

#floating-calculator.calc-maximized .calc-window-header {
  height: 52px;
  padding: 0 16px;
  cursor: default;
}

#floating-calculator.calc-maximized .calc-screen {
  min-height: 130px;
}

#floating-calculator.calc-maximized .calc-screen-main {
  font-size: 3.2rem;
}

#floating-calculator.calc-maximized .calc-key {
  height: 56px;
  font-size: 22px;
}

/* hieu ung  */
@-webkit-keyframes slideInRight {
  from {
    -webkit-transform: translate3d(100%, 0, 0);
    transform: translate3d(100%, 0, 0);
    visibility: visible;
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}

@keyframes slideInRight {
  from {
    -webkit-transform: translate3d(100%, 0, 0);
    transform: translate3d(100%, 0, 0);
    visibility: visible;
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}

.slideIn {
  -webkit-animation-name: slideInRight;
  animation-name: slideInRight;
  animation-duration: 0.3s;
  position: fixed;
  width: 100%;
  height: 100%;
  z-index: 999;
}

@-webkit-keyframes backOutRight {
  0% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 1;
  }

  20% {
    -webkit-transform: translateX(0px) scale(0.7);
    transform: translateX(0px) scale(0.7);
    opacity: 0.7;
  }

  100% {
    -webkit-transform: translateX(2000px) scale(0.7);
    transform: translateX(2000px) scale(0.7);
    opacity: 0.7;
  }
}

@keyframes backOutRight {
  0% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 1;
  }

  20% {
    -webkit-transform: translateX(0px) scale(0.7);
    transform: translateX(0px) scale(0.7);
    opacity: 0.7;
  }

  100% {
    -webkit-transform: translateX(2000px) scale(0.7);
    transform: translateX(2000px) scale(0.7);
    opacity: 0.7;
  }
}

.slideOut {
  -webkit-animation-name: backOutRight;
  animation-name: backOutRight;
  animation-duration: 0.3s;
  position: fixed;
  width: 100%;
  height: 100%;
  z-index: 998;

}

@-webkit-keyframes zoomIn {
  from {
    opacity: 0;
    -webkit-transform: scale3d(0.3, 0.3, 0.3);
    transform: scale3d(0.3, 0.3, 0.3);
  }

  50% {
    opacity: 1;
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    -webkit-transform: scale3d(0.3, 0.3, 0.3);
    transform: scale3d(0.3, 0.3, 0.3);
  }

  50% {
    opacity: 1;
  }
}

.slideHome {
  -webkit-animation-name: zoomIn;
  animation-name: zoomIn;
  animation-duration: 0.3s;
  background-color: var(--app-bg);
}

/* Xử lý các màu nền cố định trong Dark Mode */
[data-theme='dark'] .w3-white,
[data-theme='dark'] .w3-light-grey,
[data-theme='dark'] .w3-light-gray {
  background-color: var(--card-bg) !important;
  color: var(--app-text) !important;
}

@-webkit-keyframes shakeX {

  from,
  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    -webkit-transform: translate3d(-10px, 0, 0);
    transform: translate3d(-10px, 0, 0);
  }

  20%,
  40%,
  60%,
  80% {
    -webkit-transform: translate3d(10px, 0, 0);
    transform: translate3d(10px, 0, 0);
  }
}

@keyframes shakeX {

  from,
  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    -webkit-transform: translate3d(-10px, 0, 0);
    transform: translate3d(-10px, 0, 0);
  }

  20%,
  40%,
  60%,
  80% {
    -webkit-transform: translate3d(10px, 0, 0);
    transform: translate3d(10px, 0, 0);
  }
}

.shakeX {
  -webkit-animation-name: shakeX;
  animation-name: shakeX;
  animation-duration: 0.7s;
}

.pulse {
  overflow: visible;
  position: relative
}

.pulse::before {
  content: '';
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-color: inherit;
  border-radius: inherit;
  -webkit-transition: opacity .3s, -webkit-transform .3s;
  transition: opacity .3s, -webkit-transform .3s;
  transition: opacity .3s, transform .3s;
  transition: opacity .3s, transform .3s, -webkit-transform .3s;
  -webkit-animation: pulse-animation 1s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  animation: pulse-animation 1s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  z-index: -1
}

@-webkit-keyframes pulse-animation {
  0% {
    opacity: 1;
    -webkit-transform: scale(1);
    transform: scale(1)
  }

  50% {
    opacity: 0;
    -webkit-transform: scale(1.5);
    transform: scale(1.5)
  }

  100% {
    opacity: 0;
    -webkit-transform: scale(1.5);
    transform: scale(1.5)
  }
}

@keyframes pulse-animation {
  0% {
    opacity: 1;
    -webkit-transform: scale(1);
    transform: scale(1)
  }

  50% {
    opacity: 0;
    -webkit-transform: scale(1.5);
    transform: scale(1.5)
  }

  100% {
    opacity: 0;
    -webkit-transform: scale(1.5);
    transform: scale(1.5)
  }
}

.lineThrough {
  text-decoration: line-through;
}

/*table responsive*/
@media only screen and (max-width: 900px) {
  table.responsive-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    display: block;
    position: relative
  }

  table.responsive-table td:empty:before {
    content: '\00a0'
  }

  table.responsive-table th,
  table.responsive-table td {
    margin: 5px 0;
    vertical-align: top
  }

  table.responsive-table th {
    text-align: left
  }

  table.responsive-table thead {
    display: block;
    float: left
  }

  table.responsive-table thead tr {
    display: block;
    padding: 0 10px 0 0
  }

  table.responsive-table thead tr th::before {
    content: "\00a0"
  }

  table.responsive-table tbody {
    display: block;
    width: auto;
    position: relative;
    overflow-x: auto;
    white-space: nowrap
  }

  table.responsive-table tbody tr {
    display: inline-block;
    vertical-align: top
  }

  table.responsive-table th {
    display: block;
    text-align: right
  }

  table.responsive-table td {
    display: block;
    min-height: 1.25em;
    text-align: left
  }

  table.responsive-table tr {
    border-bottom: none;
    padding: 0 10px
  }

  table.responsive-table thead {
    border: 0;
    border-right: 1px solid rgba(0, 0, 0, 0.12)
  }
}

/*table trong cac tab khong class*/
.w3-tab table.striped {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
  display: table;
}

.w3-tab table.striped tbody tr:nth-child(even) {
  background-color: var(--card-bg);
}

.w3-tab table.striped th:first-child,
.w3-tab table td:first-child {
  padding: 8px 8px;
  display: table-cell;
  text-align: left;
  vertical-align: top;
}

/*swal icon fix*/
.swal2-icon .swal2-icon-content i.material-icons {
  font-size: 3.75rem;
}

/*tooltip*/
/* Tooltip container */
.tooltip {
  position: relative;
  display: inline-block;
  /* border-bottom: 1px dotted blue; */
  /* color:indigo; */
}

.tooltip i.material-icons {
  font-size: 1rem;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 120px;
  background-color: black;
  color: #fff;
  text-align: center;
  padding: 5px 0;
  border-radius: 6px;

  bottom: 100%;
  left: 50%;
  margin-left: -60px;
  /* Use half of the width (120/2 = 60), to center the tooltip */

  /* Position the tooltip text - see examples below! */
  position: absolute;
  opacity: 0;
  transition: opacity 1s;
  z-index: 999;
  line-height: initial;
}

/* Show the tooltip text when you mouse over the tooltip container */
.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/*Bottom Arrow*/
.tooltip .tooltiptext::after {
  content: " ";
  position: absolute;
  top: 100%;
  /* At the bottom of the tooltip */
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: black transparent transparent transparent;
}

/*float button*/
.fixed-action-btn {
  position: fixed;
  right: 23px;
  bottom: 23px;
  padding-top: 15px;
  margin-bottom: 0;
  z-index: 997;
}

.btn-floating {
  display: inline-block;
  color: var(--w3-theme-dark-text);
  position: relative;
  overflow: hidden;
  z-index: 1;
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 50%;
  -webkit-transition: background-color .3s;
  transition: background-color .3s;
  cursor: pointer;
  vertical-align: middle;
}

/*hieu ung khi click nut float button */
.fixed-action-btn>.btn-floating>.material-icons {
  transition: transform 0.3s;
}

.fixed-action-btn:hover>.btn-floating>.material-icons {
  transform: rotate(135deg);
}

/*them icon cho input search*/
#inputFind {
  /* background-image: url('../imgs/searchicon.png'); */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'><path fill='currentColor' d='m19.6 21l-6.3-6.3q-.75.6-1.725.95T9.5 16q-2.725 0-4.612-1.888T3 9.5t1.888-4.612T9.5 3t4.613 1.888T16 9.5q0 1.1-.35 2.075T14.7 13.3l6.3 6.3zM9.5 14q1.875 0 3.188-1.312T14 9.5t-1.312-3.187T9.5 5T6.313 6.313T5 9.5t1.313 3.188T9.5 14'/></svg>");
  background-position: 10px 10px;
  background-repeat: no-repeat;
  padding: 12px 20px 12px 40px;
}

.title {
  text-transform: uppercase;
  font-weight: bold;
}

/*icon truoc input*/
.input-field {
  position: relative;
  margin-top: 1rem;
}

.input-field .prefix {
  position: absolute;
  width: 3rem;
  font-size: 2rem;
  -webkit-transition: color .2s;
  transition: color .2s;
}

.input-field:has(label) .prefix {
  top: 1.25rem;
}

.input-field label,
.input-field input,
.input-field span.help,
.input-field select {
  /* top: -1rem; */
  position: relative;
}

.input-field .prefix~label,
.input-field .prefix~input,
.input-field .prefix~span.help,
.input-field .prefix~select {
  margin-left: 3rem;
  width: calc(100% - 3rem);
}

.input-field label {
  /* top:-0.5rem; */
  font-size: 1rem;
  -webkit-transition: color .2s;
  transition: color .2s;
}

/* .swal2-input.w3-input,
.input-field input.w3-input,
.input-field select.w3-select {
font-weight: bold;
padding: 0 5px;
font-family: 'Saira';
}*/

.swal2-html-container input[type="text"],
.swal2-html-container input[type="number"],
.swal2-html-container select {
  font-size: 1rem;
  font-weight: bold;
  padding: 0 5px;
  font-family: 'Saira';
  width: 100%;
}

.input-field span.help {
  color: var(--theme-color-light-text) !important;
  font-size: 12px !important;
}

.input-field:has(input:focus) label,
.input-field:has(input:checked) label,
.input-field:has(input:focus) .prefix {
  color: var(--theme-color-rgb);
  /* font-weight: bold; */
}

/*autocomplete*/
.autocomplete {
  /*the container must be positioned relative:*/
  position: relative;
  display: inline-block;
}

.autocomplete-items {
  position: absolute;
  border: 1px solid #d4d4d4;
  border-bottom: none;
  border-top: none;
  z-index: 99;
  /*position the autocomplete items to be the same width as the container:*/
  top: 100%;
  left: 0;
  right: 0;
}

.autocomplete-items div {
  padding: 5px;
  cursor: pointer;
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
}

.autocomplete-items div:hover {
  /*when hovering an item:*/
  background-color: var(--shadow-color);
}

.autocomplete-active {
  /*when navigating through the items using the arrow keys:*/
  background-color: var(--theme-color-rgb) !important;
  color: var(--w3-theme-dark-text);
}

/*dinh dang button*/
.btn,
.btn-large,
.btn-small,
.btn-flat {
  border: none;
  border-radius: 2px;
  display: inline-block;
  height: 36px;
  line-height: 36px;
  padding: 0 16px;
  text-transform: uppercase;
  vertical-align: middle;
  -webkit-tap-highlight-color: transparent
}

.btn,
.btn-large,
.btn-small,
.btn-floating,
.btn-flat {
  font-size: 14px;
  outline: 0
}

.btn i,
.btn-large i,
.btn-small i,
.btn-floating i,
.btn-large i,
.btn-small i,
.btn-flat i {
  font-size: 1.3rem;
  line-height: inherit
}

.btn,
.btn-large,
.btn-small {
  text-decoration: none;
  color: var(--w3-theme-dark-text);
  background-color: var(--theme-color);
  text-align: center;
  letter-spacing: .5px;
  -webkit-transition: background-color .2s ease-out;
  transition: background-color .2s ease-out;
  cursor: pointer
}

.btn-large {
  height: 54px;
  line-height: 54px;
  font-size: 15px;
  padding: 0 28px
}

.btn-large i {
  font-size: 1.6rem
}

.btn-small {
  height: 32.4px;
  line-height: 32.4px;
  font-size: 13px
}

.btn-small i {
  font-size: 1.2rem
}

/*xoay icon dong mo*/
.w3-card-2:has(.w3-hide) .icon-close {
  transition: transform 0.3s;
  transform: rotate(180deg);
}

.icon-rotate {
  transform: rotate(180deg);
}

/*an hien icon khi div co .w3-hide */
.icon-hide {
  display: inline;
}

.icon-show {
  display: none;
}

.w3-card-2:has(.w3-hide) .icon-hide {
  display: none;
}

.w3-card-2:has(.w3-hide) .icon-show {
  display: inline;
}


/*dinh dang input sum*/
.sum5,
.sum25,
.sum75 {
  font-weight: 600 !important;
}

.w3-cell .w3-input,
.sum5,
.sum25,
.sum75 {
  font-size: 1.4rem !important;
  font-weight: 400;
  text-align: right;
  height: auto !important;
  padding: 1px;
}

/*dinh dang table thong tin*/
.table-info {
  border-collapse: separate;
}

.table-info tr {
  border: none;
  line-height: 32.4px;
}

.table-info tr td {
  padding: 0 5px !important;
  ;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.table-info tr:hover td:first-child {
  color: var(--theme-color-light-text);
  font-weight: bold;
}

.table-info tr td:first-child {
  /* background-color:#ff9800; */
  /* color:#fff; */
  border-top-left-radius: 5px;
  border-bottom-left-radius: 5px;
  font-size: 0.9rem;
}

.table-info tr td:nth-child(2) {
  /* color:#ff9800; */
  /* font-weight: 600; */
  font-family: Saira;
  font-size: 1.4rem;
  text-align: right;
  width: 50%;
  font-weight: bold;
}

.table-info tr:hover td:nth-child(2) {
  font-size: 1.5rem;
}

.table-info tr td:last-child {
  /* color: #fff; */
  /* font-size: 1.2rem; */
  /* background: green; */
  text-align: center;
  border-top-right-radius: 5px;
  border-bottom-right-radius: 5px;
}

.table-info tr td a {
  display: none;
  opacity: 0;
  padding: 7px;
}

.table-info:hover a {
  display: block;
  opacity: 1;
}

/*co dinh kich thuoc khi xem nhom*/
/* .group-view.w3-card-2{ */
/* min-height: 235px; */
/* } */


/* an hien khi checked trong nhom*/
.group-view .check-show {
  display: none;
}

.group-view:has(input[type=checkbox]:checked) .check-show {
  display: block;
}

/* an hien nut xoa khi xem mac dinh */
#scale-home #del-all {
  display: none;
}

#scale-home:has(input.person.item-delete:checked) #del-all {
  display: block;
}

#scale-home:has(input.person.item-delete:checked) #inputFind {
  display: none;
}

/* kich thuoc toi thieu cua moi swipe */
swiper-slide {
  min-height: 500px;
}

/*hien nut cap nhat khi so sanh du lieu*/
#div-compare #btn-update {
  display: none;
}

#div-compare:has(input.w3-check.compare-item:checked) #btn-update {
  display: block;
}

/* =============================================
   MODERN UI OVERRIDES - Nâng cấp giao diện
   Áp dụng lên các class W3.CSS mà không đổi tên
   ============================================= */

/* --- 1. CARD: Shadow nhẹ + Bo góc hiện đại --- */
.w3-card,
.w3-card-2 {
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.06),
    0 4px 12px rgba(0, 0, 0, 0.07) !important;
  border-radius: 12px !important;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.w3-card-4,
.w3-hover-shadow:hover {
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.08),
    0 8px 24px rgba(0, 0, 0, 0.10) !important;
  border-radius: 16px !important;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

/* Hiệu ứng nhấc lên khi hover trên desktop */
@media (hover: hover) {

  .w3-card:hover,
  .w3-card-2:hover {
    box-shadow:
      0 4px 12px rgba(0, 0, 0, 0.10),
      0 12px 28px rgba(0, 0, 0, 0.10) !important;
    transform: translateY(-2px);
  }

  .w3-card-4:hover {
    box-shadow:
      0 6px 18px rgba(0, 0, 0, 0.12),
      0 16px 40px rgba(0, 0, 0, 0.10) !important;
    transform: translateY(-3px);
  }
}

/* --- 2. Bo góc mềm hơn cho các class round --- */
.w3-round,
.w3-round-medium {
  border-radius: 10px !important;
}

.w3-round-large {
  border-radius: 16px !important;
}

.w3-round-small {
  border-radius: 6px !important;
}

/* --- 3. DANH SÁCH: Divider tinh tế hơn --- */
.w3-ul li {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
  padding: 10px 16px !important;
  transition: background-color 0.15s ease;
}

.w3-ul li:last-child {
  border-bottom: none !important;
}

/* --- 4. HOVER: Màu phản hồi nhẹ nhàng hơn #ccc cũ --- */
.w3-hoverable tbody tr:hover,
.w3-ul.w3-hoverable li:hover {
  background-color: rgba(33, 150, 243, 0.05) !important;
}

/* --- 5. BUTTON: Thêm transition mượt + Bo góc nhẹ --- */
.w3-button {
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease !important;
  border-radius: 8px !important;
}

.w3-button:active {
  opacity: 0.75;
  transform: scale(0.97);
}

/* Giữ nguyên màu btn tròn/circle */
.w3-circle.w3-button,
.btn-floating.w3-button {
  border-radius: 50% !important;
}

/* --- 6. TAG / BADGE: Bo góc hài hòa hơn --- */
.w3-tag {
  font-weight: 500;
  letter-spacing: 0.2px;
}

.w3-badge {
  border-radius: 50% !important;
}

.w3-input:focus {
  border-bottom: 2px solid var(--border-color) !important;
  outline: none !important;
}

/* --- 8. BAR (nav bar trong trang): Bóng nhẹ thay đường viền cứng --- */
.w3-bar.w3-card,
.w3-bar.w3-card-2,
.w3-bar.w3-theme,
.w3-bar.w3-theme-d4 {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10) !important;
}

/* --- 9. PANEL: Padding thoáng hơn --- */
.w3-panel {
  border-radius: 10px;
}

/* --- 10. TABLE STRIPED: Màu dải xen nhẹ hơn --- */
.w3-striped tbody tr:nth-child(even) {
  background-color: var(--card-bg) !important;
}

.w3-table-all tr:nth-child(even) {
  background-color: var(--card-bg) !important;
}

.w3-bordered tr,
.w3-table-all tr {
  border-bottom: 1px solid rgba(0, 0, 0, 0.07) !important;
}

/* --- 11. NÚT DROPDOWN HOVER nhẹ --- */
.w3-dropdown-content {
  border-radius: 12px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12) !important;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

/* Modern Bottom Panel Styles */
.glass-panel {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 25px var(--shadow-color);
}

.floating-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  margin: 0 auto;
  max-width: 500px;
  width: 100%;
}

.bottom-toggle-btn {
  background: var(--w3-theme-light);
  color: var(--w3-theme-light-text);
  border-radius: 20px 20px 0 0;
  padding: 2px 10px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
  display: inline-block;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-bottom: none;
}

.bottom-toggle-btn:hover {
  background: var(--w3-theme-light);
  color: var(--w3-theme-light-text);
}

@keyframes bounceSlow {

  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-8px);
  }

  60% {
    transform: translateY(-4px);
  }
}

.bounce-hint {
  animation: bounceSlow 3s 3;
}

.grid-item-modern {
  transition: all 0.2s ease;
  border-radius: 12px;
}

.grid-item-modern:active {
  background: rgba(0, 0, 0, 0.05);
  transform: scale(0.95);
}

/* Action Sheet Styles for OpenUser */
.action-sheet {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 5px;
}

.btn-action-main {
  background: linear-gradient(135deg, var(--theme-color, #009688), var(--theme-color-dark, #00796b));
  color: var(--w3-theme-dark-text) !important;
  border-radius: 50px;
  padding: 12px 25px;
  font-weight: bold;
  box-shadow: 0 6px 20px rgba(var(--theme-color-rgb, 0, 150, 136), 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.btn-action-main:active {
  transform: scale(0.95);
  box-shadow: 0 2px 10px rgba(var(--theme-color-rgb, 0, 150, 136), 0.2);
}

.btn-action-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: white;
  color: #555 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.btn-action-circle:active {
  transform: scale(0.9);
  background: #f1f1f1;
}

.btn-purple-glow {
  color: #9c27b0 !important;
}

.btn-blue-glow {
  color: #2196f3 !important;
}

.btn-grey-glow {
  color: #757575 !important;
}

/* Glassmorphism for dynamic w3-theme */
.glass-header {
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  /* background: rgba(var(--w3-theme-rgb, 0, 150, 136), 0.85) !important; Fallback if var not set */
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Base glass effect that can be combined with w3-theme */
.glass-effect {
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

.w3-theme.glass-effect {
  background-color: rgba(var(--theme-color-rgb), 0.85) !important;
}

.glass-panel.w3-theme {
  background: rgba(var(--theme-color-rgb), 0.85) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.bottom-toggle-btn.w3-theme {
  background: var(--w3-theme) !important;
  box-shadow: 0 -4px 15px var(--shadow-color);
}

.action-sheet.w3-theme {
  background: rgba(var(--theme-color-rgb), 0.9) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Thích ứng cảnh báo số lẻ trong Dark Mode cho InputData */
[data-theme='dark'] .w3-yellow {
  background-color: var(--alert-warning-bg) !important;
  color: var(--alert-warning-text) !important;
}

/* Hiệu ứng focus cho các ô nhập mã cân */
#input-data-html .w3-input:focus {
  border-bottom: 2px solid var(--w3-theme) !important;
  background-color: var(--alert-info-bg) !important;
  outline: none;
  border-radius: 4px;
}

/* ==========================================================================
   HỆ THỐNG 3 CHẾ ĐỘ CỠ CHỮ (NHỎ - MẶC ĐỊNH - LỚN CHO NGƯỜI LỚN TUỔI/NGOÀI TRỜI)
   ========================================================================== */
:root {
  --font-scale: 1;
  --number-scale: 1;
  --title-scale: 1;
  --input-scale: 1;
}

[data-font-size="small"] {
  --font-scale: 0.88;
  --number-scale: 0.92;
  --title-scale: 0.9;
  --input-scale: 0.9;
  font-size: 14px;
}

[data-font-size="normal"] {
  --font-scale: 1;
  --number-scale: 1;
  --title-scale: 1;
  --input-scale: 1;
  font-size: 16px;
}

[data-font-size="large"] {
  --font-scale: 1.35;
  --number-scale: 1.5;
  /* Con số to hơn bình thường 1.5 lần */
  --title-scale: 1.4;
  --input-scale: 1.4;
  font-size: 19px;
}

/* Kỹ thuật Adaptive Labels: Rút gọn tiêu đề thông minh */
.adaptive-label .lbl-short {
  display: none;
}

.adaptive-label .lbl-full {
  display: inline;
}

[data-font-size="large"] .adaptive-label .lbl-full {
  display: none !important;
}

[data-font-size="large"] .adaptive-label .lbl-short {
  display: inline !important;
  font-weight: 700;
}

/* Tối ưu hiển thị cho chế độ Chữ Lớn [data-font-size="large"] */
[data-font-size="large"] .total-weight-num,
[data-font-size="large"] .total-money-num,
[data-font-size="large"] .scale-num-highlight,
[data-font-size="large"] #total-kg,
[data-font-size="large"] #total-money,
[data-font-size="large"] #current-weight-val {
  font-size: 1.5em !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px;
}

[data-font-size="large"] .w3-large {
  font-size: 1.3em !important;
}

[data-font-size="large"] .w3-xlarge {
  font-size: 1.45em !important;
}

/* Ô nhập số trên bàn cân */
[data-font-size="large"] #input-data-html .w3-input,
[data-font-size="large"] .scale-input-box {
  font-size: 1.4em !important;
  font-weight: 800 !important;
  min-height: 48px !important;
  padding: 8px 12px !important;
}

/* Các nút bấm phím số và thao tác ngoài trời */
[data-font-size="large"] .keypad-btn {
  font-size: 1.15em !important;
  font-weight: 700 !important;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Bảng kê chi tiết phiếu cân */
[data-font-size="large"] .scale-table td,
[data-font-size="large"] .scale-table th {
  padding: 10px 8px !important;
  font-size: 1.25em !important;
}

/* Chế độ Chữ nhỏ [data-font-size="small"] */
[data-font-size="small"] .scale-table td,
[data-font-size="small"] .scale-table th {
  padding: 5px 6px !important;
  font-size: 0.9em !important;
}

[data-font-size="small"] .w3-btn,
[data-font-size="small"] .w3-button {
  padding: 6px 10px;
}

/* ==========================================================================
   HỆ THỐNG CỠ CHỮ TRÊN SIDEBAR
   ========================================================================== */
#mySidebar .sidebar-fs-item {
  display: flex !important;
  align-items: center;
  justify-content: space-between !important;
  gap: 8px;
  padding: 8px 10px 8px 14px !important;
  margin: 4px 8px !important;
  width: calc(100% - 16px) !important;
  max-width: calc(100% - 16px) !important;
  border-radius: 10px;
  box-sizing: border-box !important;
  user-select: none;
  transition: background-color 0.2s ease;
  overflow: hidden;
}

#mySidebar .sidebar-fs-item:hover {
  background-color: var(--hover-bg, rgba(0, 0, 0, 0.04));
}

#mySidebar .sidebar-fs-label {
  display: inline-flex;
  align-items: center;
  font-size: 15px;
  font-weight: 500;
  color: inherit;
  white-space: nowrap;
}

#mySidebar .sidebar-fs-label .material-icons {
  font-size: 24px;
  vertical-align: middle;
  line-height: 1;
}

/* Segmented Control cho Bộ chọn cỡ chữ trên Sidebar */
.font-size-segmented-control {
  display: inline-flex;
  align-items: center;
  background: var(--input-bg, rgba(0, 0, 0, 0.06));
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
  border-radius: 20px;
  padding: 2px;
  gap: 2px;
  margin: 0;
  box-sizing: border-box;
  flex-shrink: 0;
}

.font-size-segmented-control .fs-option-btn {
  border: none;
  background: transparent;
  color: var(--app-text, #555555);
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 12px !important;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 36px;
  outline: none;
}

.font-size-segmented-control .fs-option-btn:hover {
  color: var(--w3-theme, #2196f3);
  background: rgba(0, 0, 0, 0.04);
}

.font-size-segmented-control .fs-option-btn.active {
  background: var(--w3-theme, #2196f3);
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

[data-theme='dark'] #mySidebar .sidebar-fs-item:hover {
  background-color: rgba(255, 255, 255, 0.06);
}

[data-theme='dark'] .font-size-segmented-control {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

[data-theme='dark'] .font-size-segmented-control .fs-option-btn {
  color: rgba(255, 255, 255, 0.75);
}

[data-theme='dark'] .font-size-segmented-control .fs-option-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

[data-theme='dark'] .font-size-segmented-control .fs-option-btn.active {
  background: var(--w3-theme, #2196f3);
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   UI CẬP NHẬT GIÁ (changeGiaLua)
   ========================================================================== */
.gia-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--alert-info-bg, #e8f4fd);
  color: var(--alert-info-text, #0d47a1);
  border: 1px solid var(--alert-info-border, #90caf9);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  text-align: left;
  font-size: 14px;
  line-height: 1.45;
}

.gia-banner-icon {
  font-size: 20px;
  color: var(--w3-theme, #2196f3);
  flex-shrink: 0;
  margin-top: 1px;
}

.gia-card-item {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px var(--shadow-color, rgba(0, 0, 0, 0.04));
  transition: all 0.2s ease;
  position: relative;
}

.gia-card-item:hover {
  border-color: var(--w3-theme, #2196f3);
  box-shadow: 0 2px 8px var(--shadow-color, rgba(0, 0, 0, 0.08));
}

.gia-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.gia-card-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gia-badge-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--w3-theme, #2196f3);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.gia-badge-count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}

.gia-badge-count.has-data {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffe0b2;
}

[data-theme='dark'] .gia-badge-count.has-data {
  background: #3e2723;
  color: #ffb74d;
  border-color: #5d4037;
}

.gia-badge-count.no-data {
  background: var(--app-bg, #f0f2f5);
  color: #888888;
}

.gia-del-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  background: transparent;
  color: #e53935;
  transition: all 0.2s ease;
  padding: 0;
}

.gia-del-btn:hover {
  background: rgba(229, 57, 53, 0.12);
  transform: scale(1.08);
}

.gia-del-btn.has-data {
  color: #d84315;
  background: rgba(216, 67, 21, 0.08);
}

.gia-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: center;
}

.gia-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.15));
  border-radius: 8px;
  background: var(--input-bg, #ffffff);
  color: var(--w3-text-theme, var(--app-text, #333333));
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.gia-input:focus {
  border-color: var(--w3-theme, #2196f3);
}

.gia-price-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.gia-price-wrapper .gia-input {
  padding-right: 42px;
  font-weight: 700;
  text-align: right;
  color: var(--w3-text-theme, #1565c0);
}

[data-theme='dark'] .gia-price-wrapper .gia-input {
  color: var(--w3-text-theme, #ff8a65);
}

.gia-price-unit {
  position: absolute;
  left: 10px;
  font-size: 12px;
  color: #888888;
  pointer-events: none;
  font-weight: 500;
}

.gia-add-btn {
  width: 100%;
  padding: 10px;
  border: 1.5px dashed var(--w3-theme, #2196f3);
  border-radius: 12px;
  background: transparent;
  color: var(--w3-theme, #2196f3);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  transition: all 0.2s ease;
}

.gia-add-btn:hover {
  background: rgba(33, 150, 243, 0.08);
  border-style: solid;
}

/* Hieu ung nut dang phat am thanh doc so tien */
.speech-playing {
  color: #d32f2f !important;
  border-color: #ef5350 !important;
  background: #ffebee !important;
  box-shadow: 0 0 10px rgba(239, 83, 80, 0.5) !important;
  animation: pulse-speech 0.8s infinite alternate ease-in-out;
}

@keyframes pulse-speech {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.15);
  }
}

/* Smart Sticky Header cho man hinh nhap lieu */
#scale-detail {
  overflow: visible !important;
}

#input-data-sticky-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--app-bg, #f0f2f5);
  margin: -12px -10px 8px;
  padding: 8px 10px 6px;
}

/* Dam bao thao tac cuon vuot doc luon muot ma, khong bi chan boi Swiper hoac the con */
swiper-container.inputDataSwiper,
swiper-container.inputDataSwiper swiper-slide,
.input-slide-wrapper,
.input-single-container,
#input-data-html {
  touch-action: pan-y !important;
  -webkit-overflow-scrolling: touch;
}

/* Giao dien Form xac nhan Tinh Tien toi gian & muot ma */
.tinh-tien-chip-group {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px 2px 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tinh-tien-chip-group::-webkit-scrollbar {
  display: none;
}
.tt-chip {
  flex: 0 0 auto;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 18px;
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.12));
  background: var(--w3-theme-light, #f1f5f9);
  color: var(--w3-text-theme, #1a237e);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.tt-chip:hover {
  filter: brightness(0.95);
}
.tt-chip.active {
  background: var(--w3-theme, #1e88e5) !important;
  color: var(--w3-theme-text, #fff) !important;
  border-color: var(--w3-theme, #1e88e5) !important;
  box-shadow: 0 2px 6px rgba(var(--theme-color-rgb, 30, 136, 229), 0.35);
}
.tt-input-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
  border-radius: 12px;
  padding: 8px 12px 6px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px var(--shadow-color, rgba(0, 0, 0, 0.04));
}
.tt-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--w3-text-theme, #37474f);
  margin-bottom: 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}


/* Giao dien Form xac nhan Tinh Tien toi gian & muot ma */
.tinh-tien-chip-group {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px 2px 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tinh-tien-chip-group::-webkit-scrollbar {
  display: none;
}
.tt-chip {
  flex: 0 0 auto;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 18px;
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.12));
  background: var(--w3-theme-light, #f1f5f9);
  color: var(--w3-text-theme, #1a237e);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.tt-chip:hover {
  filter: brightness(0.95);
}
.tt-chip.active {
  background: var(--w3-theme, #1e88e5) !important;
  color: var(--w3-theme-text, #fff) !important;
  border-color: var(--w3-theme, #1e88e5) !important;
  box-shadow: 0 2px 6px rgba(var(--theme-color-rgb, 30, 136, 229), 0.35);
}
.tt-input-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
  border-radius: 12px;
  padding: 8px 12px 6px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px var(--shadow-color, rgba(0, 0, 0, 0.04));
}
.tt-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--w3-text-theme, #37474f);
  margin-bottom: 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================================
   SIDEBAR DASHBOARD LAYOUT & DESKTOP RESPONSIVE
   ========================================================================== */
.sidebar-dashboard-section {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color, rgba(0, 0, 0, 0.06));
}

.sidebar-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--w3-text-theme, #546e7a);
  opacity: 0.8;
  letter-spacing: 0.5px;
  margin: 6px 4px 6px;
}

/* Quick Shortcuts Grid (2x2) */
.sidebar-shortcut-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 4px;
}

.sidebar-shortcut-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 6px 8px;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
  border-radius: 12px;
  text-decoration: none;
  color: var(--app-text, #333333);
  box-shadow: 0 1px 4px var(--shadow-color, rgba(0, 0, 0, 0.04));
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  cursor: pointer;
  user-select: none;
}

.sidebar-shortcut-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px var(--shadow-color, rgba(0, 0, 0, 0.08));
  background: var(--hover-bg, rgba(0, 0, 0, 0.02));
}

.sidebar-shortcut-card:active {
  transform: scale(0.96);
}

.sidebar-shortcut-card .material-icons {
  font-size: 24px;
  margin-bottom: 4px;
}

.sidebar-shortcut-card span {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Modern Nav Items */
#mySidebar .sidebar-nav-item {
  width: 100% !important;
  max-width: 100% !important;
  margin: 2px 0 !important;
  padding: 8px 12px !important;
  border-radius: 8px;
  display: flex !important;
  align-items: center !important;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--app-text, #333333) !important;
  transition: background-color 0.15s ease;
}

#mySidebar .sidebar-nav-item .material-icons {
  font-size: 20px;
  color: var(--w3-theme, #1e88e5);
  flex-shrink: 0;
}

#mySidebar .sidebar-nav-item:hover {
  background-color: var(--hover-bg, rgba(0, 0, 0, 0.04)) !important;
}

[data-theme='dark'] .sidebar-shortcut-card {
  background: var(--card-bg, #1e1e1e);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme='dark'] .sidebar-shortcut-card:hover {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme='dark'] #mySidebar .sidebar-nav-item:hover {
  background-color: rgba(255, 255, 255, 0.06) !important;
}

/* Responsive Desktop Layout (>= 1024px) */
@media (min-width: 1024px) {
  #mySidebar {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 280px !important;
    max-width: 280px !important;
    z-index: 99 !important;
    border-radius: 0 !important;
    border-right: 1px solid var(--border-color, rgba(0, 0, 0, 0.08)) !important;
    box-shadow: 2px 0 16px var(--shadow-color, rgba(0, 0, 0, 0.04)) !important;
    max-height: 100vh !important;
  }

  #sidebar-close-btn,
  #myOverlay {
    display: none !important;
  }

  body {
    padding-left: 280px !important;
  }

  .w3-top {
    left: 280px !important;
    width: calc(100% - 280px) !important;
  }

  .floating-bottom {
    left: 280px !important;
    width: calc(100% - 280px) !important;
    max-width: 700px !important;
    margin: 0 auto !important;
  }

  /* An nut hamburger mo sidebar khi o desktop */
  .w3-top a[href*="openSidebar"] {
    display: none !important;
  }
}

/* Đảm bảo SweetAlert2 luôn nổi lên trên cùng (kể cả trên Gate z-index: 99990) */
.swal2-container {
  z-index: 999999 !important;
}

/* ==========================================================================
   PWA Installation Prompt Banner & iOS Modal
   ========================================================================== */
.pwa-install-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  width: calc(100% - 32px);
  max-width: 480px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16), 0 2px 10px rgba(0, 0, 0, 0.08);
  padding: 12px 14px;
  box-sizing: border-box;
  z-index: 9995;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.pwa-install-banner.pwa-banner-slide-in {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.pwa-install-banner.pwa-banner-slide-out {
  transform: translateX(-50%) translateY(120%);
  opacity: 0;
  pointer-events: none;
}

@media only screen and (min-width: 901px) {
  .pwa-install-banner {
    left: calc(280px + (100% - 280px) / 2);
    transform: translateX(-50%) translateY(120%);
  }
  .pwa-install-banner.pwa-banner-slide-in {
    transform: translateX(-50%) translateY(0);
  }
  .pwa-install-banner.pwa-banner-slide-out {
    transform: translateX(-50%) translateY(120%);
  }
}

[data-theme="dark"] .pwa-install-banner {
  background: rgba(30, 41, 59, 0.96);
  border-color: rgba(51, 65, 85, 0.9);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), 0 2px 10px rgba(0, 0, 0, 0.3);
}

.pwa-install-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-install-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.pwa-install-icon {
  width: 26px;
  height: 26px;
  filter: brightness(0) invert(1);
}

.pwa-install-text {
  flex: 1;
  min-width: 0;
}

.pwa-install-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

[data-theme="dark"] .pwa-install-title {
  color: #f8fafc;
}

.pwa-install-desc {
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
  margin-top: 2px;
}

[data-theme="dark"] .pwa-install-desc {
  color: #94a3b8;
}

.pwa-install-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pwa-btn-primary {
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.35);
  transition: background-color 0.2s ease, transform 0.1s ease;
  white-space: nowrap;
}

.pwa-btn-primary:active {
  transform: scale(0.96);
}

.pwa-btn-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.pwa-btn-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #334155;
}

[data-theme="dark"] .pwa-btn-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

/* iOS Safari Guide Modal */
.pwa-ios-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 99995;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.pwa-ios-card {
  background: #ffffff;
  border-radius: 20px;
  max-width: 420px;
  width: 100%;
  padding: 20px 20px 16px;
  box-sizing: border-box;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  animation: pwaSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: env(safe-area-inset-bottom, 12px);
}

[data-theme="dark"] .pwa-ios-card {
  background: #1e293b;
  color: #f8fafc;
}

@keyframes pwaSlideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.pwa-ios-header {
  display: flex;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

[data-theme="dark"] .pwa-ios-header {
  border-bottom-color: #334155;
}

.pwa-ios-body {
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pwa-ios-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.pwa-ios-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.pwa-ios-step-text {
  font-size: 13.5px;
  color: #334155;
  line-height: 1.5;
}

[data-theme="dark"] .pwa-ios-step-text {
  color: #cbd5e1;
}

.pwa-ios-share-icon {
  display: inline-block;
  vertical-align: middle;
  color: #2563eb;
  margin: 0 2px;
}

.pwa-ios-btn-ok {
  width: 100%;
  padding: 12px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}


