@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

@tailwind base;
@tailwind components;
@tailwind utilities;

/* ==========================================================================
   Kuncup Store Global Theme Tokens
   Reference:
     - Light Mode: Sand Beige (#F7F1E7 / #FFFCF7 / #EFE4D3 / #765238)
     - Dark Mode: Modern Navy (#0B1120 / #111B2E / #17243A / #1D2B42 / #18B7A0)
   ========================================================================== */

:root,
html[data-theme="light"] {
  color-scheme: light;

  /* Surfaces & Backgrounds */
  --bg-page: #F7F1E7;
  --bg-panel: #FFFCF7;
  --bg-surface-secondary: #EFE4D3;
  --bg-surface-elevated: #FFFFFF;

  /* Modals & Dialogs */
  --bg-modal: #FFFCF7;
  --bg-modal-header: #FFFCF7;
  --bg-modal-body: #FFFCF7;
  --bg-modal-footer: #EFE4D3;
  --bg-overlay: rgba(48, 40, 32, 0.65);
  --modal-border: #E5D7C4;

  /* Typography / Text */
  --text-primary: #302820;
  --text-secondary: #786B5E;
  --text-muted: #8F8174;
  --text-inverted: #FFFFFF;

  /* Primary Accent (Warm Brown) */
  --color-accent: #765238;
  --color-accent-hover: #5F412C;
  --color-accent-light: #F2EAE1;
  --color-accent-text: #FFFFFF;

  /* Interactive Links */
  --color-link: #765238;
  --color-link-hover: #5F412C;

  /* Borders & Dividers */
  --color-border: #E5D7C4;
  --color-border-subtle: #EFE4D3;
  --color-border-focus: #765238;

  /* Form Controls & Inputs */
  --input-bg: #FFFFFF;
  --input-border: #E5D7C4;
  --input-text: #302820;
  --input-placeholder: #8F8174;
  --input-focus-border: #765238;
  --input-focus-ring: rgba(118, 82, 56, 0.20);

  /* Tables */
  --table-header-bg: #EFE4D3;
  --table-header-text: #786B5E;
  --table-row-hover: #F2E8DC;
  --table-border: #E5D7C4;

  /* Buttons */
  --btn-primary-bg: #765238;
  --btn-primary-text: #FFFFFF;
  --btn-primary-hover: #5F412C;
  --btn-secondary-bg: #FFFCF7;
  --btn-secondary-text: #302820;
  --btn-secondary-border: #E5D7C4;
  --btn-secondary-hover-bg: #EFE4D3;
  --btn-disabled-bg: #EFE4D3;
  --btn-disabled-text: #8F8174;
  --btn-disabled-border: #E5D7C4;

  /* Semantic Status Tokens (Distinguishable & Accessible) */
  --color-success: #1E6B42;
  --color-success-bg: #E8F5ED;
  --color-success-border: #BCE2CB;
  --color-success-text: #134B2E;

  --color-warning: #B36B1E;
  --color-warning-bg: #FEF3C7;
  --color-warning-border: #FDE68A;
  --color-warning-text: #854308;

  --color-danger: #B83535;
  --color-danger-bg: #FEE2E2;
  --color-danger-border: #FECACA;
  --color-danger-text: #881919;

  --color-info: #2B6999;
  --color-info-bg: #E4F1FA;
  --color-info-border: #B7D9F0;
  --color-info-text: #16466B;

  /* Admin Dashboard Theme Tokens (Sand Beige) */
  --admin-sidebar-bg: #2B1E17;
  --admin-sidebar-surface: #221711;
  --admin-sidebar-border: #3D2C22;
  --admin-sidebar-text: #F7F1E7;
  --admin-sidebar-muted: #A89B8F;
  --admin-sidebar-active: #765238;
  --admin-sidebar-active-text: #FFFFFF;

  --admin-header-bg: #FFFCF7;
  --admin-header-border: #E5D7C4;

  /* Theme Toggle Component */
  --theme-toggle-bg: #FFFCF7;
  --theme-toggle-border: #E5D7C4;
  --theme-toggle-text: #302820;
  --theme-toggle-hover-bg: #EFE4D3;

  /* Shadows */
  --card-shadow: 0 4px 16px -2px rgba(48, 40, 32, 0.06);
  --card-shadow-hover: 0 12px 32px -4px rgba(48, 40, 32, 0.12);
  --modal-shadow: 0 20px 45px -10px rgba(48, 40, 32, 0.25);
}

html.dark,
html[data-theme="dark"] {
  color-scheme: dark;

  /* Surfaces & Backgrounds */
  --bg-page: #0B1120;
  --bg-panel: #111B2E;
  --bg-surface-secondary: #17243A;
  --bg-surface-elevated: #1D2B42;

  /* Modals & Dialogs */
  --bg-modal: #111B2E;
  --bg-modal-header: #111B2E;
  --bg-modal-body: #111B2E;
  --bg-modal-footer: #17243A;
  --bg-overlay: rgba(5, 9, 17, 0.80);
  --modal-border: #293950;

  /* Typography / Text */
  --text-primary: #E8EEF7;
  --text-secondary: #A7B5C9;
  --text-muted: #7A8CA3;
  --text-inverted: #0B1120;

  /* Primary Accent (Modern Navy Teal) */
  --color-accent: #18B7A0;
  --color-accent-hover: #139E8A;
  --color-accent-light: rgba(24, 183, 160, 0.15);
  --color-accent-text: #0B1120;

  /* Interactive Links */
  --color-link: #18B7A0;
  --color-link-hover: #3CD0BB;

  /* Borders & Dividers */
  --color-border: #293950;
  --color-border-subtle: #1D2B42;
  --color-border-focus: #18B7A0;

  /* Form Controls & Inputs */
  --input-bg: #17243A;
  --input-border: #293950;
  --input-text: #E8EEF7;
  --input-placeholder: #64758D;
  --input-focus-border: #18B7A0;
  --input-focus-ring: rgba(24, 183, 160, 0.25);

  /* Tables */
  --table-header-bg: #17243A;
  --table-header-text: #A7B5C9;
  --table-row-hover: #1D2B42;
  --table-border: #293950;

  /* Buttons */
  --btn-primary-bg: #18B7A0;
  --btn-primary-text: #0B1120;
  --btn-primary-hover: #139E8A;
  --btn-secondary-bg: #17243A;
  --btn-secondary-text: #E8EEF7;
  --btn-secondary-border: #293950;
  --btn-secondary-hover-bg: #1D2B42;
  --btn-disabled-bg: #17243A;
  --btn-disabled-text: #596B82;
  --btn-disabled-border: #223247;

  /* Semantic Status Tokens (Distinguishable & Accessible) */
  --color-success: #34D399;
  --color-success-bg: rgba(52, 211, 153, 0.15);
  --color-success-border: rgba(52, 211, 153, 0.35);
  --color-success-text: #6EE7B7;

  --color-warning: #FBBF24;
  --color-warning-bg: rgba(251, 191, 36, 0.15);
  --color-warning-border: rgba(251, 191, 36, 0.35);
  --color-warning-text: #FDE68A;

  --color-danger: #F87171;
  --color-danger-bg: rgba(248, 113, 113, 0.15);
  --color-danger-border: rgba(248, 113, 113, 0.35);
  --color-danger-text: #FCA5A5;

  --color-info: #38BDF8;
  --color-info-bg: rgba(56, 189, 248, 0.15);
  --color-info-border: rgba(56, 189, 248, 0.35);
  --color-info-text: #7DD3FC;

  /* Admin Dashboard Theme Tokens (Modern Navy) */
  --admin-sidebar-bg: #0B1120;
  --admin-sidebar-surface: #111B2E;
  --admin-sidebar-border: #293950;
  --admin-sidebar-text: #E8EEF7;
  --admin-sidebar-muted: #A7B5C9;
  --admin-sidebar-active: #18B7A0;
  --admin-sidebar-active-text: #0B1120;

  --admin-header-bg: #111B2E;
  --admin-header-border: #293950;

  /* Theme Toggle Component */
  --theme-toggle-bg: #17243A;
  --theme-toggle-border: #293950;
  --theme-toggle-text: #E8EEF7;
  --theme-toggle-hover-bg: #1D2B42;

  /* Shadows */
  --card-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.45);
  --card-shadow-hover: 0 12px 32px -4px rgba(0, 0, 0, 0.60);
  --modal-shadow: 0 24px 50px -10px rgba(0, 0, 0, 0.75);
}

/* ==========================================================================
   Base Layout & Document Setup
   ========================================================================== */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  width: 100%;
  max-width: 100%;
  transition: background-color 0.2s ease, color 0.2s ease;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  background-color: var(--bg-page) !important;
  color: var(--text-primary) !important;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s ease, color 0.2s ease;
}

main {
  width: 100%;
  max-width: 100%;
}

/* Safe Area Inset Support */
.safe-area-bottom {
  padding-bottom: max(1rem, env(safe-area-inset-bottom, 1rem));
}
.safe-area-top {
  padding-top: max(0.5rem, env(safe-area-inset-top, 0.5rem));
}

/* Viewport height utility */
.h-dvh {
  height: 100vh;
  height: 100dvh;
}
.min-h-dvh {
  min-height: 100vh;
  min-height: 100dvh;
}

/* Custom Scrollbars */
.no-scrollbar::-webkit-scrollbar,
.scrollbar-none::-webkit-scrollbar {
  display: none;
}
.no-scrollbar,
.scrollbar-none {
  -ms-overflow-style: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   Editorial Buttons & Core Interactive Components
   ========================================================================== */

.btn-primary {
  background-color: var(--btn-primary-bg) !important;
  color: var(--btn-primary-text) !important;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 9999px;
  padding: 0.75rem 1.625rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary:hover {
  background-color: var(--btn-primary-hover) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: var(--btn-secondary-bg) !important;
  color: var(--btn-secondary-text) !important;
  border: 1px solid var(--btn-secondary-border) !important;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 9999px;
  padding: 0.75rem 1.625rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}
.btn-secondary:hover {
  background-color: var(--btn-secondary-hover-bg) !important;
  border-color: var(--color-accent) !important;
  color: var(--color-accent) !important;
  transform: translateY(-1px);
}

.btn-coffee {
  background-color: var(--color-accent) !important;
  color: var(--color-accent-text) !important;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 9999px;
  padding: 0.75rem 1.625rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  cursor: pointer;
}
.btn-coffee:hover {
  background-color: var(--color-accent-hover) !important;
  transform: translateY(-1px);
}

/* Disabled State across all buttons */
button:disabled,
button[disabled],
a[disabled],
.btn-disabled {
  background-color: var(--btn-disabled-bg) !important;
  color: var(--btn-disabled-text) !important;
  border-color: var(--btn-disabled-border) !important;
  opacity: 0.85 !important;
  cursor: not-allowed !important;
  pointer-events: none;
}

/* Editorial Product Card */
.editorial-card {
  background-color: var(--bg-panel) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: 1.25rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--card-shadow);
}
.editorial-card:hover {
  border-color: var(--color-accent) !important;
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background-color: var(--theme-toggle-bg);
  border: 1px solid var(--theme-toggle-border);
  color: var(--theme-toggle-text);
  box-shadow: var(--card-shadow);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.theme-toggle-btn:hover {
  background-color: var(--theme-toggle-hover-bg);
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* Forms & Inputs Theme Awareness */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="date"],
select,
textarea {
  background-color: var(--input-bg);
  color: var(--input-text);
  border-color: var(--input-border);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
input::placeholder,
textarea::placeholder {
  color: var(--input-placeholder);
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--input-focus-border) !important;
  outline: none;
}

/* ==========================================================================
   Admin Header & Sidebar Locked Overrides
   ========================================================================== */

#admin-sidebar {
  background-color: var(--admin-sidebar-bg) !important;
  border-right-color: var(--admin-sidebar-border) !important;
  color: var(--admin-sidebar-text) !important;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

#admin-sidebar .sidebar-heading {
  color: var(--admin-sidebar-muted) !important;
}

#admin-sidebar .border-b,
#admin-sidebar .border-t,
#admin-sidebar .border-l {
  border-color: var(--admin-sidebar-border) !important;
}

#admin-sidebar a.bg-\[\#4F6F52\],
#admin-sidebar button.bg-\[\#4F6F52\] {
  background-color: var(--admin-sidebar-active) !important;
  color: var(--admin-sidebar-active-text) !important;
}

#admin-sidebar a:hover:not(.bg-\[\#4F6F52\]),
#admin-sidebar button:hover:not(.bg-\[\#4F6F52\]) {
  background-color: var(--admin-sidebar-surface) !important;
}

#admin-header {
  background-color: var(--admin-header-bg) !important;
  border-bottom-color: var(--admin-header-border) !important;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* ==========================================================================
   Light Mode (Theme 5 — Sand Beige) Global Utility Harmonization
   ========================================================================== */

html[data-theme="light"] body,
html:not(.dark) body {
  background-color: #F7F1E7 !important;
  color: #302820 !important;
}

html[data-theme="light"] .bg-white,
html:not(.dark) .bg-white {
  background-color: #FFFCF7 !important;
}

html[data-theme="light"] [class*="border-[#ECE5D8]"],
html[data-theme="light"] [class*="border-[#ECE6DB]"],
html[data-theme="light"] [class*="border-[#DDD6C8]"],
html[data-theme="light"] [class*="border-[#EADBCE]"],
html[data-theme="light"] [class*="border-[#E0D7C9]"],
html[data-theme="light"] [class*="border-[#EDE5D8]"],
html[data-theme="light"] [class*="border-[#E2DBD0]"],
html[data-theme="light"] [class*="border-[#D5CDBD]"],
html:not(.dark) [class*="border-[#ECE5D8]"],
html:not(.dark) [class*="border-[#ECE6DB]"],
html:not(.dark) [class*="border-[#DDD6C8]"],
html:not(.dark) [class*="border-[#EADBCE]"],
html:not(.dark) [class*="border-[#E0D7C9]"],
html:not(.dark) [class*="border-[#EDE5D8]"],
html:not(.dark) [class*="border-[#E2DBD0]"],
html:not(.dark) [class*="border-[#D5CDBD]"] {
  border-color: #E5D7C4 !important;
}

html[data-theme="light"] .text-\[\#242424\],
html[data-theme="light"] .text-\[\#26352A\],
html[data-theme="light"] .text-\[\#1E3A2B\],
html[data-theme="light"] .text-\[\#193223\],
html[data-theme="light"] .text-\[\#2B2118\],
html[data-theme="light"] .text-\[\#333333\],
html[data-theme="light"] .text-\[\#263B2D\],
html:not(.dark) .text-\[\#242424\],
html:not(.dark) .text-\[\#26352A\],
html:not(.dark) .text-\[\#1E3A2B\],
html:not(.dark) .text-\[\#193223\],
html:not(.dark) .text-\[\#2B2118\],
html:not(.dark) .text-\[\#333333\],
html:not(.dark) .text-\[\#263B2D\] {
  color: #302820 !important;
}

html[data-theme="light"] .text-\[\#4A4A4A\],
html[data-theme="light"] .text-\[\#5A5046\],
html[data-theme="light"] .text-\[\#7A6F64\],
html[data-theme="light"] .text-\[\#8C8275\],
html[data-theme="light"] .text-\[\#888888\],
html[data-theme="light"] .text-\[\#A89F93\],
html[data-theme="light"] .text-\[\#786B5E\],
html[data-theme="light"] .text-\[\#776E65\],
html[data-theme="light"] .text-\[\#555555\],
html[data-theme="light"] .text-\[\#666666\],
html:not(.dark) .text-\[\#4A4A4A\],
html:not(.dark) .text-\[\#5A5046\],
html:not(.dark) .text-\[\#7A6F64\],
html:not(.dark) .text-\[\#8C8275\],
html:not(.dark) .text-\[\#888888\],
html:not(.dark) .text-\[\#A89F93\],
html:not(.dark) .text-\[\#786B5E\],
html:not(.dark) .text-\[\#776E65\],
html:not(.dark) .text-\[\#555555\],
html:not(.dark) .text-\[\#666666\] {
  color: #786B5E !important;
}

/* Primary actions in light mode adopt warm Sand Beige accent #765238 */
html[data-theme="light"] button.bg-\[\#4F6F52\],
html[data-theme="light"] a.bg-\[\#4F6F52\],
html[data-theme="light"] button.bg-\[\#26352A\],
html[data-theme="light"] a.bg-\[\#26352A\],
html[data-theme="light"] button.bg-\[\#263B2D\],
html[data-theme="light"] a.bg-\[\#263B2D\],
html[data-theme="light"] button.bg-emerald-600,
html[data-theme="light"] a.bg-emerald-600,
html:not(.dark) button.bg-\[\#4F6F52\],
html:not(.dark) a.bg-\[\#4F6F52\],
html:not(.dark) button.bg-\[\#26352A\],
html:not(.dark) a.bg-\[\#26352A\],
html:not(.dark) button.bg-\[\#263B2D\],
html:not(.dark) a.bg-\[\#263B2D\],
html:not(.dark) button.bg-emerald-600,
html:not(.dark) a.bg-emerald-600 {
  background-color: #765238 !important;
  color: #FFFFFF !important;
  border-color: #765238 !important;
}

html[data-theme="light"] button.bg-\[\#4F6F52\]:hover,
html[data-theme="light"] a.bg-\[\#4F6F52\]:hover,
html[data-theme="light"] button.bg-\[\#26352A\]:hover,
html[data-theme="light"] a.bg-\[\#26352A\]:hover,
html[data-theme="light"] button.bg-\[\#263B2D\]:hover,
html[data-theme="light"] a.bg-\[\#263B2D\]:hover,
html:not(.dark) button.bg-\[\#4F6F52\]:hover,
html:not(.dark) a.bg-\[\#4F6F52\]:hover,
html:not(.dark) button.bg-\[\#26352A\]:hover,
html:not(.dark) a.bg-\[\#26352A\]:hover,
html:not(.dark) button.bg-\[\#263B2D\]:hover,
html:not(.dark) a.bg-\[\#263B2D\]:hover {
  background-color: #5F412C !important;
  color: #FFFFFF !important;
}

/* Active Tabs in Light Mode (Warm Beige Surface + Warm Brown Accent) */
html:not(.dark) button[class*="bg-emerald-50"],
html:not(.dark) a[class*="bg-emerald-50"],
html:not(.dark) [class*="bg-emerald-50"][class*="border-emerald-600"] {
  background-color: #EFE4D3 !important;
  color: #765238 !important;
  border-color: #765238 !important;
}

html:not(.dark) button[class*="bg-emerald-50"] svg,
html:not(.dark) a[class*="bg-emerald-50"] svg {
  color: #765238 !important;
}

/* ==========================================================================
   Dark Mode (Theme 6 — Modern Navy) Global Utility Harmonization
   ========================================================================== */

html.dark body,
html[data-theme="dark"] body {
  background-color: #0B1120 !important;
  color: #E8EEF7 !important;
}

/* Cards & Panel Backgrounds (Modern Navy Main Panels #111B2E) */
html.dark .bg-white,
html[data-theme="dark"] .bg-white {
  background-color: #111B2E !important;
}

/* Secondary Surfaces (#17243A) — Wildcard & Literal Matching */
html.dark [class*="bg-[#FAF8F5]"],
html.dark [class*="bg-[#F8F5ED]"],
html.dark [class*="bg-[#FAF8F3]"],
html.dark [class*="bg-[#F7EFE3]"],
html.dark [class*="bg-[#F5EFE6]"],
html.dark [class*="bg-[#F4F1EA]"],
html.dark [class*="bg-[#FAFAF7]"],
html.dark [class*="bg-[#F2ECE0]"],
html.dark [class*="bg-[#EFEAE0]"],
html.dark [class*="bg-[#EFE7DC]"],
html.dark [class*="bg-[#EFECE5]"],
html.dark [class*="bg-[#FAF7F2]"],
html.dark [class*="bg-[#E5EFE4]"],
html.dark [class*="bg-[#E4ECE3]"],
html.dark [class*="bg-[#E5EEE4]"],
html.dark [class*="bg-[#D4E5D2]"],
html.dark [class*="bg-[#D4E6D2]"],
html.dark [class*="bg-[#EBF4EC]"],
html.dark [class*="bg-[#E8F3EA]"],
html.dark [class*="bg-[#FFF8F0]"],
html.dark [class*="bg-[#FDF3E8]"],
html.dark [class*="bg-stone-50"],
html.dark [class*="bg-stone-100"],
html.dark [class*="bg-amber-50/40"],
html.dark .order-card-footer,
html[data-theme="dark"] [class*="bg-[#FAF8F5]"],
html[data-theme="dark"] [class*="bg-[#F8F5ED]"],
html[data-theme="dark"] [class*="bg-[#FAF8F3]"],
html[data-theme="dark"] [class*="bg-[#F7EFE3]"],
html[data-theme="dark"] [class*="bg-[#F5EFE6]"],
html[data-theme="dark"] [class*="bg-[#F4F1EA]"],
html[data-theme="dark"] [class*="bg-[#FAFAF7]"],
html[data-theme="dark"] [class*="bg-[#F2ECE0]"],
html[data-theme="dark"] [class*="bg-[#EFEAE0]"],
html[data-theme="dark"] [class*="bg-[#EFE7DC]"],
html[data-theme="dark"] [class*="bg-[#EFECE5]"],
html[data-theme="dark"] [class*="bg-[#FAF7F2]"],
html[data-theme="dark"] [class*="bg-[#E5EFE4]"],
html[data-theme="dark"] [class*="bg-[#E4ECE3]"],
html[data-theme="dark"] [class*="bg-[#E5EEE4]"],
html[data-theme="dark"] [class*="bg-[#D4E5D2]"],
html[data-theme="dark"] [class*="bg-[#D4E6D2]"],
html[data-theme="dark"] [class*="bg-[#EBF4EC]"],
html[data-theme="dark"] [class*="bg-[#E8F3EA]"],
html[data-theme="dark"] [class*="bg-[#FFF8F0]"],
html[data-theme="dark"] [class*="bg-[#FDF3E8]"],
html[data-theme="dark"] [class*="bg-stone-50"],
html[data-theme="dark"] [class*="bg-stone-100"],
html[data-theme="dark"] [class*="bg-amber-50/40"],
html[data-theme="dark"] .order-card-footer {
  background-color: #17243A !important;
}

/* Elevated Hover Surfaces (#1D2B42) */
html.dark [class*="hover:bg-[#F2ECE0]"]:hover,
html.dark [class*="hover:bg-[#EFEAE0]"]:hover,
html.dark [class*="hover:bg-[#FAF8F5]"]:hover,
html.dark [class*="hover:bg-[#F5EFE6]"]:hover,
html.dark [class*="hover:bg-[#F8FAFC]"]:hover,
html.dark [class*="hover:bg-[#FAF8F3]"]:hover,
html.dark [class*="hover:bg-[#EAE3D6]"]:hover,
html.dark [class*="hover:bg-[#F0EBE0]"]:hover,
html[data-theme="dark"] [class*="hover:bg-[#F2ECE0]"]:hover,
html[data-theme="dark"] [class*="hover:bg-[#EFEAE0]"]:hover,
html[data-theme="dark"] [class*="hover:bg-[#FAF8F5]"]:hover,
html[data-theme="dark"] [class*="hover:bg-[#F5EFE6]"]:hover,
html[data-theme="dark"] [class*="hover:bg-[#F8FAFC]"]:hover,
html[data-theme="dark"] [class*="hover:bg-[#FAF8F3]"]:hover,
html[data-theme="dark"] [class*="hover:bg-[#EAE3D6]"]:hover,
html[data-theme="dark"] [class*="hover:bg-[#F0EBE0]"]:hover {
  background-color: #1D2B42 !important;
}

/* Secondary Action Buttons in Dark Mode (Coordinate with dark cards) */
html.dark button.bg-white,
html.dark a.bg-white,
html.dark button[class*="bg-white"],
html.dark a[class*="bg-white"],
html[data-theme="dark"] button.bg-white,
html[data-theme="dark"] a.bg-white,
html[data-theme="dark"] button[class*="bg-white"],
html[data-theme="dark"] a[class*="bg-white"] {
  background-color: #17243A !important;
  color: #E8EEF7 !important;
  border-color: #293950 !important;
}

html.dark button.bg-white:hover,
html.dark a.bg-white:hover,
html.dark button[class*="bg-white"]:hover,
html.dark a[class*="bg-white"]:hover,
html[data-theme="dark"] button.bg-white:hover,
html[data-theme="dark"] a.bg-white:hover,
html[data-theme="dark"] button[class*="bg-white"]:hover,
html[data-theme="dark"] a[class*="bg-white"]:hover {
  background-color: #1D2B42 !important;
}

/* Primary Accent Interactive Elements (Modern Navy Vibrant Teal #18B7A0) */
html.dark .bg-\[\#4F6F52\],
html.dark .bg-\[\#1E3A2B\],
html.dark .bg-\[\#2D5A3A\],
html.dark .bg-\[\#26352A\],
html.dark .bg-\[\#263B2D\],
html.dark button.bg-emerald-600,
html.dark a.bg-emerald-600,
html.dark [class*="bg-[#4F6F52]"]:not([class*="animate-pulse"]):not([class*="rounded-full bg-[#4F6F52]"]),
html.dark [class*="bg-[#1E3A2B]"],
html.dark [class*="bg-[#26352A]"],
html.dark [class*="bg-[#263B2D]"],
html[data-theme="dark"] .bg-\[\#4F6F52\],
html[data-theme="dark"] .bg-\[\#1E3A2B\],
html[data-theme="dark"] .bg-\[\#2D5A3A\],
html[data-theme="dark"] .bg-\[\#26352A\],
html[data-theme="dark"] .bg-\[\#263B2D\],
html[data-theme="dark"] button.bg-emerald-600,
html[data-theme="dark"] a.bg-emerald-600,
html[data-theme="dark"] [class*="bg-[#4F6F52]"]:not([class*="animate-pulse"]):not([class*="rounded-full bg-[#4F6F52]"]),
html[data-theme="dark"] [class*="bg-[#1E3A2B]"],
html[data-theme="dark"] [class*="bg-[#26352A]"],
html[data-theme="dark"] [class*="bg-[#263B2D]"] {
  background-color: #18B7A0 !important;
  color: #0B1120 !important;
  border-color: #18B7A0 !important;
}

html.dark button.bg-emerald-600:hover,
html.dark a.bg-emerald-600:hover,
html.dark .bg-\[\#4F6F52\]:hover,
html.dark [class*="bg-[#4F6F52]"]:hover,
html.dark [class*="hover:bg-[#3D5740]"]:hover,
html.dark [class*="hover:bg-[#3D5640]"]:hover,
html.dark [class*="hover:bg-[#3e5841]"]:hover,
html.dark [class*="hover:bg-[#26352A]"]:hover,
html.dark [class*="hover:bg-[#384C3D]"]:hover,
html.dark [class*="hover:bg-[#344839]"]:hover,
html.dark [class*="hover:bg-[#344F3C]"]:hover,
html.dark [class*="hover:bg-[#1A251D]"]:hover,
html.dark [class*="hover:bg-[#16291E]"]:hover,
html[data-theme="dark"] button.bg-emerald-600:hover,
html[data-theme="dark"] a.bg-emerald-600:hover,
html[data-theme="dark"] .bg-\[\#4F6F52\]:hover,
html[data-theme="dark"] [class*="bg-[#4F6F52]"]:hover,
html[data-theme="dark"] [class*="hover:bg-[#3D5740]"]:hover,
html[data-theme="dark"] [class*="hover:bg-[#3D5640]"]:hover,
html[data-theme="dark"] [class*="hover:bg-[#3e5841]"]:hover,
html[data-theme="dark"] [class*="hover:bg-[#26352A]"]:hover,
html[data-theme="dark"] [class*="hover:bg-[#384C3D]"]:hover,
html[data-theme="dark"] [class*="hover:bg-[#344839]"]:hover,
html[data-theme="dark"] [class*="hover:bg-[#344F3C]"]:hover,
html[data-theme="dark"] [class*="hover:bg-[#1A251D]"]:hover,
html[data-theme="dark"] [class*="hover:bg-[#16291E]"]:hover {
  background-color: #139E8A !important;
  color: #0B1120 !important;
}

/* Active Sub-Tabs & Brand Indicators in Dark Mode */
html.dark button[class*="bg-emerald-50"],
html.dark a[class*="bg-emerald-50"],
html.dark [class*="bg-emerald-50"][class*="border-emerald-600"],
html.dark [class*="bg-emerald-50/40"],
html[data-theme="dark"] button[class*="bg-emerald-50"],
html[data-theme="dark"] a[class*="bg-emerald-50"],
html[data-theme="dark"] [class*="bg-emerald-50"][class*="border-emerald-600"],
html[data-theme="dark"] [class*="bg-emerald-50/40"] {
  background-color: #17243A !important;
  color: #18B7A0 !important;
  border-color: #18B7A0 !important;
}

html.dark button[class*="bg-emerald-50"] svg,
html.dark a[class*="bg-emerald-50"] svg,
html[data-theme="dark"] button[class*="bg-emerald-50"] svg,
html[data-theme="dark"] a[class*="bg-emerald-50"] svg {
  color: #18B7A0 !important;
}

/* Border Adaptations (#293950) — Wildcard Matching */
html.dark [class*="border-[#ECE5D8]"],
html.dark [class*="border-[#ECE6DB]"],
html.dark [class*="border-[#DDD6C8]"],
html.dark [class*="border-[#EADBCE]"],
html.dark [class*="border-[#E0D7C9]"],
html.dark [class*="border-[#EDE5D8]"],
html.dark [class*="border-[#E2DBD0]"],
html.dark [class*="border-[#D5CDBD]"],
html.dark [class*="border-[#C8BFB0]"],
html.dark [class*="border-[#EAE4D9]"],
html.dark [class*="border-[#CBD5E1]"],
html.dark [class*="border-[#C5DDC3]"],
html.dark [class*="border-[#B9DFC0]"],
html.dark [class*="border-[#D5E4D3]"],
html.dark [class*="border-[#EDE4D5]"],
html.dark [class*="border-[#EFE8DD]"],
html.dark [class*="border-[#F0EBE0]"],
html.dark [class*="border-[#EAE3D6]"],
html.dark [class*="border-[#DED5C7]"],
html.dark [class*="border-[#F2ECE1]"],
html.dark [class*="border-emerald-200"],
html[data-theme="dark"] [class*="border-[#ECE5D8]"],
html[data-theme="dark"] [class*="border-[#ECE6DB]"],
html[data-theme="dark"] [class*="border-[#DDD6C8]"],
html[data-theme="dark"] [class*="border-[#EADBCE]"],
html[data-theme="dark"] [class*="border-[#E0D7C9]"],
html[data-theme="dark"] [class*="border-[#EDE5D8]"],
html[data-theme="dark"] [class*="border-[#E2DBD0]"],
html[data-theme="dark"] [class*="border-[#D5CDBD]"],
html[data-theme="dark"] [class*="border-[#C8BFB0]"],
html[data-theme="dark"] [class*="border-[#EAE4D9]"],
html[data-theme="dark"] [class*="border-[#CBD5E1]"],
html[data-theme="dark"] [class*="border-[#C5DDC3]"],
html[data-theme="dark"] [class*="border-[#B9DFC0]"],
html[data-theme="dark"] [class*="border-[#D5E4D3]"],
html[data-theme="dark"] [class*="border-[#EDE4D5]"],
html[data-theme="dark"] [class*="border-[#EFE8DD]"],
html[data-theme="dark"] [class*="border-[#F0EBE0]"],
html[data-theme="dark"] [class*="border-[#EAE3D6]"],
html[data-theme="dark"] [class*="border-[#DED5C7]"],
html[data-theme="dark"] [class*="border-[#F2ECE1]"],
html[data-theme="dark"] [class*="border-emerald-200"] {
  border-color: #293950 !important;
}

/* Text Primary Adaptations (#E8EEF7) */
html.dark .text-\[\#242424\],
html.dark .text-\[\#26352A\],
html.dark .text-\[\#1E3A2B\],
html.dark .text-\[\#193223\],
html.dark .text-\[\#2B2118\],
html.dark .text-\[\#333333\],
html.dark .text-\[\#1E1E1E\],
html.dark .text-\[\#263B2D\],
html.dark .text-\[\#3B2118\],
html.dark .text-gray-900,
html.dark .text-gray-800,
html[data-theme="dark"] .text-\[\#242424\],
html[data-theme="dark"] .text-\[\#26352A\],
html[data-theme="dark"] .text-\[\#1E3A2B\],
html[data-theme="dark"] .text-\[\#193223\],
html[data-theme="dark"] .text-\[\#2B2118\],
html[data-theme="dark"] .text-\[\#333333\],
html[data-theme="dark"] .text-\[\#1E1E1E\],
html[data-theme="dark"] .text-\[\#263B2D\],
html[data-theme="dark"] .text-\[\#3B2118\],
html[data-theme="dark"] .text-gray-900,
html[data-theme="dark"] .text-gray-800 {
  color: #E8EEF7 !important;
}

/* Text Secondary Adaptations (#A7B5C9) */
html.dark .text-\[\#4A4A4A\],
html.dark .text-\[\#5A5046\],
html.dark .text-\[\#7A6F64\],
html.dark .text-\[\#8C8275\],
html.dark .text-\[\#888888\],
html.dark .text-\[\#A89F93\],
html.dark .text-\[\#786B5E\],
html.dark .text-\[\#777777\],
html.dark .text-\[\#776E65\],
html.dark .text-\[\#555555\],
html.dark .text-\[\#666666\],
html.dark .text-\[\#444444\],
html.dark .text-\[\#4E564E\],
html.dark .text-gray-600,
html.dark .text-gray-500,
html[data-theme="dark"] .text-\[\#4A4A4A\],
html[data-theme="dark"] .text-\[\#5A5046\],
html[data-theme="dark"] .text-\[\#7A6F64\],
html[data-theme="dark"] .text-\[\#8C8275\],
html[data-theme="dark"] .text-\[\#888888\],
html[data-theme="dark"] .text-\[\#A89F93\],
html[data-theme="dark"] .text-\[\#786B5E\],
html[data-theme="dark"] .text-\[\#777777\],
html[data-theme="dark"] .text-\[\#776E65\],
html[data-theme="dark"] .text-\[\#555555\],
html[data-theme="dark"] .text-\[\#666666\],
html[data-theme="dark"] .text-\[\#444444\],
html[data-theme="dark"] .text-\[\#4E564E\],
html[data-theme="dark"] .text-gray-600,
html[data-theme="dark"] .text-gray-500 {
  color: #A7B5C9 !important;
}

/* Brand Text & Status Pills */
html.dark .text-\[\#4F6F52\],
html.dark .text-\[\#1E3B26\],
html[data-theme="dark"] .text-\[\#4F6F52\],
html[data-theme="dark"] .text-\[\#1E3B26\] {
  color: #18B7A0 !important;
}

/* Floating Cart Widget Fixes */
html.dark [data-floating-cart],
html.dark .floating-cart-widget,
html[data-theme="dark"] [data-floating-cart],
html[data-theme="dark"] .floating-cart-widget {
  background-color: #18B7A0 !important;
  color: #0B1120 !important;
  border-color: #18B7A0 !important;
}

html.dark [data-floating-cart] .text-\[\#A6C2A9\],
html[data-theme="dark"] [data-floating-cart] .text-\[\#A6C2A9\] {
  color: rgba(11, 17, 32, 0.75) !important;
}

html:not(.dark) [data-floating-cart],
html:not(.dark) .floating-cart-widget {
  background-color: #765238 !important;
  color: #FFFFFF !important;
  border-color: #5F412C !important;
}

/* Hand-drawn Doodles (Caveat Font) in Dark Mode */
html.dark .font-\[\'Caveat\'\],
html[data-theme="dark"] .font-\[\'Caveat\'\] {
  color: #E8EEF7 !important;
}

/* Inputs, Textareas, and Dropdown Selects in Dark Mode */
html.dark input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
html.dark select,
html.dark textarea,
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background-color: #17243A !important;
  border-color: #293950 !important;
  color: #E8EEF7 !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder,
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #64758D !important;
}

/* Modals & Dialogs Dark Mode Overrides */
html.dark .dialog-box,
html.dark [role="dialog"] > div,
html.dark [aria-modal="true"] > div,
html.dark #cart-popup-modal > div,
html[data-theme="dark"] .dialog-box,
html[data-theme="dark"] [role="dialog"] > div,
html[data-theme="dark"] [aria-modal="true"] > div,
html[data-theme="dark"] #cart-popup-modal > div {
  background-color: #111B2E !important;
  color: #E8EEF7 !important;
  border-color: #293950 !important;
}

/* Modal Footers in Dark Mode */
html.dark .modal-footer,
html.dark [class*="modal-footer"],
html.dark #order-modal .border-t,
html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] [class*="modal-footer"],
html[data-theme="dark"] #order-modal .border-t {
  background-color: #17243A !important;
  border-color: #293950 !important;
}

/* Tables Dark Mode Overrides */
html.dark table thead th,
html[data-theme="dark"] table thead th {
  background-color: #17243A !important;
  color: #A7B5C9 !important;
  border-color: #293950 !important;
}
html.dark table tbody td,
html[data-theme="dark"] table tbody td {
  border-color: #293950 !important;
}
html.dark table tbody tr:hover,
html[data-theme="dark"] table tbody tr:hover {
  background-color: #1D2B42 !important;
}

/* Navigation Active Border & Bar Indicators */
html.dark .border-\[\#26352A\],
html[data-theme="dark"] .border-\[\#26352A\] {
  border-color: #18B7A0 !important;
}

/* Navbar backdrop in dark mode */
html.dark header.sticky,
html[data-theme="dark"] header.sticky {
  background-color: rgba(11, 17, 32, 0.92) !important;
  border-bottom-color: #293950 !important;
}

/* Alpine Cloak */
[x-cloak] {
  display: none !important;
}
