:root {
  --background: #f4f6f8;
  --foreground: #101828;
  --card: #ffffff;
  --muted: #667085;
  --muted-2: #98a2b3;
  --line: #e1e4e8;
  --blue: #EA580C;
  --blue-light: #FFF7ED;
  --green: #25d366;
  --green-dark: #128c7e;
  --purple: #7c3aed;
  --ink: #101828;
  --danger: #b42318;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--background); color: var(--foreground); font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif; font-size: 13px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

/* Base App Shell (Removes hardcoded direction: ltr to allow html[dir] to work natively) */
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 248px; flex: 0 0 248px; background: #fff; border-inline-end: 1px solid var(--line); padding: 27px 16px 18px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; align-self: flex-start; scrollbar-width: none; -ms-overflow-style: none; }
.sidebar::-webkit-scrollbar { display: none; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 20px; font-weight: 800; letter-spacing: -.6px; color: var(--ink); white-space: nowrap; }
.brand small { color: var(--muted-2); font-size: 10px; font-weight: 500; letter-spacing: 0; margin-inline-start: -4px; margin-top: 5px; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 29px; height: 29px; border-radius: 9px; background: var(--blue); color: #fff; }
.shop-switcher { display: flex; align-items: center; gap: 9px; padding: 15px 10px; margin: 37px 0 23px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.shop-switcher > span:nth-child(2) { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.shop-switcher strong, .profile strong { font-size: 11px; color: var(--ink); text-align: start; }
.shop-switcher small, .profile small { font-size: 10px; color: var(--muted-2); text-align: start; }
.shop-icon { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 7px; background: #f0f2f5; color: #68717d; }
.nav-label, .rail-kicker, .eyebrow, .setup-step { margin: 0; color: var(--muted-2); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; text-align: start; }
.nav-label { padding: 0 11px 9px; }
.nav-label-spaced { margin-top: 27px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item { display: flex; align-items: center; gap: 12px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; padding: 11px; text-align: start; transition: .2s; }
.nav-item:hover, .nav-item.active { background: var(--blue-light); color: var(--blue); }

.nav-item em { font-style: normal; font-size: 10px; color: var(--blue); background: #FFF7ED; border-radius: 8px; padding: 2px 6px; }
.nav-symbol { font-size: 19px; width: 17px; text-align: center; }
.sidebar-bottom { margin-top: auto; }
.help-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 18px; text-align: start; }
.help-icon { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; background: #FFF7ED; color: var(--blue); margin-bottom: 10px; }
.help-card strong { font-size: 11px; }
.help-card p { margin: 5px 0 11px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.help-card button { display: flex; align-items: center; gap: 5px; padding: 0; border: 0; color: var(--blue); background: none; font-size: 10px; font-weight: 700; }
.profile { display: flex; align-items: center; gap: 9px; padding: 7px 4px 0; }
.profile > span:nth-child(2) { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.avatar, .mini-avatar { display: grid; place-items: center; border-radius: 50%; background: #e8eef9; color: #34518b; font-weight: 800; }
.avatar { width: 31px; height: 31px; font-size: 10px; }
.content-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 84px; padding: 20px 36px; display: flex; align-items: center; gap: 20px; background: #fff; border-bottom: 1px solid var(--line); }
.mobile-brand { display: none; }
.topbar-title { flex: 1; text-align: start; }
.topbar h1 { margin: 6px 0 0; font-size: 21px; letter-spacing: -.6px; }
.topbar-actions, .panel-actions, .setup-footer > div { display: flex; align-items: center; gap: 10px; }
.icon-button, .more-button { position: relative; display: grid; place-items: center; width: 35px; height: 35px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); }
.icon-button i { position: absolute; width: 5px; height: 5px; background: #f04438; border-radius: 50%; top: 8px; inset-inline-end: 8px; border: 1px solid #fff; }
.language, .date-button, .select-button { display: flex; align-items: center; gap: 8px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; font-size: 11px; }
.primary-button, .secondary-button, .filter-button, .text-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 8px; border: 1px solid transparent; padding: 10px 14px; font-size: 11px; font-weight: 700; transition: .2s; }
.primary-button { color: #fff; background: var(--blue); box-shadow: 0 4px 10px #EA580C24; }
.primary-button:hover { background: #1d4ed8; }
.secondary-button { background: #fff; border-color: var(--line); color: var(--ink); }
.text-button { border: 0; background: transparent; color: var(--muted); }
.dashboard-main { padding: 34px 36px 50px; max-width: 1480px; margin: auto; width: 100%; flex: 1; }
.page-intro { display: flex; justify-content: space-between; align-items: end; margin-bottom: 25px; text-align: start; }
.page-intro h2 { margin: 7px 0 5px; font-size: 25px; letter-spacing: -.8px; }
.muted { color: var(--muted); margin: 0; line-height: 1.6; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 17px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-height: 139px; text-align: start; }
.stat-top, .stat-bottom { display: flex; align-items: center; justify-content: space-between; }
.stat-top > span:first-child { color: var(--muted); font-size: 11px; }
.stat-card > strong { display: block; font-size: 28px; letter-spacing: -1px; margin: 17px 0 12px; }
.stat-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; background: #FFF7ED; color: var(--blue); }
.green .stat-icon { color: var(--green-dark); background: #e9fbf0; }
.violet .stat-icon { color: var(--purple); background: #f0edff; }
.ink .stat-icon { color: #fff; background: var(--ink); }
.dollar { font-size: 15px; font-weight: 800; }
.stat-bottom { justify-content: flex-start; gap: 7px; color: var(--muted-2); font-size: 10px; }
.up, .down { border-radius: 5px; padding: 3px 5px; font-weight: 700; }
.up { color: var(--green-dark); background: #e9fbf0; }
.down { color: var(--danger); background: #fff0ef; }
.analytics-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(270px, .8fr); gap: 17px; margin-bottom: 17px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); text-align: start; }
.chart-panel, .conversion-panel, .orders-panel { padding: 21px 21px 16px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.panel h2 { margin: 7px 0 0; font-size: 16px; letter-spacing: -.3px; }
.chart { display: flex; height: 225px; margin-top: 24px; }
.chart-y { width: 35px; display: flex; flex-direction: column; justify-content: space-between; padding-bottom: 26px; color: var(--muted-2); font-size: 10px; }
.chart-area { flex: 1; position: relative; }
.grid-lines { position: absolute; inset: 0 0 25px; display: flex; flex-direction: column; justify-content: space-between; }
.grid-lines i { border-top: 1px dashed #e7eaf0; }
.bars { display: flex; align-items: end; justify-content: space-around; height: 100%; gap: 6px; position: relative; z-index: 1; }
.bar-column { align-self: stretch; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 9px; flex: 1; color: var(--muted-2); font-size: 9px; }
.bar { width: min(30px, 75%); min-height: 9px; border-radius: 7px 7px 3px 3px; background: #dce5f5; }
.bar.highlight { background: var(--blue); box-shadow: 0 5px 15px #EA580C44; }
.chart-legend { display: flex; gap: 20px; margin: 8px 0 0; margin-inline-start: 36px; color: var(--muted); font-size: 10px; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend i { width: 7px; height: 7px; border-radius: 50%; }
.legend-blue { background: var(--blue); }
.legend-gray { background: #ccd4e1; }
.conversion-panel { display: flex; flex-direction: column; }
.more-button { border-radius: 50%; width: 34px; height: 34px; }
.donut { width: 173px; height: 173px; margin: 27px auto 22px; border-radius: 50%; background: conic-gradient(var(--blue) 0 70.8%, #FFF7ED 70.8% 100%); display: grid; place-items: center; position: relative; }
.donut::after { content: ''; position: absolute; inset: 15px; background: white; border-radius: 50%; }
.donut-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.donut-inner strong { font-size: 27px; letter-spacing: -1px; }
.donut-inner span { font-size: 10px; color: var(--muted); margin-top: 4px; }
.conversion-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.conversion-footer div { background: #f7f8fa; border-radius: 9px; padding: 12px; display: flex; flex-direction: column; gap: 5px; }
.conversion-footer strong { font-size: 16px; }
.conversion-footer span { color: var(--muted); font-size: 10px; }
.orders-panel { padding: 24px 24px 28px; }
.orders-panel .panel-heading { align-items: center; margin-bottom: 20px; }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; color: var(--muted-2); }
.search input { width: 200px; border: 0; outline: 0; font-size: 13px; }
.filter-button { background: #fff; color: var(--muted); border-color: var(--line); padding: 8px 14px; font-size: 12px; }
.table-wrap { overflow-x: auto; border: 1px solid #f0f1f3; border-radius: 12px; margin-bottom: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 800px; }
th { text-align: start; color: var(--muted); background: #f8fafc; padding: 14px 18px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; border-bottom: 1px solid var(--line); }
td { border-bottom: 1px solid #f0f1f3; padding: 16px 18px; color: var(--foreground); font-size: 13px; text-align: start; vertical-align: middle; }
td:first-child { color: var(--ink); }
td:first-child strong, td:first-child .product-name { display: block; font-size: 14px; }
.product-name { color: var(--muted); margin-top: 4px; font-size: 12px; }
.channel { display: inline-flex; align-items: center; gap: 6px; color: var(--green-dark); font-size: 12px; font-weight: 500; }
.badge { border-radius: 9999px; padding: 4px 14px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; line-height: 1.4; }
.badge.confirmed { color: #15803d; background: #dcfce7; }
.badge.pending { color: #b45309; background: #fef3c7; }
.badge.cancelled { color: #b91c1c; background: #fee2e2; }
.badge.reminded { color: #1d4ed8; background: #dbeafe; }
.badge.needs_call { color: #4338ca; background: #eef2ff; }
.badge.failed { color: #be123c; background: #ffe4e6; }

/* Onboarding Shell */
.onboarding-shell { min-height: 100vh; background: #fff; display: flex; flex-direction: column; }
.onboarding-top { height: 68px; border-bottom: 1px solid var(--line); padding: 0 6%; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: #fff; z-index: 10; }
.onboarding-actions { display: flex; align-items: center; gap: 22px; }
.support-link { display: flex; align-items: center; gap: 7px; border: 0; background: none; color: var(--muted); font-size: 11px; }
.onboarding-body { display: flex; flex: 1; }
.onboarding-rail { width: 31%; max-width: 390px; background: #f8fafc; border-inline-end: 1px solid var(--line); padding: 32px 7%; display: flex; flex-direction: column; text-align: start; position: sticky; top: 68px; height: calc(100vh - 68px); overflow-y: auto; align-self: flex-start; scrollbar-width: none; -ms-overflow-style: none; }
.onboarding-rail::-webkit-scrollbar { display: none; }
.onboarding-rail h1 { font-size: 24px; letter-spacing: -1px; margin: 8px 0 6px; }
.rail-copy { color: var(--muted); line-height: 1.7; max-width: 240px; margin: 0; font-size: 12px; }
.stepper { position: relative; display: flex; flex-direction: column; gap: 0; margin-top: 28px; }
.stepper::before { content: ''; position: absolute; inset-inline-start: 12px; top: 21px; bottom: 21px; width: 2px; background: #d8dee8; z-index: 0; }
.step { position: relative; z-index: 1; display: flex; align-items: flex-start; gap: 12px; min-height: 56px; padding: 6px 0; border: 0; background: none; text-align: start; color: var(--muted-2); cursor: pointer; }
.step-dot { position: relative; z-index: 2; width: 25px; height: 25px; display: grid; place-items: center; flex: 0 0 25px; border-radius: 50%; border: 1px solid #d8dee8; background: #fff; font-size: 10px; }
.step.completed .step-dot { background: var(--green); border-color: var(--green); color: #fff; font-weight: 800; }
.step.current .step-dot, .step.current strong { border-color: var(--blue); color: var(--blue); }
.step span:last-child { display: flex; flex-direction: column; gap: 4px; padding-top: 2px; text-align: start; }
.step strong { color: var(--ink); font-size: 11px; }
.step small { color: var(--muted-2); font-size: 9px; }
.rail-footer { display: flex; align-items: center; gap: 9px; margin-top: auto; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 24px; }
.mini-avatar { width: 28px; height: 28px; font-size: 11px; background: #FFF7ED; color: var(--blue); }
.rail-footer span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.rail-footer strong { font-size: 10px; }
.rail-footer small { color: var(--muted); font-size: 9px; }
.onboarding-main { flex: 1; padding: 30px 7%; text-align: start; }
.onboarding-breadcrumb { display: flex; align-items: center; gap: 7px; color: var(--muted-2); font-size: 10px; }
.onboarding-breadcrumb strong { color: var(--ink); }
.setup-content { width: min(650px, 100%); margin: 75px auto 0; }
.setup-step { color: var(--blue); font-weight: 700; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.setup-header h2 { font-size: 26px; letter-spacing: -1px; margin: 13px 0 9px; }
.setup-header p { color: var(--muted); margin: 0; line-height: 1.6; }
.setup-card { border: 1px solid var(--line); border-radius: 12px; margin-top: 31px; padding: 23px; box-shadow: 0 7px 25px #122b4b0a; background: #fff; text-align: start; }
.setup-card-heading { display: flex; align-items: center; gap: 11px; padding-bottom: 21px; border-bottom: 1px solid #eff1f4; }
.setup-card-icon { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 11px; background: #e9fbf0; color: var(--green-dark); }
.setup-card-heading h3 { font-size: 13px; margin: 0 0 5px; }
.setup-card-heading p { color: var(--muted); font-size: 10px; margin: 0; }
.toggle { width: 35px; height: 20px; padding: 3px; border-radius: 15px; background: #d5dae2; margin-inline-start: auto; cursor: pointer; }
.toggle i { display: block; width: 14px; height: 14px; background: #fff; border-radius: 50%; transition: margin .2s; }
.toggle.on { background: var(--green); }
.toggle.on i { margin-inline-start: 15px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin: 22px 0; }
.setup-card label { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
.setup-card select, .setup-card textarea, .modal input { outline: 0; border: 1px solid var(--line); border-radius: 7px; padding: 11px; color: var(--ink); background: #fff; font-size: 11px; font-weight: 400; }
.setup-card textarea { min-height: 80px; resize: vertical; line-height: 1.6; }
.message-preview { background: #f6fbf8; margin-top: 20px; padding: 14px; border-radius: 8px; }
.preview-label { font-size: 9px; letter-spacing: .08em; color: var(--green-dark); font-weight: 800; }
.whatsapp-bubble { width: min(280px, 90%); background: #dcf8e8; border-radius: 4px 12px 12px 12px; padding: 11px 12px 7px; margin-top: 10px; color: #234333; font-size: 10px; line-height: 1.5; text-align: start; }
html[dir="rtl"] .whatsapp-bubble { border-radius: 12px 4px 12px 12px; }
.whatsapp-bubble p { margin: 0 0 5px; }
.whatsapp-bubble small { display: block; text-align: end; color: #5b8b70; font-size: 9px; }
.whatsapp-bubble small span { color: #128c4a; }
.setup-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 23px; }

/* Custom Additions */
.btn-wa-green { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 8px; border: 1px solid transparent; padding: 10px 14px; font-size: 11px; font-weight: 700; color: #fff; background: var(--green-dark); box-shadow: 0 4px 10px rgba(18, 140, 126, 0.2); transition: .2s; width: 100%; }
.btn-wa-green:hover { background: #0c6a5e; }
.btn-wa-green:disabled { opacity: 0.7; cursor: not-allowed; }

/* SVG Icon Sizing */
.icon-sm { width: 14px; height: 14px; display: inline-block; vertical-align: middle; flex-shrink: 0; }
.icon-md { width: 16px; height: 16px; display: inline-block; vertical-align: middle; flex-shrink: 0; }
.icon-lg { width: 22px; height: 22px; display: inline-block; vertical-align: middle; flex-shrink: 0; }
.nav-item svg { margin-top: 1px; }

/* Responsiveness Media Queries */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .analytics-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; flex: auto; min-height: auto; height: auto; position: static; border-inline-end: none; border-bottom: 1px solid var(--line); padding: 16px; }
  .side-nav { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .nav-item { flex: 1 1 calc(50% - 8px); justify-content: flex-start; text-align: start; }
  .sidebar-bottom { display: none; }
  
  .topbar { flex-direction: column; align-items: flex-start; gap: 16px; height: auto; padding: 16px; }
  .topbar-actions { width: 100%; flex-wrap: wrap; justify-content: space-between; }
  .dashboard-main { padding: 16px; }
  
  .onboarding-body { flex-direction: column; }
  .onboarding-rail { width: 100%; max-width: 100%; height: auto; position: static; border-inline-end: none; border-bottom: 1px solid var(--line); padding: 24px 16px; }
  .stepper { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 16px; margin-top: 24px; }
  .stepper::before { display: none; }
  .step span:last-child { display: none; }
  .onboarding-main { padding: 24px 16px; }
  .setup-content { margin-top: 16px; }
  
  .stats-grid { grid-template-columns: 1fr; }
  .conversion-footer { grid-template-columns: 1fr; }
  .setup-footer { flex-direction: column; gap: 16px; align-items: stretch; }
  .setup-footer > button { width: 100%; }
}

/* Modals & Dropdowns */
.dropdown-menu { position: absolute; top: calc(100% + 8px); inset-inline-start: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.05); padding: 8px; min-width: 180px; z-index: 50; opacity: 0; visibility: hidden; transform: translateY(-10px); transition: .2s; }
.dropdown-menu.show { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu.dropdown-up { top: auto; bottom: calc(100% + 8px); }
.dropdown-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: transparent; text-align: start; font-size: 11px; color: var(--ink); border-radius: 6px; transition: .15s; }
.dropdown-item:hover { background: #f4f6f8; }
.dropdown-divider { height: 1px; background: var(--line); border: 0; margin: 6px 0; }
.dropdown-item small { display: block; color: var(--muted-2); font-size: 9px; margin-top: 2px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 100; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: .2s; }
.modal-backdrop.show { opacity: 1; visibility: visible; }
.modal-box { background: #fff; border-radius: 16px; width: 90%; max-width: 400px; padding: 24px; position: relative; transform: scale(0.95); transition: .2s; text-align: start; }
.modal-backdrop.show .modal-box { transform: scale(1); }
.modal-close { position: absolute; top: 16px; inset-inline-end: 16px; background: transparent; border: 0; color: var(--muted-2); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.modal-close:hover { background: #f0f2f5; color: var(--ink); }
.modal-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: #FFF7ED; color: var(--blue); margin-bottom: 16px; }
.modal-title { font-size: 18px; letter-spacing: -0.5px; margin: 0 0 8px; color: var(--ink); }
.modal-desc { font-size: 11px; color: var(--muted); margin: 0 0 20px; line-height: 1.5; }
.modal-label { display: flex; flex-direction: column; gap: 6px; font-size: 10px; font-weight: 700; color: var(--muted); }
.modal-input { outline: 0; border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: 11px; color: var(--ink); background: #fff; width: 100%; margin-bottom: 24px; }
.modal-input:focus { border-color: var(--blue); }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions button { width: 100%; }


/* ==========================================================================
   Dark Mode & Neon Glow Engine
   ========================================================================== */


html.dark, :root.dark {
  --background: #0B0E14; /* Deep slate black */
  --foreground: #e2e8f0;
  --card: #151A23;       /* Elevated slate */
  --muted: #94a3b8;
  --muted-2: #64748b;
  --line: #1E2532;       /* Subtle border */
  --blue: #ea580c;
  --blue-light: rgba(234, 88, 12, 0.1);
  --green: #10b981;
  --green-dark: #34d399;
  --purple: #8b5cf6;
  --ink: #ffffff;
  --danger: #ef4444;
  --radius: 14px;
}

html.dark body {
  background: var(--background);
  color: var(--foreground);
}

/* Base Surfaces & Containers */
html.dark .sidebar,
html.dark .topbar {
  background: #10141D;
  border-color: var(--line);
}

html.dark .panel,
html.dark .stat-card,
html.dark .hero-card,
html.dark .setup-card,
html.dark .help-card,
html.dark .modal-content,
html.dark .dropdown-menu,
html.dark .onboarding-shell,
html.dark .onboarding-top,
html.dark .modal-box,
html.dark .table-wrap,
html.dark .billing-cards .plan-card {
  background: var(--card);
  border-color: var(--line);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

html.dark .shop-switcher {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--line);
}

html.dark .shop-icon {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

/* Stat Icons & Badges - Ultra subtle */
html.dark .stat-icon { background: rgba(234, 88, 12, 0.1); }
html.dark .green .stat-icon { background: rgba(16, 185, 129, 0.1); }
html.dark .violet .stat-icon { background: rgba(139, 92, 246, 0.1); }
html.dark .ink .stat-icon { background: rgba(255, 255, 255, 0.05); color: #fff; }

html.dark .up { background: rgba(16, 185, 129, 0.1); color: #34d399; }
html.dark .down { background: rgba(239, 68, 68, 0.1); color: #f87171; }

/* Buttons & Inputs */
html.dark .icon-button, 
html.dark .more-button,
html.dark .language, 
html.dark .date-button, 
html.dark .select-button,
html.dark .form-control,
html.dark .modal-input,
html.dark .setup-card select, 
html.dark .setup-card textarea, 
html.dark .modal input,
html.dark .search input {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  color: var(--foreground);
}

html.dark .search {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line);
}
html.dark .search input { background: transparent; border: none; }

html.dark .icon-button:hover, 
html.dark .language:hover, 
html.dark .date-button:hover, 
html.dark .select-button:hover {
  background: rgba(255, 255, 255, 0.06);
}

html.dark .secondary-button,
html.dark .filter-button {
  background: rgba(255, 255, 255, 0.03);
  color: var(--foreground);
  border-color: var(--line);
}

html.dark .secondary-button:hover,
html.dark .filter-button:hover,
html.dark .dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Tables & Rows */
html.dark th {
  background: #10141D;
  color: var(--muted);
  border-bottom-color: var(--line);
}

html.dark td {
  border-bottom-color: var(--line);
}

html.dark tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Reference Image Badges (Ultra Matte) */
html.dark .badge.pending { background: rgba(255, 255, 255, 0.04); color: #cbd5e1; border: 1px solid rgba(255, 255, 255, 0.1); }
html.dark .badge.confirmed { background: rgba(16, 185, 129, 0.06); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.2); }
html.dark .badge.cancelled, html.dark .badge.failed { background: rgba(239, 68, 68, 0.06); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.2); }
html.dark .badge.needs_call { background: rgba(245, 158, 11, 0.06); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.2); }
html.dark .badge.reminded, html.dark .badge.sent { background: rgba(59, 130, 246, 0.06); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.2); }
html.dark .badge.draft { background: rgba(255, 255, 255, 0.04); color: #cbd5e1; border: 1px solid rgba(255, 255, 255, 0.1); }

/* Filter Pill - Active */
html.dark .filter-pill[data-status="all"] { 
  background: var(--blue) !important; 
  color: #fff !important; 
  border-color: var(--blue) !important; 
  box-shadow: 0 0 10px rgba(234, 88, 12, 0.2);
}

html.dark .step-dot {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line);
}

html.dark .modal-icon,
html.dark .mini-avatar,
html.dark .help-icon,
html.dark .nav-item em {
  background: rgba(234, 88, 12, 0.1);
  color: var(--blue);
}

html.dark .donut {
  background: conic-gradient(var(--blue) 0 70.8%, #1E2532 70.8% 100%);
}
html.dark .donut::after {
  background: var(--card);
}

html.dark .toggle i {
  background: #cbd5e1;
}

html.dark .icon-button i {
  border-color: var(--card);
}

/* Filter Pills - Dark Mode Fixes */
html.dark .filter-pill[data-status="all"] { background: rgba(255, 255, 255, 0.04) !important; color: #cbd5e1 !important; border-color: rgba(255, 255, 255, 0.1) !important; }
html.dark .filter-pill[data-status="confirmed"] { background: rgba(16, 185, 129, 0.06) !important; color: #34d399 !important; border-color: rgba(16, 185, 129, 0.2) !important; }
html.dark .filter-pill[data-status="cancelled"], html.dark .filter-pill[data-status="failed"] { background: rgba(239, 68, 68, 0.06) !important; color: #f87171 !important; border-color: rgba(239, 68, 68, 0.2) !important; }
html.dark .filter-pill[data-status="pending"] { background: rgba(168, 85, 247, 0.06) !important; color: #c084fc !important; border-color: rgba(168, 85, 247, 0.2) !important; }
html.dark .filter-pill[data-status="sent"] { background: rgba(59, 130, 246, 0.06) !important; color: #60a5fa !important; border-color: rgba(59, 130, 246, 0.2) !important; }
html.dark .filter-pill[data-status="needs_call"] { background: rgba(245, 158, 11, 0.06) !important; color: #fbbf24 !important; border-color: rgba(245, 158, 11, 0.2) !important; }

/* Filter Pills - Active States */
html.dark .filter-pill[data-status="all"].active { background: var(--blue) !important; color: #fff !important; border-color: var(--blue) !important; }
html.dark .filter-pill[data-status="confirmed"].active { background: #10b981 !important; color: #fff !important; border-color: #10b981 !important; }
html.dark .filter-pill[data-status="cancelled"].active, html.dark .filter-pill[data-status="failed"].active { background: #ef4444 !important; color: #fff !important; border-color: #ef4444 !important; }
html.dark .filter-pill[data-status="pending"].active { background: #8b5cf6 !important; color: #fff !important; border-color: #8b5cf6 !important; }
html.dark .filter-pill[data-status="sent"].active { background: #3b82f6 !important; color: #fff !important; border-color: #3b82f6 !important; }
html.dark .filter-pill[data-status="needs_call"].active { background: #f59e0b !important; color: #fff !important; border-color: #f59e0b !important; }

/* ====== NOTIFICATION DROPDOWN FIXES ====== */
.notif-dropdown-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  transition: background 0.15s ease;
  background: var(--card);
}
.notif-dropdown-item:hover {
  background: #f8fafc;
}
.notif-dropdown-item.unread {
  background: #fff8f5; /* Light mode unread */
}
.notif-dropdown-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}
/* Light Mode Icons */
.notif-dropdown-icon.success { background: #dcfce7; color: #16a34a; }
.notif-dropdown-icon.error { background: #eef2ff; color: #4f46e5; }
.notif-dropdown-icon.warning { background: #fee2e2; color: #ef4444; }
.notif-dropdown-icon.default { background: #dbeafe; color: #2563eb; }

.notif-dropdown-content {
  flex: 1;
  min-width: 0;
}
.notif-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.notif-dropdown-header strong {
  font-size: 13px;
  color: var(--ink);
}
.notif-dropdown-header span {
  font-size: 10px;
  color: var(--muted);
}
.notif-dropdown-content p {
  font-size: 11px;
  color: var(--muted-2);
  margin: 0;
  line-height: 1.4;
}
.notif-unread-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
  margin-top: 6px;
  flex-shrink: 0;
}

/* ====== DARK MODE NOTIFICATIONS ====== */
html.dark .notif-dropdown-item {
  background: var(--card);
}
html.dark .notif-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.04);
}
html.dark .notif-dropdown-item.unread {
  background: rgba(234, 88, 12, 0.04); /* Subtle orange tint for unread */
}

/* Dark Mode Icons (Matte & Subtle) */
html.dark .notif-dropdown-icon.success { background: rgba(16, 185, 129, 0.1); color: #34d399; }
html.dark .notif-dropdown-icon.error { background: rgba(139, 92, 246, 0.1); color: #c084fc; }
html.dark .notif-dropdown-icon.warning { background: rgba(239, 68, 68, 0.1); color: #f87171; }
html.dark .notif-dropdown-icon.default { background: rgba(59, 130, 246, 0.1); color: #60a5fa; }

