/* ==========================================================================
   XENTRA CORE — MERCHANT & OWNER DASHBOARD STYLES
   ========================================================================== */

:root {
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --bg-app: #0f172a;
  --bg-sidebar: #1e293b;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --primary-color: #b6ff00;
  --primary-text: #0f172a;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
}

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

html, body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

input, button, select, textarea, optgroup {
  font-family: inherit;
}

.x-dash-layout,
.x-auth-fullscreen,
#x-merchant-dashboard-app,
#x-merchant-login-app {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.x-dash-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.x-dash-sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.x-dash-xentra-brand {
  padding: 20px 20px 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.x-dash-xentra-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
  filter: invert(1) brightness(1.2);
}

.x-dash-brand-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.x-dash-logo-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.x-dash-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.x-dash-brand-info h2 {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.x-dash-badge-pro {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 4px;
}

/* Navigation Links */
.x-dash-nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.x-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
}

.x-nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.x-nav-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 700;
}

.x-nav-item.active svg {
  stroke: var(--primary-color);
}

.x-dash-footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.x-btn-view-store {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}

.x-btn-view-store:hover {
  background: var(--primary-color);
  color: var(--primary-text);
}

/* Main Content */
.x-dash-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: #f8fafc;
}

/* Topbar */
.x-dash-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.x-topbar-left h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
}

.x-topbar-left p {
  font-size: 13px;
  color: var(--text-muted);
}

.x-topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.x-live-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-green);
  background: rgba(16, 185, 129, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
}

.x-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.x-admin-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.x-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1e293b;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}

.x-user-meta {
  display: flex;
  flex-direction: column;
}

.x-user-meta span {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.x-user-role {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.x-btn-logout {
  background: #fee2e2;
  color: #dc2626;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 6px;
  transition: all 0.2s;
}

.x-btn-logout:hover {
  background: #fca5a5;
}

/* Tab Contents */
.x-tab-content {
  display: none;
  padding: 32px;
  animation: fadeIn 0.25s ease forwards;
}

.x-tab-content.active {
  display: block;
}

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

/* Metric Cards */
.x-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.x-metric-card {
  background: var(--bg-card);
  padding: 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
}

.x-metric-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.x-metric-icon.bg-green { background: #ecfdf5; color: #10b981; }
.x-metric-icon.bg-blue { background: #eff6ff; color: #3b82f6; }
.x-metric-icon.bg-amber { background: #fffbeb; color: #f59e0b; }

.x-metric-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.x-metric-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
}

/* Panels */
.x-card-panel {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.x-panel-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.x-panel-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.x-panel-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.x-header-buttons {
  display: flex;
  gap: 10px;
}

.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }

/* Quick Actions Grid */
.x-quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.x-quick-btn {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.x-quick-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

.x-quick-btn span {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.x-quick-btn small {
  font-size: 12px;
  color: var(--text-muted);
}

/* Brand Split Grid */
.x-brand-split-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

/* Forms */
.x-form {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.x-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.x-form-group label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.x-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  background: #ffffff;
  color: var(--text-main);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.x-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.x-input-with-action {
  display: flex;
  gap: 10px;
}

.x-help {
  font-size: 12px;
  color: var(--text-muted);
}

.x-color-picker-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.x-color-input {
  -webkit-appearance: none;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  background: none;
}

.x-color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.x-color-input::-webkit-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-sm);
}

.x-hex-input {
  width: 140px;
  font-family: monospace;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

.x-color-swatches {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.x-swatch-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.x-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px var(--border-color);
  cursor: pointer;
  transition: transform 0.15s;
}

.x-swatch:hover {
  transform: scale(1.15);
}

.x-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.x-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #0f172a;
}

/* Buttons */
.x-btn-primary {
  background: #0f172a;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.x-btn-primary:hover {
  background: #1e293b;
  box-shadow: var(--shadow-sm);
}

.x-btn-secondary {
  background: #f1f5f9;
  color: #334155;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.x-btn-secondary:hover {
  background: #e2e8f0;
}

/* Phone Mockup */
.x-preview-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.x-phone-mockup {
  width: 300px;
  height: 580px;
  background: #1e293b;
  border-radius: 36px;
  padding: 12px;
  box-shadow: var(--shadow-lg);
  margin-top: 16px;
  position: relative;
}

.x-phone-notch {
  width: 100px;
  height: 18px;
  background: #0f172a;
  border-radius: 0 0 12px 12px;
  margin: 0 auto;
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.x-phone-screen {
  width: 100%;
  height: 100%;
  background: #ffffff;
  border-radius: 26px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.x-mock-header {
  padding: 34px 16px 14px 16px;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
}

.x-mock-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.x-mock-logo {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
}

.x-mock-text strong {
  display: block;
  font-size: 14px;
  color: #0f172a;
}

.x-mock-text span {
  font-size: 11px;
  color: #64748b;
}

.x-mock-categories {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
}

.x-mock-pill {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: #f1f5f9;
  color: #64748b;
}

.x-mock-pill.active {
  background: var(--primary-color);
  color: var(--primary-text);
}

.x-mock-product {
  margin: 10px 16px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.x-mock-prod-info h4 {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.x-mock-prod-info p {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.3;
}

.x-mock-price {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  display: block;
  margin-top: 4px;
}

.x-mock-prod-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.x-mock-img {
  width: 50px;
  height: 50px;
  background: #f8fafc;
  border-radius: 8px;
  background-image: url('https://images.unsplash.com/photo-1598515214211-89d3c73ae83b?w=200');
  background-size: cover;
  background-position: center;
}

.x-mock-add-btn {
  background: var(--primary-color);
  color: var(--primary-text);
  border: none;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
}

.x-mock-cart-dock {
  margin-top: auto;
  background: #0f172a;
  color: #ffffff;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.x-mock-dock-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.x-mock-dock-left strong {
  display: block;
  font-size: 11px;
}

.x-mock-dock-left span {
  font-size: 11px;
  color: #94a3b8;
}

.x-mock-cart-cta {
  background: var(--primary-color);
  color: var(--primary-text);
  border: none;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 8px;
}

/* Tables */
.x-table-responsive {
  overflow-x: auto;
}

.x-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.x-table th {
  padding: 12px 14px;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.x-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  vertical-align: middle;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.py-6 { padding-top: 24px; padding-bottom: 24px; }

.x-table-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #f1f5f9;
}

/* Status Badges & Switches */
.x-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.x-badge-success { background: #dcfce7; color: #15803d; }
.x-badge-danger { background: #fee2e2; color: #b91c1c; }
.x-badge-warning { background: #fef3c7; color: #b45309; }
.x-badge-info { background: #e0e7ff; color: #4338ca; }
.x-badge-muted { background: #f1f5f9; color: #64748b; }

.x-btn-danger-outline {
  background: transparent;
  color: #ef4444;
  border: 1px solid #fca5a5;
}
.x-btn-danger-outline:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.x-btn-success-outline {
  background: transparent;
  color: #15803d;
  border: 1px solid #86efac;
}
.x-btn-success-outline:hover {
  background: #dcfce7;
  color: #166534;
}

/* Filter Tabs */
.x-catalog-filters {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.x-cat-filter-btn {
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  background: #f1f5f9;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.x-cat-filter-btn.active {
  background: #0f172a;
  color: #ffffff;
}

/* Modal & Overlay Architecture */
.x-modal-backdrop,
.x-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  font-family: var(--font-family);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.x-modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: min(520px, calc(100vw - 32px));
  width: 100%;
  max-height: min(90vh, calc(100dvh - 32px));
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalPop 0.2s ease forwards;
  font-family: var(--font-family);
  color: var(--text-main);
  box-sizing: border-box;
  margin: auto;
  position: relative;
}

.x-modal-card.x-modal-sm { max-width: min(440px, calc(100vw - 32px)); }
.x-modal-card.x-modal-md { max-width: min(540px, calc(100vw - 32px)); }
.x-modal-card.x-modal-lg { max-width: min(720px, calc(100vw - 32px)) !important; }
.x-modal-card.x-modal-xl { max-width: min(960px, calc(100vw - 32px)) !important; }

.x-modal-card * {
  font-family: inherit;
  box-sizing: border-box;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.x-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  background: #ffffff;
  box-sizing: border-box;
  width: 100%;
}

.x-modal-header h3 {
  font-size: 17px;
  font-weight: 800;
  font-family: var(--font-family);
  color: var(--text-main);
  margin: 0;
}

.x-modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-family);
  padding: 4px 8px;
  border-radius: 4px;
}

.x-modal-close:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.x-modal-card .x-form,
.x-modal-scroll-body {
  padding: 20px;
  margin-top: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  max-height: 100%;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.x-modal-card label {
  font-family: var(--font-family);
}

.x-modal-card input,
.x-modal-card select,
.x-modal-card textarea,
.x-modal-card button {
  font-family: var(--font-family);
}

.x-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
}

.x-modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 0;
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  background: #ffffff;
  position: sticky;
  bottom: 0;
  z-index: 10;
  box-sizing: border-box;
  width: 100%;
  flex-shrink: 0;
}

/* Normalized File Input & Upload Wrap */
input[type="file"].x-input,
.x-input[type="file"],
.x-file-input {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  font-size: 12px;
  color: #475569;
  background: #f8fafc;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.x-file-upload-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.x-file-upload-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-sizing: border-box;
}

.x-file-upload-info small,
.x-file-upload-wrap small {
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.4;
}

@media (max-width: 480px) {
  .x-file-upload-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* Branches Grid */
.x-branches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.x-branch-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.x-branch-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.x-branch-card-header h4 {
  font-size: 16px;
  font-weight: 800;
}

/* Toggle switch cabang: hijau = aktif, merah = nonaktif */
.x-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  cursor: pointer;
  flex-shrink: 0;
}
.x-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.x-toggle-slider {
  position: absolute;
  inset: 0;
  background: #ef4444;
  border-radius: 999px;
  transition: background 0.2s ease;
}
.x-toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  top: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.3);
}
.x-toggle input:checked + .x-toggle-slider,
.x-toggle.x-toggle-on .x-toggle-slider {
  background: #10b981;
}
.x-toggle input:checked + .x-toggle-slider::before,
.x-toggle.x-toggle-on .x-toggle-slider::before {
  transform: translateX(22px);
}
.x-toggle input:disabled + .x-toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}
.x-toggle input:disabled {
  cursor: not-allowed;
}

.x-branch-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border-color);
}

.x-branch-detail-row span:first-child {
  color: var(--text-muted);
}

.x-branch-detail-row span:last-child {
  font-weight: 700;
}

/* ==========================================================================
   OWNER DASHBOARD SHELL — PHASE 0 ADDITIONS
   ========================================================================== */

/* Nav group labels */
.x-nav-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  padding: 14px 14px 4px 14px;
  user-select: none;
  pointer-events: none;
}

.x-nav-group-label:first-child {
  padding-top: 4px;
}

/* Nav item — data-route attribute (new routing system) */
.x-nav-item[data-route] {
  position: relative;
}

/* Catalog parent — chevron toggle */
.x-nav-parent {
  justify-content: flex-start;
}

.x-nav-chevron {
  margin-left: auto;
  flex-shrink: 0;
  transition: transform 0.2s ease;
  opacity: 0.5;
}

.x-nav-parent.active .x-nav-chevron,
.x-nav-parent[aria-expanded="true"] .x-nav-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

/* Catalog sub-nav */
.x-nav-sub {
  display: none;
  flex-direction: column;
  padding: 2px 0 4px 42px;
  gap: 2px;
}

.x-nav-sub.open {
  display: flex;
}

.x-nav-sub-item {
  display: flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
  position: relative;
}

.x-nav-sub-item::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 10px;
  opacity: 0.4;
  flex-shrink: 0;
}

.x-nav-sub-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.x-nav-sub-item:hover::before {
  opacity: 1;
}

.x-nav-sub-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 600;
}

.x-nav-sub-item.active::before {
  opacity: 1;
  background: var(--primary-color);
}

/* Mobile sidebar close button */
.x-sidebar-close {
  display: none;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
}

.x-sidebar-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* Mobile sidebar overlay */
.x-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

/* Hamburger button (hidden on desktop) */
.x-hamburger {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.x-hamburger svg {
  pointer-events: none;
}

.x-hamburger:hover {
  background: #f1f5f9;
}

/* Topbar left — flex for hamburger + title */
.x-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Topbar icon buttons (search, notifications) */
.x-topbar-icon-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.x-topbar-icon-btn:hover {
  background: #f1f5f9;
  color: var(--text-main);
  border-color: #cbd5e1;
}

/* Brand context badge */
.x-topbar-brand-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  flex-shrink: 0;
}

/* Branch context selector */
.x-branch-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Branch context badge (BM locked branch context) */
.x-branch-context-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  flex-shrink: 0;
}

.x-branch-select {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  outline: none;
  padding: 0;
  min-width: 100px;
  max-width: 180px;
}

.x-branch-select:focus {
  outline: none;
}

/* Route placeholder pages */
.x-route-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 32px;
  text-align: center;
  gap: 12px;
  min-height: 300px;
}

.x-route-placeholder-icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 8px;
}

.x-route-placeholder h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.x-route-placeholder p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 400px;
  margin: 0;
  line-height: 1.6;
}


@media (max-width: 900px) {
  .x-brand-split-grid {
    grid-template-columns: 1fr;
  }
  .x-branch-selector {
    display: none;
  }
}

@media (max-width: 1023px) {
  /* Show hamburger on mobile & tablet */
  .x-hamburger {
    display: flex;
  }
  /* Show sidebar close button on mobile & tablet */
  .x-sidebar-close {
    display: flex;
  }

  /* Sidebar becomes a fixed off-canvas drawer on mobile & tablet */
  .x-dash-layout {
    flex-direction: row;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
  }
  .x-dash-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px !important;
    max-width: 85vw !important;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: none;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
  }
  .x-dash-sidebar.open {
    transform: translateX(0);
  }
  .x-sidebar-overlay.open {
    display: block;
  }
  .x-dash-xentra-brand {
    padding: 16px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .x-dash-brand-header {
    padding: 12px 16px;
  }
  .x-dash-brand-info {
    display: block !important;
  }
  .x-dash-nav {
    display: flex !important;
    flex-direction: column !important;
    overflow-x: visible !important;
    padding: 8px 12px !important;
    gap: 2px !important;
  }
  /* Nav group labels */
  .x-nav-group-label {
    display: block !important;
  }
  .x-nav-item {
    padding: 10px 14px !important;
    white-space: normal !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    flex-shrink: 0;
  }
  .x-nav-item span {
    display: inline-block !important;
  }
  .x-dash-footer {
    display: block !important;
  }
  .x-dash-main {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 1 1 100%;
  }
  .x-dash-topbar {
    padding: 12px 16px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
  }
  .x-topbar-left {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }
  .x-hamburger {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    cursor: pointer !important;
  }
  .x-topbar-left > div {
    min-width: 0;
    flex: 1;
    overflow: hidden;
  }
  .x-topbar-left h1 {
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
  }
  .x-topbar-left p {
    display: none !important;
  }
  .x-topbar-right {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
  }
  .x-topbar-icon-btn {
    display: none;
  }
  #btn-notifications.x-topbar-icon-btn {
    display: flex;
    width: 32px;
    height: 32px;
    padding: 0;
  }
  .x-admin-profile .x-user-meta {
    display: none;
  }
  .x-topbar-brand-badge {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    padding: 4px 8px;
  }
  .x-topbar-brand-badge span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .x-branch-selector {
    max-width: 140px;
    font-size: 12px;
  }
  .x-branch-select {
    max-width: 100%;
    font-size: 12px;
    padding: 3px 6px;
  }
  .x-branch-context-badge {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    padding: 4px 8px;
  }
  .x-branch-context-badge span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .x-tab-content {
    padding: 20px 16px;
  }
  .x-metrics-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .x-quick-actions-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .x-phone-mockup {
    max-width: 100%;
    margin: 0 auto;
  }
  .x-panel-header-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .x-header-buttons {
    width: 100%;
    display: flex;
    gap: 8px;
  }
  .x-header-buttons button {
    flex: 1;
  }
}

/* =========================================================================
   MERCHANT AUTH FULLSCREEN STYLES

   ========================================================================= */
.x-auth-fullscreen {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, #1e293b 0%, #0f172a 100%);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.x-auth-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  max-width: 440px;
  width: 100%;
  padding: 36px 32px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.x-auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.x-auth-logo-wrap {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: #f1f5f9;
  margin: 0 auto 12px auto;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.x-auth-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.x-auth-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
}

.x-auth-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.x-auth-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: -6px;
  margin-bottom: 6px;
}

.x-btn-block {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.x-auth-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  background: #f8fafc;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-color);
  margin-top: 14px;
}

/* Branch Catalog Manager Modal Styles */
.x-modal-lg {
  max-width: 960px !important;
  width: 95% !important;
  max-height: 90vh !important;
  display: flex !important;
  flex-direction: column !important;
}

.x-modal-scroll-body {
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.x-catalog-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.x-catalog-section-title h4 {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.x-badge-lock {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  font-weight: 700;
  font-size: 11px;
}

.x-badge-range {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  font-weight: 700;
  font-size: 11px;
}

.x-branch-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.x-product-card-simple {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: all 0.2s;
}

.x-product-card-simple:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.x-product-card-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: #f1f5f9;
  flex-shrink: 0;
}

.x-product-card-content {
  flex: 1;
  min-width: 0;
}

.x-product-card-content h5 {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.x-product-card-price {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-top: 4px;
}

.x-product-card-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Phase 4: Overview & Reports Styles */
.x-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.x-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.x-date-input {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: #ffffff;
  color: var(--text-main);
}

.x-overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

@media (max-width: 960px) {
  .x-overview-grid {
    grid-template-columns: 1fr;
  }
}

.x-table-responsive {
  width: 100%;
  overflow-x: auto;
}

.x-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.x-data-table th {
  padding: 10px 14px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-color);
  background: #f8fafc;
  white-space: nowrap;
}

.x-data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.x-data-table tr:hover td {
  background: #f8fafc;
}

.x-empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.x-empty-state-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.x-subnav-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.x-subnav-tab {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.x-subnav-tab:hover {
  color: var(--text-main);
}

.x-subnav-tab.active {
  color: #0f172a;
  border-bottom-color: #0f172a;
  font-weight: 700;
}

.x-alert-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: #fffbeb;
  border: 1px solid #fef3c7;
  color: #b45309;
  font-size: 13px;
  margin-bottom: 16px;
}

/* =========================================================================
   SETTINGS LAYOUT & RESPONSIVE FORM RULES
   ========================================================================= */

.settings-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-top: 8px;
  width: 100%;
  box-sizing: border-box;
}

.settings-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-sizing: border-box;
}

.settings-content-panel {
  flex: 1;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Base table wrapper for horizontal scrolling on narrow screens */
.x-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 1023px) {
  .settings-layout {
    flex-direction: column;
    gap: 16px;
  }

  .settings-sidebar {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px;
  }

  .settings-content-panel {
    width: 100% !important;
  }

  .x-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .x-filter-group {
    flex-wrap: wrap;
    gap: 8px;
  }
}

@media (max-width: 768px) {
  /* Settings form multi-column grids become single-column on mobile */
  .settings-content-panel div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Filter date inputs full width or wrap nicely */
  .x-date-input {
    flex: 1 1 auto;
    min-width: 130px;
  }

  /* Cards have comfortable padding on mobile */
  .x-card {
    padding: 16px !important;
  }

  /* Ensure inputs & buttons fit neatly inside cards */
  .x-input, select.x-input {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Modal cards fill width on mobile with safe gutter */
  .x-modal-card {
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
    border-radius: var(--radius-md) !important;
  }

  .x-modal-header {
    padding: 14px 16px !important;
  }

  .x-modal-card .x-form,
  .x-modal-scroll-body {
    padding: 16px !important;
  }

  .x-modal-scroll-body {
    flex: 1 1 auto;
    max-height: 100%;
    -webkit-overflow-scrolling: touch;
  }

  /* Form row elements stack vertically on narrow screens */
  .x-form-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* Responsive topbar adjustments on tablet/narrow screens */
  .x-dash-topbar {
    padding: 12px 14px;
    gap: 10px;
  }
  .x-topbar-left h1 {
    font-size: 17px;
  }
  .x-topbar-right {
    gap: 8px;
  }
  #topbar-brand-badge {
    display: none !important;
  }
  #x-branch-selector {
    display: none !important;
  }
  .x-live-status {
    padding: 3px 8px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .x-modal-backdrop {
    padding: 8px !important;
  }

  .x-modal-card {
    max-width: calc(100vw - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
  }

  .x-modal-footer {
    flex-wrap: wrap;
    justify-content: stretch;
    gap: 8px;
  }

  .x-modal-footer button {
    flex: 1 1 100%;
  }

}

/* BM Add Catalog Picker Card Styles */
.x-catalog-picker-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-md);
  background: #ffffff;
  gap: 12px;
  transition: all 0.15s ease;
  cursor: pointer;
  box-sizing: border-box;
  width: 100%;
}

.x-catalog-picker-card:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.x-catalog-picker-card.is-selected {
  border-color: #2563eb !important;
  background: #eff6ff !important;
  box-shadow: 0 0 0 1px #2563eb;
}

.x-catalog-picker-card.is-adopted {
  background: #f8fafc;
  border-color: #e2e8f0;
  opacity: 0.82;
  cursor: default;
}

.x-catalog-picker-card.is-adopted:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.x-catalog-picker-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: #2563eb;
}

/* Category Checkbox Multi-Select UI Card in Edit Menu */
.x-category-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  box-sizing: border-box;
}

.x-category-chip-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.x-category-chip-card:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.x-category-chip-card.is-checked {
  background: #eff6ff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

.x-category-chip-card .override-cat-checkbox {
  width: 17px;
  height: 17px;
  cursor: pointer;
  accent-color: #2563eb;
  margin: 0;
  flex-shrink: 0;
}

.x-category-chip-card span {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .x-catalog-picker-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .x-category-select-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================================
   UNIFIED IMAGE UPLOAD & PREVIEW CONTROLS
   ========================================================================= */
.x-image-upload-control {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  flex-wrap: nowrap;
  box-sizing: border-box;
  width: 100%;
}

.x-image-upload-preview-box {
  width: 76px;
  height: 76px;
  border-radius: 12px;
  border: 1.5px dashed #cbd5e1;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.x-image-upload-preview-box.is-banner {
  width: 140px;
  height: 72px;
}

.x-image-upload-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.x-image-upload-empty {
  font-size: 24px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px;
  width: 100%;
  height: 100%;
}

.x-image-upload-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.x-image-upload-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.x-image-specs-text {
  font-size: 11.5px;
  font-weight: 500;
  color: #64748b;
  margin-top: 2px;
  line-height: 1.4;
  word-break: break-word;
}

@media (max-width: 480px) {
  .x-image-upload-control {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
  }
  .x-image-upload-preview-box {
    width: 68px;
    height: 68px;
  }
}

/* =========================================================================
   SAAS POLISH: BRAND PROFILE & SETTINGS ENHANCEMENTS
   ========================================================================= */
.x-brand-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  background: #ffffff;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.x-brand-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.x-field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.x-field-hint {
  font-size: 11.5px;
  font-weight: 400;
  color: #94a3b8;
}

.x-color-picker-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.x-color-swatches-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px dashed #e2e8f0;
}

/* Polished Brand Panel Layout */
.x-brand-split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
}

.x-brand-split-grid .x-card-panel {
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
}

.x-brand-split-grid .x-panel-header h3 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #0f172a;
  margin: 0 0 6px 0;
}

.x-brand-split-grid .x-panel-header p {
  font-size: 13px;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

/* Button & Upload Control Polish */
.x-image-upload-control {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  transition: border-color 0.2s, background-color 0.2s;
}

.x-image-upload-control:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.x-image-upload-actions .x-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  margin: 0;
  box-sizing: border-box;
}

.x-image-upload-actions label.x-btn-secondary {
  margin: 0;
  cursor: pointer;
  user-select: none;
}

.x-image-upload-actions .x-btn-secondary:hover:not(:disabled),
.x-image-upload-actions label.x-btn-secondary:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.x-image-upload-actions .x-btn-secondary:active,
.x-image-upload-actions label.x-btn-secondary:active {
  transform: translateY(0);
}

.x-image-upload-actions .x-btn-secondary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.x-file-input-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
}

/* Phone Mockup Saas Polish */
.x-phone-mockup {
  margin: 12px auto 0 auto;
  box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.25);
  border: 4px solid #0f172a;
}

/* ==========================================================================
   MOBILE-FIRST ACTION UX SYSTEM (POPOVERS, OVERFLOW MENUS, ACTION GROUPS)
   ========================================================================== */

/* Item actions container in tables / cards */
.x-item-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  position: relative;
}

/* Desktop-only action buttons (hidden on mobile) */
.x-action-desktop-only {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Branch card responsive action row */
.x-branch-actions-row {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
}

.x-branch-primary-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Product card action footer */
.x-product-card-simple .x-product-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
}

/* Mobile Breakpoint Optimizations */
@media (max-width: 768px) {
  /* Tables on mobile: keep action column compact */
  .x-table td.text-right,
  .x-data-table td.text-right {
    white-space: nowrap;
    padding: 10px 8px;
  }

  /* In table rows on mobile, hide secondary text buttons that are now in the `⋯` menu */
  .x-action-desktop-only {
    display: none !important;
  }

  /* Branch card actions on mobile */
  .x-branch-actions-row {
    flex-wrap: nowrap;
  }

  .x-branch-primary-actions {
    flex: 1 1 auto;
    min-width: 0;
  }

  .x-branch-primary-actions button {
    flex: 1 1 auto;
    padding: 8px 10px !important;
    font-size: 12px !important;
    text-align: center;
    justify-content: center;
  }

}

@media (max-width: 480px) {
  .x-item-actions {
    gap: 4px;
  }


  /* Header action buttons: wrap or stack cleanly */
  .x-header-buttons {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .x-header-buttons button {
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
    padding: 8px 10px;
    font-size: 12.5px;
  }
}

/* =========================================================================
   BRANCH MANAGER OPERATIONAL CENTER (BM-1) STYLES
   ========================================================================= */
.x-bm-hero-banner {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg, 12px);
  position: relative;
  overflow: hidden;
}

.x-bm-branch-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(14, 165, 233, 0.1);
  color: #0284c7;
  border: 1px solid rgba(14, 165, 233, 0.25);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.x-status-dot-open {
  background: var(--accent-green, #10b981) !important;
  box-shadow: 0 0 8px var(--accent-green, #10b981) !important;
}

.x-status-dot-closed {
  background: #dc2626 !important;
  box-shadow: 0 0 8px #dc2626 !important;
}

.x-status-dot-paused {
  background: var(--accent-amber, #f59e0b) !important;
  box-shadow: 0 0 8px var(--accent-amber, #f59e0b) !important;
}

/* ==========================================================================
   MARKETING — STOREFRONT BANNER UI SCAFFOLD
   ========================================================================== */


/* ==========================================================================
   MARKETING — STOREFRONT BANNER EDITOR
   ========================================================================== */
.x-marketing-banner-editor-modal {
  overflow: hidden;
}

.x-marketing-banner-editor-body {
  overflow-y: auto;
  padding: 20px;
}

.x-marketing-banner-editor-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
  gap: 20px;
  align-items: start;
}

.x-marketing-banner-editor-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.x-marketing-banner-section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.x-marketing-banner-section-title strong {
  display: block;
  font-size: 13px;
  color: var(--text-main);
}

.x-marketing-banner-section-title span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
}

.x-marketing-banner-upload-box {
  width: 100%;
  min-height: 190px;
  aspect-ratio: 1.94 / 1;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.x-marketing-banner-upload-box img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.x-marketing-banner-upload-empty {
  font-size: 44px;
  opacity: .55;
}

.x-marketing-banner-upload-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.x-marketing-banner-help {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.45;
}

.x-marketing-banner-branch-selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.x-marketing-banner-branch-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 190px;
  overflow: auto;
  padding: 4px;
}

.x-marketing-banner-branch-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--border-color);
  border-radius: 9px;
  background: #fff;
}

.x-marketing-banner-branch-check input {
  margin-top: 2px;
}

.x-marketing-banner-branch-check span {
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.x-marketing-banner-branch-check small {
  grid-column: 2;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: -3px;
}

.x-marketing-banner-placement-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.x-marketing-banner-schedule-toggle,
.x-marketing-banner-create-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #f8fafc;
}

.x-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
}

.x-checkbox-label input {
  margin: 0;
}

.x-marketing-banner-publish-note {
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 9px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 11px;
  line-height: 1.5;
}

.x-marketing-banner-publish-note strong {
  display: block;
  margin-bottom: 2px;
}


.x-marketing-banner-legacy-settings-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border-color);
  background: #f8fafc;
  border-radius: 10px;
}

.x-marketing-banner-legacy-settings-notice strong {
  display: block;
  font-size: 13px;
  color: var(--text-main);
}

.x-marketing-banner-legacy-settings-notice p {
  margin: 4px 0 0;
  max-width: 720px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
}

.x-marketing-banner-legacy-footnote {
  margin-top: 10px;
  font-size: 10px;
  line-height: 1.5;
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .x-marketing-banner-legacy-settings-notice {
    align-items: stretch;
    flex-direction: column;
  }

  .x-marketing-banner-legacy-settings-notice .x-btn-primary {
    width: 100%;
    justify-content: center;
  }
}

.x-marketing-banner-legacy-notice {
  padding: 10px 20px;
  border-bottom: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
  font-size: 11px;
  line-height: 1.5;
}

.x-marketing-banner-branch-filter {
  min-width: 170px;
  max-width: 240px;
}

.x-marketing-banner-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.x-marketing-banner-preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 24px;
}

.x-marketing-banner-no-assignment {
  font-size: 11px;
  color: var(--text-muted);
}

.x-marketing-banner-draft-hint {
  font-size: 10px;
  color: #b45309;
  font-weight: 700;
}

.x-marketing-banner-preview-stage {
  position: relative;
  aspect-ratio: 1.94 / 1;
  border-radius: 14px;
  overflow: hidden;
  background: #f1f5f9;
}

.x-marketing-banner-preview-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.x-marketing-banner-preview-stage-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 13px;
}

.x-marketing-banner-preview-stage-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(transparent, rgba(15,23,42,.86));
  color: #fff;
}

.x-marketing-banner-preview-stage-caption strong {
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.x-marketing-banner-preview-stage-caption span {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  opacity: .88;
}

.x-marketing-banner-preview-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.x-marketing-banner-preview-meta > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 9px;
}

.x-marketing-banner-preview-meta span {
  font-size: 10px;
  color: var(--text-muted);
}

.x-marketing-banner-preview-meta strong {
  font-size: 11px;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.x-carousel-slide-clickable {
  cursor: pointer;
}

@media (max-width: 720px) {
  .x-marketing-banner-editor-grid,
  .x-marketing-banner-placement-grid {
    grid-template-columns: 1fr;
  }

  .x-marketing-banner-branch-list {
    grid-template-columns: 1fr;
  }

  .x-marketing-banner-preview-meta {
    grid-template-columns: 1fr;
  }

  .x-marketing-banner-editor-body {
    padding: 16px;
  }

  .x-marketing-banner-schedule-toggle,
  .x-marketing-banner-create-controls {
    align-items: flex-start;
    flex-direction: column;
  }

  .x-marketing-banner-branch-filter {
    width: 100%;
    max-width: none;
  }
}

.x-marketing-banner-panel {
  overflow: visible;
}

.x-marketing-banner-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-color);
}

.x-marketing-banner-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.x-marketing-banner-header p {
  margin: 3px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.x-marketing-banner-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color);
  background: #f8fafc;
  flex-wrap: wrap;
}

.x-marketing-banner-toolbar-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.x-marketing-banner-toolbar-copy strong {
  font-size: 12px;
  color: var(--text-main);
}

.x-marketing-banner-toolbar-copy span {
  font-size: 11px;
  color: var(--text-muted);
}

.x-marketing-banner-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
  font-size: 12px;
}

.x-marketing-banner-filter-label {
  color: var(--text-muted);
  font-weight: 600;
}

.x-marketing-banner-filter-value {
  color: var(--text-main);
  font-weight: 700;
}

.x-marketing-banner-table {
  min-width: 980px;
}

.x-marketing-banner-table td {
  vertical-align: middle;
}

.x-marketing-banner-primary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 270px;
}

.x-marketing-banner-preview {
  width: 132px;
  height: 68px;
  flex: 0 0 132px;
  border-radius: 9px;
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(135deg, rgba(182,255,0,.22), rgba(15,23,42,.92)),
    linear-gradient(135deg, #0f172a, #334155);
  border: 1px solid #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.x-marketing-banner-preview::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 24%, rgba(255,255,255,.22), transparent 26%),
    linear-gradient(120deg, transparent 30%, rgba(255,255,255,.08) 30%, rgba(255,255,255,.08) 68%, transparent 68%);
  pointer-events: none;
}

.x-marketing-banner-preview-overlay {
  position: absolute;
  inset: auto 0 0;
  padding: 8px 9px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: linear-gradient(transparent, rgba(15,23,42,.9));
  color: #ffffff;
}

.x-marketing-banner-preview-overlay strong {
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: .03em;
}

.x-marketing-banner-preview-overlay span {
  font-size: 9px;
  line-height: 1.25;
  opacity: .85;
}

.x-marketing-banner-name {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.x-marketing-banner-name strong {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.35;
}

.x-marketing-banner-secondary {
  font-size: 12px;
  color: var(--text-main);
  line-height: 1.45;
}

.x-marketing-banner-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  border: 1px solid transparent;
}

.x-marketing-banner-status.is-draft {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

.x-marketing-banner-status.is-scheduled {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.x-marketing-banner-status.is-active {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.x-marketing-banner-status.is-paused {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.x-marketing-banner-status.is-ended {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
}

.x-marketing-banner-visibility {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.x-toggle.x-toggle-compact {
  width: 42px;
  height: 24px;
}

.x-toggle.x-toggle-compact .x-toggle-slider::before {
  width: 18px;
  height: 18px;
  top: 3px;
  left: 3px;
}

.x-toggle.x-toggle-compact input:checked + .x-toggle-slider::before {
  transform: translateX(18px);
}

.x-marketing-banner-visibility-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

@media (max-width: 768px) {
  .x-marketing-banner-header {
    align-items: stretch;
  }

  .x-marketing-banner-header > div:first-child {
    min-width: 0;
  }

  .x-marketing-banner-header .x-btn-primary {
    width: 100%;
    justify-content: center;
  }

  .x-marketing-banner-toolbar {
    padding: 12px 16px;
  }

  .x-marketing-banner-table {
    min-width: 0;
  }

  .x-marketing-banner-table,
  .x-marketing-banner-table tbody,
  .x-marketing-banner-table tr,
  .x-marketing-banner-table td {
    display: block;
    width: 100%;
  }

  .x-marketing-banner-table thead {
    display: none;
  }

  .x-marketing-banner-table tbody {
    padding: 10px 12px 14px;
  }

  .x-marketing-banner-table tr {
    margin-bottom: 12px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: visible;
  }

  .x-marketing-banner-table td {
    border-bottom: 1px solid #f1f5f9;
    padding: 11px 14px;
  }

  .x-marketing-banner-table td:last-child {
    border-bottom: none;
  }

  .x-marketing-banner-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .x-marketing-banner-primary {
    align-items: flex-start;
    min-width: 0;
  }

  .x-marketing-banner-preview {
    width: 120px;
    height: 62px;
    flex-basis: 120px;
  }

  .x-marketing-banner-secondary {
    display: block;
  }

  .x-marketing-banner-visibility {
    justify-content: flex-start;
  }

  .x-marketing-banner-table td[data-label="Aksi"] .x-item-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .x-marketing-banner-primary {
    flex-direction: column;
  }

  .x-marketing-banner-preview {
    width: 100%;
    height: 110px;
    flex-basis: auto;
  }

  .x-marketing-banner-name {
    width: 100%;
  }

  .x-marketing-banner-toolbar {
    align-items: stretch;
  }

  .x-marketing-banner-filter {
    justify-content: space-between;
    width: 100%;
  }
}

/* ==========================================================================
   BRANCH MANAGER OPERATIONAL CENTER: MOBILE ORDER CARDS & ATTENTION
   ========================================================================== */

/* Responsive switching between desktop table and mobile cards */
.bm-orders-desktop-table {
  display: block;
}

.bm-orders-mobile-cards {
  display: none;
}

@media (max-width: 768px) {
  .bm-orders-desktop-table {
    display: none !important;
  }

  .bm-orders-mobile-cards {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }
}

/* Operational Card Component */
.bm-order-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 12px);
  padding: 16px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.05));
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

/* Attention pulse / highlight for genuinely new pending orders */
.bm-order-card.bm-order-card-attention {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25), var(--shadow-md);
  animation: bmOrderPulse 1.8s ease-in-out infinite alternate;
}

@keyframes bmOrderPulse {
  0% {
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.2), var(--shadow-sm);
  }
  100% {
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.4), var(--shadow-md);
  }
}

/* Card Header */
.bm-order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

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

.bm-order-card-number {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main, #0f172a);
  word-break: break-all;
}

.bm-order-card-time {
  font-size: 12px;
  color: var(--text-muted, #64748b);
  font-weight: 600;
}

/* Card Customer & Fulfillment Meta */
.bm-order-card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bm-order-card-customer {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main, #0f172a);
  word-break: break-word;
}

.bm-order-card-phone {
  font-size: 12px;
  color: var(--text-muted, #64748b);
}

.bm-order-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.bm-order-card-table {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #64748b);
}

/* Card Total & Status Row */
.bm-order-card-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-main, #f8fafc);
  border-radius: var(--radius-sm, 8px);
  gap: 8px;
}

.bm-order-card-total-wrap {
  display: flex;
  flex-direction: column;
}

.bm-order-card-total-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bm-order-card-total-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main, #0f172a);
}

.bm-order-card-status-wrap {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.bm-order-card-countdown {
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Card Action Buttons (Thumb-accessible) */
.bm-order-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  margin-top: 4px;
}

.bm-order-card-actions .x-btn-primary,
.bm-order-card-actions .x-btn-secondary {
  flex: 1;
  min-height: 40px;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm, 8px);
  box-sizing: border-box;
}

.bm-order-card-actions .bm-btn-danger {
  color: #dc2626;
  border-color: #fecaca;
  background: #fff;
}

.bm-order-card-actions .bm-btn-danger:hover {
  background: #fef2f2;
}

.bm-order-card-actions .bm-btn-detail {
  flex: 0 0 auto;
  min-width: 70px;
}



/* ==========================================================================
   XENTRA MERCHANT — MOBILE DESIGN SOURCE OF TRUTH
   Operational order inbox + app shell
   ========================================================================== */

.bm-order-center {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}

.bm-order-center-head {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.bm-order-center-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.bm-section-kicker {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #64748b;
}

.bm-order-center-heading h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.bm-order-center-heading p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.bm-icon-btn {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.bm-icon-btn:active {
  transform: scale(.98);
}

.bm-order-queue-tabs {
  display: inline-flex;
  width: 100%;
  margin-top: 16px;
  padding: 3px;
  background: #f1f5f9;
  border-radius: 12px;
}

.bm-order-queue-tab {
  flex: 1 1 0;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.bm-order-queue-tab.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .08);
}

.bm-order-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 10px;
  background: #e2e8f0;
  color: #475569;
  font-size: 10px;
  font-weight: 800;
}

.bm-order-queue-tab.active .bm-order-count {
  background: #0f172a;
  color: #ffffff;
}

.bm-order-type-scroller {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 2px 3px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.bm-order-type-scroller::-webkit-scrollbar {
  display: none;
}

.bm-order-type-chip {
  min-height: 34px;
  flex: 0 0 auto;
  padding: 0 13px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #ffffff;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.bm-order-type-chip.active {
  border-color: #0f172a;
  background: #0f172a;
  color: #ffffff;
}

.bm-order-search-row {
  margin-top: 12px;
}

.bm-order-search {
  min-height: 42px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}

.bm-order-search svg {
  flex: 0 0 auto;
  color: #94a3b8;
}

.bm-order-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  color: #0f172a;
}

.bm-order-feed {
  width: 100%;
}

.bm-order-feed-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.bm-order-feed-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 15px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .035);
  min-width: 0;
}

.bm-order-feed-card.needs-attention {
  border-color: #fed7aa;
  box-shadow: 0 0 0 1px rgba(249, 115, 22, .08), 0 5px 16px rgba(15, 23, 42, .05);
}

.bm-order-feed-top,
.bm-order-feed-context,
.bm-order-feed-state,
.bm-order-feed-actions {
  display: flex;
  align-items: center;
}

.bm-order-feed-top {
  justify-content: space-between;
  gap: 8px;
}

.bm-order-feed-context {
  min-width: 0;
  gap: 7px;
}

.bm-order-feed-context strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #334155;
  font-size: 12px;
}

.bm-order-feed-top time {
  flex: 0 0 auto;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
}

.bm-order-type-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.bm-order-type-pill.type-dine-in {
  background: #ede9fe;
  color: #6d28d9;
}

.bm-order-type-pill.type-pickup {
  background: #fef3c7;
  color: #92400e;
}

.bm-order-type-pill.type-delivery {
  background: #dbeafe;
  color: #1d4ed8;
}

.bm-order-type-pill.type-reservation {
  background: #fef3c7;
  color: #92400e;
}

.bm-order-feed-main {
  margin-top: 12px;
}

.bm-order-feed-number {
  color: #0f172a;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

.bm-order-feed-customer {
  margin-top: 3px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.bm-order-feed-items {
  margin-top: 5px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.bm-order-feed-state {
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}

.bm-order-state-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.bm-order-state-pill.attention {
  background: #dcfce7;
  color: #15803d;
}

.bm-order-state-pill.neutral {
  background: #f1f5f9;
  color: #475569;
}

.bm-order-state-pill.muted {
  background: #f8fafc;
  color: #64748b;
}

.bm-order-deadline {
  flex: 0 0 auto;
  color: #b45309;
  font-size: 10px;
  font-weight: 800;
}

.bm-order-payment-line {
  margin-top: 9px;
  font-size: 11px;
  font-weight: 700;
}

.bm-order-payment-line.unpaid {
  color: #b91c1c;
}

.bm-order-payment-line.partial {
  color: #92400e;
}

.bm-order-payment-line.paid {
  color: #15803d;
}

.bm-order-addition-alert {
  margin-top: 9px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 11px;
  font-weight: 800;
}

.bm-order-feed-actions {
  gap: 8px;
  margin-top: 13px;
}

.bm-order-primary-action,
.bm-order-detail-action {
  min-height: 40px;
  border-radius: 11px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.bm-order-primary-action {
  flex: 1 1 auto;
  border: 1px solid #0f172a;
  background: #0f172a;
  color: #ffffff;
  padding: 0 13px;
}

.bm-order-detail-action {
  flex: 0 0 auto;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  padding: 0 13px;
}

.bm-order-empty {
  min-height: 260px;
  padding: 28px 20px;
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #64748b;
}

.bm-order-empty-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 10px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  font-size: 22px;
}

.bm-order-empty strong {
  color: #334155;
  font-size: 14px;
}

.bm-order-empty span {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.45;
}

.x-merchant-mobile-nav {
  display: none;
}

@media (max-width: 768px) {
  body {
    padding-bottom: 78px;
  }

  .x-dash-sidebar,
  .x-sidebar-overlay,
  .x-hamburger {
    display: none !important;
  }

  .x-dash-main {
    margin-left: 0 !important;
    width: 100% !important;
    min-width: 0;
  }

  .x-dash-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: 58px;
    padding: 9px 12px;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #eef2f7;
  }

  .x-topbar-left {
    min-width: 0;
  }

  .x-topbar-left > div:last-child {
    min-width: 0;
  }

  .x-topbar-left h1 {
    margin: 0;
    font-size: 17px;
  }

  .x-topbar-left p {
    display: none;
  }

  .x-topbar-right {
    margin-left: auto;
  }

  .x-user-meta,
  .x-btn-logout {
    display: none !important;
  }

  .x-admin-profile {
    padding: 0 !important;
    border: 0 !important;
  }

  .x-dash-main > .x-tab-content {
    padding: 12px;
  }

  .bm-order-center {
    max-width: none;
  }

  .bm-order-center-head {
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 12px;
  }

  .bm-order-center-heading h3 {
    font-size: 20px;
  }

  .bm-order-feed-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .bm-order-feed-card {
    border-radius: 16px;
    padding: 14px;
  }

  .bm-order-search input {
    font-size: 16px;
  }
}

@media (min-width: 769px) {
  .bm-order-feed-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .bm-order-center-head {
    padding: 13px;
  }

  .bm-order-type-chip {
    padding-left: 11px;
    padding-right: 11px;
  }

  .bm-order-primary-action,
  .bm-order-detail-action {
    font-size: 11px;
  }
}


/* ==========================================================================
   XENTRA MERCHANT APP — UI-FIRST SHELL
   Visual surface intentionally independent from fulfillment/payment logic.
   ========================================================================== */
.x-merchant-app .x-dash-sidebar,
.x-merchant-app .x-sidebar-overlay,
.x-merchant-app .x-hamburger { display:none !important; }
.x-merchant-app .x-dash-main { width:100%; margin-left:0 !important; padding-bottom:100px; }
.x-merchant-app .x-dash-topbar { padding-left:clamp(16px,3vw,32px); padding-right:clamp(16px,3vw,32px); }
.x-merchant-app .x-tab-content { max-width:1180px; width:100%; margin:0 auto; box-sizing:border-box; }
.x-merchant-app .table-responsive,
.x-merchant-app .x-table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
@media(max-width:768px){
  html,
  body.x-merchant-app {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    overflow: hidden !important;
    position: fixed !important;
    inset: 0 !important;
    background: #e8e8ea !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .x-merchant-app .x-dash-layout {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    display: flex !important;
    flex-direction: column !important;
    background: #e8e8ea !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .x-merchant-app .x-dash-main {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    background: #e8e8ea !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}
@media(min-width:769px){
  .x-merchant-app .x-dash-topbar{max-width:1180px;width:100%;margin:0 auto;border-left:1px solid #eef2f7;border-right:1px solid #eef2f7}
  .x-mobile-topbar,
  .x-mobile-operational-row { display: none !important; }
}

/* ==========================================================================
   Merchant Home — supplied visual reference
   Mobile top bar + bottom navigation are intentionally reference-driven.
   ========================================================================== */
.x-mobile-topbar,
.x-mobile-operational-row,
.x-topbar-desktop {
  display: none;
}

@media (max-width: 768px) {
  /* Topbar (Row 1 + Row 2): Stays fixed on top */
  .x-dash-topbar,
  .x-merchant-app .x-dash-topbar {
    flex: 0 0 auto !important;
    position: relative !important;
    top: 0 !important;
    z-index: 100 !important;
    padding: max(12px, env(safe-area-inset-top)) 16px 12px !important;
    background: #e8e8ea !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .x-topbar-desktop { display: none !important; }

  .x-mobile-topbar {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    background: transparent !important;
  }

  .x-mobile-topbar-main {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .x-mobile-branch-pill {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    height: 42px !important;
    padding: 0 14px 0 8px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    border-radius: 21px !important;
    background: #ffffff !important;
    color: #111111 !important;
    box-sizing: border-box !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.04) !important;
  }

  .x-mobile-branch-logo {
    width: 26px !important;
    height: 26px !important;
    flex: 0 0 26px !important;
    border-radius: 6px !important;
    object-fit: cover !important;
  }

  .x-mobile-branch-pill span {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 15px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    letter-spacing: -.2px !important;
  }

  .x-mobile-topbar-actions {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .x-mobile-circle-btn {
    position: relative !important;
    width: 42px !important;
    height: 42px !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    color: #111111 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    cursor: pointer !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.04) !important;
  }

  .x-mobile-circle-btn svg {
    width: 22px !important;
    height: 22px !important;
    fill: currentColor !important;
  }

  .x-mobile-notification-badge {
    position: absolute !important;
    top: -3px !important;
    right: -3px !important;
    min-width: 18px !important;
    height: 18px !important;
    padding: 0 5px !important;
    border-radius: 9px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #ef3340 !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
  }

  .x-mobile-profile-icon {
    width: 22px !important;
    height: 22px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .x-mobile-profile-icon svg {
    width: 22px !important;
    height: 22px !important;
    fill: currentColor !important;
  }

  /* Row 2: Operational status row (inside topbar, stays on top) */
  .x-mobile-operational-row {
    margin-top: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    width: 100% !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    background: transparent !important;
  }

  .x-mobile-status-control {
    height: 36px !important;
    min-width: 105px !important;
    border: 0 !important;
    border-radius: 18px !important;
    padding: 0 12px 0 5px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    background: #ffffff !important;
    color: #111111 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.04) !important;
  }

  .x-mobile-online-control {
    margin-left: auto !important;
    justify-content: flex-end !important;
    min-width: 155px !important;
    padding: 0 5px 0 12px !important;
    gap: 8px !important;
  }

  .x-mobile-switch {
    position: relative !important;
    width: 38px !important;
    height: 22px !important;
    flex: 0 0 38px !important;
    border-radius: 11px !important;
    background: #ef3340 !important; /* off = red */
    transition: background .15s ease !important;
  }

  .x-mobile-switch span {
    position: absolute !important;
    top: 2px !important;
    left: 2px !important;
    width: 18px !important;
    height: 18px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.25) !important;
    transition: left .15s ease !important;
  }

  .x-mobile-switch.is-on {
    background: #08a94f !important; /* on = green */
  }

  .x-mobile-switch.is-on span {
    left: 18px !important;
  }

  .x-mobile-switch.is-off {
    background: #ef3340 !important; /* off = red */
  }

  .x-mobile-switch.is-off span {
    left: 2px !important;
  }

  /* Curved frame (stays on top, cards scroll inside):
     Background is putih-kebiruan (#f0f4f8), top-left and top-right curve radius 28px */
  .x-merchant-app .x-tab-content {
    background: #f0f4f8 !important; /* putih-kebiruan */
    border-radius: 28px 28px 0 0 !important;
    box-shadow: 0 -3px 14px rgba(0, 0, 0, 0.05) !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    position: relative !important;
  }

  .x-merchant-app .x-tab-content:not(.active) {
    display: none !important;
  }

  .x-merchant-app .x-tab-content.active {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: block !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 16px 16px 0 !important;
    box-sizing: border-box !important;
  }

  /* Physical bottom spacer to guarantee exact 70px clearance above fixed bottom navbar across all browsers */
  .x-merchant-app .x-tab-content.active::after {
    content: "" !important;
    display: block !important;
    height: calc(138px + env(safe-area-inset-bottom, 0px)) !important;
    width: 100% !important;
    clear: both !important;
    flex-shrink: 0 !important;
    pointer-events: none !important;
  }

  /* White cards inside the putih-kebiruan curved frame */
  .x-merchant-app .x-tab-content .x-card-panel,
  .x-merchant-app .x-tab-content .x-bm-hero-banner {
    background: #ffffff !important;
    border-radius: 18px !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
    margin-bottom: 16px !important;
  }

  /* Reset margin on the last child so the 138px spacer creates precisely 70px visible clearance */
  .x-merchant-app .x-tab-content > *:last-child,
  .x-merchant-app .x-tab-content .x-hari-ini-container > *:last-child,
  .x-merchant-app .x-tab-content .x-card-panel:last-child {
    margin-bottom: 0 !important;
  }

  .x-merchant-mobile-nav,
  .x-merchant-app .x-merchant-mobile-nav {
    position: fixed !important;
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    margin: 0 !important;
    transform: none !important;
    z-index: 200 !important;
    min-height: 68px !important;
    height: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    border: 0 !important;
    border-top: 0 !important;
    border-radius: 28px 28px 0 0 !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08) !important;
    backdrop-filter: none !important;
  }

  .x-merchant-mobile-nav-item,
  .x-merchant-app .x-merchant-mobile-nav-item {
    position: relative !important;
    min-width: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #222222 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 2px 2px 0 !important;
    cursor: pointer !important;
    font-size: 11px !important;
    line-height: 1.1 !important;
    font-weight: 700 !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .x-merchant-mobile-nav-item svg,
  .x-merchant-app .x-merchant-mobile-nav-item svg {
    width: 24px !important;
    height: 24px !important;
    color: #222222 !important;
    fill: currentColor !important;
    overflow: visible !important;
    display: block !important;
    transition: color .15s ease, fill .15s ease;
  }

  .x-merchant-mobile-nav-item > span:not(.x-mobile-nav-badge),
  .x-merchant-app .x-merchant-mobile-nav-item > span:not(.x-mobile-nav-badge) {
    font-size: 11px !important;
    line-height: 1.1 !important;
    font-weight: 700 !important;
    color: #111111 !important; /* tulisan menu bottom tetap hitam */
    white-space: nowrap !important;
  }

  .x-merchant-mobile-nav-item.active,
  .x-merchant-app .x-merchant-mobile-nav-item.active {
    color: #08a94f !important;
    background: transparent !important;
  }

  .x-merchant-mobile-nav-item.active svg,
  .x-merchant-app .x-merchant-mobile-nav-item.active svg {
    color: #08a94f !important; /* hanya icon yang berubah warna */
    fill: #08a94f !important;
  }

  .x-merchant-mobile-nav-item.active::before,
  .x-merchant-app .x-merchant-mobile-nav-item.active::before {
    content: "" !important;
    position: absolute !important;
    top: -8px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 48px !important;
    height: 4px !important;
    border-radius: 0 0 4px 4px !important;
    background: #08a94f !important;
  }

  .x-mobile-nav-badge,
  .x-merchant-mobile-nav .x-mobile-nav-badge,
  .x-merchant-app .x-merchant-mobile-nav .x-mobile-nav-badge,
  .x-merchant-mobile-nav-item .x-mobile-nav-badge,
  .x-merchant-app .x-merchant-mobile-nav-item .x-mobile-nav-badge,
  span.x-mobile-nav-badge,
  span#mobile-orders-count {
    position: absolute !important;
    top: 0 !important;
    right: calc(50% - 18px) !important;
    min-width: 18px !important;
    height: 18px !important;
    padding: 0 5px !important;
    border-radius: 9px !important;
    background: #ef3340 !important;
    color: #ffffff !important; /* badge berlatar merah selalu bertulisan putih */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 10px !important;
    line-height: 1 !important;
    font-weight: 800 !important;
    box-sizing: border-box !important;
  }

  .x-mobile-notification-badge,
  span#mobile-notification-count {
    color: #ffffff !important;
  }

}

/* Mobile Account — reference-driven account screen */
.x-mobile-account-page { display:none; }
@media(max-width:768px){
  .x-mobile-account-page{
    position:fixed;
    inset:0;
    z-index:500;
    display:none;
    overflow-y:auto;
    background:#f5f5f7;
    color:#111111;
    font-family:"Plus Jakarta Sans",sans-serif;
  }
  body.x-mobile-account-open .x-mobile-account-page{display:block;}
  body.x-mobile-account-open .x-dash-layout,
  body.x-mobile-account-open .x-merchant-mobile-nav{display:none !important;}
  .x-mobile-account-statusbar-spacer{height:max(16px, env(safe-area-inset-top));}
  .x-mobile-account-header{height:52px;padding:0 16px;display:flex;align-items:center;gap:12px;box-sizing:border-box;}
  .x-mobile-account-header h1{margin:0;font-size:20px;line-height:1;font-weight:700;letter-spacing:-.3px;color:#111111;}
  .x-mobile-account-back{width:36px;height:36px;padding:0;border:0;background:transparent;display:flex;align-items:center;justify-content:center;color:#111111;cursor:pointer;}
  .x-mobile-account-back svg{width:24px;height:24px;}
  .x-mobile-account-content{padding:16px 16px 36px;box-sizing:border-box;max-width:600px;margin:0 auto;}
  .x-mobile-account-profile-card{width:100%;padding:18px 16px;border:0;border-radius:18px;background:#ffffff;display:flex;align-items:center;justify-content:space-between;text-align:left;color:#111111;box-shadow:0 1px 3px rgba(0,0,0,.03);cursor:pointer;}
  .x-mobile-account-profile-copy{min-width:0;display:flex;flex-direction:column;gap:4px;}
  .x-mobile-account-name-row{display:flex;align-items:center;gap:8px;min-width:0;}
  .x-mobile-account-name-row strong{font-size:17px;line-height:1.2;font-weight:700;color:#111111;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .x-mobile-account-role-divider{color:#d1d5db;font-size:14px;font-weight:300;}
  .x-mobile-account-name-row span#mobile-account-role{flex:0 0 auto;padding:2px 8px;border-radius:10px;background:#e5283b;color:#ffffff;font-size:11px;font-weight:700;line-height:1.2;}
  .x-mobile-account-profile-copy>span:not(.x-mobile-account-role-divider):not(#mobile-account-role){font-size:13px;line-height:1.3;color:#666666;}
  .x-mobile-account-chevron{color:#999999;display:flex;align-items:center;}
  .x-mobile-account-profile-chevron{width:36px;height:36px;border-radius:50%;background:#e8f9ed;color:#0da03d;display:flex;align-items:center;justify-content:center;flex:0 0 36px;}
  .x-mobile-account-section{margin-top:24px;}
  .x-mobile-account-section h2{margin:0 0 10px 4px;padding:0;font-size:15px;line-height:1.2;font-weight:700;color:#111111;letter-spacing:-.2px;}
  .x-mobile-account-list-card{width:100%;border-radius:18px;background:#ffffff;overflow:hidden;box-shadow:0 1px 3px rgba(0,0,0,.03);}
  .x-mobile-account-single-row{min-height:52px;border:0;display:flex;align-items:center;padding:0 16px;box-sizing:border-box;text-align:left;width:100%;background:#ffffff;cursor:pointer;}
  .x-mobile-account-leading-icon{width:22px;height:22px;display:flex;align-items:center;justify-content:center;flex:0 0 22px;color:#222222;}
  .x-mobile-account-leading-icon svg{width:20px;height:20px;}
  .x-mobile-account-row-label{margin-left:14px;min-width:0;flex:1;font-size:14px;line-height:1.2;font-weight:600;color:#111111;}
  .x-mobile-account-row{width:100%;height:52px;padding:0 16px;border:0;border-bottom:1px solid #f2f2f4;background:#ffffff;display:flex;align-items:center;text-align:left;color:#111111;cursor:pointer;}
  .x-mobile-account-row:last-child{border-bottom:0;}
  .x-mobile-account-new{margin-left:auto;margin-right:8px;padding:2px 7px;border-radius:6px;background:#00880d;color:#ffffff;font-size:11px;font-weight:700;}
  .x-mobile-account-value{margin-left:auto;margin-right:8px;color:#888888;font-size:13px;}
  .x-mobile-account-logout{width:100%;height:48px;margin-top:28px;border:1.5px solid #e5283b;border-radius:24px;background:#ffffff;color:#e5283b;font-size:15px;font-weight:700;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s ease;}
  .x-mobile-account-logout:active{background:#fde8ea;}
}
