
/**
 * Palette Panel - Professional WordPress Dashboard & Commerce Styles
 * Author: Palette Digital Agency (https://palette.agency/)
 * Self-Contained, Standalone & Offline-Capable
 */

body.palette-body,
.palette-app,
#palette-admin-app,
.palette-admin-app,
.palette-app button,
.palette-app input,
.palette-app select,
.palette-app textarea,
#palette-admin-app button,
#palette-admin-app input,
#palette-admin-app select,
#palette-admin-app textarea,
.palette-modal,
.palette-modal button,
.palette-modal input,
.palette-modal textarea,
.badge,
.badge-count,
.wallet-amount {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Tahoma, sans-serif !important;
}

.palette-app input::placeholder,
.palette-app textarea::placeholder,
#palette-admin-app input::placeholder,
#palette-admin-app textarea::placeholder,
.palette-modal input::placeholder,
.palette-modal textarea::placeholder {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Tahoma, sans-serif !important;
    color: #64748b !important;
    opacity: 0.88 !important;
}

/* =========================================================================
 * 🌟 Form Controls, Inputs & Accessibility (WCAG 2.1 AA/AAA)
 * ========================================================================= */
#palette-admin-app input[type="text"]:not(.sr-only),
#palette-admin-app input[type="password"]:not(.sr-only),
#palette-admin-app input[type="email"]:not(.sr-only),
#palette-admin-app input[type="tel"]:not(.sr-only),
#palette-admin-app input[type="number"]:not(.sr-only),
#palette-admin-app select:not(.sr-only),
#palette-admin-app textarea:not(.sr-only),
.palette-app input[type="text"]:not(.sr-only):not([type="checkbox"]):not([type="radio"]),
.palette-app input[type="password"]:not(.sr-only),
.palette-app input[type="email"]:not(.sr-only),
.palette-app input[type="tel"]:not(.sr-only),
.palette-app input[type="number"]:not(.sr-only),
.palette-app select:not(.sr-only),
.palette-app textarea:not(.sr-only) {
    border: 1px solid rgba(203, 213, 225, 0.85) !important;
    background-color: #f8fafc !important;
    color: #1e293b !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease !important;
}

#palette-admin-app input:focus:not([type="checkbox"]):not([type="radio"]),
#palette-admin-app select:focus,
#palette-admin-app textarea:focus,
.palette-app input:focus:not([type="checkbox"]):not([type="radio"]),
.palette-app select:focus,
.palette-app textarea:focus {
    border-color: var(--palette-primary, #4c5e8b) !important;
    box-shadow: 0 0 0 3px rgba(76, 94, 139, 0.18) !important;
    background-color: #ffffff !important;
    outline: none !important;
}

/* Color Picker Inputs - Always visible with protective border */
#palette-admin-app input[type="color"],
.palette-app input[type="color"] {
    border: 1px solid #cbd5e1 !important;
    border-radius: 0.5rem !important;
    padding: 2px !important;
    background-color: #ffffff !important;
    cursor: pointer !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06) !important;
    transition: transform 0.15s ease, border-color 0.15s ease !important;
}
#palette-admin-app input[type="color"]:hover,
.palette-app input[type="color"]:hover {
    transform: scale(1.05);
    border-color: var(--palette-primary, #4c5e8b) !important;
}

/* Local Typography & Material Symbols (100% Offline & Self-Contained) */
@import url('palette-fonts.css');

:root {
  --palette-primary: #4c5e8b;
  --palette-primary-dim: #40527f;
  --palette-primary-container: #b6c8fc;
  --palette-on-primary: #f9f8ff;
  --palette-on-primary-container: #2e416c;
  --palette-secondary: #585f72;
  --palette-secondary-dim: #4c5366;
  --palette-secondary-container: #dbe2f9;
  --palette-on-secondary-container: #4a5164;
  --palette-tertiary: #6b5680;
  --palette-tertiary-dim: #5f4b73;
  --palette-tertiary-container: #e7cdfe;
  --palette-on-tertiary-container: #56426a;
  --palette-surface: #f9f9fe;
  --palette-surface-container: #ecedf6;
  --palette-surface-container-low: #f2f3fb;
  --palette-surface-container-high: #e6e8f1;
  --palette-surface-container-lowest: #ffffff;
  --palette-on-surface: #2f323b;
  --palette-on-surface-variant: #5b5f68;
  --palette-outline: #777b84;
  --palette-outline-variant: #dfe2ed;
  --palette-error: #a83836;
  --palette-error-container: #fa746f;
  --palette-radius: 1.5rem;
  --palette-font: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Tahoma, sans-serif;
}



/* Container & Typography Reset */
.palette-app, body.palette-body {
  font-family: var(--palette-font) !important;
  direction: rtl !important;
  text-align: right !important;
  color: var(--palette-on-surface);
  background-color: var(--palette-surface);
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

.palette-app * * {
  box-sizing: border-box;
}

.palette-app *:not(.material-symbols-outlined):not([class*="material-symbols"]){
  font-family: var(--palette-font);
}

/* Material Symbols Rendering Fix */
.material-symbols-outlined,
.palette-app .material-symbols-outlined{
  font-family: 'Material Symbols Outlined' !important;
  font-weight: normal !important;
  font-style: normal !important;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr !important;
  text-align: center;
  vertical-align: middle;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Standalone Utility Classes for Palette Panel Frontend & Modals */
.bg-primary { background-color: var(--palette-primary) !important; }
.bg-primary-dim { background-color: var(--palette-primary-dim) !important; }
.bg-primary-container { background-color: var(--palette-primary-container) !important; }
.bg-secondary { background-color: var(--palette-secondary) !important; }
.bg-secondary-container { background-color: var(--palette-secondary-container) !important; }
.bg-tertiary { background-color: var(--palette-tertiary) !important; }
.bg-tertiary-container { background-color: var(--palette-tertiary-container) !important; }
.bg-surface { background-color: var(--palette-surface) !important; }
.bg-surface-container { background-color: var(--palette-surface-container) !important; }
.bg-surface-container-low { background-color: var(--palette-surface-container-low) !important; }
.bg-surface-container-high { background-color: var(--palette-surface-container-high) !important; }
.bg-surface-container-lowest { background-color: var(--palette-surface-container-lowest) !important; }
.bg-background { background-color: var(--palette-surface) !important; }
.bg-white { background-color: #ffffff !important; }
.bg-white\/10 { background-color: rgba(255, 255, 255, 0.1) !important; }
.bg-white\/20 { background-color: rgba(255, 255, 255, 0.2) !important; }
.bg-slate-900\/60 { background-color: rgba(15, 23, 42, 0.6) !important; }
.bg-black\/50 { background-color: rgba(0, 0, 0, 0.5) !important; }
.bg-black\/60 { background-color: rgba(0, 0, 0, 0.6) !important; }
.bg-emerald-50 { background-color: #ecfdf5 !important; }
.bg-emerald-500\/10 { background-color: rgba(16, 185, 129, 0.1) !important; }
.bg-amber-50 { background-color: #fffbeb !important; }
.bg-amber-500 { background-color: #f59e0b !important; }
.bg-amber-500\/10 { background-color: rgba(245, 158, 11, 0.1) !important; }
.bg-blue-50 { background-color: #eff6ff !important; }
.bg-blue-500\/10 { background-color: rgba(59, 130, 246, 0.1) !important; }
.bg-rose-50 { background-color: #fff1f2 !important; }
.bg-sky-50 { background-color: #f0f9ff !important; }
.bg-transparent { background-color: transparent !important; }

.bg-gradient-to-br { background-image: linear-gradient(135deg, var(--palette-primary) 0%, var(--palette-primary-dim) 100%) !important; }
.bg-gradient-to-l { background-image: linear-gradient(to left, var(--palette-primary) 0%, var(--palette-primary-dim) 50%, #0f172a 100%) !important; }
.bg-gradient-to-r { background-image: linear-gradient(to right, var(--palette-primary) 0%, var(--palette-primary-dim) 100%) !important; }

.text-primary { color: var(--palette-primary) !important; }
.text-primary-dim { color: var(--palette-primary-dim) !important; }
.text-on-primary { color: var(--palette-on-primary) !important; }
.text-on-primary-container { color: var(--palette-on-primary-container) !important; }
.text-secondary { color: var(--palette-secondary) !important; }
.text-on-secondary-container { color: var(--palette-on-secondary-container) !important; }
.text-tertiary { color: var(--palette-tertiary) !important; }
.text-on-surface { color: var(--palette-on-surface) !important; }
.text-on-surface-variant { color: var(--palette-on-surface-variant) !important; }
.text-white { color: #ffffff !important; }
.text-white\/80 { color: rgba(255, 255, 255, 0.8) !important; }
.text-white\/70 { color: rgba(255, 255, 255, 0.7) !important; }
.text-emerald-600 { color: #059669 !important; }
.text-emerald-700 { color: #047857 !important; }
.text-amber-600 { color: #d97706 !important; }
.text-amber-700 { color: #b45309 !important; }
.text-rose-500 { color: #f43f5e !important; }
.text-rose-600 { color: #e11d48 !important; }
.text-rose-700 { color: #be123c !important; }
.text-sky-700 { color: #0369a1 !important; }
.text-blue-600 { color: #2563eb !important; }

.border-primary { border-color: var(--palette-primary) !important; }
.border-outline-variant { border-color: var(--palette-outline-variant) !important; }
.border-outline-variant\/20 { border-color: rgba(223, 226, 237, 0.2) !important; }
.border-outline-variant\/30 { border-color: rgba(223, 226, 237, 0.3) !important; }
.border-outline-variant\/40 { border-color: rgba(223, 226, 237, 0.4) !important; }
.border-white\/10 { border-color: rgba(255, 255, 255, 0.1) !important; }
.border-rose-200 { border-color: #fecdd3 !important; }
.border-emerald-200 { border-color: #a7f3d0 !important; }
.border-none { border-style: none !important; border-width: 0 !important; }

/* Grid, Flex & Layout utilities */
.flex { display: flex !important; }
.inline-flex { display: inline-flex !important; }
.grid { display: grid !important; }
.hidden { display: none !important; }
.block { display: block !important; }
.inline-block { display: inline-block !important; }
.items-center { align-items: center !important; }
.items-start { align-items: flex-start !important; }
.items-stretch { align-items: stretch !important; }
.justify-center { justify-content: center !important; }
.justify-between { justify-content: space-between !important; }
.justify-around { justify-content: space-around !important; }
.justify-end { justify-content: flex-end !important; }
.flex-col { flex-direction: column !important; }
.flex-1 { flex: 1 1 0% !important; }
.flex-wrap { flex-wrap: wrap !important; }
.shrink-0 { flex-shrink: 0 !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-1\.5 { gap: 0.375rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-2\.5 { gap: 0.625rem !important; }
.gap-3 { gap: 0.75rem !important; }
.gap-3\.5 { gap: 0.875rem !important; }
.gap-4 { gap: 1rem !important; }
.gap-5 { gap: 1.25rem !important; }
.gap-6 { gap: 1.5rem !important; }
.gap-8 { gap: 2rem !important; }

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)) !important; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }

/* Spacing & Sizing */
.w-full { width: 100% !important; }
.w-fit { width: fit-content !important; }
.w-8 { width: 2rem !important; }
.w-9 { width: 2.25rem !important; }
.w-10 { width: 2.5rem !important; }
.w-11 { width: 2.75rem !important; }
.w-12 { width: 3rem !important; }
.w-16 { width: 4rem !important; }
.w-64 { width: 16rem !important; }
.w-72 { width: 18rem !important; }
.w-80 { width: 20rem !important; }

.h-full { height: 100% !important; }
.h-8 { height: 2rem !important; }
.h-9 { height: 2.25rem !important; }
.h-10 { height: 2.5rem !important; }
.h-11 { height: 2.75rem !important; }
.h-12 { height: 3rem !important; }
.h-16 { height: 4rem !important; }
.h-44 { height: 11rem !important; }
.h-screen { height: 100vh !important; }
.min-h-screen { min-height: 100vh !important; }

.max-w-sm { max-width: 24rem !important; }
.max-w-md { max-width: 28rem !important; }
.max-w-lg { max-width: 32rem !important; }
.max-w-xl { max-width: 36rem !important; }
.max-w-2xl { max-width: 42rem !important; }
.max-w-3xl { max-width: 48rem !important; }
.max-w-4xl { max-width: 56rem !important; }
.max-w-5xl { max-width: 64rem !important; }
.max-w-6xl { max-width: 72rem !important; }
.max-w-7xl { max-width: 80rem !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.mr-1 { margin-right: 0.25rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.ml-1 { margin-left: 0.25rem !important; }
.ml-2 { margin-left: 0.5rem !important; }
.mt-0\.5 { margin-top: 0.125rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 0.75rem !important; }
.mt-4 { margin-top: 1rem !important; }
.mt-6 { margin-top: 1.5rem !important; }
.mt-8 { margin-top: 2rem !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 0.75rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.my-4 { margin-top: 1rem !important; margin-bottom: 1rem !important; }

.p-1 { padding: 0.25rem !important; }
.p-1\.5 { padding: 0.375rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-2\.5 { padding: 0.625rem !important; }
.p-3 { padding: 0.75rem !important; }
.p-3\.5 { padding: 0.875rem !important; }
.p-4 { padding: 1rem !important; }
.p-5 { padding: 1.25rem !important; }
.p-6 { padding: 1.5rem !important; }
.p-7 { padding: 1.75rem !important; }
.p-8 { padding: 2rem !important; }
.p-12 { padding: 3rem !important; }
.px-2 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.px-3 { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
.px-3\.5 { padding-left: 0.875rem !important; padding-right: 0.875rem !important; }
.px-4 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-5 { padding-left: 1.25rem !important; padding-right: 1.25rem !important; }
.px-6 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.px-7 { padding-left: 1.75rem !important; padding-right: 1.75rem !important; }
.px-8 { padding-left: 2rem !important; padding-right: 2rem !important; }
.py-1 { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; }
.py-1\.5 { padding-top: 0.375rem !important; padding-bottom: 0.375rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-2\.5 { padding-top: 0.625rem !important; padding-bottom: 0.625rem !important; }
.py-3 { padding-top: 0.75rem !important; padding-bottom: 0.75rem !important; }
.py-3\.5 { padding-top: 0.875rem !important; padding-bottom: 0.875rem !important; }
.py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.pt-2 { padding-top: 0.5rem !important; }
.pt-4 { padding-top: 1rem !important; }
.pt-6 { padding-top: 1.5rem !important; }
.pt-20 { padding-top: 5rem !important; }
.pb-2 { padding-bottom: 0.5rem !important; }
.pb-3 { padding-bottom: 0.75rem !important; }
.pb-4 { padding-bottom: 1rem !important; }
.pb-5 { padding-bottom: 1.25rem !important; }
.pb-24 { padding-bottom: 6rem !important; }
.pb-28 { padding-bottom: 7rem !important; }

.space-y-1 > * + * { margin-top: 0.25rem !important; }
.space-y-2 > * + * { margin-top: 0.5rem !important; }
.space-y-3 > * + * { margin-top: 0.75rem !important; }
.space-y-4 > * + * { margin-top: 1rem !important; }
.space-y-6 > * + * { margin-top: 1.5rem !important; }
.space-y-8 > * + * { margin-top: 2rem !important; }

.rounded-lg { border-radius: 0.5rem !important; }
.rounded-xl { border-radius: 0.75rem !important; }
.rounded-2xl { border-radius: 1rem !important; }
.rounded-3xl { border-radius: 1.5rem !important; }
.rounded-\[2rem\] { border-radius: 2rem !important; }
.rounded-full { border-radius: 9999px !important; }

.border { border-width: 1px !important; }
.border-2 { border-width: 2px !important; }
.border-b { border-bottom-width: 1px !important; }
.border-t { border-top-width: 1px !important; }
.border-l { border-left-width: 1px !important; }
.border-r { border-right-width: 1px !important; }
.border-dashed { border-style: dashed !important; }

.shadow-xs { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important; }
.shadow-sm { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1) !important; }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1) !important; }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1) !important; }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important; }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important; }

.text-\[10px\] { font-size: 10px !important; }
.text-\[11px\] { font-size: 11px !important; }
.text-xs { font-size: 0.75rem !important; line-height: 1rem !important; }
.text-sm { font-size: 0.875rem !important; line-height: 1.25rem !important; }
.text-base { font-size: 1rem !important; line-height: 1.5rem !important; }
.text-lg { font-size: 1.125rem !important; line-height: 1.75rem !important; }
.text-xl { font-size: 1.25rem !important; line-height: 1.75rem !important; }
.text-2xl { font-size: 1.5rem !important; line-height: 2rem !important; }
.text-3xl { font-size: 1.875rem !important; line-height: 2.25rem !important; }
.font-medium { font-weight: 500 !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: 700 !important; }
.font-black { font-weight: 900 !important; }
.font-mono { font-family: monospace, Tahoma, sans-serif !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-left { text-align: left !important; }

.cursor-pointer { cursor: pointer !important; }
.transition-all { transition-property: all !important; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important; transition-duration: 150ms !important; }
.transition-colors { transition-property: color, background-color, border-color !important; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important; transition-duration: 150ms !important; }
.transition-transform { transition-property: transform !important; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important; }
.duration-300 { transition-duration: 300ms !important; }
.ease-in-out { transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important; }

.fixed { position: fixed !important; }
.absolute { position: absolute !important; }
.relative { position: relative !important; }
.inset-0 { top: 0px !important; right: 0px !important; bottom: 0px !important; left: 0px !important; }
.top-0 { top: 0px !important; }
.right-0 { right: 0px !important; }
.left-0 { left: 0px !important; }
.bottom-0 { bottom: 0px !important; }
.z-30 { z-index: 30 !important; }
.z-40 { z-index: 40 !important; }
.z-50 { z-index: 50 !important; }
.overflow-hidden { overflow: hidden !important; }
.overflow-y-auto { overflow-y: auto !important; }
.backdrop-blur-sm { backdrop-filter: blur(4px) !important; -webkit-backdrop-filter: blur(4px) !important; }
.backdrop-blur-md { backdrop-filter: blur(12px) !important; -webkit-backdrop-filter: blur(12px) !important; }
.backdrop-blur-lg { backdrop-filter: blur(16px) !important; -webkit-backdrop-filter: blur(16px) !important; }

/* Transforms & Drawers */
.transform { transform: translateZ(0); }
.translate-x-full { transform: translateX(100%) !important; }
.translate-x-0 { transform: translateX(0px) !important; }

/* ==========================================
 * Responsive Breakpoints (md >= 768px)
 * ========================================== */
@media (min-width: 768px) {
  .md\:hidden { display: none !important; }
  .md\:flex { display: flex !important; }
  .md\:block { display: block !important; }
  .md\:grid { display: grid !important; }
  .md\:mr-64 { margin-right: 16rem !important; }
  .md\:w-64 { width: 16rem !important; }
  .md\:w-9 { width: 2.25rem !important; }
  .md\:h-9 { height: 2.25rem !important; }
  .md\:w-12 { width: 3rem !important; }
  .md\:h-12 { height: 3rem !important; }
  .md\:pt-20 { padding-top: 5rem !important; }
  .md\:px-6 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
  .md\:px-8 { padding-left: 2rem !important; padding-right: 2rem !important; }
  .md\:pb-12 { padding-bottom: 3rem !important; }
  .md\:text-base { font-size: 1rem !important; line-height: 1.5rem !important; }
  .md\:text-3xl { font-size: 1.875rem !important; line-height: 2.25rem !important; }
  .md\:text-sm { font-size: 0.875rem !important; line-height: 1.25rem !important; }
  .md\:translate-x-0 { transform: translateX(0px) !important; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .md\:flex-row { flex-direction: row !important; }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .lg\:col-span-2 { grid-column: span 2 / span 2 !important; }
}


/* ==========================================
 * 🌓 Enhanced Dark Mode Contrast & Components
 * ========================================== */
html.dark, html.dark body.palette-body, html.dark .palette-app, html.dark .palette-app {
  --palette-surface: #0b1329 !important;
  --palette-surface-container: #151f38 !important;
  --palette-surface-container-low: #111a30 !important;
  --palette-surface-container-high: #1e294b !important;
  --palette-surface-container-lowest: #182344 !important;
  --palette-on-surface: #ffffff !important;
  --palette-on-surface-variant: #cbd5e1 !important;
  --palette-outline-variant: #283556 !important;
  background-color: #0b1329 !important;
  color: #ffffff !important;
}

html.dark header, html.dark aside, html.dark nav {
  background-color: rgba(17, 26, 48, 0.95) !important;
  border-color: rgba(40, 53, 86, 0.8) !important;
}

html.dark .bg-surface-container-lowest,
html.dark .bg-white {
  background-color: #182344 !important;
  color: #ffffff !important;
}

html.dark .bg-surface-container-low {
  background-color: #111a30 !important;
}

html.dark .bg-surface-container-high {
  background-color: #1e294b !important;
}

html.dark .text-on-surface,
html.dark .text-slate-800,
html.dark .text-slate-900 {
  color: #ffffff !important;
}

html.dark .text-on-surface-variant,
html.dark .text-slate-600,
html.dark .text-slate-500 {
  color: #cbd5e1 !important;
}

html.dark input:not([type="checkbox"]):not([type="radio"]),
html.dark select,
html.dark textarea {
  background-color: #111a30 !important;
  color: #ffffff !important;
  border: 1px solid #283556 !important;
}

html.dark input:focus:not([type="checkbox"]):not([type="radio"]),
html.dark select:focus,
html.dark textarea:focus {
  border-color: #818cf8 !important;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.25) !important;
  background-color: #151f38 !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #94a3b8 !important;
  opacity: 0.82 !important;
}

html.dark #palette-admin-app input[type="color"],
html.dark .palette-app input[type="color"] {
  border-color: #334155 !important;
  background-color: #1e293b !important;
}

html.dark .border-outline-variant\/30,
html.dark .border-outline-variant\/20,
html.dark .border-outline-variant\/10,
html.dark .border-slate-200,
html.dark .border-slate-100 {
  border-color: #283556 !important;
}

html.dark table th {
  background-color: #111a30 !important;
  color: #e2e8f0 !important;
}

html.dark table td {
  border-color: #283556 !important;
  color: #ffffff !important;
}

html.dark tr:hover td {
  background-color: rgba(30, 41, 75, 0.5) !important;
}

/* =========================================================================
 * 🌟 Admin UX Enhancements (Palette Pro Standards)
 * ========================================================================= */

/* 1. Pulse Highlight for Command Palette Search */
@keyframes palette-pulse-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(76, 94, 139, 0.7);
    border-color: #4c5e8b !important;
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(76, 94, 139, 0);
    border-color: #e11d48 !important;
    transform: scale(1.02);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(76, 94, 139, 0);
    border-color: #4c5e8b !important;
    transform: scale(1);
  }
}

.palette-search-highlight {
  animation: palette-pulse-glow 1.2s ease-in-out 2 !important;
  outline: 2px solid #4c5e8b !important;
  outline-offset: 3px !important;
  border-radius: 1rem !important;
}

/* 2. Floating Sticky Save Bar (Dirty State) */
.palette-sticky-save-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 99999;
  width: calc(100% - 48px);
  max-width: 820px;
  background: rgba(17, 34, 70, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  padding: 14px 24px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.palette-sticky-save-bar.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* 3. Command Palette Modal */
.palette-cmd-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  transition: opacity 0.2s ease;
}

.palette-cmd-window {
  width: 100%;
  max-width: 680px;
  background: #ffffff;
  border-radius: 28px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(226, 232, 240, 0.8);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  border: 1px solid #e2e8f0;
}

html.dark .palette-cmd-window {
  background: #151f38;
  border-color: #283556;
  color: #ffffff;
}

/* 4. SMS Live Phone Mockup */
.sms-phone-mockup {
  width: 290px;
  background: #1e293b;
  border-radius: 40px;
  padding: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25), inset 0 0 0 2px rgba(255, 255, 255, 0.1);
  position: relative;
}

.sms-phone-screen {
  background: #f8fafc;
  border-radius: 30px;
  padding: 16px 14px;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

html.dark .sms-phone-screen {
  background: #0f172a;
}

.sms-speech-bubble {
  background: #ffffff;
  border-radius: 18px 18px 4px 18px;
  padding: 12px 14px;
  font-size: 11px;
  line-height: 1.6;
  color: #1e293b;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
  position: relative;
  word-break: break-word;
}

html.dark .sms-speech-bubble {
  background: #1e293b;
  color: #f8fafc;
  border-color: #334155;
}

/* 5. Modules Switchboard Cards */
.module-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.module-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

/* ==========================================================================
   Palette Panel - WooCommerce Checkout Fields & Modern Checkout UI
   ========================================================================== */

/* 1. Structural Grid & Layout (Scoped under .woocommerce-checkout) */
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper,
.woocommerce-checkout .woocommerce-shipping-fields__field-wrapper,
.woocommerce-checkout .woocommerce-additional-fields__field-wrapper,
.woocommerce-checkout form.checkout #customer_details .woocommerce-billing-fields__field-wrapper,
.woocommerce-checkout form.checkout #customer_details .woocommerce-shipping-fields__field-wrapper,
.woocommerce-checkout form.checkout #customer_details .woocommerce-additional-fields__field-wrapper {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    gap: 12px 2.5% !important;
    box-sizing: border-box !important;
}

.woocommerce-checkout .woocommerce-billing-fields__field-wrapper::before,
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper::after,
.woocommerce-checkout .woocommerce-shipping-fields__field-wrapper::before,
.woocommerce-checkout .woocommerce-shipping-fields__field-wrapper::after,
.woocommerce-checkout .woocommerce-additional-fields__field-wrapper::before,
.woocommerce-checkout .woocommerce-additional-fields__field-wrapper::after {
    display: none !important;
    content: none !important;
}

.woocommerce-checkout .form-row,
.woocommerce-checkout form.checkout .form-row,
.woocommerce-checkout #customer_details .form-row {
    box-sizing: border-box !important;
    margin: 0 0 12px 0 !important;
    padding: 0 !important;
}

/* Half width (50%) */
.woocommerce-checkout .form-row.form-row-wide-md-half,
.woocommerce-checkout .form-row.palette-width-half,
.slow-checkout-wrapper form .form-row.form-row-wide-md-half,
.slow-checkout-wrapper form .form-row.palette-width-half,
.woocommerce form .form-row.form-row-wide-md-half,
.woocommerce-page form .form-row.form-row-wide-md-half {
    flex: 1 1 calc(50% - 10px) !important;
    width: calc(50% - 10px) !important;
    max-width: calc(50% - 10px) !important;
    float: right !important;
    clear: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Third width (33.33%) */
.woocommerce-checkout .form-row.form-row-wide-md-third,
.woocommerce-checkout .form-row.palette-width-third,
.slow-checkout-wrapper form .form-row.form-row-wide-md-third,
.slow-checkout-wrapper form .form-row.palette-width-third,
.woocommerce form .form-row.form-row-wide-md-third,
.woocommerce-page form .form-row.form-row-wide-md-third {
    flex: 1 1 calc(33.333% - 10px) !important;
    width: calc(33.333% - 10px) !important;
    max-width: calc(33.333% - 10px) !important;
    float: right !important;
    clear: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Full width (100%) */
.woocommerce-checkout .form-row.form-row-wide,
.woocommerce-checkout .form-row.palette-width-full,
.slow-checkout-wrapper form .form-row.form-row-wide,
.slow-checkout-wrapper form .form-row.palette-width-full,
.woocommerce form .form-row.form-row-wide,
.woocommerce-page form .form-row.form-row-wide {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    clear: both !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Responsive stacking on mobile / tablet (< 768px) */
@media (max-width: 768px) {
    .woocommerce-checkout .woocommerce-billing-fields__field-wrapper,
    .woocommerce-checkout .woocommerce-shipping-fields__field-wrapper,
    .slow-checkout-wrapper .woocommerce-billing-fields__field-wrapper {
        gap: 10px 0 !important;
    }
    .woocommerce-checkout .form-row.form-row-wide-md-half,
    .woocommerce-checkout .form-row.form-row-wide-md-third,
    .woocommerce-checkout .form-row.palette-width-half,
    .woocommerce-checkout .form-row.palette-width-third,
    .slow-checkout-wrapper form .form-row.form-row-wide-md-half,
    .slow-checkout-wrapper form .form-row.form-row-wide-md-third,
    .slow-checkout-wrapper form .form-row.palette-width-half,
    .slow-checkout-wrapper form .form-row.palette-width-third {
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        clear: both !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* Hidden fields */
.woocommerce-checkout .form-row.hidden,
.woocommerce-checkout p.hidden,
.woocommerce-checkout .form-row.palette-field-hidden,
.slow-checkout-wrapper .form-row.hidden,
.slow-checkout-wrapper .form-row.palette-field-hidden,
[data-palette-disabled="1"],
#billing_country_field[data-palette-disabled="1"],
#billing_country_field.hidden {
    display: none !important;
}

/* Palette Panel & ThemeHigh Checkout Required / Optional Enforcers */
.palette-field-required label .optional,
.thwcfd-required label .optional {
    display: none !important;
}

.palette-field-optional label .required,
.thwcfd-optional label .required {
    display: none !important;
}

/* 2. Modern Checkout UI (Palette Modern Checkout) */
body.palette-modern-checkout .woocommerce-checkout,
.palette-modern-checkout form.checkout {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    direction: rtl !important;
}

body.palette-modern-checkout .woocommerce-checkout .form-row label {
    display: block !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #334155 !important;
    margin-bottom: 6px !important;
    line-height: 1.4 !important;
}

body.palette-modern-checkout .woocommerce-checkout .form-row label .required {
    color: #ef4444 !important;
    text-decoration: none !important;
    margin-right: 2px !important;
}

body.palette-modern-checkout .woocommerce-checkout .form-row label .optional {
    color: #94a3b8 !important;
    font-weight: 500 !important;
    font-size: 11px !important;
}

body.palette-modern-checkout .woocommerce-checkout .form-row input[type="text"],
body.palette-modern-checkout .woocommerce-checkout .form-row input[type="tel"],
body.palette-modern-checkout .woocommerce-checkout .form-row input[type="email"],
body.palette-modern-checkout .woocommerce-checkout .form-row input[type="password"],
body.palette-modern-checkout .woocommerce-checkout .form-row input[type="number"],
body.palette-modern-checkout .woocommerce-checkout .form-row select,
body.palette-modern-checkout .woocommerce-checkout .form-row textarea {
    width: 100% !important;
    border: 1.5px solid #e2e8f0 !important;
    background-color: #f8fafc !important;
    color: #1e293b !important;
    border-radius: 14px !important;
    padding: 11px 14px !important;
    font-size: 13px !important;
    font-family: 'Vazirmatn', inherit !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
    outline: none !important;
    box-sizing: border-box !important;
}

body.palette-modern-checkout .woocommerce-checkout .form-row input:focus,
body.palette-modern-checkout .woocommerce-checkout .form-row select:focus,
body.palette-modern-checkout .woocommerce-checkout .form-row textarea:focus {
    border-color: var(--palette-primary, #4c5e8b) !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3.5px rgba(76, 94, 139, 0.16) !important;
}

body.palette-modern-checkout .woocommerce-checkout .form-row textarea {
    min-height: 90px !important;
    resize: vertical !important;
}

/* Modern Order Review Box */
body.palette-modern-checkout #order_review {
    border-radius: 20px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    padding: 20px !important;
    box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.05) !important;
}

/* Payment gateway methods */
body.palette-modern-checkout #payment ul.payment_methods {
    border: none !important;
    padding: 0 !important;
    margin: 0 0 15px 0 !important;
}

body.palette-modern-checkout #payment ul.payment_methods li {
    background: #f8fafc !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 14px !important;
    padding: 12px 16px !important;
    margin-bottom: 8px !important;
    transition: all 0.2s ease !important;
    list-style: none !important;
}

body.palette-modern-checkout #payment ul.payment_methods li:hover {
    border-color: #cbd5e1 !important;
    background: #f1f5f9 !important;
}

body.palette-modern-checkout #payment ul.payment_methods li.payment_method_selected,
body.palette-modern-checkout #payment ul.payment_methods li:has(input[type="radio"]:checked) {
    border-color: var(--palette-primary, #4c5e8b) !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 2px rgba(76, 94, 139, 0.12) !important;
}

/* Place order button */
body.palette-modern-checkout #place_order {
    background: var(--palette-primary, #4c5e8b) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 16px !important;
    padding: 14px 28px !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    width: 100% !important;
    transition: all 0.25s ease !important;
    box-shadow: 0 8px 20px -4px rgba(76, 94, 139, 0.4) !important;
}

body.palette-modern-checkout #place_order:hover {
    background: var(--palette-primary-dim, #3c4c73) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 12px 24px -4px rgba(76, 94, 139, 0.5) !important;
}