/* ==========================================================================
   KX-STORE Jordan | Permanent Header + Collapsible Sidebar Layout
   Header with Logo stays ALWAYS visible; Sidebar collapses for maximum table width
   Strictly Light Mode (NO Dark Mode), Strictly NO Card Grids (Master Tables & Dense Rows)
   Target Market: Jordan (د.أ / JOD)
   ========================================================================== */

:root {
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #f8fafc;
  --bg-active: #e2e8f0;
  
  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-focus: #2563eb;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  
  /* Brand Accents */
  --brand-navy: #0a2540;
  --brand-blue: #1d4ed8;
  --brand-blue-hover: #1e40af;
  --brand-blue-subtle: #eff6ff;
  
  /* Financials & Status */
  --price-emerald: #059669;
  --price-emerald-bg: #ecfdf5;
  --discount-amber: #d97706;
  --discount-amber-bg: #fffbeb;
  --badge-danger: #dc2626;
  --badge-danger-bg: #fef2f2;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  
  --header-height: 62px;
  --sidebar-width: 280px;
}

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

html {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

body.app-layout-body {
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  direction: rtl;
  text-align: right;
  height: 100vh;
  overflow: hidden;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

.num-font, .price-val, .total-price-val, .badge-tag, code, .spec-code {
  font-family: 'Plus Jakarta Sans', 'Cairo', sans-serif;
}

/* ==========================================================================
   GLOBAL TOP HEADER: Stays ALWAYS Visible (الشعار لا يختفي أبداً)
   ========================================================================== */
.app-global-header {
  height: var(--header-height);
  min-height: var(--header-height);
  width: 100%;
  max-width: 100vw;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 16px;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}

.header-right-side {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Sleek Sidebar Mini Collapse Button (Inside Sidebar Title Bar) */
.sidebar-action-collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background-color: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-action-collapse-btn:hover {
  background-color: #eff6ff;
  color: var(--brand-blue);
  border-color: #bfdbfe;
  transform: scale(1.05);
}

/* Logo Section (Clickable Home Button) */
.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: opacity 0.15s ease, transform 0.15s ease;
  user-select: none;
}

.brand-section:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.brand-section:active {
  transform: translateY(0);
}

.brand-logo-wrap {
  display: flex;
  align-items: baseline;
  background: linear-gradient(135deg, var(--brand-navy) 0%, #1e3a8a 100%);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -0.5px;
}

.brand-logo-text {
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
}

.brand-logo-tag {
  font-size: 10px;
  font-weight: 700;
  margin-right: 2px;
  color: #38bdf8;
  text-transform: uppercase;
}

.brand-tagline .store-name-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--brand-navy);
  line-height: 1.1;
}

.brand-tagline .store-sub {
  font-size: 11.5px;
  color: #334155;
  font-weight: 600;
}

/* Global Header Search */
.header-search-wrap {
  flex: 1;
  max-width: 440px;
  position: relative;
  display: flex;
  align-items: center;
}

.header-search-wrap .search-icon {
  position: absolute;
  right: 12px;
  color: #475569;
  pointer-events: none;
}

.header-search-wrap input {
  width: 100%;
  height: 38px;
  padding: 0 36px 0 28px;
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
  background-color: #ffffff;
  transition: all 0.15s ease;
}

.header-search-wrap input::placeholder {
  color: #64748b;
  font-weight: 500;
}

.header-search-wrap input:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.clear-search-btn {
  position: absolute;
  left: 10px;
  background: none;
  border: none;
  font-size: 16px;
  color: var(--text-subtle);
  cursor: pointer;
}

.header-left-side {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: #0f172a;
}

.live-sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  padding: 4px 11px;
  border-radius: 14px;
  font-size: 12px;
  color: #14532d;
  font-weight: 700;
  transition: all 0.2s ease;
}

.manual-sync-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  color: #15803d;
  transition: all 0.2s ease;
  margin-right: 2px;
}

.manual-sync-btn:hover {
  background: #dcfce7;
  color: #14532d;
  transform: scale(1.1);
}

.manual-sync-btn.syncing .sync-svg {
  animation: spinSync 0.8s linear infinite;
}

@keyframes spinSync {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

/* Toast Notifications System */
.app-toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.app-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  padding: 12px 18px;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  font-size: 13.5px;
  font-weight: 600;
  font-family: 'Cairo', sans-serif;
  animation: slideInToast 0.3s ease-out;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.app-toast.toast-success {
  border-right: 4px solid #10b981;
}

.app-toast.toast-error {
  border-right: 4px solid #ef4444;
}

.app-toast.toast-warning {
  border-right: 4px solid #f59e0b;
}

.app-toast.toast-info {
  border-right: 4px solid #3b82f6;
}

.app-toast.toast-fadeout {
  opacity: 0;
  transform: translateY(12px);
}

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

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #16a34a;
  box-shadow: 0 0 6px #16a34a;
  animation: pulseLive 2s infinite ease-in-out;
}

@keyframes pulseLive {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.15); }
}

.currency-tag {
  color: #065f46;
  font-weight: 600;
}

.market-tag-pill {
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 4px 9px;
  border-radius: var(--radius-xs);
  font-weight: 700;
  font-size: 12px;
  color: #0f172a;
}

/* ==========================================================================
   APP BODY CONTAINER: Collapsible Sidebar + Left Main Stage
   ========================================================================== */
.app-body-container {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
  width: 100vw;
  overflow: hidden;
  background-color: var(--bg-page);
  position: relative;
}

/* RIGHT SIDEBAR (ONLY Navigation & Categories) */
.app-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  background-color: var(--bg-surface);
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  height: 100%;
  z-index: 50;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.02);
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              min-width 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              max-width 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.18s ease;
}

.sidebar-title-bar {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #fafbfc;
}

.sidebar-title-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.btn-sidebar-close {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background-color: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xs);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-sidebar-close:hover {
  background-color: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* COLLAPSED SIDEBAR STATE (تختفي القائمة الجانبية فقط ويتسع الجدول بالكامل) */
.app-body-container.sidebar-collapsed .app-sidebar {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  border-left: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
}

.app-body-container.sidebar-collapsed .app-main {
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 100% !important;
}

.sidebar-nav-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.nav-group {
  margin-bottom: 18px;
}

.nav-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-subtle);
  padding: 4px 8px 6px 8px;
  letter-spacing: 0.5px;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
  text-align: right;
  position: relative;
}

.nav-item-btn:hover {
  background-color: var(--bg-subtle);
  color: var(--brand-blue);
}

.nav-item-btn.active {
  background-color: #eff6ff;
  color: var(--brand-blue);
  font-weight: 700;
}

.nav-item-btn.active::before {
  content: '';
  position: absolute;
  right: 0;
  top: 5px;
  bottom: 5px;
  width: 3px;
  background-color: var(--brand-blue);
  border-radius: 4px 0 0 4px;
}

.nav-item-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
}

.nav-item-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item-count {
  font-size: 10.5px;
  background-color: #f1f5f9;
  color: #64748b;
  padding: 1px 6px;
  border-radius: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
}

.nav-item-btn.active .nav-item-count {
  background-color: #dbeafe;
  color: #1e40af;
}

/* Featured Primary Sidebar Button: بناء تجميعة (لون غامق بارز + ضوء أخضر نابض) */
.nav-item-btn.nav-item-builder-highlight {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  padding: 8px 12px !important;
  border-radius: var(--radius-sm);
  margin: 3px 0 4px 0;
  box-shadow: 0 3px 10px rgba(30, 58, 138, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.nav-item-btn.nav-item-builder-highlight .nav-item-text {
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  letter-spacing: -0.2px;
}

.nav-item-btn.nav-item-builder-highlight .nav-item-icon {
  font-size: 15px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.nav-item-btn.nav-item-builder-highlight:hover {
  background: linear-gradient(135deg, #0284c7 0%, #1d4ed8 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.45);
}

.nav-item-btn.nav-item-builder-highlight.active {
  background: linear-gradient(135deg, #020617 0%, #172554 50%, #1d4ed8 100%) !important;
  box-shadow: 0 0 0 2px #93c5fd, 0 4px 14px rgba(15, 23, 42, 0.5) !important;
  border-color: #60a5fa !important;
}

.nav-item-btn.nav-item-builder-highlight::before {
  display: none !important;
}

/* Green Live Pulse Dot for Builder Sidebar */
.builder-sidebar-pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 6px #22c55e, 0 0 12px rgba(34, 197, 94, 0.9);
  animation: pulseGreenLive 1.6s infinite ease-in-out;
  flex-shrink: 0;
  margin-right: auto;
}

@keyframes pulseGreenLive {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 4px #22c55e, 0 0 8px rgba(34, 197, 94, 0.6);
  }
  50% {
    transform: scale(1.22);
    box-shadow: 0 0 10px #22c55e, 0 0 16px rgba(34, 197, 94, 0.95);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 4px #22c55e, 0 0 8px rgba(34, 197, 94, 0.6);
  }
}

.sidebar-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border-light);
  background-color: #fafbfc;
  font-size: 11.5px;
}

.sidebar-footer-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================================
   LEFT MAIN DISPLAY STAGE (يتوسع ليأخذ العرض الكامل 100%)
   ========================================================================== */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-page);
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.stage-subbar {
  height: 44px;
  min-height: 44px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.stage-subbar-start {
  display: flex;
  align-items: center;
  gap: 12px;
}

.subbar-sidebar-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 10px;
  background: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.subbar-sidebar-toggle-btn:hover {
  background-color: #eff6ff;
  color: var(--brand-blue);
  border-color: #93c5fd;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.08);
}

.subbar-sidebar-toggle-btn .sidebar-toggle-svg {
  color: var(--brand-blue);
  transition: transform 0.2s ease;
}

.subbar-divider {
  width: 1px;
  height: 16px;
  background-color: var(--border-medium);
}

/* When Sidebar is Collapsed: Highlight the toggle button cleanly */
.app-body-container.sidebar-collapsed .subbar-sidebar-toggle-btn {
  background: #eff6ff;
  border-color: #93c5fd;
  color: var(--brand-blue);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.15);
}

.app-body-container.sidebar-collapsed .subbar-sidebar-toggle-btn:hover {
  background: #dbeafe;
  border-color: #60a5fa;
}

.stage-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
}

.breadcrumb-root {
  color: #334155;
  font-weight: 600;
}

.breadcrumb-sep {
  color: #94a3b8;
  font-weight: 600;
}

.breadcrumb-active {
  color: #0a2540;
  font-weight: 800;
  font-size: 14px;
}

.stage-subbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-expand-stage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #f8fafc;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xs);
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--brand-navy);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-expand-stage:hover {
  background-color: #eff6ff;
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}

.screen-width-hint {
  font-size: 11.5px;
  color: var(--text-subtle);
}

.stage-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 44px;
  scrollbar-width: thin;
}

.stage-view { display: none; }
.stage-view.active { display: block; animation: fadeInView 0.16s ease-in-out; }

.sortable-column { cursor: pointer; user-select: none; }
.sortable-column::after { content: ' ↕'; opacity: .45; font-size: .8em; }
.sortable-column[aria-sort="ascending"]::after { content: ' ↑'; opacity: 1; }
.sortable-column[aria-sort="descending"]::after { content: ' ↓'; opacity: 1; }
.sortable-column:focus-visible { outline: 2px solid #2563eb; outline-offset: -2px; }

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

/* Section Header */
.section-header-box {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.section-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--brand-navy);
}

.section-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

.header-stats-pill {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-medium);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

/* KPI Ribbon */
.kpi-ribbon-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.kpi-dense-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-right: 4px solid var(--brand-blue);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.kpi-dense-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-dense-val {
  font-size: 21px;
  font-weight: 800;
  color: var(--brand-navy);
  font-family: 'Plus Jakarta Sans', 'Cairo', sans-serif;
  margin-top: 2px;
}

.kpi-dense-sub {
  font-size: 10.5px;
  color: var(--text-subtle);
  margin-top: 2px;
}

/* Category Header Banner */
.category-header-banner {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.cat-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cat-main-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--brand-navy);
}

.cat-badge-count {
  background-color: #eff6ff;
  color: #1d4ed8;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 12px;
  border: 1px solid #bfdbfe;
}

.cat-subtext {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.price-range-badge {
  background: #f1f5f9;
  border: 1px solid var(--border-medium);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 600;
}

/* Filters Bar */
.catalog-filters-bar {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.filter-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 130px;
  flex: 1;
}

.filter-col.search-col {
  flex: 2;
  min-width: 180px;
}

.catalog-dynamic-filters {
  display: contents;
}

.catalog-dynamic-filters[hidden] {
  display: none;
}

.dynamic-filter-col {
  min-width: 145px;
}

.dynamic-filter-col .filter-label {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-actions-col {
  flex: 0 0 auto;
  min-width: auto;
}

.filter-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.form-input, .form-select {
  height: 35px;
  padding: 0 10px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  color: var(--text-main);
  font-family: inherit;
  font-size: 12px;
  transition: border-color 0.15s ease;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* ==========================================================================
   Master Data Tables System (Strictly NO Cards)
   ========================================================================== */
.table-container-wrap {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 20px;
}

.table-toolbar {
  padding: 10px 16px;
  background-color: #fafbfc;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.toolbar-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-box-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-navy);
}

.table-count-badge {
  background-color: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.toolbar-quick-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

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

.kx-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 12.5px;
}

.kx-data-table th {
  background-color: #f8fafc;
  color: #334155;
  font-weight: 700;
  font-size: 11.5px;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border-medium);
  white-space: nowrap;
}

.kx-data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  vertical-align: middle;
  background-color: #ffffff;
  transition: background-color 0.1s ease;
}

.kx-data-table tbody tr:hover td {
  background-color: #f8fafc;
}

.kx-data-table tbody tr.row-highlight td {
  background-color: #eff6ff;
}

.item-model-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-model-title {
  font-weight: 700;
  color: var(--brand-navy);
  cursor: pointer;
  transition: color 0.15s ease;
}

.item-model-title:hover {
  color: var(--brand-blue);
  text-decoration: underline;
}

.brand-chip {
  display: inline-block;
  background-color: #f1f5f9;
  color: #475569;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  width: fit-content;
  border: 1px solid #e2e8f0;
}

.spec-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 3px;
}

.spec-chip {
  font-size: 10px;
  background-color: #f8fafc;
  border: 1px solid var(--border-light);
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  color: #475569;
}

.price-display-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.price-val {
  font-size: 14px;
  font-weight: 800;
  color: var(--price-emerald);
}

.old-price-val {
  font-size: 10.5px;
  color: var(--text-subtle);
  text-decoration: line-through;
}

.discount-badge {
  background-color: var(--discount-amber-bg);
  color: var(--discount-amber);
  border: 1px solid #fde68a;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: var(--radius-xs);
}

.stock-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  white-space: nowrap;
}

.stock-in {
  background-color: var(--price-emerald-bg);
  color: var(--price-emerald);
  border: 1px solid #a7f3d0;
}

.stock-order {
  background-color: var(--discount-amber-bg);
  color: var(--discount-amber);
  border: 1px solid #fde68a;
}

.seller-tag {
  font-weight: 600;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.city-pill {
  font-size: 9.5px;
  background-color: #f1f5f9;
  color: #64748b;
  padding: 1px 4px;
  border-radius: var(--radius-xs);
}

.row-actions-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-end;
}


.catalog-display-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background: #f8fafc;
}

.catalog-display-label {
  padding-inline: 6px 3px;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
}

.catalog-display-toggle-btn {
  min-height: 30px;
  padding: 4px 9px;
  border: 0;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.catalog-display-toggle-btn.active {
  background: #ffffff;
  color: var(--brand-blue);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.catalog-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 2px;
  box-sizing: border-box;
}

.catalog-cards-container[hidden] {
  display: none !important;
}

.catalog-mobile-card {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: #ffffff;
  padding: 13px;
  box-sizing: border-box;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
}

.catalog-mobile-card.is-selected {
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

.catalog-card-head,
.catalog-card-bottom,
.catalog-card-market,
.catalog-card-actions {
  display: flex;
  min-width: 0;
}

.catalog-card-head {
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.catalog-card-title-wrap {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.catalog-card-title {
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand-navy);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
  text-align: start;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.catalog-card-code,
.catalog-card-submeta {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-card-compare-wrap {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  color: #475569;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}

.catalog-card-compare {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-blue);
}

.catalog-card-specs-summary {
  min-width: 0;
  margin: 10px 0;
  overflow: hidden;
}

.catalog-card-specs-summary .spec-chips-row {
  display: flex;
  max-height: 58px;
  overflow: hidden;
  flex-wrap: wrap;
  gap: 5px;
}

.catalog-card-specs-summary .spec-chip {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-card-market {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.catalog-card-market > div {
  min-width: 0;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: #f8fafc;
}

.catalog-card-market strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #1e293b;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-card-meta-label {
  display: block;
  margin-bottom: 2px;
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 700;
}

.catalog-card-bottom {
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.catalog-card-price {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.catalog-card-price strong {
  color: var(--price-emerald);
  font-size: 16px;
  line-height: 1.25;
  white-space: nowrap;
}

.catalog-card-price > span:not(.catalog-card-meta-label):not(.discount-badge):not(.old-price-val) {
  max-width: 100%;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-card-actions {
  flex: 0 0 auto;
  align-items: stretch;
  justify-content: flex-end;
  gap: 6px;
}

.catalog-card-actions .btn,
.catalog-card-actions a {
  min-height: 36px;
}

.catalog-card-empty {
  grid-column: 1 / -1;
  padding: 28px 14px;
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-align: center;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: inherit;
  font-weight: 600;
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary { background-color: var(--brand-blue); color: #ffffff; }
.btn-primary:hover { background-color: var(--brand-blue-hover); }

.btn-secondary { background-color: var(--bg-surface); color: var(--brand-navy); border-color: var(--border-medium); }
.btn-secondary:hover { background-color: var(--bg-subtle); }

.btn-outline { background-color: transparent; color: var(--text-main); border-color: var(--border-medium); }
.btn-outline:hover { background-color: var(--bg-subtle); }

.btn-sm { font-size: 11.5px; padding: 3px 8px; }
.btn-xs { font-size: 10.5px; padding: 2px 6px; border-radius: var(--radius-xs); }
.btn-block { width: 100%; }

.text-start { text-align: start; }
.text-center { text-align: center; }
.text-end { text-align: end; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--price-emerald); }
.text-xs { font-size: 11px; }
.font-bold { font-weight: 700; }
.block { display: block; }

/* Builder */
.builder-split-layout {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 18px;
  align-items: start;
}

.builder-advisory {
  margin-bottom: 12px;
  padding: 12px 16px;
  border: 1px solid #f1d58a;
  border-radius: var(--radius-md);
  background: #fffbeb;
  color: #713f12;
  font-size: 13px;
  line-height: 1.7;
}

.build-summary-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 16px;
}

.summary-box-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--brand-navy);
  margin-bottom: 12px;
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 6px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  margin-bottom: 7px;
}

.summary-divider {
  height: 1px;
  background-color: var(--border-light);
  margin: 12px 0;
}

.summary-total-wrap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.builder-state-notice {
  margin: 10px 0;
  padding: 9px 11px;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 11.5px;
  line-height: 1.6;
}

.builder-budget-card {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #f8fafc;
}

.builder-budget-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--brand-navy);
}

.builder-budget-input { width: 100%; }

.builder-budget-progress-track {
  height: 8px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.builder-budget-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #10b981, #2563eb);
  transition: width 0.2s ease;
}

.builder-budget-progress-fill.is-over { background: linear-gradient(90deg, #f59e0b, #ef4444); }

.builder-budget-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 11px;
}

#builderBudgetRemaining { color: #047857; }
#builderBudgetRemaining.is-over { color: #b91c1c; }

.builder-save-status {
  margin-top: -3px;
  text-align: center;
  color: var(--text-muted);
  font-size: 10.5px;
}

.builder-save-status[data-tone="saved"] { color: #047857; }
.builder-save-status[data-tone="warning"] { color: #b45309; }

.quote-budget-summary {
  margin: 10px 0 12px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.total-label { font-size: 14px; font-weight: 700; color: var(--brand-navy); }
.total-price-val { font-size: 22px; font-weight: 800; color: var(--price-emerald); }


.catalog-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-inline-start: 10px;
  padding: 2px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background: #f8fafc;
}

.catalog-view-toggle-btn {
  min-height: 28px;
  padding: 3px 10px;
  border: 0;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.catalog-view-toggle-btn.active {
  background: #ffffff;
  color: var(--brand-blue);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.product-market-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 110px;
}

.freshness-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 2px 7px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
}

.freshness-compact {
  display: flex;
  margin-top: 4px;
  padding: 1px 6px;
  font-size: 9.5px;
}

.freshness-today,
.freshness-recent {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.freshness-aging {
  border-color: #fde68a;
  background: #fffbeb;
  color: #a16207;
}

.freshness-stale {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.freshness-unknown {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
}

.price-signal {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.price-signal-down {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.price-signal-up {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.price-signal-neutral {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.lowest-price-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 2px;
  padding: 1px 5px;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-xs);
  background: #ecfdf5;
  color: #047857;
  font-size: 9.5px;
  font-weight: 800;
}

.drawer-freshness-badge {
  margin: -4px 0 12px;
}

.drawer-spec-label-cell,
.compare-property-cell {
  position: relative;
}

.spec-label-text {
  vertical-align: middle;
}

.spec-help-affordance {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  margin-inline-start: 6px;
  padding: 0;
  border: 1px solid #bfdbfe;
  border-radius: 50%;
  background: #eff6ff;
  color: #1d4ed8;
  font-family: inherit;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  cursor: help;
  vertical-align: middle;
}

.spec-help-affordance:hover,
.spec-help-affordance:focus-visible {
  border-color: #60a5fa;
  background: #dbeafe;
  outline: none;
}

.seller-links-row {
  flex-wrap: wrap;
}

/* Detail Drawer */
.detail-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  right: -520px;
  width: 480px;
  max-width: 90vw;
  background-color: #ffffff;
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: right 0.24s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.24s;
  visibility: hidden;
  pointer-events: none;
}

.detail-drawer.open {
  right: 0;
  visibility: visible;
  pointer-events: auto;
}

.drawer-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background-color: #fafbfc;
}

.drawer-category-tag { font-size: 10.5px; font-weight: 700; color: var(--brand-blue); text-transform: uppercase; }
.drawer-title { font-size: 15px; font-weight: 800; color: var(--brand-navy); margin-top: 2px; }
.btn-close-drawer { background: none; border: none; font-size: 22px; line-height: 1; color: var(--text-muted); cursor: pointer; }
.btn-close-drawer:hover { color: var(--badge-danger); }

.drawer-body { padding: 16px; overflow-y: auto; flex: 1; }

.drawer-price-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #f8fafc;
  border: 1px solid var(--border-light);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}

.drawer-seller-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 16px;
  background-color: #ffffff;
}

.seller-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.seller-label { font-size: 10.5px; color: var(--text-muted); }
.seller-name { font-size: 13.5px; font-weight: 700; color: var(--brand-navy); }

.drawer-section-title { font-size: 12.5px; font-weight: 700; color: var(--brand-navy); margin-bottom: 6px; }
.drawer-specs-wrap { margin-bottom: 18px; }
.drawer-specs-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.drawer-specs-table td { padding: 6px 8px; border-bottom: 1px solid var(--border-light); }
.drawer-specs-table td:first-child { font-weight: 600; color: var(--text-muted); width: 40%; background-color: #fafbfc; }

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  max-width: 100vw;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

/* Modals */
.modal-dialog-wrap {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  max-width: 100vw;
  overflow: hidden;
  transition: opacity 0.16s ease, visibility 0.16s ease;
}

.modal-dialog-wrap.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.modal-dialog-content {
  background-color: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 800px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-dialog-content.modal-lg { max-width: 1000px; }
.modal-dialog-content.modal-xl { max-width: 1140px; max-height: 88vh; }

.modal-dialog-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #fafbfc;
}

.modal-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.modal-header-info h3 { 
  font-size: 15px; 
  font-weight: 800; 
  color: var(--brand-navy); 
  margin: 0;
}

.modal-header-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-count-pill {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 700;
  color: #0f172a;
}

/* Builder Component Selection Filter Zone */
.builder-modal-filter-zone {
  background-color: #f8fafc;
  border-bottom: 1px solid var(--border-light);
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.builder-modal-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.builder-filter-input-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search-mini-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.builder-search-input {
  width: 100%;
  padding-right: 32px !important;
  font-size: 13px !important;
  height: 36px;
}

.builder-filter-select {
  min-width: 155px;
  height: 36px;
  font-size: 12.5px;
  background-color: #ffffff;
}

.builder-filter-subrow {
  padding-top: 6px;
  border-top: 1px dashed #e2e8f0;
}

.builder-price-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.filter-label-inline {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.price-input-mini {
  width: 70px;
  height: 32px;
  text-align: center;
  font-size: 12px !important;
  padding: 2px 6px !important;
}

.price-sep {
  color: #94a3b8;
  font-weight: bold;
}

.builder-sort-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.builder-sort-select {
  height: 32px;
  font-size: 12px;
  padding: 2px 8px;
  background-color: #ffffff;
}

.builder-filter-checkbox-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  user-select: none;
  transition: all 0.15s ease;
}

.builder-filter-checkbox-wrap:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.btn-builder-reset-filters {
  margin-right: auto;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-builder-reset-filters:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

.modal-dialog-body { padding: 0; overflow-y: auto; flex: 1; }


.compare-modal-content {
  max-width: min(1180px, 96vw);
}

.compare-modal-header {
  gap: 16px;
  align-items: center;
}

.compare-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.compare-diff-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.compare-diff-toggle input {
  accent-color: var(--brand-blue);
}

.compare-v2-table .compare-property-head,
.compare-v2-table .compare-property-cell {
  min-width: 165px;
  font-weight: 800;
}

.compare-v2-table .compare-product-head {
  min-width: 180px;
}

.compare-v2-table tr.compare-diff > td,
.compare-v2-table td.compare-diff-cell {
  background: #fff7ed;
  border-color: #fdba74;
}

.compare-v2-table tr.compare-diff .compare-property-cell {
  color: #c2410c;
}

.compare-empty-row {
  padding: 28px !important;
  text-align: center;
  color: var(--text-muted);
}

@media (max-width: 820px) {
  .compare-modal-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .compare-modal-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

.print-only { 
  display: none !important; 
}

@media print {
  @page {
    size: A4 portrait;
    margin: 10mm 12mm 12mm 12mm;
  }

  *, *:before, *:after {
    box-shadow: none !important;
    text-shadow: none !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html, body {
    background: #ffffff !important;
    color: #0f172a !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    font-family: 'Cairo', Arial, sans-serif !important;
    font-size: 10pt !important;
    direction: rtl !important;
  }

  /* 1. Strictly HIDE all website elements in body, selecting one print surface */
  body:not(.print-comparison-mode) > *:not(#printQuotationTemplate) {
    display: none !important;
  }

  body.print-comparison-mode > *:not(#printComparisonTemplate) {
    display: none !important;
  }

  .app-global-header,
  .app-body-container,
  .app-sidebar,
  .app-main,
  .stage-subbar,
  .stage-content,
  .docked-quick-toolbar,
  .app-footer,
  .detail-drawer,
  .drawer-overlay,
  .modal-dialog-wrap,
  .app-toast-container {
    display: none !important;
  }

  /* 2. Display selected print surface only */
  body:not(.print-comparison-mode) #printQuotationTemplate.print-only {
    display: block !important;
    visibility: visible !important;
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #0f172a !important;
  }

  body.print-comparison-mode #printQuotationTemplate.print-only {
    display: none !important;
  }

  body.print-comparison-mode #printComparisonTemplate.print-only {
    display: block !important;
    visibility: visible !important;
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    page: comparison;
  }

  @page comparison {
    size: A4 landscape;
    margin: 8mm;
  }

  .comparison-print-header {
    display: flex !important;
    justify-content: space-between !important;
    gap: 18px !important;
    border-bottom: 2px solid #0a2540 !important;
    padding-bottom: 8px !important;
    margin-bottom: 10px !important;
  }

  .comparison-print-brand {
    font-size: 14pt !important;
    font-weight: 900 !important;
    color: #0a2540 !important;
  }

  .comparison-print-header h2 {
    margin: 4px 0 !important;
    font-size: 16pt !important;
    color: #0f172a !important;
  }

  .comparison-print-header p,
  .comparison-print-meta {
    margin: 0 !important;
    font-size: 8.5pt !important;
    color: #475569 !important;
  }

  .comparison-print-meta {
    min-width: 190px !important;
    line-height: 1.8 !important;
  }

  .comparison-print-table {
    width: 100% !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
    font-size: 8.5pt !important;
  }

  .comparison-print-table th,
  .comparison-print-table td {
    border: 1px solid #cbd5e1 !important;
    padding: 5px 6px !important;
    vertical-align: top !important;
    overflow-wrap: anywhere !important;
  }

  .comparison-print-table th {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    font-weight: 800 !important;
  }

  .comparison-print-table th span {
    display: block !important;
    margin-top: 2px !important;
    color: #64748b !important;
    font-size: 7pt !important;
    font-weight: 600 !important;
  }

  .comparison-print-table tr.compare-diff td {
    background: #fff7ed !important;
  }

  .comparison-print-key {
    width: 145px !important;
    font-weight: 800 !important;
    color: #334155 !important;
  }

  .comparison-print-footer {
    display: flex !important;
    justify-content: space-between !important;
    gap: 12px !important;
    margin-top: 10px !important;
    padding-top: 7px !important;
    border-top: 1px solid #94a3b8 !important;
    color: #475569 !important;
    font-size: 7.5pt !important;
  }

  /* Header of Quotation */
  .quote-print-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    border-bottom: 2.5px solid #0a2540 !important;
    padding-bottom: 10px !important;
    margin-bottom: 12px !important;
  }

  .quote-brand-title {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 20pt !important;
    font-weight: 900 !important;
    font-family: 'Plus Jakarta Sans', 'Cairo', sans-serif !important;
    color: #0a2540 !important;
    line-height: 1 !important;
  }

  .quote-brand-title .brand-kx {
    color: #0a2540 !important;
  }

  .quote-brand-title .brand-store {
    background: #1d4ed8 !important;
    color: #ffffff !important;
    padding: 2px 7px !important;
    border-radius: 4px !important;
    font-size: 13pt !important;
    margin-right: 4px !important;
  }

  .quote-brand-title .brand-country {
    font-size: 11pt !important;
    font-weight: 700 !important;
    margin-right: 8px !important;
    color: #334155 !important;
  }

  .quote-sub {
    margin: 5px 0 0 0 !important;
    font-size: 9.5pt !important;
    color: #475569 !important;
    font-weight: 600 !important;
  }

  .quote-source-note {
    margin: 2px 0 0 0 !important;
    font-size: 8pt !important;
    color: #64748b !important;
  }

  .quote-meta {
    text-align: left !important;
    direction: ltr !important;
  }

  .quote-doc-title {
    margin: 0 0 6px 0 !important;
    font-size: 13.5pt !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    text-align: right !important;
    direction: rtl !important;
  }

  .quote-meta-row {
    font-size: 9pt !important;
    color: #334155 !important;
    margin-bottom: 3px !important;
    text-align: right !important;
    direction: rtl !important;
  }

  .quote-meta-row strong {
    color: #0f172a !important;
    font-weight: 700 !important;
  }

  /* Print advisory and parts count */
  .quote-print-banner {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 7px 12px !important;
    margin-bottom: 12px !important;
    font-size: 9.5pt !important;
  }

  .banner-advisory {
    font-weight: 800 !important;
  }

  .banner-parts-count {
    font-weight: 700 !important;
    color: #1e293b !important;
  }

  /* Quotation Table */
  .quote-print-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-bottom: 12px !important;
    font-size: 9.5pt !important;
  }

  .quote-print-table th {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    border: 1.5px solid #475569 !important;
    padding: 7px 9px !important;
    font-weight: 800 !important;
    font-size: 9.5pt !important;
    text-align: right !important;
  }

  .quote-print-table td {
    border: 1px solid #cbd5e1 !important;
    padding: 7px 9px !important;
    vertical-align: middle !important;
    color: #0f172a !important;
  }

  .quote-print-table tbody tr:nth-child(even) {
    background-color: #f8fafc !important;
  }

  .quote-cat-name {
    font-weight: 800 !important;
    color: #1d4ed8 !important;
    font-size: 9.5pt !important;
  }

  .quote-item-model strong {
    font-size: 10.5pt !important;
    color: #0f172a !important;
    display: inline-block !important;
    margin-bottom: 2px !important;
  }

  .quote-brand-badge {
    display: inline-block !important;
    background: #e2e8f0 !important;
    color: #1e293b !important;
    border: 1px solid #94a3b8 !important;
    padding: 1px 5px !important;
    border-radius: 3px !important;
    font-size: 8pt !important;
    font-weight: 700 !important;
    margin-right: 6px !important;
  }

  .quote-item-specs {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    margin-top: 3px !important;
  }

  .quote-spec-chip {
    font-size: 8pt !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    padding: 1px 5px !important;
    border-radius: 3px !important;
    color: #475569 !important;
  }

  .quote-seller-name {
    font-weight: 800 !important;
    font-size: 10.5pt !important;
    color: #0a2540 !important;
  }

  .quote-city-sub {
    display: block !important;
    font-size: 8pt !important;
    color: #64748b !important;
    margin-top: 1px !important;
  }

  .quote-price-val {
    font-size: 12pt !important;
    font-weight: 800 !important;
    color: #047857 !important;
    font-family: 'Plus Jakarta Sans', 'Cairo', sans-serif !important;
    white-space: nowrap !important;
    direction: ltr !important;
    text-align: left !important;
  }

  /* Table Total Footer */
  .quote-table-total-row {
    background: #f1f5f9 !important;
    border-top: 2px solid #0a2540 !important;
  }

  .total-label-cell {
    text-align: left !important;
    font-weight: 800 !important;
    font-size: 11pt !important;
    color: #0f172a !important;
    padding: 10px !important;
  }

  .total-val-cell {
    font-size: 13pt !important;
    font-weight: 900 !important;
    color: #047857 !important;
    padding: 10px !important;
    white-space: nowrap !important;
    direction: ltr !important;
    text-align: left !important;
    border: 1.5px solid #0a2540 !important;
    background: #ecfdf5 !important;
  }

  /* Quotation Document Footer */
  .quote-print-footer {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: 14px !important;
    padding-top: 8px !important;
    border-top: 1px solid #cbd5e1 !important;
    font-size: 8pt !important;
    color: #64748b !important;
  }

  .quote-footer-notice {
    max-width: 72% !important;
    line-height: 1.4 !important;
  }

  .quote-footer-stamp {
    text-align: left !important;
    direction: ltr !important;
    font-weight: 700 !important;
    color: #334155 !important;
    display: flex !important;
    flex-direction: column !important;
  }
}

@media (max-width: 820px) {
  .header-search-wrap, .header-left-side .currency-tag { display: none; }
  .btn-toggle-label { display: none; }
  .app-sidebar {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    box-shadow: var(--shadow-xl);
  }
}

/* ==========================================================================
   STORE BADGE & PRICE FILTER INPUT STYLES
   ========================================================================== */
.seller-store-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.store-badge-highlight {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-weight: 700;
  font-size: 12px;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  width: fit-content;
}

.store-city-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
}

.price-inputs-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.price-input {
  width: 72px !important;
  padding: 4px 6px !important;
  font-size: 12px !important;
  height: 32px !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  text-align: center;
}

.price-sep {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 13px;
}

.sidebar-badge-count {
  font-size: 11px;
  font-weight: 700;
  background-color: #eff6ff;
  color: var(--brand-blue);
  border: 1px solid #bfdbfe;
  padding: 2px 7px;
  border-radius: 10px;
  font-family: 'Plus Jakarta Sans', 'Cairo', sans-serif;
}

/* ==========================================================================
   FIXED FULL-WIDTH GLOBAL FOOTER (يمتد من أقصى اليمين لأقصى اليسار تحت القائمة المنسدلة والشاشة)
   ========================================================================== */
.app-global-footer {
  flex-shrink: 0;
  width: 100vw;
  background-color: #ffffff;
  border-top: 1px solid var(--border-light);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
  z-index: 85;
  position: relative;
}

/* 1. DOCKED STATUS & ACTIONS BAR (Always visible at the absolute bottom edge-to-edge) */
.footer-docked-bar {
  height: 42px;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background-color: #ffffff;
  gap: 12px;
  width: 100%;
}

.docked-right-side {
  display: flex;
  align-items: center;
  gap: 10px;
}

.docked-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--brand-navy) 0%, #1e3a8a 100%);
  color: #ffffff;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.docked-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.pulse-dot-green {
  width: 6px;
  height: 6px;
  background-color: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 6px #22c55e;
  animation: pulseLive 2s infinite ease-in-out;
}

.docked-center-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.docked-stat-item strong {
  color: var(--brand-navy);
}

.docked-stat-sep {
  color: #cbd5e1;
}

.docked-left-side {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-docked-support {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  border-radius: var(--radius-xs);
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-docked-support:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  transform: translateY(-1px);
}

.support-bubble-new {
  font-size: 9.5px;
  background-color: #22c55e;
  color: #ffffff;
  padding: 1px 5px;
  border-radius: 8px;
  font-weight: 800;
}

.btn-toggle-footer-drawer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid var(--border-medium);
  color: var(--text-muted);
  border-radius: var(--radius-xs);
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-toggle-footer-drawer:hover {
  background: #f1f5f9;
  color: var(--brand-navy);
  border-color: #94a3b8;
}

/* 2. EXPANDABLE DETAILS PANEL (Toggled via drawer button) */
.footer-expandable-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-light);
}

.footer-expandable-panel.is-expanded {
  max-height: 520px;
  overflow-y: auto;
}

.footer-panel-inner {
  padding: 24px 28px 16px 28px;
}

.footer-main-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1.3fr;
  gap: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
}

@media (max-width: 1024px) {
  .footer-main-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

@media (max-width: 640px) {
  .footer-main-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.footer-brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.footer-brand-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--brand-navy);
  display: block;
}

.footer-brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

.footer-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
}

.footer-badge-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.footer-pill {
  display: inline-flex;
  align-items: center;
  background-color: #f1f5f9;
  border: 1px solid var(--border-medium);
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-navy);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
}

.footer-col-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--brand-navy);
  margin-bottom: 12px;
  position: relative;
  padding-bottom: 6px;
  border-bottom: 2px solid #e2e8f0;
}

.footer-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.footer-link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: right;
  padding: 3px 0;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-link-btn:hover {
  color: var(--brand-blue);
  transform: translateX(-3px);
}

.footer-cat-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

.footer-cat-icon {
  font-size: 13px;
}

.footer-support-intro {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

.footer-support-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-whatsapp-footer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.25);
  transition: all 0.18s ease;
  font-family: inherit;
}

.btn-whatsapp-footer:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(16, 185, 129, 0.35);
}

.footer-wa-quick-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-weight: 700;
  font-size: 12.5px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.1);
}

.footer-wa-quick-link:hover {
  background-color: #d1fae5;
  border-color: #34d399;
  color: #047857;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(16, 185, 129, 0.2);
}

.footer-support-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.support-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #22c55e;
}

.footer-disclaimer-strip {
  padding-top: 14px;
}

.footer-policy-text {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 10px;
}

.footer-policy-text strong {
  color: var(--brand-navy);
}

.footer-copyright-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11.5px;
  color: var(--text-subtle);
  border-top: 1px dashed var(--border-light);
  padding-top: 10px;
}

.footer-copyright-row strong {
  color: var(--brand-navy);
}

/* ==========================================================================
   TECHNICAL SUPPORT & HARDWARE ICONS / COLORFUL BUTTONS
   ========================================================================== */

/* Header Action Button: بناء تجميعة */
.btn-builder-header,
.btn-tech-support-header {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
  transition: all 0.18s ease;
  position: relative;
  text-decoration: none;
  white-space: nowrap;
}

.btn-builder-header:hover,
.btn-tech-support-header:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
  background: linear-gradient(135deg, #0369a1 0%, #1d4ed8 100%);
}

.btn-builder-header.active {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #2563eb, 0 4px 12px rgba(37, 99, 235, 0.35);
}

.support-pulse-dot {
  width: 7px;
  height: 7px;
  background-color: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 6px #4ade80;
  animation: pulseLive 1.8s infinite ease-in-out;
}

/* Category & Component Icon Badges */
.cat-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  font-size: 13px;
  border: 1px solid transparent;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.nav-item-btn:hover .cat-icon-badge {
  transform: scale(1.12);
}

.row-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid var(--border-light);
}

/* Action Buttons: Colorful & Professional */
.btn-action-view {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  color: #ffffff !important;
  border: none;
  border-radius: var(--radius-xs);
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
  transition: all 0.15s ease;
  font-family: inherit;
  text-decoration: none;
}

.btn-action-view:hover {
  background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.35);
}

/* Smart Store Action Buttons */
.btn-action-store {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: var(--radius-xs);
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
}

/* 1. Direct Product Link (شراء من المتجر ↗) */
.btn-action-store.btn-store-product {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff !important;
  border: 1px solid #047857;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}
.btn-action-store.btn-store-product:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.35);
}

/* 2. Category Listing Link (قسم المتجر ↗) */
.btn-action-store.btn-store-cat {
  background: #eff6ff;
  color: #1d4ed8 !important;
  border: 1px solid #93c5fd;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.1);
}
.btn-action-store.btn-store-cat:hover {
  background: #dbeafe;
  border-color: #2563eb;
  color: #1e40af !important;
  transform: translateY(-1px);
}

/* 3. Store Homepage Link (موقع المتجر ↗) */
.btn-action-store.btn-store-home {
  background: #f8fafc;
  color: #334155 !important;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.btn-action-store.btn-store-home:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a !important;
  transform: translateY(-1px);
}

/* Sticky Actions Column for Data Tables (Left edge in RTL) */
.kx-data-table th.col-sticky-actions,
.kx-data-table td.col-sticky-actions {
  position: sticky;
  left: 0;
  z-index: 5;
  background-color: #ffffff;
  box-shadow: -4px 0 8px -2px rgba(0, 0, 0, 0.07);
}
.kx-data-table th.col-sticky-actions {
  background-color: #f8fafc;
  z-index: 6;
}
.kx-data-table tbody tr:hover td.col-sticky-actions {
  background-color: #f8fafc;
}
.kx-data-table tbody tr.row-highlight td.col-sticky-actions {
  background-color: #eff6ff;
}

.btn-primary-gradient {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-primary-gradient:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-emerald-gradient {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-emerald-gradient:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.btn-indigo-gradient {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-indigo-gradient:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.btn-support-builder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(124, 58, 237, 0.25);
  transition: all 0.18s ease;
  margin-top: 8px;
  width: 100%;
  font-family: inherit;
}

.btn-support-builder:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(124, 58, 237, 0.35);
}

/* Support Modal Header - Ultra-Clear & Crisp Light Design */
.support-modal-header {
  background: #ffffff !important;
  color: var(--brand-navy) !important;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.support-modal-header .support-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.support-modal-header .support-avatar-badge {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #eff6ff !important;
  border: 1px solid #bfdbfe !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.1);
}

.support-modal-header h3.support-modal-title,
.modal-dialog-header.support-modal-header h3 {
  color: #0f172a !important;
  font-size: 16.5px !important;
  font-weight: 900 !important;
  margin: 0 0 3px 0 !important;
  line-height: 1.3 !important;
  letter-spacing: -0.2px;
}

.support-modal-header p.support-modal-sub,
.modal-dialog-header.support-modal-header p {
  color: #475569 !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  margin: 0 !important;
  line-height: 1.4 !important;
}

.support-modal-header .btn-close-drawer {
  color: #64748b !important;
  font-size: 22px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--border-medium);
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.15s ease;
}

.support-modal-header .btn-close-drawer:hover {
  background: #fee2e2 !important;
  color: #dc2626 !important;
  border-color: #fca5a5 !important;
}

.support-status-banner {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.status-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: #166534;
}

.status-banner-left p {
  margin: 0;
  font-size: 11.5px;
  color: #15803d;
}

.btn-whatsapp-direct {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff !important;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
  transition: all 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-whatsapp-direct:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
}

/* ==========================================================================
   TECHNICAL SUPPORT & CONSULTATION REQUEST FORM
   ========================================================================== */
.support-modal-body {
  padding: 20px 24px 28px !important;
}

.status-banner-badge .sla-badge {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.support-layout-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 22px;
  align-items: start;
}

@media (max-width: 940px) {
  .support-layout-grid {
    grid-template-columns: 1fr;
  }
}

.support-form-container {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.form-section-block {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid #f1f5f9;
}

.form-section-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.form-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-blue) 100%);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.form-section-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--brand-navy);
  margin: 0;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 600px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

.support-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.support-form-group .form-label {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
}

.req-star {
  color: #dc2626;
  font-weight: 900;
}

.form-input-sm, .form-select-sm {
  height: 38px;
  padding: 0 12px;
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  font-family: inherit;
  font-size: 12.5px;
  color: #0f172a;
  transition: all 0.15s ease;
  width: 100%;
}

.form-input-sm:focus, .form-select-sm:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background-color: #ffffff;
}

.input-with-prefix {
  display: flex;
  align-items: center;
  position: relative;
}

.input-prefix {
  position: absolute;
  right: 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  pointer-events: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  direction: ltr;
}

.form-input-sm.has-prefix {
  padding-right: 76px;
  direction: ltr;
  text-align: right;
}

.form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  font-family: inherit;
  font-size: 12.5px;
  color: #0f172a;
  resize: vertical;
  line-height: 1.5;
  transition: all 0.15s ease;
}

.support-builder-attach-card {
  background: #f0f7ff;
  border: 1px dashed #93c5fd;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 6px;
  margin-bottom: 6px;
}

.custom-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--brand-blue);
  cursor: pointer;
}

.checkbox-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: #1e3a8a;
}

.attach-summary-text {
  font-size: 11px;
  color: #2563eb;
  font-weight: 600;
}

.support-submit-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.btn-lg {
  height: 44px;
  font-size: 13.5px;
  font-weight: 800;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  transition: all 0.18s ease;
}

.btn-lg:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

.support-form-feedback {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.support-form-feedback.success {
  background-color: #f0fdf4;
  border: 1px solid #86efac;
  color: #15803d;
}

.support-form-feedback.error {
  background-color: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
}

/* Success Confirmation Screen */
.support-success-screen {
  text-align: center;
  padding: 24px 16px;
  animation: fadeIn 0.3s ease;
}

.success-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  font-size: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.2);
}

.success-title {
  font-size: 18px;
  font-weight: 900;
  color: var(--brand-navy);
  margin-bottom: 6px;
}

.success-ticket-id {
  font-size: 13.5px;
  color: #334155;
  margin-bottom: 12px;
}

.success-ticket-id strong {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--brand-blue);
  letter-spacing: 0.5px;
}

.success-desc {
  font-size: 12.5px;
  color: #475569;
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto 18px;
}

.success-summary-box {
  background: #f8fafc;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  text-align: right;
  font-size: 12px;
  margin-bottom: 20px;
  line-height: 1.6;
}

.success-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* Side Info Cards */
.support-side-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.side-info-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
  transition: all 0.15s ease;
}

.side-info-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.side-info-card.highlight-card {
  background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 100%);
  border-color: #bfdbfe;
}

.side-card-icon {
  font-size: 20px;
  margin-bottom: 6px;
}

.side-card-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--brand-navy);
  margin-bottom: 5px;
}

.side-card-text {
  font-size: 11.5px;
  color: #475569;
  line-height: 1.5;
  margin: 0;
}

.contacts-card {
  background: #fafbfc;
}

.support-contact-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.support-contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 11.5px;
}

.support-contact-list li .contact-icon {
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

.support-contact-list li strong {
  display: block;
  color: var(--brand-navy);
  font-size: 11.5px;
}

.support-contact-list li span {
  color: #64748b;
}

/* ==========================================================================
   SMART GLOBAL SEARCH LIVE POPOVER (كافة الأصناف الـ 16)
   ========================================================================== */
.global-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  background-color: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  z-index: 120;
  max-height: 440px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-drop-group-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--brand-navy);
  padding: 6px 8px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  background-color: #fafbfc;
  border-radius: 4px;
  margin-top: 4px;
}

.search-drop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.12s ease;
  text-decoration: none;
  border: 1px solid transparent;
}

.search-drop-item:hover {
  background-color: #eff6ff;
  border-color: #bfdbfe;
}

.search-drop-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  max-width: 72%;
}

.search-drop-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.search-drop-footer {
  padding: 8px 10px;
  text-align: center;
  background: #f8fafc;
  border-top: 1px solid var(--border-light);
  border-radius: 0 0 6px 6px;
  margin-top: 6px;
}

.search-drop-view-all-btn {
  background: linear-gradient(135deg, var(--brand-blue) 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-xs);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.15s ease;
}

.search-drop-view-all-btn:hover {
  opacity: 0.95;
}

/* ==========================================================================
   VIEW 10: SEARCH RESULTS VIEW
   ========================================================================== */
.search-categories-ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.search-cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  background-color: #f1f5f9;
  border: 1px solid var(--border-medium);
  color: var(--text-dark);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.search-cat-tab:hover {
  background-color: #e2e8f0;
  border-color: #94a3b8;
}

.search-cat-tab.active {
  background: linear-gradient(135deg, var(--brand-navy) 0%, #1e40af 100%);
  color: #ffffff;
  border-color: var(--brand-navy);
  box-shadow: 0 2px 6px rgba(30, 58, 138, 0.25);
}

.search-cat-tab-count {
  font-size: 10.5px;
  opacity: 0.85;
}

/* Support Email Box (Resend) */
.support-email-box {
  background: #f8fafc;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
}



/* Install and offline state */
.install-app-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font: 700 12px 'Cairo', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.08);
}
.install-app-btn:hover {
  background: #dbeafe;
  border-color: #3b82f6;
  color: #1e40af;
  transform: translateY(-1px);
}
.install-app-btn:active {
  transform: scale(0.97);
}
.install-app-btn .install-btn-svg {
  flex-shrink: 0;
}
.install-app-btn[hidden], .offline-notice[hidden] { display: none !important; }

/* Sidebar Install Action Button */
.nav-item-install-sidebar {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  font-weight: 700 !important;
  border: 1px solid #bfdbfe !important;
  border-radius: var(--radius-sm);
  margin-top: 6px;
  display: flex;
  align-items: center;
  transition: all 0.15s ease;
}
.nav-item-install-sidebar:hover {
  background: #dbeafe !important;
  color: #1e40af !important;
  border-color: #93c5fd !important;
}
.sidebar-badge-install {
  font-size: 10px;
  font-weight: 800;
  background: #2563eb;
  color: #ffffff;
  padding: 1px 7px;
  border-radius: 10px;
  margin-right: auto;
}
.offline-notice {
  padding: 8px 18px;
  background: #fffbeb;
  color: #713f12;
  border-bottom: 1px solid #fcd34d;
  font-size: 12px;
  text-align: center;
}

/* Tablet: preserve a usable search, give the builder one column. */
@media (max-width: 1024px) {
  .builder-split-layout { grid-template-columns: minmax(0, 1fr); }
  .modal-dialog-content.modal-xl { max-width: min(100%, 920px); }
  .header-search-wrap { min-width: 180px; }
}

/* Mobile Hamburger Menu Toggle Button (Default hidden on desktop) */
.mobile-menu-toggle-btn {
  display: none;
  background: var(--bg-subtle);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--brand-navy);
  padding: 6px 9px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  min-height: 38px;
  min-width: 38px;
}
.mobile-menu-toggle-btn:active {
  background: var(--bg-active);
  transform: scale(0.96);
}

/* Sidebar Backdrop on Mobile */
.sidebar-mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 1150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

/* Mobile Bottom Navigation Bar (Default hidden on desktop) */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 58px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-light);
  z-index: 990;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -3px 14px rgba(0, 0, 0, 0.06);
  justify-content: space-around;
  align-items: stretch;
}

.mobile-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  font-family: 'Cairo', sans-serif;
  gap: 2px;
  padding: 6px 2px;
  transition: color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-btn:active {
  transform: scale(0.94);
}
.mobile-nav-icon {
  font-size: 19px;
  line-height: 1;
}
.mobile-nav-label {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
}
.mobile-nav-btn.active {
  color: var(--brand-blue);
}
.mobile-nav-btn.active .mobile-nav-label {
  font-weight: 900;
}
.mobile-nav-btn.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2.5px;
  background-color: var(--brand-blue);
  border-radius: 0 0 3px 3px;
}
.mob-builder-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 18px);
  background-color: var(--price-emerald);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 4px rgba(5, 150, 105, 0.3);
}

/* Tablet: preserve a usable search, give the builder one column. */
@media (max-width: 1024px) {
  .builder-split-layout { grid-template-columns: minmax(0, 1fr); }
  .modal-dialog-content.modal-xl { max-width: min(100%, 920px); }
  .header-search-wrap { min-width: 180px; }
}

/* ==========================================================================
   HANDHELD & MOBILE LAYOUT (< 820px) — ZERO HORIZONTAL OVERFLOW
   ========================================================================== */
@media (max-width: 820px) {
  html, body.app-layout-body {
    height: auto;
    min-height: 100dvh;
    overflow-x: hidden !important;
    max-width: 100vw;
    width: 100%;
    position: relative;
    padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px));
  }

  /* Show Mobile Elements */
  .mobile-menu-toggle-btn { display: inline-flex; }
  .mobile-bottom-nav { display: flex; }

  /* App Global Header on Mobile */
  .app-global-header {
    width: 100%;
    max-width: 100vw;
    height: auto;
    min-height: 58px;
    flex-wrap: wrap;
    padding: 8px 12px;
    gap: 8px;
    box-sizing: border-box;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }
  .header-right-side {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .header-left-side {
    gap: 6px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }
  .header-left-side .market-tag-pill,
  .header-left-side .currency-tag {
    display: none !important;
  }
  .btn-builder-header {
    padding: 6px 10px;
    font-size: 12px;
  }
  .header-search-wrap {
    display: flex !important;
    order: 3;
    flex: 1 0 100%;
    max-width: 100%;
    min-width: 0;
    margin-top: 2px;
    box-sizing: border-box;
  }
  .header-search-wrap input {
    font-size: 15px;
    height: 40px;
    padding: 8px 36px 8px 12px;
  }
  .global-search-dropdown { width: 100%; max-width: 100%; }
  .brand-tagline .store-sub { display: none; }
  .brand-tagline .store-name-title { font-size: 16px; }

  /* Subbar on Mobile */
  .stage-subbar {
    padding: 0 12px;
    max-width: 100vw;
    box-sizing: border-box;
    height: 40px;
  }
  .stage-subbar .screen-width-hint { display: none; }
  .subbar-toggle-label { display: none; }

  /* Main Stage & Body Containers */
  .app-body-container {
    width: 100%;
    max-width: 100vw;
    flex: 1 0 auto;
    min-height: auto;
    overflow-x: hidden;
    overflow-y: visible;
    box-sizing: border-box;
  }
  .app-main {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    height: auto;
    overflow-x: hidden;
    overflow-y: visible;
    box-sizing: border-box;
  }
  .stage-content {
    overflow-x: hidden;
    overflow-y: visible;
    padding: 10px 10px 24px;
    max-width: 100vw;
    box-sizing: border-box;
  }

  /* Sidebar Drawer on Mobile (RTL Clean Drawer) */
  .app-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    height: 100dvh;
    width: min(85vw, 320px);
    min-width: 0;
    max-width: min(85vw, 320px);
    z-index: 1200;
    box-shadow: -6px 0 25px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
  }
  .app-body-container.sidebar-collapsed .app-sidebar {
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
  }
  .sidebar-mobile-backdrop {
    display: block;
  }
  .app-body-container:not(.sidebar-collapsed) + .sidebar-mobile-backdrop,
  .app-body-container:not(.sidebar-collapsed) .sidebar-mobile-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  /* KPI Summary Ribbon on Mobile */
  .kpi-ribbon-bar {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    width: 100%;
    box-sizing: border-box;
  }
  .kpi-stat-card {
    min-width: 0 !important;
    padding: 10px 8px !important;
  }

  /* Section Titles on Mobile */
  .section-header-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 12px 10px;
  }
  .section-title { font-size: 16px; line-height: 1.4; }
  .section-desc { font-size: 12px; }

  /* Table Containers: Strict Safe Horizontal Scroll */
  .table-container-wrap, .table-responsive {
    max-width: 100% !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    display: block;
    margin-bottom: 12px;
  }
  .kx-data-table { min-width: 620px; }
  .builder-table { min-width: 580px; }

  /* Catalog cards are the responsive default surface. */
  #catalogCardsContainer {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: minmax(0, 1fr) !important;
    overflow: hidden !important;
  }

  .catalog-mobile-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 12px 10px;
  }

  .catalog-display-toggle {
    min-width: 0;
  }

  .catalog-display-toggle-btn,
  .catalog-card-actions .btn,
  .catalog-card-actions a,
  .catalog-card-title,
  .catalog-card-compare-wrap {
    min-height: 44px;
  }

  .catalog-card-title {
    display: flex;
    align-items: center;
    width: 100%;
  }

  .catalog-card-bottom {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-card-actions {
    width: 100%;
    min-width: 0;
  }

  .catalog-card-actions .btn,
  .catalog-card-actions a {
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
    padding-inline: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .catalog-card-market {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  /* Footer on Mobile */
  .app-global-footer {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  .footer-expandable-panel {
    max-width: 100vw;
    overflow-x: hidden;
  }
  .footer-panel-inner {
    max-width: 100%;
    padding: 16px 12px;
  }
  .footer-main-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .footer-docked-bar {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow: hidden;
    height: auto;
    min-height: 48px;
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
  }
  .docked-center-stats {
    display: none !important;
  }
  .docked-right-side, .docked-left-side {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }

  /* Modals on Mobile */
  .modal-dialog-wrap {
    padding: 8px;
    box-sizing: border-box;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .modal-dialog-content,
  .modal-dialog-content.modal-lg,
  .modal-dialog-content.modal-xl {
    max-width: 100%;
    width: 100%;
    max-height: calc(100dvh - 16px);
    border-radius: var(--radius-sm);
    box-sizing: border-box;
    overflow-y: auto;
  }
  .modal-dialog-header { padding: 10px 12px; }
  .modal-dialog-body { padding: 12px 10px; max-width: 100%; box-sizing: border-box; overflow-x: hidden; }
  .builder-modal-filter-row { align-items: stretch; flex-direction: column; gap: 8px; }
  .builder-filter-input-wrap, .builder-modal-filter-row select { min-width: 0; width: 100%; max-width: 100%; }

  /* Technical Support Modal on Mobile */
  .support-layout-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
    max-width: 100%;
    width: 100%;
  }
  .support-form-container {
    padding: 14px 10px;
    max-width: 100%;
    box-sizing: border-box;
  }
  .support-side-info {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .form-grid-2 {
    grid-template-columns: 1fr !important;
    gap: 10px;
    width: 100%;
  }

  /* Detail Drawer on Mobile */
  .detail-drawer {
    width: 100% !important;
    max-width: 100vw !important;
  }
}

@media (max-width: 480px) {
  .brand-tagline { display: none !important; }
}

@media (max-width: 420px) {
  .brand-tagline { display: none !important; }
  .brand-logo-wrap { padding: 4px 7px; }
  .btn-builder-header { padding: 6px 9px; font-size: 11px; }
  .builder-btn-label { font-size: 11px; }
  .install-app-btn { padding: 6px 9px; font-size: 11.5px; }
  .header-left-side { flex-shrink: 0; }
  .mobile-nav-label { font-size: 10px; }
  .mobile-nav-icon { font-size: 18px; }
}

/* ==========================================
   SMART PC BUILDER COMPATIBILITY & POWER METER
   ========================================== */
.compat-card {
  margin: 12px 0 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm, 10px);
  border: 1px solid var(--border-light, #e2e8f0);
  background: #ffffff;
  transition: all 0.25s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.compat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.compat-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 15px;
  flex-shrink: 0;
}

.compat-headline-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  gap: 8px;
}

.compat-headline {
  margin: 0;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main, #0f172a);
}

.compat-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.compat-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted, #64748b);
}

/* Status variants */
.compat-card.compat-green {
  border-color: #86efac;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}
.compat-card.compat-green .compat-icon-badge {
  background: #22c55e;
  color: #ffffff;
}
.compat-card.compat-green .compat-headline {
  color: #15803d;
}
.compat-card.compat-green .compat-badge-pill {
  background: #22c55e;
  color: #ffffff;
}
.compat-card.compat-green .compat-desc {
  color: #166534;
}

.compat-card.compat-red {
  border-color: #fca5a5;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  animation: shakeAlert 0.4s ease;
}
@keyframes shakeAlert {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
.compat-card.compat-red .compat-icon-badge {
  background: #ef4444;
  color: #ffffff;
}
.compat-card.compat-red .compat-headline {
  color: #b91c1c;
}
.compat-card.compat-red .compat-badge-pill {
  background: #ef4444;
  color: #ffffff;
}
.compat-card.compat-red .compat-desc {
  color: #991b1b;
  font-weight: 600;
}

.compat-card.compat-amber {
  border-color: #fde047;
  background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
}
.compat-card.compat-amber .compat-icon-badge {
  background: #eab308;
  color: #ffffff;
}
.compat-card.compat-amber .compat-headline {
  color: #a16207;
}
.compat-card.compat-amber .compat-badge-pill {
  background: #eab308;
  color: #ffffff;
}
.compat-card.compat-amber .compat-desc {
  color: #854d0e;
}

.compat-card.compat-blue,
.compat-card.compat-advisory {
  border-color: #93c5fd;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}
.compat-card.compat-blue .compat-icon-badge {
  background: #3b82f6;
  color: #ffffff;
}
.compat-card.compat-blue .compat-headline {
  color: #1d4ed8;
}
.compat-card.compat-blue .compat-badge-pill {
  background: #3b82f6;
  color: #ffffff;
}
.compat-card.compat-blue .compat-desc {
  color: #1e40af;
}

.compat-card.compat-empty {
  border-style: dashed;
  border-color: #cbd5e1;
  background: #f8fafc;
}
.compat-card.compat-empty .compat-icon-badge {
  background: #e2e8f0;
  color: #64748b;
}

.compat-checks-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.compat-check-item {
  font-size: 11px;
  color: #15803d;
  display: flex;
  align-items: center;
  gap: 5px;
}
.compat-check-item::before {
  content: '✓';
  font-weight: 800;
  color: #22c55e;
}

.compat-fix-row {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.btn-compat-fix {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #ffffff;
  color: #dc2626;
  border: 1px solid #f87171;
  border-radius: var(--radius-xs, 6px);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.btn-compat-fix:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Dynamic Wattage Meter Box */
.wattage-meter-box {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm, 8px);
  background: #f8fafc;
  border: 1px solid var(--border-light, #e2e8f0);
}
.wattage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.wattage-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main, #0f172a);
}
.wattage-val {
  font-size: 13.5px;
  color: #2563eb;
  font-family: var(--font-number, inherit);
}
.wattage-bar-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.wattage-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #10b981 0%, #3b82f6 100%);
  transition: width 0.4s ease, background 0.4s ease;
}
.wattage-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-muted, #64748b);
}
.wattage-load-badge {
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
}

/* Modal Proactive Compatibility Banner */
.builder-modal-compat-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 14px 4px;
  padding: 8px 12px;
  border-radius: var(--radius-xs, 6px);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  animation: fadeInDown 0.25s ease;
}
.banner-compat-content {
  display: flex;
  align-items: center;
  gap: 8px;
}
.banner-compat-icon {
  font-size: 16px;
}
.banner-compat-text {
  font-size: 12px;
  font-weight: 700;
  color: #1d4ed8;
}
.btn-clear-compat-filter {
  background: #ffffff;
  border: 1px solid #93c5fd;
  color: #2563eb;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
}
.btn-clear-compat-filter:hover {
  background: #2563eb;
  color: #ffffff;
}

/* Print Certificate Seal */
.print-compat-seal {
  font-size: 11px;
  font-weight: 700;
  color: #15803d;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 4px;
  padding: 3px 8px;
  display: inline-block;
}
.print-compat-seal.print-seal-conflict {
  color: #b91c1c;
  background: #fee2e2;
  border-color: #fca5a5;
}
.print-compat-seal.print-seal-warning {
  color: #a16207;
  background: #fef9c3;
  border-color: #fde047;
}
.print-compat-seal.print-seal-advisory {
  color: #1d4ed8;
  background: #dbeafe;
  border-color: #93c5fd;
}


/* P8.5 — public print cleanup: compatibility warning chip is intentionally omitted from PDF output. */
@media print {
  #printQuoteCompatBadge,
  .print-compat-seal.print-seal-warning {
    display: none !important;
  }
}


/* P8.5 — disable non-actionable offer buttons when only the current offer exists. */
.view-product-offers-btn:disabled,
.pm-filter-offers-btn:disabled,
.catalog-card-offers:disabled {
  background: #e5e7eb !important;
  color: #9ca3af !important;
  border-color: #d1d5db !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  opacity: 1 !important;
  transform: none !important;
}

.view-product-offers-btn:disabled:hover,
.pm-filter-offers-btn:disabled:hover,
.catalog-card-offers:disabled:hover {
  background: #e5e7eb !important;
  color: #9ca3af !important;
  box-shadow: none !important;
  transform: none !important;
}


/* Post-P8 hardening: privacy and accessible dialog surfaces. */
.privacy-modal-content {
  max-width: 680px;
}
.privacy-modal-body {
  display: grid;
  gap: 12px;
  line-height: 1.9;
  color: var(--text-main);
}
.privacy-modal-body p {
  margin: 0;
}
.support-privacy-note {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: var(--radius-sm);
  background: #eff6ff;
  color: #334155;
  font-size: 11.5px;
  line-height: 1.8;
}
.privacy-inline-link,
.footer-policy-link {
  border: 0;
  background: transparent;
  color: var(--brand-blue);
  font-family: inherit;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}
.privacy-inline-link {
  padding: 0 4px;
}
.footer-policy-link {
  padding: 2px 6px;
}
[role="dialog"]:focus-visible,
.btn-close-drawer:focus-visible,
.privacy-inline-link:focus-visible,
.footer-policy-link:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}
