/* 
  📔 SỔ TAY AESTHETIC THEME
  Handcrafted Memo, Sticky Notes, Notebook Paper & Washi Tape Style
*/

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700;800&family=Caveat:wght@600;700&family=Patrick+Hand&display=swap');

:root {
  --paper-bg: #f9f6f0;
  --paper-grid: #ede6da;
  --paper-card: #ffffff;
  --text-main: #2d2a26;
  --text-muted: #736c64;
  --pencil-border: #dcd4c7;
  --pencil-dark: #3a3530;

  /* Sticky notes */
  --sticky-yellow: #fef9c3;
  --sticky-yellow-border: #facc15;
  --sticky-blue: #e0f2fe;
  --sticky-blue-border: #7dd3fc;
  --sticky-pink: #fce7f3;
  --sticky-pink-border: #f472b6;
  --sticky-green: #dcfce7;
  --sticky-green-border: #86efac;
  --sticky-orange: #ffedd5;
  --sticky-orange-border: #fb923c;

  --washi-tape: rgba(254, 215, 170, 0.75);
  --washi-pink: rgba(244, 114, 182, 0.65);
  --washi-cyan: rgba(125, 211, 252, 0.65);
  --washi-mint: rgba(134, 239, 172, 0.65);

  --accent-gold: #eab308;
  --accent-green: #10b981;
  --accent-purple: #8b5cf6;
  --accent-red: #ef4444;

  --font-main: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-hand: 'Caveat', 'Patrick Hand', cursive;
  --font-memo: 'Patrick Hand', cursive;
}

html {
  box-sizing: border-box;
  overflow-x: hidden !important;
  max-width: 100% !important;
  width: 100% !important;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

body {
  font-family: var(--font-main);
  background-color: var(--paper-bg);
  background-image:
    radial-gradient(var(--paper-grid) 1.5px, transparent 1.5px),
    linear-gradient(to bottom, rgba(240, 235, 224, 0.4) 1px, transparent 1px);
  background-size: 24px 24px, 100% 28px;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden !important;
  max-width: 100% !important;
  width: 100% !important;
  position: relative;
}

/* Notebook Binder Top Bar */
.notebook-binder {
  background: #4a3e36;
  background-image: repeating-linear-gradient(45deg, #443831, #443831 10px, #4a3e36 10px, #4a3e36 20px);
  padding: 8px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.4);
}

.binder-ring {
  width: 14px;
  height: 22px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 40%, #64748b 70%, #334155 100%);
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5), inset 0 1px 2px #fff;
}

/* Header & Tabs */
header.app-header {
  background: #ffffff;
  border-bottom: 2px dashed #d5cbbe;
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 15px rgba(60, 50, 40, 0.05);
}

.header-container {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.header-top-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.logo-badge {
  background: var(--sticky-yellow);
  border: 2px solid var(--pencil-dark);
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 1.6rem;
  box-shadow: 3px 3px 0 var(--pencil-dark);
  transform: rotate(-3deg);
}

.logo-title {
  font-family: var(--font-hand);
  font-size: 1.95rem;
  font-weight: 700;
  color: #2b2521;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.logo-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Header Controls (Dark/Light & Language) */
.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-control-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 2px solid var(--pencil-dark);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
  box-shadow: 2px 2px 0 var(--pencil-dark);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  font-family: inherit;
  outline: none;
}

.header-control-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--pencil-dark);
  background: #fef9c3;
}

.header-control-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--pencil-dark);
}

.lang-dropdown-wrapper {
  position: relative;
}

.lang-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #ffffff;
  border: 2px solid var(--pencil-dark);
  border-radius: 10px;
  box-shadow: 3px 4px 0 var(--pencil-dark);
  min-width: 155px;
  z-index: 1000;
  overflow: hidden;
  animation: fadeInDown 0.18s ease;
}

.lang-dropdown-menu.show {
  display: block;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lang-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  transition: background 0.15s;
}

.lang-menu-item:hover {
  background: #fef08a;
}

.lang-menu-item.active {
  background: #fef9c3;
  color: #b45309;
}

/* Nav Bookmark Tabs */
.nav-bookmarks {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-btn {
  background: #f4efe6;
  border: 1.5px solid #d5cbbe;
  border-bottom: none;
  border-radius: 10px 10px 4px 4px;
  padding: 8px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #554d46;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.tab-btn:hover {
  background: #ffffff;
  color: #1a1715;
  transform: translateY(-2px);
}

.tab-btn.active {
  background: #ffffff;
  color: #2b2521;
  border-color: var(--pencil-dark);
  border-bottom: 2px solid #ffffff;
  box-shadow: 0 -3px 0 var(--pencil-dark);
  font-weight: 700;
}

.tab-btn.tab-ctv {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.tab-btn.tab-ctv.active {
  box-shadow: 0 -3px 0 #10b981;
}

.tab-btn.tab-admin {
  background: #fdf2f8;
  border-color: #fbcfe8;
  color: #9d174d;
}

.tab-btn.tab-admin.active {
  box-shadow: 0 -3px 0 #ec4899;
}

/* User Quick Bar */
.user-quick-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-bar-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-meta-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-identity {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1.5px solid #d5cbbe;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.88rem;
  font-weight: 600;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fixed-deposit-memo-card {
  background: #fefce8;
  border: 2px dashed #ca8a04;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 16px;
  text-align: left;
  box-sizing: border-box;
  width: 100%;
}

.fixed-deposit-memo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-weight: 800;
  color: #854d0e;
  font-size: 0.92rem;
}

.fixed-memo-title {
  white-space: nowrap;
}

.fixed-memo-code {
  background: #fef08a;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1.5px solid #ca8a04;
  font-family: monospace;
  font-size: 1.05rem;
  color: #78350f;
  cursor: pointer;
  white-space: nowrap;
}

.fixed-memo-desc {
  font-size: 0.82rem;
  color: #574e44;
  margin-top: 8px;
  line-height: 1.5;
}

.deposit-input-card {
  background: #ffffff;
  border: 2px solid var(--pencil-dark);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 3px 3px 0 var(--pencil-dark);
  box-sizing: border-box;
  width: 100%;
}

.user-info-chips {
  background: #ffffff;
  border: 1.5px solid #d5cbbe;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-id-chip {
  background: #fef08a;
  padding: 2px 7px;
  border-radius: 5px;
  font-family: monospace;
  font-weight: 800;
  border: 1.5px solid #ca8a04;
  cursor: pointer;
  color: #854d0e;
  font-size: 0.8rem;
}

.role-badge {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.role-user {
  background: #e2e8f0;
  color: #334155;
}

.role-ctv {
  background: #d1fae5;
  color: #065f46;
}

.role-admin {
  background: #fee2e2;
  color: #991b1b;
}

.user-balance-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.balance-pill {
  background: var(--sticky-yellow);
  border: 1.5px solid #eab308;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #854d0e;
  box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.balance-pill:hover {
  transform: translateY(-1px);
}

.bal-add-tag {
  font-size: 0.74rem;
  background: #fde047;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  color: #78350f;
}

.ctv-comm-pill {
  background: #ecfdf5;
  border-color: #6ee7b7;
}

.user-auth-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-amounts-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.user-name-tag {
  background: #ffffff;
  border: 1.5px solid #d5cbbe;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-memo {
  background: #ffffff;
  border: 2px solid var(--pencil-dark);
  border-radius: 8px;
  padding: 7px 16px;
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--pencil-dark);
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--pencil-dark);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

.btn-memo:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--pencil-dark);
}

.btn-memo:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--pencil-dark);
}

.btn-memo-primary {
  background: var(--pencil-dark);
  color: #ffffff;
}

.btn-memo-primary:hover {
  background: #1e1b18;
}

.btn-memo-accent {
  background: var(--sticky-yellow);
  border-color: #854d0e;
  color: #854d0e;
  box-shadow: 2px 2px 0 #854d0e;
}

.btn-memo-success {
  background: #10b981;
  color: #ffffff;
  border-color: #065f46;
  box-shadow: 2px 2px 0 #065f46;
}

.btn-memo-danger {
  background: #fee2e2;
  border-color: #b91c1c;
  color: #b91c1c;
  box-shadow: 2px 2px 0 #b91c1c;
}

/* Washi Tape Accent */
.washi-tape-strip {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%) rotate(-1deg);
  width: 110px;
  height: 24px;
  background: var(--washi-tape);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  border-left: 2px dashed rgba(0, 0, 0, 0.1);
  border-right: 2px dashed rgba(0, 0, 0, 0.1);
  z-index: 2;
  pointer-events: none;
}

.washi-tape-pink {
  background: var(--washi-pink);
}

.washi-tape-cyan {
  background: var(--washi-cyan);
}

.washi-tape-mint {
  background: var(--washi-mint);
}

/* Main Container */
main.main-content {
  max-width: 1240px;
  margin: 24px auto;
  padding: 0 16px 60px 16px;
}

/* Notebook Bulletin / Announcement Board */
.bulletin-board {
  background: #fffefb;
  border: 2px solid var(--pencil-dark);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 4px 6px 0 rgba(70, 55, 40, 0.2);
  margin-bottom: 28px;
  position: relative;
}

.board-pin {
  position: absolute;
  top: -14px;
  left: 24px;
  font-size: 1.8rem;
  filter: drop-shadow(2px 3px 2px rgba(0, 0, 0, 0.3));
}

.bulletin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px dashed #ded5c8;
  padding-bottom: 10px;
  margin-bottom: 14px;
  padding-left: 36px;
}

.bulletin-title {
  font-family: var(--font-hand);
  font-size: 1.6rem;
  font-weight: 700;
  color: #38302a;
}

.announcements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.announcement-note {
  background: var(--sticky-yellow);
  border: 1.5px solid var(--sticky-yellow-border);
  border-radius: 10px;
  padding: 14px;
  box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.06);
  transform: rotate(-0.5deg);
  transition: transform 0.2s ease;
}

.announcement-note:nth-child(even) {
  background: var(--sticky-blue);
  border-color: var(--sticky-blue-border);
  transform: rotate(0.6deg);
}

.announcement-note:hover {
  transform: scale(1.01) rotate(0deg);
}

.note-badge {
  display: inline-block;
  background: var(--pencil-dark);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.note-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #1f1d1a;
  margin-bottom: 4px;
}

.note-desc {
  font-size: 0.85rem;
  color: #4b443c;
  line-height: 1.45;
}

/* Products Section */
.section-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-title {
  font-family: var(--font-hand);
  font-size: 2.1rem;
  font-weight: 700;
  color: #27231f;
  display: flex;
  align-items: center;
  gap: 8px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

/* Sticky Product Card */
.product-card {
  background: #ffffff;
  border: 2px solid var(--pencil-dark);
  border-radius: 14px;
  padding: 22px 18px 18px 18px;
  position: relative;
  box-shadow: 4px 5px 0 var(--pencil-dark);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 6px 8px 0 var(--pencil-dark);
}

.product-card.locket-card {
  background: #fffdfa;
  border-top: 5px solid #f59e0b;
}

.product-card.spotify-card {
  background: #fcfdfa;
  border-top: 5px solid #10b981;
}

.product-tag {
  position: absolute;
  top: -12px;
  right: 16px;
  background: #fef08a;
  border: 1.5px solid var(--pencil-dark);
  border-radius: 6px;
  padding: 3px 10px;
  font-family: var(--font-memo);
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 1px 2px 0 var(--pencil-dark);
}

.product-cat {
  font-size: 0.76rem;
  font-weight: 700;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.product-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1a1715;
  margin-bottom: 8px;
  line-height: 1.3;
}

.product-pricing-box {
  background: #fdfbf7;
  border: 1px solid #e7ded0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.price-main {
  font-size: 1.45rem;
  font-weight: 800;
  color: #d97706;
}

.price-sub {
  font-size: 0.78rem;
  color: #78716c;
}

.ctv-badge-highlight {
  background: #d1fae5;
  color: #065f46;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.product-desc {
  font-size: 0.85rem;
  color: #4a433c;
  line-height: 1.5;
  margin-bottom: 16px;
  flex-grow: 1;
  white-space: pre-line;
  max-height: 120px;
  overflow-y: auto;
  padding-right: 4px;
}

.product-desc::-webkit-scrollbar {
  width: 4px;
}

.product-desc::-webkit-scrollbar-thumb {
  background: #d6cebf;
  border-radius: 4px;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #78716c;
  margin-bottom: 14px;
  padding-top: 8px;
  border-top: 1px dashed #e5ded2;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30, 25, 20, 0.6);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-paper {
  background: #ffffff;
  border: 3px solid var(--pencil-dark);
  border-radius: 18px;
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px;
  position: relative;
  box-shadow: 6px 10px 0 var(--pencil-dark);
  transform: translateY(15px);
  transition: transform 0.2s ease;
}

.modal-backdrop.open .modal-paper {
  transform: translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #fee2e2;
  border: 2px solid var(--pencil-dark);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  cursor: pointer !important;
  box-shadow: 1px 2px 0 var(--pencil-dark);
  z-index: 100000 !important;
  pointer-events: auto !important;
  touch-action: manipulation !important;
  user-select: none;
  transition: transform 0.1s ease, background 0.15s ease;
  line-height: 1;
  padding: 0;
}

.modal-close-btn::before {
  content: "";
  position: absolute;
  top: -8px;
  right: -8px;
  bottom: -8px;
  left: -8px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1;
}

.modal-close-btn:hover {
  background: #ef4444;
  color: #fff;
  transform: scale(1.1);
}

.modal-close-btn:active {
  transform: scale(0.92);
}

/* ====================================================== */
/* BANK SCAN MODAL (3 STATES: LOADING, NOT_FOUND, SUCCESS) */
/* ====================================================== */
.modal-scan-card {
  background: #ffffff;
  border-radius: 24px;
  max-width: 440px;
  width: 92%;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  animation: scanModalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  border: 2px solid var(--pencil-dark);
}

@keyframes scanModalPop {
  from {
    transform: scale(0.92) translateY(20px);
    opacity: 0;
  }

  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.scan-top-bar {
  height: 48px;
  background: linear-gradient(90deg, #38bdf8 0%, #2dd4bf 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  color: #ffffff;
  transition: background 0.3s ease;
}

.scan-top-bar.bar-success {
  background: #10b981;
}

.scan-top-title {
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.scan-modal-close {
  background: rgba(255, 255, 255, 0.25);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  margin-left: auto;
  transition: all 0.15s;
}

.scan-modal-close:hover {
  background: rgba(255, 255, 255, 0.4);
}

.scan-state-view {
  padding: 24px 20px 20px 20px;
  text-align: center;
}

/* Spinner */
.scan-spinner-box {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.scan-spinning-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid #e0f2fe;
  border-top-color: #0284c7;
  border-right-color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: spinRing 1s linear infinite;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.25);
}

@keyframes spinRing {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.scan-bolt-icon {
  font-size: 1.8rem;
  color: #f97316;
  animation: boltPulse 1.2s ease-in-out infinite alternate;
}

@keyframes boltPulse {
  from {
    transform: scale(0.9);
  }

  to {
    transform: scale(1.15);
    filter: drop-shadow(0 0 6px #fb923c);
  }
}

/* Info circle */
.scan-info-icon-box {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.scan-info-circle {
  width: 54px;
  height: 54px;
  background: #3b82f6;
  color: #ffffff;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 800;
  box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
}

/* Success circle */
.scan-success-icon-box {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.scan-success-circle {
  width: 72px;
  height: 72px;
  background: #dcfce7;
  color: #10b981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 800;
  box-shadow: 0 0 0 6px #f0fdf4;
}

/* Pill */
.scan-status-pill {
  display: inline-block;
  background: #e0f2fe;
  color: #0284c7;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
  border: 1px solid #bae6fd;
}

.scan-main-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
}

.scan-sub-text {
  font-size: 0.86rem;
  color: #64748b;
  line-height: 1.45;
  margin-bottom: 16px;
}

.scan-body-text {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 6px;
}

.scan-hint-text {
  font-size: 0.82rem;
  color: #64748b;
  margin: 10px 0 16px 0;
  line-height: 1.45;
}

.scan-blue-text {
  color: #2563eb;
  font-family: monospace;
  font-size: 0.95rem;
}

/* Info Box */
.scan-info-box {
  background: #cbd5e1;
  background: rgba(148, 163, 184, 0.45);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  text-align: left;
}

.scan-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 0.84rem;
}

.scan-info-lbl {
  color: #64748b;
  font-weight: 600;
}

.scan-info-val {
  color: #0284c7;
  font-weight: 800;
  font-family: monospace;
  font-size: 0.88rem;
}

/* Dashed Green Card */
.scan-amount-dashed-card {
  border: 2px dashed #10b981;
  background: #f0fdf4;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
  text-align: center;
}

.scan-amount-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #059669;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.scan-amount-number {
  font-size: 1.9rem;
  font-weight: 800;
  color: #059669;
}

/* Receipt table */
.scan-receipt-table {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 18px;
  text-align: left;
}

.scan-receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.84rem;
}

.scan-receipt-row:last-child {
  border-bottom: none;
}

.scan-receipt-row .lbl {
  color: #64748b;
  font-weight: 500;
}

.scan-receipt-row .val {
  font-weight: 700;
  color: #1e293b;
}

.text-cyan {
  color: #0284c7 !important;
}

.text-green {
  color: #10b981 !important;
}

/* Scan Buttons */
.btn-scan-primary {
  width: 100%;
  padding: 13px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.96rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  margin-bottom: 8px;
  transition: all 0.15s;
}

.btn-scan-primary:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.btn-scan-success {
  width: 100%;
  padding: 13px;
  background: #10b981;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.98rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  margin-bottom: 8px;
  transition: all 0.15s;
}

.btn-scan-success:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-scan-ghost {
  width: 100%;
  padding: 10px;
  background: transparent;
  color: #64748b;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-scan-ghost:hover {
  background: #f1f5f9;
  color: #334155;
}

/* Forms */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  color: #2e2823;
  margin-bottom: 5px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: #fefcf9;
  border: 2px solid #3c352f;
  border-radius: 8px;
  font-family: var(--font-main);
  font-size: 0.94rem;
  color: #2b2521;
  outline: none;
  transition: all 0.15s ease;
  box-shadow: inset 1px 2px 3px rgba(0, 0, 0, 0.05);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Order Receipt Memo Card */
.receipt-memo {
  background: #fef9c3;
  border: 2px dashed #ca8a04;
  border-radius: 12px;
  padding: 18px;
  margin: 16px 0;
  position: relative;
  font-family: var(--font-main);
}

.receipt-stamp {
  position: absolute;
  top: 12px;
  right: 16px;
  border: 2px solid #dc2626;
  color: #dc2626;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-hand);
  font-size: 1.1rem;
  font-weight: 800;
  transform: rotate(12deg);
  opacity: 0.85;
}

.delivered-data-box {
  background: #ffffff;
  border: 1.5px solid #eab308;
  border-radius: 8px;
  padding: 12px;
  font-family: monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 10px 0;
  color: #1e293b;
}

/* VietQR Box */
.qr-deposit-box {
  text-align: center;
  background: #fdfbf7;
  border: 2px solid var(--pencil-dark);
  border-radius: 14px;
  padding: 20px;
  margin: 16px 0;
}

.qr-image-wrapper {
  background: #ffffff;
  border: 2px dashed #94a3b8;
  border-radius: 12px;
  padding: 12px;
  display: inline-block;
  margin: 12px auto;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.qr-image {
  max-width: 250px;
  width: 100%;
  height: auto;
  display: block;
}

.deposit-info-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  text-align: left;
}

.deposit-info-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #eae2d5;
  font-size: 0.9rem;
}

.deposit-info-table td.label {
  font-weight: 600;
  color: #645a4f;
  width: 35%;
}

.deposit-info-table td.val {
  font-weight: 700;
  color: #1c1917;
}

.copy-pill {
  cursor: pointer;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.82rem;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.copy-pill:hover {
  background: #e2e8f0;
}

/* Tables in Notebook Style */
.notebook-table-card {
  background: #ffffff;
  border: 2px solid var(--pencil-dark);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 4px 6px 0 var(--pencil-dark);
  overflow-x: auto;
  margin-bottom: 24px;
}

.notebook-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.notebook-table th {
  background: #fbf7f0;
  border-bottom: 2px solid var(--pencil-dark);
  padding: 10px 12px;
  text-align: left;
  font-weight: 800;
  color: #3b332b;
}

.notebook-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #ebe3d7;
  color: #2b2521;
}

.notebook-table tr:hover {
  background: #fdfcf9;
}

/* Admin Tabs Layout */
.admin-subnav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  border-bottom: 2px dashed #d5cbbe;
  padding-bottom: 12px;
}

.admin-subtab-btn {
  background: #f5efe6;
  border: 1.5px solid #d0c5b7;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #574d44;
  cursor: pointer;
  transition: all 0.15s ease;
}

.admin-subtab-btn.active {
  background: var(--pencil-dark);
  color: #ffffff;
  border-color: var(--pencil-dark);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

/* CTV Portal Cards */
.ctv-stat-card {
  background: #ecfdf5;
  border: 2px solid #059669;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 3px 4px 0 #059669;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #ffffff;
  border: 2px solid var(--pencil-dark);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 4px 4px 0 var(--pencil-dark);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideInRight 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  max-width: 360px;
}

.toast.toast-success {
  background: #ecfdf5;
  border-color: #059669;
  box-shadow: 3px 3px 0 #059669;
  color: #065f46;
}

.toast.toast-error {
  background: #fef2f2;
  border-color: #dc2626;
  box-shadow: 3px 3px 0 #dc2626;
  color: #991b1b;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Footer Note & Layout */
footer.app-footer {
  background: #f7f3ec;
  border-top: 2px dashed #d5cbbe;
  padding: 36px 20px 24px;
  color: #475569;
  font-size: 0.92rem;
  margin-top: 48px;
}

.footer-container {
  max-width: 1060px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  text-align: left;
}

.footer-heading {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin-top: 0;
  margin-bottom: 16px;
  position: relative;
  letter-spacing: -0.01em;
}

.footer-heading::after {
  content: '';
  display: block;
  width: 42px;
  height: 3px;
  background: #f59e0b;
  border-radius: 2px;
  margin-top: 6px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links li a {
  color: #1e293b;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.footer-links li a::before {
  content: '▸';
  color: #f59e0b;
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.footer-links li a:hover {
  color: #d97706;
  text-decoration: underline;
  transform: translateX(4px);
}

.footer-contact-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #1e293b;
  font-size: 0.95rem;
  line-height: 1.45;
}

.footer-icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.footer-highlight-link {
  color: #0f172a;
  font-weight: 800;
  text-decoration: underline;
  transition: color 0.2s;
}

.footer-highlight-link:hover {
  color: #d97706;
}

.footer-bottom {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px dashed #d5cbbe;
  text-align: center;
}

.footer-bottom-brand {
  font-family: var(--font-hand);
  font-size: 1.35rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 6px;
}

.footer-bottom-copy {
  font-size: 0.8rem;
  color: #78716c;
}

/* Policy & Terms Modal Style */
.policy-modal-paper {
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.policy-modal-body {
  overflow-y: auto;
  padding-right: 6px;
  margin-top: 10px;
  line-height: 1.6;
}

.policy-card {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.04);
}

.policy-card h4 {
  margin: 0 0 10px 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1.5px dashed #e2e8f0;
  padding-bottom: 8px;
}

.policy-card p {
  margin: 6px 0;
  color: #334155;
  font-size: 0.92rem;
}

/* ====================================================== */
/* RESPONSIVE DESIGN - MOBILE & TABLET OPTIMIZATIONS     */
/* ====================================================== */

@media (max-width: 768px) {

  /* Prevent ANY horizontal page overflow on mobile devices */
  html,
  body {
    overflow-x: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
    position: relative;
  }

  /* Binder Rings Top Decoration */
  .notebook-binder {
    padding: 5px 6px;
    gap: 8px;
    overflow: hidden;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
  }

  .binder-ring {
    width: 9px;
    height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
  }

  .binder-ring:nth-child(n+8) {
    display: none !important;
  }

  /* Header & Logo */
  header.app-header {
    padding: 8px 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible;
  }

  .header-container {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .header-top-row {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .logo-brand {
    gap: 7px;
    flex: 1 !important;
    min-width: 0 !important;
    max-width: 100%;
    overflow: hidden;
  }

  .logo-badge {
    font-size: 1.15rem;
    padding: 4px 6px;
    border-radius: 8px;
    box-shadow: 2px 2px 0 var(--pencil-dark);
    flex-shrink: 0;
  }

  .logo-title {
    font-size: 1.25rem;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .logo-subtitle {
    font-size: 0.66rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-controls {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    flex-shrink: 0 !important;
  }

  .header-control-btn {
    padding: 5px 8px !important;
    font-size: 0.78rem !important;
    border-radius: 8px !important;
  }

  .header-control-btn .control-label {
    display: none !important;
  }

  /* Nav Bookmarks: Responsive 3-column grid on mobile - NO overflowing buttons */
  .nav-bookmarks {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
    overflow: visible !important;
    padding: 2px 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .tab-btn {
    width: 100% !important;
    min-width: 0 !important;
    padding: 7px 4px !important;
    font-size: 0.77rem !important;
    font-weight: 700 !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    border: 1.5px solid #d5cbbe !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
  }

  .tab-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tab-btn.active {
    border-color: var(--pencil-dark) !important;
    box-shadow: 2px 2px 0 var(--pencil-dark) !important;
  }

  /* User Quick Bar: Clean 2-row card on mobile that never overflows */
  .user-quick-bar {
    width: 100%;
    max-width: 100%;
    margin-top: 2px;
    box-sizing: border-box;
  }

  .user-bar-container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    background: #fdfbf7;
    border: 1.5px solid #dcd4c7;
    border-radius: 12px;
    padding: 8px 8px;
    box-shadow: 2px 2px 0 var(--pencil-dark);
  }

  .user-meta-group {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 5px !important;
    box-sizing: border-box !important;
  }

  .user-identity {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
  }

  .user-uname {
    font-size: 0.8rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 95px !important;
    display: inline-block;
  }

  .role-badge {
    font-size: 0.65rem !important;
    padding: 2px 5px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .user-actions {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
    flex-wrap: nowrap !important;
  }

  .user-id-chip {
    font-size: 0.72rem !important;
    padding: 2px 5px !important;
    border-radius: 4px !important;
    white-space: nowrap !important;
  }

  .user-actions .btn-memo,
  .btn-logout {
    padding: 3px 7px !important;
    font-size: 0.72rem !important;
    height: 26px !important;
    min-height: 0 !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .user-balance-group {
    width: 100% !important;
    display: flex !important;
    gap: 6px !important;
    box-sizing: border-box !important;
  }

  .balance-pill {
    width: 100% !important;
    flex: 1 !important;
    min-width: 0 !important;
    justify-content: space-between !important;
    padding: 6px 10px !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
  }

  .bal-label {
    font-size: 0.78rem !important;
    white-space: nowrap !important;
  }

  .bal-val {
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
  }

  .bal-add-tag {
    font-size: 0.72rem !important;
    padding: 2px 6px !important;
    white-space: nowrap !important;
  }

  .user-auth-btns {
    width: 100% !important;
    display: flex !important;
    gap: 6px !important;
  }

  .user-auth-btns .btn-memo {
    flex: 1 !important;
    padding: 8px 8px !important;
    font-size: 0.84rem !important;
    text-align: center !important;
  }

  /* Main Content Layout */
  main.main-content {
    margin: 8px auto !important;
    padding: 0 8px 40px 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Bulletin & Cards */
  .bulletin-board {
    padding: 14px 10px !important;
    border-radius: 12px !important;
    margin-bottom: 16px !important;
    box-shadow: 2px 3px 0 rgba(70, 55, 40, 0.2) !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .bulletin-header {
    padding-left: 24px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 10px;
  }

  .bulletin-title {
    font-size: 1.25rem;
  }

  .board-pin {
    top: -10px;
    left: 8px;
    font-size: 1.25rem;
  }

  .washi-tape-strip {
    width: 75px;
    height: 16px;
    top: -8px;
  }

  /* Fixed Deposit Code Memo Box */
  .fixed-deposit-memo-card {
    padding: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-bottom: 14px !important;
  }

  .fixed-deposit-memo-header {
    font-size: 0.85rem !important;
    gap: 6px !important;
  }

  .fixed-memo-title {
    font-size: 0.8rem !important;
  }

  .fixed-memo-code {
    font-size: 0.95rem !important;
    padding: 2px 6px !important;
  }

  .fixed-memo-desc {
    font-size: 0.78rem !important;
    line-height: 1.4 !important;
    margin-top: 6px !important;
  }

  /* Deposit Input Box */
  .deposit-input-card {
    padding: 14px 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .view-page-title {
    font-size: 1.65rem !important;
  }

  /* Section Headlines & Products Grid */
  .section-headline {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 12px;
  }

  .section-title {
    font-size: 1.45rem;
  }

  .products-grid {
    grid-template-columns: 100% !important;
    gap: 14px;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .product-card {
    padding: 16px 12px 12px 12px;
    border-radius: 12px;
    box-shadow: 3px 3px 0 var(--pencil-dark);
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .product-name {
    font-size: 1.12rem;
  }

  .product-pricing-box {
    padding: 8px 10px;
  }

  .price-main {
    font-size: 1.25rem;
  }

  /* Quick Amount Grid on Deposit */
  .quick-amounts-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 5px !important;
    margin-bottom: 12px;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .quick-amounts-grid .btn-memo {
    width: 100% !important;
    padding: 8px 1px !important;
    font-size: 0.78rem !important;
    text-align: center !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }

  /* VietQR Deposit Box */
  .qr-deposit-box {
    padding: 14px 8px;
    width: 100%;
    box-sizing: border-box;
  }

  .qr-image {
    max-width: 200px;
  }

  .deposit-info-table td {
    padding: 5px 3px;
    font-size: 0.8rem;
  }

  .deposit-info-table td.label {
    width: 35%;
    font-size: 0.76rem;
  }

  .copy-pill {
    padding: 2px 5px;
    font-size: 0.7rem;
    margin-left: 3px;
  }

  /* Table Cards */
  .notebook-table-card {
    padding: 8px 6px;
    border-radius: 10px;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    box-sizing: border-box;
  }

  .notebook-table th,
  .notebook-table td {
    padding: 7px 5px;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  /* Admin Subtabs: Responsive 2-column grid on mobile - NO overflowing buttons */
  .admin-subnav {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
    overflow: visible !important;
    padding-bottom: 4px !important;
    margin-bottom: 14px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .admin-subtab-btn {
    width: 100% !important;
    min-width: 0 !important;
    padding: 7px 6px !important;
    font-size: 0.75rem !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    box-sizing: border-box !important;
  }

  /* Multi-column grids in all views collapse to 1 column on mobile (except 3-col toggle buttons) */
  .tab-view div[style*="grid-template-columns: 1fr 1fr"]:not([style*="1fr 1fr 1fr"]),
  .tab-view div[style*="grid-template-columns: 360px 1fr"],
  .tab-view div[style*="grid-template-columns: 380px 1fr"],
  .tab-view div[style*="grid-template-columns: 1.15fr 0.85fr"],
  .tab-view div[style*="grid-template-columns: 2fr 1fr"],
  .tab-view div[style*="grid-template-columns: repeat(auto-fit"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Profile overview cards & Admin KPI cards: 2 columns on mobile */
  /* Profile overview cards: 1 column on mobile (prevents horizontal cramping and text clipping) */
  #view-profile div[style*="minmax(210px, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  #view-profile div[style*="minmax(210px, 1fr)"] > div {
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  /* Admin KPI cards: 2 columns on mobile */
  #view-admin div[style*="minmax(190px, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  /* Fix any fixed-width containers on mobile */
  .tab-view div[style*="width: 320px"] {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Profile subtab buttons fit 50/50 on mobile */
  #prof-tab-btn-balance,
  #prof-tab-btn-orders {
    flex: 1 1 calc(50% - 6px) !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 8px 6px !important;
    font-size: 0.76rem !important;
    white-space: nowrap !important;
  }

  /* Modals */
  .modal-paper {
    padding: 18px 12px;
    border-radius: 14px;
    width: 95%;
    max-height: 94vh;
    margin: 8px;
    box-shadow: 4px 6px 0 var(--pencil-dark);
    box-sizing: border-box;
  }

  .modal-close-btn {
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
    z-index: 99999 !important;
    pointer-events: auto !important;
  }

  /* Toast Notification */
  #toast-container {
    bottom: 12px;
    left: 8px;
    right: 8px;
    align-items: stretch;
  }

  .toast {
    max-width: none;
    font-size: 0.82rem;
    padding: 10px 12px;
  }
}

@media (max-width: 380px) {
  .logo-title {
    font-size: 1.15rem !important;
  }

  .tab-btn {
    font-size: 0.72rem !important;
    padding: 6px 2px !important;
  }

  .quick-amounts-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  #view-profile div[style*="minmax(210px, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
}

.live-pulse-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: #16a34a;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
  animation: pulseGreen 1.8s infinite;
}

@keyframes pulseGreen {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
  }

  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 8px rgba(22, 163, 74, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
  }
}

/* Responsive cho mục Thêm Sản Phẩm Riêng & Footer & Header Controls */
@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  #admin-sec-custom-products div[style*="grid-template-columns: 1fr 1fr"],
  #admin-sec-custom-products div[style*="grid-template-columns: 2fr 1fr"],
  #admin-sec-custom-products div[style*="grid-template-columns: 1fr 1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  .header-top-row {
    justify-content: space-between !important;
    gap: 8px !important;
  }
}

@media (max-width: 480px) {
  .header-control-btn {
    padding: 5px 8px !important;
    font-size: 0.8rem !important;
  }

  .header-control-btn .control-label {
    display: none !important;
  }

  /* Receipt Modal Mobile Fine-Tuning */
  .receipt-modal-paper {
    padding: 14px 12px !important;
    width: 95% !important;
    max-width: 95% !important;
    border-radius: 12px !important;
  }

  .receipt-title-clean {
    font-size: 1.25rem !important;
  }

  .receipt-stamp-pill {
    font-size: 0.65rem !important;
    padding: 1px 6px !important;
    right: 52px !important;
    pointer-events: none !important;
    user-select: none !important;
    z-index: 5 !important;
  }

  .dns-compact-row {
    gap: 5px !important;
  }

  .dns-compact-input {
    font-size: 0.76rem !important;
    padding: 0 6px !important;
    height: 34px !important;
  }

  .btn-compact-dns {
    padding: 0 8px !important;
    font-size: 0.76rem !important;
    height: 34px !important;
  }

  .dns-steps-compact {
    padding: 8px 10px !important;
  }

  .dns-step-item {
    font-size: 0.78rem !important;
    line-height: 1.42 !important;
  }

  .btn-compact-action {
    font-size: 0.76rem !important;
    padding: 0 4px !important;
    height: 36px !important;
  }
}

/* ====================================================== */
/* ========================================
   REFINED COMPACT RECEIPT MODAL (LIGHT BASE)
   ======================================== */
.receipt-modal-paper {
  background: #ffffff !important;
  border: 2px solid var(--pencil-dark) !important;
  box-shadow: 4px 6px 0 var(--pencil-dark) !important;
  border-radius: 14px !important;
}

.receipt-header-clean {
  position: relative;
  padding-bottom: 10px;
  border-bottom: 1.5px dashed #e2e8f0;
  margin-bottom: 10px;
}

.receipt-stamp-pill {
  position: absolute;
  top: 0;
  right: 58px !important;
  background: #fef2f2;
  border: 1.5px solid #ef4444;
  color: #dc2626;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  transform: rotate(4deg);
  letter-spacing: 0.5px;
  pointer-events: none !important;
  user-select: none !important;
  z-index: 5 !important;
}

.receipt-title-clean {
  font-family: var(--font-hand);
  font-size: 1.45rem;
  color: #854d0e;
  margin: 0 0 4px 0;
  line-height: 1.25;
}

.receipt-meta-clean {
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.4;
}

.receipt-meta-clean b {
  color: #1e293b;
}

/* Compact DNS Link Card */
.dns-compact-card {
  background: #f0fdf4;
  border: 1.5px solid #22c55e;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 9px;
}

.dns-compact-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.dns-compact-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #166534;
}

.dns-compact-badge {
  background: #bbf7d0;
  color: #15803d;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
}

.dns-compact-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.dns-compact-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  background: #ffffff;
  border: 1.5px solid #86efac;
  border-radius: 6px;
  padding: 0 9px;
  font-family: monospace;
  font-size: 0.82rem;
  color: #065f46;
  font-weight: 700;
  outline: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-compact-dns {
  height: 36px;
  padding: 0 11px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: all 0.15s ease;
  border: none;
}

.btn-dns-open {
  background: #059669;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.3);
}

.btn-dns-open:hover {
  background: #047857;
}

.btn-dns-copy {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
}

.btn-dns-copy:hover {
  background: #f1f5f9;
}

/* 4-Step Instructions (Clean & Compact) */
.dns-steps-compact {
  background: #fefce8;
  border: 1.5px solid #fef08a;
  border-radius: 9px;
  padding: 8px 11px;
  margin-bottom: 9px;
}

.dns-steps-heading {
  font-size: 0.82rem;
  font-weight: 800;
  color: #854d0e;
  margin-bottom: 5px;
}

.dns-step-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dns-step-item {
  font-size: 0.8rem;
  color: #713f12;
  line-height: 1.35;
}

.dns-step-item b {
  color: #451a03;
}

/* Modal Bottom Action Row */
.receipt-action-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.btn-compact-action {
  flex: 1;
  height: 38px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.15s ease;
}

.btn-action-guide {
  background: #eff6ff;
  border: 1.5px solid #3b82f6;
  color: #1d4ed8;
}

.btn-action-guide:hover {
  background: #dbeafe;
}

.btn-action-support {
  background: #ecfdf5;
  border: 1.5px solid #10b981;
  color: #047857;
}

.btn-action-support:hover {
  background: #d1fae5;
}

/* General product text */
.general-data-text {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: monospace;
  font-size: 0.86rem;
  color: #1e293b;
  line-height: 1.5;
  margin: 8px 0;
}

.receipt-footer-clean {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

/* MODAL: GUIDE IMAGES (BƯỚC 1 & BƯỚC 2) */
.guide-modal-paper {
  max-width: 980px;
  width: 96%;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
}

.guide-tabs-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.guide-tab-btn {
  flex: 1;
  padding: 10px 12px;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.guide-tab-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.guide-tab-btn.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.2);
}

.guide-tab-badge {
  background: #f59e0b;
  color: #ffffff;
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
}

.guide-image-container {
  overflow-y: auto;
  text-align: center;
  flex: 1;
  padding: 10px;
  background: #090d16;
  border-radius: 10px;
  border: 1.5px solid #1e293b;
  max-height: 65vh;
}

.guide-image-container img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
  display: block;
  margin: 0 auto;
}

.guide-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 8px;
  flex-wrap: wrap;
}

.guide-nav-actions {
  display: flex;
  gap: 8px;
}

/* CTV Simplified Stats Cards (Số tiền đã mua, Số đơn, KPI 5 đơn/tháng) */
.ctv-card-money {
  background: #ecfdf5;
  border: 2px solid #059669;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 3px 4px 0 #059669;
}

.ctv-card-orders {
  background: #eff6ff;
  border: 2px solid #3b82f6;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 3px 4px 0 #3b82f6;
}

.ctv-card-kpi {
  background: #fefce8;
  border: 2px solid #ca8a04;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 3px 4px 0 #ca8a04;
}

/* ====================================================== */
/* TOÀN DIỆN DARK MODE - SỔ TAY ĐÊM & BẢNG ĐEN CỔ ĐIỂN    */
/* Tối ưu độ tương phản văn bản, 100% rõ nét, đẹp mắt    */
/* ====================================================== */
body.dark-mode {
  background-color: #121214 !important;
  color: #f4f4f5 !important;
}

/* 1. HEADER & TOP NAV */
body.dark-mode header.app-header {
  background: #1c1c1f !important;
  border-bottom-color: #3f3f46 !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45) !important;
}

body.dark-mode .logo-title {
  color: #fde047 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

body.dark-mode .logo-subtitle {
  color: #cbd5e1 !important;
}

body.dark-mode .logo-badge {
  background: #27272a !important;
  color: #fde047 !important;
  border-color: #52525b !important;
  box-shadow: 3px 3px 0 #000000 !important;
}

body.dark-mode .header-control-btn {
  background: #27272a !important;
  color: #f4f4f5 !important;
  border-color: #52525b !important;
  box-shadow: 2px 2px 0 #000000 !important;
}

body.dark-mode .header-control-btn:hover {
  background: #3f3f46 !important;
  color: #fde047 !important;
}

body.dark-mode .lang-dropdown-menu {
  background: #27272a !important;
  border-color: #52525b !important;
  box-shadow: 3px 4px 0 #000000 !important;
}

body.dark-mode .lang-menu-item {
  color: #f4f4f5 !important;
}

body.dark-mode .lang-menu-item:hover {
  background: #3f3f46 !important;
  color: #fde047 !important;
}

body.dark-mode .lang-menu-item.active {
  background: #52525b !important;
  color: #fde047 !important;
}

body.dark-mode .tab-btn {
  background: #27272a !important;
  border-color: #3f3f46 !important;
  color: #cbd5e1 !important;
}

body.dark-mode .tab-btn:hover {
  background: #3f3f46 !important;
  color: #ffffff !important;
}

body.dark-mode .tab-btn.active {
  background: #121214 !important;
  color: #fde047 !important;
  border-color: #71717a !important;
  border-bottom: 2px solid #121214 !important;
}

body.dark-mode .user-info-card,
body.dark-mode .user-identity,
body.dark-mode .user-id-chip,
body.dark-mode .balance-pill {
  background: #27272a !important;
  border-color: #52525b !important;
  color: #f4f4f5 !important;
}

body.dark-mode .user-uname,
body.dark-mode .user-uname b {
  color: #f4f4f5 !important;
}

body.dark-mode .user-id-chip b {
  color: #fde047 !important;
}

body.dark-mode .bal-val {
  color: #fde047 !important;
}

body.dark-mode .btn-logout {
  background: #27272a !important;
  color: #f87171 !important;
  border-color: #ef4444 !important;
}

/* 2. BULLETIN BOARD & ANNOUNCEMENTS (BẢNG TIN ADMIN) */
body.dark-mode .bulletin-board {
  background: #18181b !important;
  border-color: #3f3f46 !important;
  box-shadow: 4px 6px 0 #000000 !important;
}

body.dark-mode .bulletin-title {
  color: #fde047 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode #store-banner-notice {
  color: #cbd5e1 !important;
}

body.dark-mode .announcement-note {
  background: #27272a !important;
  border-color: #52525b !important;
  box-shadow: 3px 4px 0 #000000 !important;
  color: #f4f4f5 !important;
}

body.dark-mode .announcement-note:nth-child(even) {
  background: #1e2638 !important;
  border-color: #3b82f6 !important;
}

body.dark-mode .note-title {
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 1.05rem !important;
}

body.dark-mode .note-desc {
  color: #e2e8f0 !important;
  line-height: 1.5 !important;
}

body.dark-mode .note-badge {
  background: #3f3f46 !important;
  color: #fde047 !important;
  border: 1px solid #71717a !important;
}

/* 3. STORE PRODUCTS (KHẮC PHỤC TRIỆT ĐỂ CHỮ TỐI TRONG CARD SẢN PHẨM) */
body.dark-mode .section-title {
  color: #fde047 !important;
}

body.dark-mode .section-headline div {
  color: #cbd5e1 !important;
}

body.dark-mode .product-card {
  background: #1e1e24 !important;
  border-color: #3f3f46 !important;
  box-shadow: 4px 6px 0 #000000 !important;
}

body.dark-mode .product-cat {
  color: #fbbf24 !important;
  font-weight: 700 !important;
}

body.dark-mode .product-name {
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 1.25rem !important;
  letter-spacing: 0.3px !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

body.dark-mode .price-main {
  color: #4ade80 !important;
  font-weight: 800 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

body.dark-mode .ctv-badge-highlight {
  background: #064e3b !important;
  color: #6ee7b7 !important;
  border-color: #059669 !important;
}

body.dark-mode .price-sub {
  color: #cbd5e1 !important;
}

body.dark-mode .price-sub b {
  color: #fde047 !important;
}

body.dark-mode .product-desc {
  color: #f1f5f9 !important;
  background: #131316 !important;
  border: 1px solid #2e2e36 !important;
  border-radius: 8px !important;
  padding: 10px 12px !important;
  line-height: 1.5 !important;
}

body.dark-mode .product-meta {
  color: #94a3b8 !important;
  border-top-color: #27272a !important;
}

body.dark-mode .product-meta span {
  color: #cbd5e1 !important;
}

body.dark-mode .product-tag {
  background: #991b1b !important;
  color: #fef08a !important;
  border-color: #ef4444 !important;
}

/* 4. BUTTONS (NÚT BẤM SÁNG RÕ) */
body.dark-mode .btn-memo-primary {
  background: #eab308 !important;
  color: #18181b !important;
  font-weight: 800 !important;
  border-color: #ca8a04 !important;
  box-shadow: 2px 3px 0 #000000 !important;
}

body.dark-mode .btn-memo-primary:hover {
  background: #facc15 !important;
  color: #000000 !important;
}

body.dark-mode .btn-memo {
  background: #27272a !important;
  color: #f4f4f5 !important;
  border-color: #52525b !important;
  box-shadow: 2px 2px 0 #000000 !important;
}

body.dark-mode .btn-memo:hover {
  background: #3f3f46 !important;
  color: #ffffff !important;
}

body.dark-mode .btn-memo-success {
  background: #059669 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
}

body.dark-mode .btn-memo-warning {
  background: #d97706 !important;
  color: #ffffff !important;
  border-color: #f59e0b !important;
}

body.dark-mode .btn-memo-danger {
  background: #b91c1c !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
}

/* 5. TABLES (BẢNG DỮ LIỆU ĐƠN HÀNG, NẠP TIỀN, CTV, ADMIN) */
body.dark-mode .notebook-table-card {
  background: #18181b !important;
  border-color: #3f3f46 !important;
  box-shadow: 4px 6px 0 #000000 !important;
}

body.dark-mode .notebook-table th {
  background: #27272a !important;
  color: #fde047 !important;
  border-bottom: 2px solid #52525b !important;
  font-weight: 800 !important;
}

body.dark-mode .notebook-table td {
  border-bottom: 1px dashed #3f3f46 !important;
  color: #f4f4f5 !important;
}

body.dark-mode .notebook-table tbody tr:hover {
  background: #242429 !important;
}

/* 6. FORMS & INPUTS */
body.dark-mode .form-input,
body.dark-mode .form-textarea,
body.dark-mode .form-select {
  background: #141416 !important;
  border-color: #52525b !important;
  color: #f4f4f5 !important;
}

body.dark-mode .form-input:focus,
body.dark-mode .form-textarea:focus,
body.dark-mode .form-select:focus {
  border-color: #fde047 !important;
  outline: none;
}

body.dark-mode .form-label {
  color: #e2e8f0 !important;
  font-weight: 700 !important;
}

/* 7. ALL MODALS (MUA HÀNG, ĐƠN HÀNG, CTV, ADMIN) */
body.dark-mode .modal-paper {
  background: #18181b !important;
  border-color: #3f3f46 !important;
  color: #f4f4f5 !important;
  box-shadow: 6px 10px 0 #000000 !important;
}

body.dark-mode .modal-paper h3,
body.dark-mode .modal-paper h4 {
  color: #fde047 !important;
}

body.dark-mode .modal-paper p {
  color: #cbd5e1 !important;
}

body.dark-mode .modal-close-btn {
  background: #27272a !important;
  border-color: #ef4444 !important;
  color: #f87171 !important;
  box-shadow: 1px 2px 0 #000000 !important;
}

body.dark-mode .modal-close-btn:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
}

/* Receipt Modal Dark Specifics */
body.dark-mode .receipt-modal-paper {
  background: #18181b !important;
  border-color: #3f3f46 !important;
  box-shadow: 4px 6px 0 #000000 !important;
}

body.dark-mode .receipt-header-clean {
  border-bottom-color: #27272a !important;
}

body.dark-mode .receipt-stamp-pill {
  background: #450a0a !important;
  border-color: #f87171 !important;
  color: #fca5a5 !important;
}

body.dark-mode .receipt-title-clean {
  color: #fde047 !important;
}

body.dark-mode .receipt-meta-clean {
  color: #a1a1aa !important;
}

body.dark-mode .receipt-meta-clean b {
  color: #f4f4f5 !important;
}

body.dark-mode .dns-compact-card {
  background: #0f291e !important;
  border-color: #10b981 !important;
}

body.dark-mode .dns-compact-title {
  color: #6ee7b7 !important;
}

body.dark-mode .dns-compact-badge {
  background: #064e3b !important;
  color: #a7f3d0 !important;
}

body.dark-mode .dns-compact-input {
  background: #091712 !important;
  border-color: #059669 !important;
  color: #a7f3d0 !important;
}

body.dark-mode .btn-dns-copy {
  background: #27272a !important;
  border-color: #3f3f46 !important;
  color: #e4e4e7 !important;
}

body.dark-mode .dns-steps-compact {
  background: #241e0f !important;
  border-color: #a16207 !important;
}

body.dark-mode .dns-steps-heading {
  color: #fde047 !important;
}

body.dark-mode .dns-step-item {
  color: #fef08a !important;
}

body.dark-mode .dns-step-item b {
  color: #ffffff !important;
}

body.dark-mode .btn-action-guide {
  background: #172554 !important;
  border-color: #3b82f6 !important;
  color: #93c5fd !important;
}

body.dark-mode .btn-action-support {
  background: #0f291e !important;
  border-color: #10b981 !important;
  color: #6ee7b7 !important;
}

body.dark-mode .general-data-text {
  background: #18181b !important;
  border-color: #27272a !important;
  color: #e4e4e7 !important;
}

body.dark-mode .guide-tab-btn {
  background: #27272a !important;
  border-color: #3f3f46 !important;
  color: #d4d4d8 !important;
}

body.dark-mode .guide-tab-btn.active {
  background: #3b82f6 !important;
  color: #ffffff !important;
  border-color: #60a5fa !important;
}

/* 8. CTV AREA CARDS & BADGES */
body.dark-mode .ctv-card-money {
  background: #0f291e !important;
  border-color: #10b981 !important;
  box-shadow: 3px 4px 0 #047857 !important;
}

body.dark-mode .ctv-card-orders {
  background: #172554 !important;
  border-color: #3b82f6 !important;
  box-shadow: 3px 4px 0 #1d4ed8 !important;
}

body.dark-mode .ctv-card-kpi {
  background: #2a2211 !important;
  border-color: #eab308 !important;
  box-shadow: 3px 4px 0 #a16207 !important;
}

body.dark-mode #ctv-stat-spent {
  color: #6ee7b7 !important;
}

body.dark-mode #ctv-stat-orders {
  color: #93c5fd !important;
}

body.dark-mode #ctv-stat-kpi {
  color: #fde047 !important;
}

body.dark-mode #ctv-stat-month-spent {
  color: #a7f3d0 !important;
}

body.dark-mode #ctv-stat-month-orders {
  color: #bfdbfe !important;
}

body.dark-mode #ctv-stat-kpi-desc {
  color: #fef08a !important;
}

/* 9. OVERRIDE THÔNG MINH CHO CÁC STYLE INLINE MÀU NỀN SÁNG TRONG DARK MODE */
body.dark-mode [style*="background: #ffffff"],
body.dark-mode [style*="background:#ffffff"],
body.dark-mode [style*="background: #fff"],
body.dark-mode [style*="background:#fff"],
body.dark-mode [style*="background: #f8fafc"],
body.dark-mode [style*="background:#f8fafc"],
body.dark-mode [style*="background: #fffdf9"],
body.dark-mode [style*="background:#fffdf9"],
body.dark-mode [style*="background: #faf8f5"],
body.dark-mode [style*="background:#faf8f5"] {
  background: #1e1e24 !important;
  border-color: #3f3f46 !important;
  color: #f4f4f5 !important;
}

body.dark-mode [style*="background: #eff6ff"],
body.dark-mode [style*="background:#eff6ff"] {
  background: #172554 !important;
  border-color: #3b82f6 !important;
  color: #bfdbfe !important;
}

body.dark-mode [style*="background: #f0fdf4"],
body.dark-mode [style*="background:#f0fdf4"],
body.dark-mode [style*="background: #dcfce7"],
body.dark-mode [style*="background:#dcfce7"] {
  background: #0f291e !important;
  border-color: #10b981 !important;
  color: #a7f3d0 !important;
}

body.dark-mode [style*="background: #fdf2f8"],
body.dark-mode [style*="background:#fdf2f8"],
body.dark-mode [style*="background: #fce7f3"],
body.dark-mode [style*="background:#fce7f3"] {
  background: #2e1026 !important;
  border-color: #ec4899 !important;
  color: #fbcfe8 !important;
}

body.dark-mode [style*="background: #fefce8"],
body.dark-mode [style*="background:#fefce8"],
body.dark-mode [style*="background: #fef08a"],
body.dark-mode [style*="background:#fef08a"] {
  background: #2a2211 !important;
  border-color: #eab308 !important;
  color: #fef08a !important;
}

body.dark-mode [style*="background: #faf5ff"],
body.dark-mode [style*="background:#faf5ff"] {
  background: #25143a !important;
  border-color: #a855f7 !important;
  color: #e9d5ff !important;
}

body.dark-mode [style*="background: #fff7ed"],
body.dark-mode [style*="background:#fff7ed"],
body.dark-mode [style*="background: #ffedd5"],
body.dark-mode [style*="background:#ffedd5"] {
  background: #431407 !important;
  border-color: #ea580c !important;
  color: #fed7aa !important;
}

body.dark-mode [style*="background: #fee2e2"],
body.dark-mode [style*="background:#fee2e2"],
body.dark-mode [style*="background: #fff1f2"],
body.dark-mode [style*="background:#fff1f2"] {
  background: #450a0a !important;
  border-color: #ef4444 !important;
  color: #fca5a5 !important;
}

/* 10. OVERRIDE THÔNG MINH CHO CÁC STYLE INLINE MÀU CHỮ TỐI TRONG DARK MODE */
body.dark-mode [style*="color:#78716c"],
body.dark-mode [style*="color: #78716c"],
body.dark-mode [style*="color:#6b5f54"],
body.dark-mode [style*="color: #6b5f54"],
body.dark-mode [style*="color:#64748b"],
body.dark-mode [style*="color: #64748b"],
body.dark-mode [style*="color:#475569"],
body.dark-mode [style*="color: #475569"] {
  color: #cbd5e1 !important;
}

body.dark-mode [style*="color:#1f1d1a"],
body.dark-mode [style*="color: #1f1d1a"],
body.dark-mode [style*="color:#1a1715"],
body.dark-mode [style*="color: #1a1715"],
body.dark-mode [style*="color:#0f172a"],
body.dark-mode [style*="color: #0f172a"] {
  color: #ffffff !important;
}

body.dark-mode [style*="color:#38302a"],
body.dark-mode [style*="color: #38302a"],
body.dark-mode [style*="color:#574e44"],
body.dark-mode [style*="color: #574e44"] {
  color: #fde047 !important;
}

body.dark-mode [style*="color:#4b443c"],
body.dark-mode [style*="color: #4b443c"],
body.dark-mode [style*="color:#334155"],
body.dark-mode [style*="color: #334155"],
body.dark-mode [style*="color:#374151"],
body.dark-mode [style*="color: #374151"] {
  color: #e2e8f0 !important;
}

body.dark-mode [style*="color:#1e293b"],
body.dark-mode [style*="color: #1e293b"] {
  color: #f8fafc !important;
}

body.dark-mode [style*="color:#065f46"],
body.dark-mode [style*="color: #065f46"],
body.dark-mode [style*="color:#047857"],
body.dark-mode [style*="color: #047857"],
body.dark-mode [style*="color:#15803d"],
body.dark-mode [style*="color: #15803d"] {
  color: #6ee7b7 !important;
}

body.dark-mode [style*="color:#1e3a8a"],
body.dark-mode [style*="color: #1e3a8a"],
body.dark-mode [style*="color:#1d4ed8"],
body.dark-mode [style*="color: #1d4ed8"],
body.dark-mode [style*="color:#1e40af"],
body.dark-mode [style*="color: #1e40af"] {
  color: #93c5fd !important;
}

body.dark-mode [style*="color:#78350f"],
body.dark-mode [style*="color: #78350f"],
body.dark-mode [style*="color:#854d0e"],
body.dark-mode [style*="color: #854d0e"],
body.dark-mode [style*="color:#b45309"],
body.dark-mode [style*="color: #b45309"],
body.dark-mode [style*="color:#ca8a04"],
body.dark-mode [style*="color: #ca8a04"] {
  color: #fde047 !important;
}

body.dark-mode [style*="color:#9a3412"],
body.dark-mode [style*="color: #9a3412"],
body.dark-mode [style*="color:#7c2d12"],
body.dark-mode [style*="color: #7c2d12"] {
  color: #fed7aa !important;
}

/* 11. FOOTER IN DARK MODE */
body.dark-mode footer.app-footer {
  background: #121214 !important;
  border-top-color: #27272a !important;
  color: #a1a1aa !important;
}

body.dark-mode .footer-heading {
  color: #fde047 !important;
}

body.dark-mode .footer-links li a {
  color: #e4e4e7 !important;
}

body.dark-mode .footer-links li a:hover {
  color: #fde047 !important;
}

body.dark-mode .footer-contact-item {
  color: #e4e4e7 !important;
}

body.dark-mode .footer-highlight-link {
  color: #93c5fd !important;
}

body.dark-mode .footer-bottom-brand {
  color: #fde047 !important;
}

/* 12. OUT OF STOCK BUTTON & CARD */
.btn-out-of-stock,
.btn-memo.btn-out-of-stock {
  background: #e2e8f0 !important;
  color: #64748b !important;
  border-color: #cbd5e1 !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  font-weight: 800 !important;
  opacity: 0.85;
  transform: none !important;
}

body.dark-mode .btn-out-of-stock,
body.dark-mode .btn-memo.btn-out-of-stock {
  background: #27272a !important;
  color: #71717a !important;
  border-color: #3f3f46 !important;
  box-shadow: none !important;
}

/* 13. PASSWORD VISIBILITY TOGGLE (HIỆN / ẨN MẬT KHẨU) */
.pwd-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.pwd-input-wrapper .form-input {
  width: 100%;
  padding-right: 42px !important;
}

.pwd-toggle-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 5px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
  z-index: 2;
}

.pwd-toggle-btn:hover {
  color: #0f172a;
  background: rgba(148, 163, 184, 0.16);
}

body.dark-mode .pwd-toggle-btn {
  color: #a1a1aa;
}

body.dark-mode .pwd-toggle-btn:hover {
  color: #fde047;
  background: rgba(255, 255, 255, 0.08);
}

/* 14. STORE CATEGORY FILTER BUTTONS */
.store-category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.store-cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 0.85rem;
  font-weight: 800;
  border-radius: 9px;
  background: #ffffff;
  color: #1e293b;
  border: 2px solid var(--pencil-dark);
  box-shadow: 2px 2px 0 var(--pencil-dark);
  cursor: pointer;
  transition: all 0.15s ease;
}

.store-cat-btn:hover {
  background: #fef9c3;
  transform: translateY(-1px);
}

.store-cat-btn.active {
  background: #f59e0b !important;
  color: #ffffff !important;
  border-color: var(--pencil-dark) !important;
  box-shadow: 2px 3px 0 var(--pencil-dark) !important;
}

.store-cat-count {
  background: rgba(15, 23, 42, 0.08);
  color: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 10px;
}

.store-cat-btn.active .store-cat-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

body.dark-mode .store-cat-btn {
  background: #1e1e22 !important;
  color: #f4f4f5 !important;
  border-color: #3f3f46 !important;
  box-shadow: 2px 2px 0 #000000 !important;
}

body.dark-mode .store-cat-btn:hover {
  border-color: #facc15 !important;
  color: #fde047 !important;
}

body.dark-mode .store-cat-btn.active {
  background: #eab308 !important;
  color: #09090b !important;
  border-color: #fde047 !important;
}

body.dark-mode .store-cat-btn.active .store-cat-count {
  background: rgba(0, 0, 0, 0.2);
  color: #09090b;
}

@media (max-width: 640px) {
  .store-category-filters {
    gap: 6px;
  }
  .store-cat-btn {
    padding: 6px 10px;
    font-size: 0.78rem;
  }
}



/* ======================================================== */
/* 📱 ULTIMATE MOBILE RESPONSIVE FIX (MAX-WIDTH: 768px)     */
/* ======================================================== */
html, body {
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
  position: relative !important;
  box-sizing: border-box !important;
}
*, *:before, *:after {
  box-sizing: border-box !important;
}

@media (max-width: 768px) {
  header.app-header {
    padding: 8px 10px !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  .header-container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    flex-direction: column !important;
  }
  .header-top-row {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .logo-brand {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  .logo-brand > div {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
  }
  .logo-badge {
    font-size: 1.15rem !important;
    flex-shrink: 0 !important;
  }
  .logo-title {
    font-size: 1.05rem !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .logo-subtitle {
    font-size: 0.65rem !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .header-controls {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    flex-shrink: 0 !important;
  }
  .header-control-btn {
    padding: 5px 8px !important;
    font-size: 0.78rem !important;
  }
  .header-control-btn .control-label {
    display: none !important;
  }

  .nav-bookmarks {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    gap: 6px !important;
    padding: 2px 2px 6px 2px !important;
  }
  .nav-bookmarks::-webkit-scrollbar {
    display: none !important;
  }
  .nav-bookmarks .tab-btn {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    padding: 7px 12px !important;
    font-size: 0.82rem !important;
  }

  .user-quick-bar {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .user-bar-container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 8px !important;
  }

  .app-container, main.main-content, .notebook-page, .store-page {
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  .bulletin-board {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    padding: 14px 10px !important;
    margin-bottom: 16px !important;
  }
  .announcements-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .announcement-note {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    transform: none !important;
  }

  .store-category-filters {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    gap: 6px !important;
    padding: 4px 2px 8px 2px !important;
  }
  .store-category-filters::-webkit-scrollbar {
    display: none !important;
  }
  .store-cat-btn {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
  }

  .products-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .product-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    padding: 16px 12px !important;
    border-radius: 12px !important;
    transform: none !important;
  }

  footer.app-footer {
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    padding: 24px 12px !important;
  }
  .footer-container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .footer-col {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
}

/* ====================================================== */
/* MOBILE NAVIGATION DRAWER & HAMBURGER BUTTON (3 GẠCH)   */
/* ====================================================== */
.btn-hamburger-menu {
  display: none !important;
}

@media (max-width: 768px) {
  .btn-hamburger-menu {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 5px 10px !important;
    font-size: 1.3rem !important;
    font-weight: 800 !important;
    background: #fef08a !important;
    color: #1e293b !important;
    border: 1.5px solid var(--pencil-dark) !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    box-shadow: 2px 2px 0 var(--pencil-dark) !important;
    line-height: 1 !important;
    user-select: none !important;
    touch-action: manipulation !important;
    margin-left: 2px !important;
    flex-shrink: 0 !important;
  }
  .btn-hamburger-menu:active {
    transform: translate(1px, 1px) !important;
    box-shadow: 1px 1px 0 var(--pencil-dark) !important;
  }
}

/* Mobile Drawer Backdrop */
.mobile-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 99998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile Drawer Sidebar */
.mobile-drawer-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 310px;
  max-width: 84vw;
  height: 100vh;
  height: 100dvh;
  background: #fffdf9;
  border-right: 2.5px solid var(--pencil-dark);
  box-shadow: 6px 0 26px rgba(0, 0, 0, 0.25);
  z-index: 99999;
  transform: translateX(-102%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.mobile-drawer-menu.active {
  transform: translateX(0);
}

body.drawer-open {
  overflow: hidden !important;
}

/* Mobile Drawer Header */
.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px;
  background: #ffffff;
  border-bottom: 2px dashed #cbd5e1;
  position: sticky;
  top: 0;
  z-index: 2;
}

.mobile-drawer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-logo-icon {
  font-size: 1.45rem;
  background: #fef08a;
  border: 1.5px solid var(--pencil-dark);
  border-radius: 8px;
  padding: 4px 6px;
  box-shadow: 1.5px 1.5px 0 var(--pencil-dark);
}

.drawer-brand-title {
  font-family: var(--font-hand);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--pencil-dark);
  line-height: 1.1;
}

.drawer-brand-subtitle {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 1px;
}

.mobile-drawer-close {
  background: #fee2e2;
  border: 1.5px solid #ef4444;
  color: #991b1b;
  font-size: 1.1rem;
  font-weight: 800;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 1.5px 1.5px 0 #ef4444;
  transition: transform 0.1s ease;
}

.mobile-drawer-close:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}

/* User Section inside Drawer */
.mobile-drawer-user-section {
  padding: 12px 14px;
  border-bottom: 1.5px solid #e2e8f0;
  background: #fafaf9;
}

.drawer-user-card {
  background: #ffffff;
  border: 1.5px solid var(--pencil-dark);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 2px 2px 0 var(--pencil-dark);
}

.drawer-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fef08a;
  border: 1.5px solid var(--pencil-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.drawer-user-balance-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #cbd5e1;
}

.drawer-guest-card {
  background: #ffffff;
  border: 1.5px solid var(--pencil-dark);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 2px 2px 0 var(--pencil-dark);
}

/* Nav Links inside Drawer */
.mobile-drawer-nav {
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.drawer-nav-group-title {
  font-size: 0.68rem;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.5px;
  padding: 4px 8px;
}

.drawer-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  color: #1e293b;
  text-decoration: none;
  border: 1.5px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, border 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.drawer-nav-item:active {
  background: #fef08a !important;
  border-color: var(--pencil-dark) !important;
  transform: translate(1px, 1px);
}

.drawer-nav-item.active {
  background: #ffffff;
  border: 1.5px solid var(--pencil-dark);
  box-shadow: 2px 2px 0 var(--pencil-dark);
  color: #0f172a;
}

.drawer-nav-icon {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.drawer-nav-text {
  flex: 1;
}

.drawer-nav-badge,
.drawer-nav-tag {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 800;
  flex-shrink: 0;
}

.drawer-nav-badge {
  background: #fef08a;
  color: #854d0e;
  border: 1px solid #ca8a04;
}

/* Drawer Tools */
.mobile-drawer-tools {
  padding: 12px 14px;
  border-top: 1.5px dashed #cbd5e1;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-tool-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px;
  font-size: 0.82rem;
  font-weight: 700;
  background: #ffffff;
  border: 1.5px solid var(--pencil-dark);
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 1.5px 1.5px 0 var(--pencil-dark);
}

.drawer-lang-btn {
  flex: 1;
  padding: 6px 4px;
  font-size: 0.74rem;
  font-weight: 700;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}

.drawer-lang-btn.active {
  background: #fef08a;
  border-color: #ca8a04;
  color: #854d0e;
  box-shadow: 1px 1px 0 #ca8a04;
}

/* Drawer Footer */
.mobile-drawer-footer {
  padding: 12px 14px 18px 14px;
  background: #fafaf9;
  border-top: 1px solid #e2e8f0;
}

/* Dark mode overrides for Mobile Drawer */
body.dark-mode .mobile-drawer-menu {
  background: #18181b !important;
  border-right-color: #3f3f46 !important;
  color: #f1f5f9 !important;
}

body.dark-mode .mobile-drawer-header {
  background: #27272a !important;
  border-bottom-color: #3f3f46 !important;
}

body.dark-mode .drawer-brand-title {
  color: #fde047 !important;
}

body.dark-mode .mobile-drawer-user-section {
  background: #202023 !important;
  border-bottom-color: #3f3f46 !important;
}

body.dark-mode .drawer-user-card,
body.dark-mode .drawer-guest-card {
  background: #27272a !important;
  border-color: #3f3f46 !important;
  box-shadow: 2px 2px 0 #000 !important;
}

body.dark-mode .drawer-nav-item {
  color: #e2e8f0 !important;
}

body.dark-mode .drawer-nav-item.active {
  background: #27272a !important;
  border-color: #fde047 !important;
  color: #fde047 !important;
  box-shadow: 2px 2px 0 #000 !important;
}

body.dark-mode .mobile-drawer-tools,
body.dark-mode .mobile-drawer-footer {
  background: #202023 !important;
  border-top-color: #3f3f46 !important;
}

body.dark-mode .drawer-tool-btn,
body.dark-mode .drawer-lang-btn {
  background: #27272a !important;
  border-color: #3f3f46 !important;
  color: #f1f5f9 !important;
  box-shadow: 1.5px 1.5px 0 #000 !important;
}


/* ==========================================================================
   PAGE PRELOADER & RELOAD EFFECT (VN STORE NOTEBOOK)
   ========================================================================== */
.app-preloader {
  position: fixed;
  inset: 0;
  z-index: 9999999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s ease;
}

.app-preloader.preloader-fade-out {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.preloader-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(249, 246, 240, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body.dark-mode .preloader-backdrop {
  background: rgba(18, 18, 20, 0.96);
}

.preloader-card {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 38px;
  background: #ffffff;
  border: 2px solid #2d2a26;
  border-radius: 20px;
  box-shadow: 6px 6px 0 #2d2a26;
  max-width: 320px;
  width: 90%;
  text-align: center;
  animation: preloaderCardPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

body.dark-mode .preloader-card {
  background: #18181b;
  border-color: #facc15;
  box-shadow: 6px 6px 0 #000000;
}

@keyframes preloaderCardPop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.preloader-notebook-art {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.preloader-ring-spinner {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3.5px dashed #eab308;
  animation: preloaderSpin 3s linear infinite;
}

body.dark-mode .preloader-ring-spinner {
  border-color: #facc15;
}

@keyframes preloaderSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.preloader-book-center {
  font-size: 2.4rem;
  line-height: 1;
  animation: preloaderBounce 1.6s ease-in-out infinite;
}

@keyframes preloaderBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-7px) scale(1.08); }
}

.preloader-title {
  font-family: 'Patrick Hand', cursive, sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #2d2a26;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

body.dark-mode .preloader-title {
  color: #fde047;
}

.preloader-subtitle {
  font-size: 0.82rem;
  font-weight: 600;
  color: #736c64;
  margin-bottom: 16px;
}

body.dark-mode .preloader-subtitle {
  color: #a1a1aa;
}

.preloader-progress-track {
  width: 100%;
  height: 6px;
  background: #f0ebe1;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid #dcd4c7;
}

body.dark-mode .preloader-progress-track {
  background: #27272a;
  border-color: #3f3f46;
}

.preloader-progress-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #eab308, #10b981, #06b6d4, #eab308);
  background-size: 200% 100%;
  border-radius: 999px;
  animation: preloaderGradMove 1.4s linear infinite;
}

@keyframes preloaderGradMove {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.preloader-status {
  font-size: 0.78rem;
  font-weight: 600;
  color: #8c8275;
  animation: preloaderPulse 1.2s ease-in-out infinite;
}

body.dark-mode .preloader-status {
  color: #71717a;
}

@keyframes preloaderPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Top Progress Bar */
#top-loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #eab308, #10b981, #3b82f6);
  z-index: 99999999;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.7);
  transition: width 0.3s ease, opacity 0.4s ease;
  pointer-events: none;
}

/* Skeleton Loading for Products */
.product-skeleton-card {
  background: #ffffff;
  border: 2px solid #2d2a26;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 4px 4px 0 #2d2a26;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

body.dark-mode .product-skeleton-card {
  background: #18181b;
  border-color: #3f3f46;
  box-shadow: 4px 4px 0 #000000;
}

.skeleton-shimmer {
  background: linear-gradient(90deg, rgba(220, 212, 199, 0.4) 0%, rgba(240, 235, 225, 0.9) 50%, rgba(220, 212, 199, 0.4) 100%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: 8px;
}

body.dark-mode .skeleton-shimmer {
  background: linear-gradient(90deg, #27272a 0%, #3f3f46 50%, #27272a 100%);
  background-size: 200% 100%;
}

@keyframes skeletonShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-thumb {
  width: 100%;
  height: 120px;
  border-radius: 12px;
}

.skeleton-badge {
  width: 45%;
  height: 20px;
  border-radius: 6px;
}

.skeleton-title {
  width: 80%;
  height: 24px;
}

.skeleton-price {
  width: 60%;
  height: 26px;
  border-radius: 6px;
}

.skeleton-btn {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  margin-top: 4px;
}

/* APP PRELOADER & RELOAD EFFECT */
#app-preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999999;
  background-color: #fdfbf7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s ease;
  pointer-events: auto;
  user-select: none;
  font-family: 'Patrick Hand', 'Be Vietnam Pro', -apple-system, sans-serif;
}
[data-theme="dark"] #app-preloader {
  background-color: #16171a !important;
  color: #f3f4f6 !important;
}
#app-preloader.fade-out {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: 24px;
}
.loader-book-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loader-book-icon {
  font-size: 42px;
  animation: bookBounce 1.2s ease-in-out infinite;
  display: inline-block;
  transform-origin: bottom center;
}
.loader-spinner-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3.5px solid rgba(234, 179, 8, 0.18);
  border-top-color: #eab308;
  border-right-color: #10b981;
  animation: spinRing 0.85s linear infinite;
}
.loader-brand {
  font-size: 21px;
  font-weight: 700;
  color: #2d2a26;
  letter-spacing: 0.5px;
}
[data-theme="dark"] .loader-brand {
  color: #f9fafb !important;
}
.loader-status {
  font-size: 14.5px;
  color: #736c64;
  display: flex;
  align-items: center;
  gap: 6px;
}
[data-theme="dark"] .loader-status {
  color: #9ca3af !important;
}
.loader-dots span {
  display: inline-block;
  animation: dotPulse 1.4s infinite;
  font-weight: 800;
}
.loader-dots span:nth-child(2) { animation-delay: 0.2s; }
.loader-dots span:nth-child(3) { animation-delay: 0.4s; }

.loader-bar-bg {
  width: 150px;
  height: 4px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
  margin-top: 2px;
}
[data-theme="dark"] .loader-bar-bg {
  background: rgba(255, 255, 255, 0.12) !important;
}
.loader-bar-fill {
  position: absolute;
  height: 100%;
  width: 45%;
  background: linear-gradient(90deg, #eab308, #10b981);
  border-radius: 99px;
  animation: barSlide 1.25s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes spinRing {
  to { transform: rotate(360deg); }
}
@keyframes bookBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-7px) scale(1.06); }
}
@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.2); }
}
@keyframes barSlide {
  0% { left: -45%; width: 35%; }
  50% { left: 30%; width: 50%; }
  100% { left: 100%; width: 25%; }
}