/* ==========================================================================
   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;
  -webkit-tap-highlight-color: transparent;
}

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;
  -webkit-tap-highlight-color: transparent;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

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

button, a, input, select, textarea, label, summary, [role="button"], [tabindex] {
  -webkit-tap-highlight-color: transparent;
}

/* Remove default browser tap highlight and click focus ring for mouse/touch */
button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
[role="button"]:focus:not(:focus-visible),
.x-btn:focus:not(:focus-visible),
.x-tab-btn:focus:not(:focus-visible) {
  outline: none;
}

.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: 8px;
  background: #ffffff;
  border: 1.5px solid #475569;
  border-radius: 20px;
  padding: 0 12px;
  height: 38px;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.x-branch-selector:hover {
  border-color: #1e293b;
  background: #f8fafc;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.x-branch-pin-icon {
  color: #475569;
  flex-shrink: 0;
}

.x-branch-chevron-icon {
  color: #64748b;
  flex-shrink: 0;
  pointer-events: none;
}

/* 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: 13.5px;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  outline: none;
  padding: 0;
  min-width: 100px;
  max-width: 200px;
  appearance: none;
  -webkit-appearance: none;
}

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

/* Branch inline custom dropdown */
.x-branch-dropdown {
  position: relative;
  cursor: pointer;
}

.x-branch-trigger {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  outline: none;
  display: inline-flex;
  align-items: center;
  max-width: 160px;
  min-width: 0;
}

.x-branch-current-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.x-branch-selector .x-branch-chevron-icon {
  flex-shrink: 0;
  transition: transform 0.2s ease;
  pointer-events: none;
}

.x-branch-dropdown.open .x-branch-chevron-icon {
  transform: rotate(180deg);
}

.x-branch-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: auto;
  min-width: 200px;
  max-width: 280px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.14), 0 6px 10px -4px rgba(0, 0, 0, 0.07);
  padding: 6px;
  z-index: 200;
  display: none;
  flex-direction: column;
  gap: 2px;
  max-height: 280px;
  overflow-y: auto;
}

.x-branch-dropdown.open .x-branch-dropdown-menu {
  display: flex;
  animation: branchDropdownIn 0.15s ease-out;
}

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

.x-branch-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s ease, color 0.1s ease;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.x-branch-dropdown-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.x-branch-dropdown-item.active {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 700;
}

.x-branch-dropdown-item .x-branch-check-icon {
  opacity: 0;
  flex-shrink: 0;
  color: #334155;
  margin-left: 8px;
}

.x-branch-dropdown-item.active .x-branch-check-icon {
  opacity: 1;
}

/* 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 {
    height: 38px !important;
    padding: 0 10px !important;
    border-radius: 20px !important;
    max-width: 175px !important;
    font-size: 13.5px !important;
  }
  .x-branch-select {
    max-width: 125px !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    padding: 0 !important;
  }
  .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.x-merchant-app,
  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 for Merchant App */
  .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;
    touch-action: pan-y;
    will-change: transform;
    -webkit-overflow-scrolling: touch;
  }
  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-owner-bottom-nav,
  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;}
}

/* ==========================================================================
   OWNER DASHBOARD — Mobile Bottom Navigation & Focus Selector
   Owner-specific mobile shell: 5-item bottom nav + Focus scope top bar
   ========================================================================== */
.x-owner-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  /* Owner mobile bottom nav: matches merchant mobile bottom nav visual identity */
  .x-owner-bottom-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;
    overflow: visible;
  }

  .x-owner-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;
    transition: color .15s ease;
  }

  .x-owner-nav-item img,
  .x-owner-nav-item svg {
    width: 24px !important;
    height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    color: #222222 !important;
    fill: currentColor !important;
    overflow: visible !important;
    display: block !important;
    flex-shrink: 0 !important;
    object-fit: contain !important;
    transition: color .15s ease, fill .15s ease, filter .15s ease;
  }

  .x-owner-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-owner-nav-item.active {
    color: #08a94f !important;
    background: transparent !important;
  }

  /* Active item icon is green; the label remains black. */
  .x-owner-nav-item.active img,
  .x-owner-nav-item.active svg,
  .x-owner-nav-item.active image {
    color: #08a94f !important;
    fill: #08a94f !important;
    filter: brightness(0) saturate(100%) invert(48%) sepia(97%) saturate(1451%) hue-rotate(116deg) brightness(92%) contrast(101%) !important;
  }

  /* Active item indicator — green rounded tab extending from the top edge of the floating navbar. */
  .x-owner-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;
  }

  /* Topbar stays fixed on top with generous mobile padding */
  .x-dash-topbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 68px !important;
    min-height: 68px !important;
    padding: 0 20px !important;
    padding-top: env(safe-area-inset-top, 0px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    z-index: 100 !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    border-bottom: 1px solid #eef2f7 !important;
    box-sizing: border-box !important;
  }

  /* Mobile Owner topbar: hide redundant desktop hamburger and overview title for generous whitespace */
  .x-dash-topbar .x-topbar-left {
    display: none !important;
  }

  /* Right container spans full width: branch selector on left, icons on right */
  .x-dash-topbar .x-topbar-right {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    flex-shrink: 0 !important;
  }

  /* Show Focus Selector on mobile for Owner (override 900px and 768px hide rules) */
  #x-branch-selector {
    display: flex !important;
    align-items: center !important;
    background: #ffffff !important;
    border: 1.5px solid #475569 !important;
    border-radius: 20px !important;
    height: 40px !important;
    padding: 0 12px !important;
    max-width: 210px !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06) !important;
    flex-shrink: 1 !important;
  }

  .x-dash-topbar #btn-notifications {
    margin-left: auto !important;
  }

  /* Twin circular stroke icon buttons: Notifications & User Profile */
  #btn-notifications.x-topbar-icon-btn,
  .x-topbar-icon-btn-round {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    border: 1.5px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #334155 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0 !important;
  }

  #btn-notifications.x-topbar-icon-btn:hover,
  .x-topbar-icon-btn-round:hover {
    border-color: #94a3b8 !important;
    color: #0f172a !important;
    background: #f8fafc !important;
  }

  .x-avatar.x-avatar-stroke-round {
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    border: 1.5px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #334155 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0 !important;
  }

  .x-admin-profile:hover .x-avatar.x-avatar-stroke-round {
    border-color: #94a3b8 !important;
    color: #0f172a !important;
    background: #f8fafc !important;
  }

  /* Hub grids */
  .x-hub-header {
    padding: 16px 0 8px;
  }
  .x-hub-header h2 {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 4px;
  }
  .x-hub-header p {
    font-size: 12.5px;
    color: #64748b;
    margin: 0;
  }
  .x-hub-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 16px;
  }

  .x-hub-section {
    margin: 8px 0 14px;
  }
  .x-hub-section-title {
    margin: 0 0 8px;
    padding: 0 2px;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #64748b;
  }
  .x-hub-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e8e8ea;
    border-radius: 14px;
    padding: 14px 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .12s ease;
  }
  .x-hub-card:active { background: #f1f5f9; }
  .x-hub-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #ffffff;
  }
  .x-hub-icon.bg-indigo { background: #4f46e5; }
  .x-hub-icon.bg-blue   { background: #2563eb; }
  .x-hub-icon.bg-purple { background: #7c3aed; }
  .x-hub-icon.bg-orange { background: #ea580c; }
  .x-hub-icon.bg-green  { background: #16a34a; }
  .x-hub-icon.bg-pink   { background: #db2777; }
  .x-hub-info { flex: 1 1 auto; min-width: 0; }
  .x-hub-info h3 {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 2px;
  }
  .x-hub-info p {
    font-size: 11.5px;
    color: #64748b;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .x-hub-arrow { color: #c7c7cc; flex-shrink: 0; }

  /* Content area top and bottom spacers for fixed topbar and owner bottom nav */
  .x-dash-main {
    padding-top: max(68px, calc(68px + env(safe-area-inset-top, 0px))) !important;
    padding-bottom: calc(42px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Owner Command Center on Mobile */
  .x-desktop-overview-view { display: none !important; }
  .x-owner-command-center {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px 0 14px;
  }

  /* 1. Periode Selector & Form Pencarian Tanggal (2 Rows) */
  .x-occ-period-bar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 10px 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
  }
  .x-occ-preset-row {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 8px;
    position: relative;
  }
  .x-occ-dropdown {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
  }
  .x-occ-dropdown-trigger {
    width: 100%;
    height: 42px;
    min-height: 42px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    text-align: left;
    outline: none;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
  }
  .x-occ-dropdown-trigger:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
  }
  .x-occ-dropdown-trigger:focus-visible,
  .x-occ-dropdown-trigger[aria-expanded="true"] {
    background: #ffffff;
    border-color: #334155;
    box-shadow: 0 0 0 2px rgba(51, 65, 85, 0.15);
  }
  .x-occ-dropdown-trigger #occ-period-current-label {
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .x-occ-dropdown-trigger .x-occ-chevron-icon {
    position: static;
    flex-shrink: 0;
    color: #64748b;
    transition: transform 0.2s ease;
  }
  .x-occ-dropdown-trigger[aria-expanded="true"] .x-occ-chevron-icon {
    transform: rotate(180deg);
  }
  .x-occ-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
    padding: 6px;
    z-index: 100;
    display: none;
    flex-direction: column;
    gap: 2px;
  }
  .x-occ-dropdown.open .x-occ-dropdown-menu {
    display: flex;
    animation: occDropdownFadeIn 0.15s ease-out;
  }
  @keyframes occDropdownFadeIn {
    from {
      opacity: 0;
      transform: translateY(-6px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  .x-occ-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s ease, color 0.12s ease;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
  }
  .x-occ-dropdown-item:hover {
    background: #f1f5f9;
    color: #0f172a;
  }
  .x-occ-dropdown-item.active {
    background: #f8fafc;
    color: #0f172a;
    font-weight: 700;
  }
  .x-occ-dropdown-item .x-occ-check-icon {
    opacity: 0;
    color: #0f172a;
    flex-shrink: 0;
    transition: opacity 0.12s ease;
  }
  .x-occ-dropdown-item.active .x-occ-check-icon {
    opacity: 1;
  }
  .x-occ-period-selector-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 0 28px 0 12px;
    height: 42px;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
  }
  .x-occ-calendar-icon {
    color: #475569;
    flex-shrink: 0;
  }
  .x-occ-period-select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    cursor: pointer;
    outline: none;
    height: 100%;
    width: 100%;
    padding: 0;
  }
  .x-occ-chevron-icon {
    position: absolute;
    right: 12px;
    color: #64748b;
    pointer-events: none;
  }

  /* Bottom Sheet: Mobile Drawer for Custom Date Range Picker */
  body.x-sheet-open {
    overflow: hidden !important;
  }
  .x-bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
    touch-action: none;
  }
  .x-bottom-sheet-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }
  /* Floating X close button — rendered above sheet, outside modal box */
  .x-bottom-sheet-ext-close {
    position: fixed;
    top: auto;
    right: 16px;
    z-index: 1053;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    border: 1.5px solid #e2e8f0;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    color: #334155;
    padding: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease;
  }
  .x-bottom-sheet-ext-close.open {
    display: flex;
  }
  .x-bottom-sheet-ext-close:active {
    background: #f1f5f9;
  }
  .x-bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1051;
    padding: 12px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    max-width: 480px;
    margin: 0 auto;
    /* min-height so sheet doesn't collapse when content is short */
    min-height: 280px;
  }
  .x-bottom-sheet.open {
    transform: translateY(0);
  }
  .x-bottom-sheet-handle {
    width: 36px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 999px;
    margin: 0 auto 12px;
  }
  .x-bottom-sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
  }
  .x-bottom-sheet-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }
  .x-bottom-sheet-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
  }
  .x-bottom-sheet-subtitle {
    font-size: 12px;
    color: #64748b;
    margin: 0;
  }
  .x-bottom-sheet-close {
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, color 0.15s ease;
  }
  .x-bottom-sheet-close:hover {
    background: #e2e8f0;
    color: #0f172a;
  }
  .x-bottom-sheet-body {
    width: 100%;
  }
  .x-bottom-sheet-body .x-occ-custom-range-row {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
  }
  .x-bottom-sheet-body .x-occ-date-inputs-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
  }
  .x-bottom-sheet-body .x-occ-date-field {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-width: 0;
    gap: 6px;
  }
  .x-bottom-sheet-body .x-occ-date-label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
  }
  .x-bottom-sheet-body .x-occ-date-input {
    width: 100%;
    height: 44px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    background: #f8fafc;
    box-sizing: border-box;
    outline: none;
  }
  .x-bottom-sheet-body .x-occ-date-input:focus {
    background: #ffffff;
    border-color: #334155;
    box-shadow: 0 0 0 2px rgba(51, 65, 85, 0.12);
  }
  .x-bottom-sheet-body .x-occ-range-sep {
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    margin-top: 20px;
    flex-shrink: 0;
  }
  .x-bottom-sheet-body .x-occ-search-btn {
    width: 100%;
    height: 44px;
    background: #334155;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.1);
    transition: background 0.15s ease, transform 0.1s ease;
  }
  .x-bottom-sheet-body .x-occ-search-btn:active {
    background: #0f172a;
    transform: scale(0.98);
  }
  .x-occ-custom-range-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
  }
  .x-occ-date-input {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    height: 42px;
    flex: 1 1 0;
    min-width: 0;
    outline: none;
    box-sizing: border-box;
  }
  .x-occ-date-input:focus {
    border-color: #475569;
    box-shadow: 0 0 0 2px rgba(71, 85, 105, 0.15);
  }
  .x-occ-range-sep {
    font-size: 12px;
    color: #64748b;
    font-weight: 700;
    flex-shrink: 0;
    padding: 0 2px;
  }
  .x-occ-search-btn {
    background: #334155;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    height: 42px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, transform 0.1s ease;
  }
  .x-occ-search-btn:hover {
    background: #1e293b;
  }
  .x-occ-search-btn:active {
    background: #0f172a;
    transform: scale(0.97);
  }

  /* 2. Hero KPI Card */
  .x-occ-hero-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
  }
  .x-occ-hero-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
  }
  .x-occ-hero-sublabel {
    font-size: 12.5px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .x-occ-hero-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
  }
  .x-occ-hero-trend.positive {
    background: rgba(34, 197, 94, 0.18);
    color: #4ade80;
  }
  .x-occ-hero-trend.negative {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
  }
  .x-occ-hero-trend.neutral {
    background: rgba(148, 163, 184, 0.18);
    color: #cbd5e1;
  }
  .x-occ-hero-primary-val {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.5px;
    color: #ffffff;
    margin: 4px 0 14px;
  }
  .x-occ-hero-metrics-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }
  .x-occ-mini-kpi {
    display: flex;
    flex-direction: column;
  }
  .x-occ-mini-kpi-val {
    font-size: 14.5px;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.2;
  }
  .x-occ-mini-kpi-lbl {
    font-size: 10.5px;
    color: #94a3b8;
    margin-top: 2px;
  }

  /* 3-7. Command Center Cards */
  .x-occ-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  }
  .x-occ-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
  }
  .x-occ-card-title {
    font-size: 14.5px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
  }
  .x-occ-card-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    font-weight: 700;
    color: #475569;
    text-decoration: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s ease, transform 0.15s ease;
  }
  .x-occ-card-link:hover {
    color: #0f172a;
  }
  .x-occ-card-link:active {
    transform: translateX(1px);
  }
  .x-occ-link-chevron {
    flex-shrink: 0;
    stroke: currentColor;
    stroke-width: 2.5;
    transition: transform 0.15s ease;
  }
  .x-occ-card-link:hover .x-occ-link-chevron {
    transform: translateX(2px);
  }
  .x-occ-empty-placeholder {
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
    padding: 10px 0;
  }

  /* Branch ranking & single branch */
  .x-occ-branch-list {
    display: flex;
    flex-direction: column;
  }
  .x-occ-branch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
  }
  .x-occ-branch-row:last-child {
    border-bottom: none;
    padding-bottom: 2px;
  }
  .x-occ-branch-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  .x-occ-branch-name {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
  }
  .x-occ-branch-orders {
    font-size: 11px;
    color: #64748b;
    margin-top: 1px;
  }
  .x-occ-branch-revenue {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    flex-shrink: 0;
  }
  .x-occ-branch-single {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 2px 0;
  }
  .x-occ-single-kpi-main {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
  }
  .x-occ-single-kpi-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
  }
  .x-occ-dot { color: #cbd5e1; }

  /* Orders summary grid */
  .x-occ-orders-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
  .x-occ-order-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
  }
  .x-occ-order-stat-val {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
  }
  .x-occ-order-stat-lbl {
    font-size: 10.5px;
    color: #64748b;
    font-weight: 600;
    margin-top: 3px;
  }
  .x-occ-order-stat.status-completed .x-occ-order-stat-val { color: #16a34a; }
  .x-occ-order-stat.status-progress .x-occ-order-stat-val { color: #2563eb; }
  .x-occ-order-stat.status-cancelled .x-occ-order-stat-val { color: #dc2626; }

  /* Top products */
  .x-occ-product-list {
    display: flex;
    flex-direction: column;
  }
  .x-occ-product-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
  }
  .x-occ-product-row:last-child {
    border-bottom: none;
    padding-bottom: 2px;
  }
  .x-occ-product-rank {
    font-size: 14px;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
  }
  .x-occ-product-info {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
  }
  .x-occ-product-name {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .x-occ-product-sold {
    font-size: 11px;
    color: #64748b;
    margin-top: 1px;
  }
  .x-occ-product-revenue {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    flex-shrink: 0;
  }

  /* Attention */
  .x-occ-normal-state {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    color: #16a34a;
    font-size: 13px;
    font-weight: 700;
  }
  .x-occ-normal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #dcfce7;
    border-radius: 50%;
    color: #16a34a;
    font-size: 12px;
    font-weight: 800;
  }
  .x-occ-alerts-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .x-occ-alert-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: 10px;
    padding: 8px 10px;
    color: #92400e;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
  }
  .x-occ-alert-left {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }
  .x-occ-alert-icon { font-size: 13px; flex-shrink: 0; }
  .x-occ-alert-arrow {
    color: #d97706;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Quick access */
  .x-occ-quick-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
  }
  .x-occ-quick-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px 2px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .12s ease;
  }
  .x-occ-quick-chip:active { background: #e2e8f0; }
  .x-occ-chip-icon { font-size: 17px; line-height: 1; }
  .x-occ-chip-label { font-size: 10.5px; font-weight: 700; color: #334155; }
}

/* ==========================================================================
   OWNER MOBILE UX REFINEMENT — native-app surface, touch & accessibility
   ========================================================================== */
@media (max-width: 768px) {
  .x-owner-command-center {
    gap: 20px;
    padding: 8px 0 28px;
  }

  /* Keep only meaningful surfaces as cards; sections breathe like a native app. */
  .x-occ-period-bar,
  .x-occ-card {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .x-occ-period-bar {
    padding: 0;
    gap: 8px;
  }

  .x-occ-preset-row {
    gap: 8px;
  }

  .x-occ-period-selector-wrap {
    height: 44px;
    min-height: 44px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding-left: 14px;
    box-shadow: 0 1px 3px rgba(15,23,42,.04);
  }

  .x-occ-period-select {
    font-size: 14px;
    min-height: 44px;
  }

  .x-occ-custom-toggle,
  .x-occ-search-btn {
    min-height: 44px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    padding: 0 14px;
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent;
  }

  .x-occ-custom-toggle {
    flex: 0 0 auto;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #334155;
  }

  .x-occ-custom-toggle[aria-expanded="true"] {
    background: #f1f5f9;
    border-color: #cbd5e1;
  }

  .x-occ-custom-range-row {
    align-items: flex-end;
    padding: 10px 0 2px;
  }

  .x-occ-custom-range-row[hidden] {
    display: none;
  }

  .x-occ-date-field {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
  }

  .x-occ-date-field > span {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
  }

  .x-occ-date-input {
    width: 100%;
    min-height: 44px;
    height: 44px;
    border-radius: 12px;
    border-color: #dbe2ea;
    font-size: 13px;
  }

  .x-occ-range-sep {
    margin-bottom: 13px;
  }

  /* Primary summary: light, readable, less dashboard-like. */
  .x-occ-hero-card {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(15,23,42,.05);
  }

  .x-occ-hero-sublabel {
    color: #64748b;
    font-size: 12px;
    letter-spacing: .2px;
    text-transform: none;
  }

  .x-occ-hero-primary-val {
    color: #0f172a;
    font-size: 28px;
    letter-spacing: -.7px;
    margin: 5px 0 16px;
  }

  .x-occ-hero-metrics-row {
    border-top-color: #eef2f7;
    gap: 12px;
  }

  .x-occ-mini-kpi-val {
    color: #0f172a;
    font-size: 15px;
  }

  .x-occ-mini-kpi-lbl {
    color: #64748b;
    font-size: 11px;
  }

  .x-occ-hero-trend {
    font-size: 11px;
    padding: 4px 8px;
  }

  /* Native-app section rhythm. */
  .x-occ-card {
    padding: 0;
  }

  .x-occ-card-header {
    min-height: 32px;
    margin-bottom: 8px;
  }

  .x-occ-card-title {
    font-size: 15px;
    letter-spacing: -.15px;
  }

  .x-occ-card-link {
    min-height: 40px;
    padding: 8px 0;
    font-size: 12.5px;
  }

  .x-occ-branch-row,
  .x-occ-product-row {
    min-height: 56px;
    padding: 10px 4px;
    border-bottom-color: #eef2f7;
  }

  .x-occ-branch-row {
    text-decoration: none;
    color: inherit;
    border-radius: 10px;
  }

  .x-occ-branch-row:active {
    background: #f8fafc;
  }

  .x-occ-branch-name,
  .x-occ-product-name {
    font-size: 14px;
  }

  .x-occ-branch-orders,
  .x-occ-product-sold {
    font-size: 12px;
  }

  .x-occ-branch-revenue,
  .x-occ-product-revenue {
    font-size: 14px;
  }

  .x-occ-orders-summary-grid {
    gap: 8px;
  }

  .x-occ-order-stat {
    min-height: 68px;
    justify-content: center;
    padding: 9px 4px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #e8edf3;
  }

  .x-occ-order-stat-val {
    font-size: 17px;
  }

  .x-occ-order-stat-lbl {
    font-size: 11px;
  }

  .x-occ-attention-section .x-occ-card-body {
    min-height: 48px;
  }

  .x-occ-alert-item {
    min-height: 52px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
  }

  .x-occ-normal-state {
    min-height: 48px;
    padding: 0 2px;
    font-size: 13px;
  }

  /* Quick actions are controls, so make their targets generous and iconography consistent. */
  .x-occ-quick-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }

  .x-occ-quick-chip {
    min-height: 72px;
    padding: 9px 3px;
    border: 1px solid #e5eaf0;
    border-radius: 14px;
    background: #ffffff;
  }

  .x-occ-chip-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
  }

  .x-occ-chip-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .x-occ-chip-label {
    font-size: 11px;
    line-height: 1.15;
    color: #334155;
  }

  /* Visible keyboard focus; never leave touch/keyboard users without a state. */
  .x-owner-nav-item:focus-visible,
  .x-occ-quick-chip:focus-visible,
  .x-occ-card-link:focus-visible,
  .x-occ-custom-toggle:focus-visible,
  .x-occ-search-btn:focus-visible,
  .x-occ-period-select:focus-visible,
  .x-occ-date-input:focus-visible {
    outline: 2px solid #94a3b8;
    outline-offset: 2px;
  }

  /* Suppress outline when clicked or tapped */
  .x-owner-nav-item:focus:not(:focus-visible),
  .x-occ-quick-chip:focus:not(:focus-visible),
  .x-occ-card-link:focus:not(:focus-visible),
  .x-occ-custom-toggle:focus:not(:focus-visible),
  .x-occ-search-btn:focus:not(:focus-visible),
  .x-occ-period-select:focus:not(:focus-visible),
  .x-occ-date-input:focus:not(:focus-visible) {
    outline: none;
  }

  .x-owner-nav-item {
    min-height: 48px;
    font-size: 11px;
  }

  .x-owner-nav-item svg {
    width: 23px;
    height: 23px;
  }

  .x-owner-nav-item:not(.active) {
    color: #5f6773;
  }

  /* Loading state. */
  .x-occ-loading-state {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 8px 4px;
  }

  .x-occ-skeleton {
    display: block;
    height: 14px;
    width: 100%;
    border-radius: 7px;
    background: linear-gradient(90deg,#eef2f7 25%,#f8fafc 50%,#eef2f7 75%);
    background-size: 200% 100%;
    animation: x-occ-skeleton-pulse 1.25s ease-in-out infinite;
  }

  .x-occ-skeleton.short {
    width: 58%;
  }

  @keyframes x-occ-skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }

  .x-occ-error-state {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 10px 12px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fff7f7;
    color: #991b1b;
  }

  .x-occ-error-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
  }

  .x-occ-error-copy strong {
    font-size: 13px;
  }

  .x-occ-error-copy span {
    font-size: 11.5px;
    color: #b91c1c;
  }

  .x-occ-retry-btn {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #ffffff;
    color: #991b1b;
    font-size: 12px;
    font-weight: 800;
  }
}

@media (prefers-reduced-motion: reduce) {
  .x-occ-skeleton,
  .x-owner-nav-item,
  .x-occ-card-link {
    animation: none !important;
    transition: none !important;
  }
}

@media (min-width: 769px) {
  .x-owner-bottom-nav { display: none !important; }
  #x-topbar-focus-scope { display: contents; }
  .x-owner-command-center { display: none !important; }
  .x-desktop-overview-view { display: block !important; }
}


/* ==========================================================================
   OWNER MOBILE QUICK ACCESS — 2x4 native-app shortcut surface
   ========================================================================== */
@media (max-width: 768px) {
  #occ-quick-access-section.x-occ-quick-access-card {
    background: #ffffff !important;
    border: 1px solid #e5e9ef !important;
    border-radius: 18px !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.045) !important;
    padding: 15px 14px 13px !important;
  }

  #occ-quick-access-section .x-occ-card-header {
    min-height: 30px;
    margin-bottom: 7px;
    padding: 0 2px;
  }

  #occ-quick-access-section .x-occ-card-title {
    font-size: 15px;
    font-weight: 800;
    color: #20262e;
    letter-spacing: -.15px;
  }

  #occ-quick-access-section .x-occ-quick-all {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    min-height: 34px;
    padding: 4px 2px 4px 7px;
    border: 0;
    background: transparent;
    color: #198b3a;
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
    border-radius: 9px;
    -webkit-tap-highlight-color: transparent;
  }

  #occ-quick-access-section .x-occ-quick-all:active {
    background: #f0f8f1;
  }

  #occ-quick-access-section .x-occ-quick-all:focus-visible {
    outline: 2px solid #94a3b8;
    outline-offset: 2px;
  }

  #occ-quick-access-section .x-occ-quick-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 2px 3px !important;
    width: 100%;
  }

  #occ-quick-access-section .x-occ-quick-chip {
    min-height: 78px !important;
    padding: 8px 3px 7px !important;
    border: 0 !important;
    border-radius: 13px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #3b434d;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color .14s ease, transform .10s ease;
  }

  #occ-quick-access-section .x-occ-quick-chip:active {
    background: #f6f8fa !important;
    transform: scale(.98);
  }

  #occ-quick-access-section .x-occ-chip-icon {
    width: 44px !important;
    height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 44px !important;
    font-size: 0 !important;
  }

  #occ-quick-access-section .x-occ-chip-icon img {
    display: block;
    width: 44px;
    height: 44px;
    object-fit: contain;
  }

  #occ-quick-access-section .x-occ-chip-label {
    max-width: 100%;
    font-size: 11px !important;
    line-height: 1.18 !important;
    font-weight: 700 !important;
    color: #4a525c !important;
    text-align: center;
    white-space: normal;
    word-break: break-word;
  }

  #occ-quick-access-section .x-occ-quick-chip:focus-visible {
    outline: 2px solid #94a3b8;
    outline-offset: -2px;
  }
}

@media (min-width: 390px) and (max-width: 768px) {
  #occ-quick-access-section .x-occ-quick-chip {
    min-height: 82px !important;
  }
  #occ-quick-access-section .x-occ-chip-label {
    font-size: 11.5px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #occ-quick-access-section .x-occ-quick-chip,
  #occ-quick-access-section .x-occ-quick-all {
    transition: none !important;
  }
}


/* ==========================================================================
   OWNER STOCK OVERVIEW — read-only inventory health surface
   ========================================================================== */
.x-owner-stock-view {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 0 44px;
}
.x-owner-stock-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.x-owner-stock-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  color: #8a94a3;
  margin-bottom: 4px;
}
.x-owner-stock-header h2 {
  margin: 0;
  color: #18212b;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -.5px;
}
.x-owner-stock-header p {
  margin: 6px 0 0;
  color: #6b7480;
  font-size: 13px;
}
.x-owner-stock-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.x-owner-stock-scope {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #e4e8ed;
  border-radius: 11px;
  background: #fff;
  color: #47515d;
  font-size: 12px;
  font-weight: 700;
}
.x-owner-stock-refresh {
  min-height: 38px;
}
.x-owner-stock-refresh:disabled {
  opacity: .6;
  cursor: wait;
}
.x-owner-stock-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.x-owner-stock-kpi {
  min-height: 88px;
  padding: 15px;
  border: 1px solid #e6eaf0;
  border-radius: 16px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 11px;
  box-sizing: border-box;
}
.x-owner-stock-kpi-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  overflow: hidden;
  background: #f5f7f9;
}
.x-owner-stock-kpi-icon svg {
  width: 32px;
  height: 32px;
  display: block;
}
.x-owner-stock-kpi-icon.warning { background: #fff8e8; }
.x-owner-stock-kpi-icon.danger { background: #fff2f2; }
.x-owner-stock-kpi-icon.units { background: #edf9f3; }
.x-owner-stock-kpi-label {
  display: block;
  margin-bottom: 3px;
  color: #7a838f;
  font-size: 11.5px;
  font-weight: 700;
}
.x-owner-stock-kpi strong {
  color: #1d2731;
  font-size: 21px;
  line-height: 1;
  font-weight: 800;
}
.x-owner-stock-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 14px;
  margin-bottom: 14px;
}
.x-owner-stock-panel {
  border: 1px solid #e5e9ee;
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}
.x-owner-stock-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 18px 13px;
}
.x-owner-stock-panel-head h3 {
  margin: 0;
  color: #202831;
  font-size: 15px;
  font-weight: 800;
}
.x-owner-stock-panel-head p {
  margin: 3px 0 0;
  color: #7b8590;
  font-size: 11.5px;
  line-height: 1.35;
}
.x-owner-stock-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 32px;
  padding: 4px 2px 4px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #198b3a;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.x-owner-stock-link:hover { background: #f2f8f3; }
.x-owner-stock-alerts,
.x-owner-stock-branches,
.x-owner-stock-movements {
  padding: 0 18px 14px;
}
.x-owner-stock-alert-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 14px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  border-top: 1px solid #f0f2f5;
}
.x-owner-stock-alert-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.x-owner-stock-alert-main strong {
  color: #27313b;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.x-owner-stock-alert-main small {
  margin-top: 2px;
  color: #8a939e;
  font-size: 10.5px;
}
.x-owner-stock-alert-status {
  align-self: flex-start;
  margin-bottom: 3px;
  color: #b06b00;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.x-owner-stock-alert-row.is-out .x-owner-stock-alert-status { color: #c63d3d; }
.x-owner-stock-alert-number {
  min-width: 52px;
  text-align: right;
}
.x-owner-stock-alert-number strong {
  display: block;
  color: #27313b;
  font-size: 15px;
  font-weight: 800;
}
.x-owner-stock-alert-number small {
  color: #919aa4;
  font-size: 9.5px;
}
.x-owner-stock-alert-arrow {
  color: #a3acb5;
  font-size: 22px;
  line-height: 1;
}
.x-owner-stock-more {
  width: 100%;
  margin-top: 8px;
  min-height: 40px;
  border: 1px solid #e4e8ed;
  border-radius: 11px;
  background: #fff;
  color: #56616d;
  font-size: 11.5px;
  font-weight: 750;
  cursor: pointer;
}
.x-owner-stock-more:hover { background: #f8fafb; }
.x-owner-stock-branch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  border-top: 1px solid #f0f2f5;
}
.x-owner-stock-branch-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.x-owner-stock-branch-copy strong {
  color: #27313b;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.x-owner-stock-branch-copy span {
  margin-top: 2px;
  color: #89929c;
  font-size: 10.5px;
}
.x-owner-stock-branch-meta {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.x-owner-stock-branch-meta small {
  color: #89929c;
  font-size: 9.5px;
}
.x-owner-stock-branch-badge {
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 800;
}
.x-owner-stock-branch-badge.good { background: #eaf8ef; color: #23824b; }
.x-owner-stock-branch-badge.warning { background: #fff6df; color: #ae7004; }
.x-owner-stock-branch-badge.danger { background: #fff0f0; color: #c54141; }
.x-owner-stock-movement-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  border-top: 1px solid #f0f2f5;
}
.x-owner-stock-movement-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
}
.x-owner-stock-movement-icon.in { background: #ebf8f1; color: #22804b; }
.x-owner-stock-movement-icon.out { background: #fff1f1; color: #c54242; }
.x-owner-stock-movement-icon.adjust { background: #f3f5f7; color: #65707c; }
.x-owner-stock-movement-copy {
  display: flex;
  flex-direction: column;
}
.x-owner-stock-movement-copy strong {
  color: #303943;
  font-size: 12.5px;
  font-weight: 750;
}
.x-owner-stock-movement-copy span {
  margin-top: 2px;
  color: #8c959f;
  font-size: 10.5px;
}
.x-owner-stock-movement-value {
  font-size: 12.5px;
  font-weight: 800;
}
.x-owner-stock-movement-value.in { color: #20814a; }
.x-owner-stock-movement-value.out { color: #c54242; }
.x-owner-stock-movement-value.adjust { color: #65707c; }
.x-owner-stock-empty,
.x-owner-stock-empty-compact,
.x-owner-stock-error,
.x-owner-stock-loading {
  color: #87919b;
  font-size: 11.5px;
}
.x-owner-stock-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 96px;
}
.x-owner-stock-empty-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #eaf8ef;
  color: #24854d;
  font-weight: 900;
}
.x-owner-stock-empty p { margin: 2px 0 0; color: #98a0a9; font-size: 10.5px; }
.x-owner-stock-empty-compact,
.x-owner-stock-loading,
.x-owner-stock-error { padding: 20px 0; }
.x-owner-stock-error { color: #b73c3c; }
.x-owner-stock-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  background: #f6f8fa;
  color: #717b86;
  font-size: 10.5px;
  line-height: 1.45;
}
.x-owner-stock-note svg { flex: 0 0 auto; margin-top: 1px; }

@media (max-width: 768px) {
  .x-owner-stock-view {
    padding: 4px 0 28px;
  }
  .x-owner-stock-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
  }
  .x-owner-stock-header h2 { font-size: 24px; }
  .x-owner-stock-header p { font-size: 11.5px; max-width: 290px; }
  .x-owner-stock-header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .x-owner-stock-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }
  .x-owner-stock-kpi {
    min-height: 78px;
    padding: 12px;
    border-radius: 15px;
  }
  .x-owner-stock-kpi-icon {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    border-radius: 11px;
  }
  .x-owner-stock-kpi-icon svg { width: 29px; height: 29px; }
  .x-owner-stock-kpi-label { font-size: 10px; }
  .x-owner-stock-kpi strong { font-size: 18px; }
  .x-owner-stock-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 10px;
  }
  .x-owner-stock-panel { border-radius: 16px; }
  .x-owner-stock-panel-head { padding: 14px 14px 10px; }
  .x-owner-stock-panel-head h3 { font-size: 14px; }
  .x-owner-stock-panel-head p { font-size: 10.5px; }
  .x-owner-stock-alerts,
  .x-owner-stock-branches,
  .x-owner-stock-movements { padding: 0 14px 12px; }
  .x-owner-stock-alert-row { min-height: 56px; }
  .x-owner-stock-alert-main strong { font-size: 12px; }
  .x-owner-stock-alert-main small { font-size: 9.5px; }
  .x-owner-stock-branch-copy strong { font-size: 12px; }
  .x-owner-stock-branch-copy span { font-size: 9.5px; }
  .x-owner-stock-movement-copy strong { font-size: 11.5px; }
  .x-owner-stock-movement-copy span { font-size: 9.5px; }
  .x-owner-stock-note { font-size: 10px; }
}
