/* ═══════════════════════════════════════════════════════════════════════════
   DEX AI CHATBOT — Premium Design System
   Dark Mode · 8pt Grid · WhatsApp Authentic · Glassmorphism Dashboard
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Design Tokens ────────────────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-base:     hsl(210, 18%, 6%);
  --bg-surface:  hsl(210, 14%, 9%);
  --bg-elevated: hsl(210, 12%, 12%);
  --bg-overlay:  hsl(210, 10%, 15%);
  --bg-glass:    hsla(210, 20%, 15%, 0.4);

  /* WhatsApp Colours */
  --wa-header:   hsl(168, 75%, 17%);
  --wa-chat:     hsl(210, 18%, 8%);
  --wa-sent:     hsl(168, 55%, 21%);
  --wa-sent-txt: hsl(142, 60%, 88%);
  --wa-recv:     hsl(210, 14%, 17%);
  --wa-recv-txt: hsl(0, 0%, 93%);
  --wa-input:    hsl(210, 14%, 13%);
  --wa-green:    hsl(142, 70%, 49%);
  --wa-green-dk: hsl(142, 50%, 35%);
  --wa-tick:     hsl(199, 89%, 58%);

  /* Text */
  --text-1: hsl(0,   0%, 95%);
  --text-2: hsl(210, 10%, 68%);
  --text-3: hsl(210,  8%, 45%);
  --text-4: hsl(210,  6%, 32%);

  /* Status / Semantic */
  --green:  hsl(142, 71%, 45%);
  --blue:   hsl(217, 91%, 62%);
  --amber:  hsl(38,  92%, 50%);
  --red:    hsl(0,   84%, 60%);
  --purple: hsl(265, 80%, 65%);
  --teal:   hsl(187, 80%, 50%);

  /* Borders */
  --border:    hsl(210, 10%, 20%);
  --border-lt: hsl(210,  8%, 26%);

  /* Spacing (4pt base) */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px;

  /* Radius */
  --r-xs: 4px; --r-sm: 6px; --r-md: 10px; --r-lg: 16px;
  --r-xl: 20px; --r-2xl: 24px; --r-full: 9999px;

  /* Shadows */
  --sh-sm: 0 1px 3px rgba(0,0,0,.35);
  --sh-md: 0 4px 16px rgba(0,0,0,.45);
  --sh-lg: 0 8px 32px rgba(0,0,0,.55);
  --sh-xl: 0 16px 64px rgba(0,0,0,.65);

  /* Transitions */
  --t-fast: 0.15s ease;
  --t-mid:  0.25s ease;
  --t-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-1);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }
a { color: var(--wa-green); }
code { font-family: 'JetBrains Mono', monospace; }

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-lt); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-4); }

/* ══════════════════════════════════════════════════════════════════════════
   TOP BAR
   ══════════════════════════════════════════════════════════════════════════ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s3) var(--s6);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  height: 52px;
}
.topbar-brand { display: flex; align-items: center; gap: var(--s3); }
.brand-logo {
  background: linear-gradient(135deg, var(--wa-green), var(--teal));
  color: #000;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 1px;
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  display: grid; place-items: center;
}
.brand-name  { font-size: 14px; font-weight: 700; color: var(--text-1); line-height: 1.2; }
.brand-sub   { font-size: 10px; color: var(--text-3); letter-spacing: .5px; }
.topbar-status { display: flex; gap: var(--s2); }
.status-pill {
  display: flex; align-items: center; gap: var(--s1);
  font-size: 11px; font-weight: 500; color: var(--text-2);
  padding: var(--s1) var(--s3);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
}
.status-pill .status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-4);
  animation: pulse-dot 2s infinite;
}
.status-pill.active .status-dot { background: var(--green); }
.status-pill.status-pill--blue .status-dot { background: var(--blue); }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* ══════════════════════════════════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════════════════════════════════ */
.layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  flex: 1;
  overflow: hidden;
  gap: 0;
}

.panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel--left  { border-right: 1px solid var(--border); position: relative; }
.panel--right { background: radial-gradient(circle at top right, rgba(0, 168, 132, 0.08) 0%, var(--bg-base) 60%); }

/* ══════════════════════════════════════════════════════════════════════════
   WHATSAPP SIMULATOR — Left Panel
   ══════════════════════════════════════════════════════════════════════════ */

/* Header */
.wa-header {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  background: var(--wa-header);
  flex-shrink: 0;
}
.wa-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--wa-green-dk);
  display: grid; place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.wa-header-info { flex: 1; min-width: 0; }
.wa-name { font-size: 15px; font-weight: 600; color: var(--text-1); }
.wa-sub  { display: flex; align-items: center; gap: 5px; font-size: 11px; color: hsl(142, 40%, 70%); }
.wa-dot  { width: 7px; height: 7px; border-radius: 50%; background: var(--wa-green); animation: pulse-dot 2s infinite; }
.wa-header-actions { display: flex; gap: var(--s1); }
.wa-icon-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: transparent;
  color: hsl(142, 30%, 75%);
  font-size: 14px;
  display: grid; place-items: center;
  transition: background var(--t-fast);
}
.wa-icon-btn:hover { background: hsla(142,30%,75%,.15); }

/* Chat Area */
.wa-chat {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--s4) var(--s3);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  background: var(--wa-chat);
  /* Subtle WhatsApp background pattern */
  background-image: radial-gradient(circle, hsla(142,50%,30%,.04) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Date separator */
.wa-date-sep {
  display: flex; align-items: center; justify-content: center;
  padding: var(--s2) 0;
}
.wa-date-sep span {
  font-size: 11px; font-weight: 500;
  color: var(--text-3);
  background: hsla(210,14%,17%,.8);
  padding: 3px 10px;
  border-radius: var(--r-full);
}

/* Chat Bubbles */
.bubble-row {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  animation: bubble-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.bubble-row--user  { align-self: flex-end; align-items: flex-end; }
.bubble-row--bot   { align-self: flex-start; align-items: flex-start; }

@keyframes bubble-in {
  from { opacity: 0; transform: scale(0.85) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.bubble {
  padding: var(--s2) var(--s3);
  border-radius: var(--r-lg);
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  word-break: break-word;
  white-space: pre-wrap;
}
.bubble--user {
  background: var(--wa-sent);
  color: var(--wa-sent-txt);
  border-bottom-right-radius: var(--r-xs);
}
.bubble--bot {
  background: var(--wa-recv);
  color: var(--wa-recv-txt);
  border-bottom-left-radius: var(--r-xs);
}
.bubble-meta {
  font-size: 10px;
  color: var(--text-4);
  padding: 2px var(--s1);
  display: flex;
  align-items: center;
  gap: 4px;
}
.bubble-meta--user { color: hsl(142,30%,55%); }
.tick { font-size: 12px; color: var(--wa-tick); }

/* Bold / Italic in bubble text */
.bubble strong { font-weight: 600; }
.bubble em { font-style: italic; color: inherit; opacity: .85; }

/* Typing Indicator */
.typing-row { align-self: flex-start; animation: bubble-in 0.2s ease; }
.typing-indicator {
  background: var(--wa-recv);
  border-radius: var(--r-lg);
  border-bottom-left-radius: var(--r-xs);
  padding: 12px 16px;
  display: flex;
  gap: 5px;
  align-items: center;
}
.typing-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-3);
  animation: typing-bounce 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ── Product List Widget ──────────────────────────────────────────────────── */
.product-list-widget {
  background: var(--wa-recv);
  border-radius: var(--r-lg);
  border-bottom-left-radius: var(--r-xs);
  overflow: hidden;
  width: 100%;
  max-width: 340px;
}
.plw-header {
  padding: var(--s3) var(--s4);
  background: hsl(210, 14%, 20%);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  border-bottom: 1px solid var(--border);
}
.plw-item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast);
  cursor: pointer;
}
.plw-item:hover  { background: var(--bg-overlay); }
.plw-item:last-child { border-bottom: none; }
.plw-emoji { font-size: 22px; flex-shrink: 0; width: 32px; text-align: center; }
.plw-info  { flex: 1; min-width: 0; }
.plw-title { font-size: 13px; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plw-desc  { font-size: 11px; color: var(--text-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plw-price { font-size: 12px; font-weight: 700; color: var(--wa-green); flex-shrink: 0; }
.plw-add-btn {
  font-size: 11px; font-weight: 600;
  background: var(--wa-green);
  color: #000;
  padding: 4px 10px;
  border-radius: var(--r-full);
  flex-shrink: 0;
  transition: opacity var(--t-fast);
}
.plw-add-btn:hover { opacity: .85; }
.plw-footer {
  padding: var(--s2) var(--s4);
  font-size: 10px;
  color: var(--text-3);
  text-align: center;
  background: hsl(210, 14%, 20%);
}

/* ── Cart Widget ──────────────────────────────────────────────────────────── */
.cart-widget {
  background: var(--wa-recv);
  border-radius: var(--r-lg);
  border-bottom-left-radius: var(--r-xs);
  overflow: hidden;
  max-width: 320px;
}
.cw-header {
  padding: var(--s2) var(--s4);
  background: hsl(38, 60%, 25%);
  font-size: 12px;
  font-weight: 600;
  color: hsl(38, 90%, 80%);
}
.cw-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s2) var(--s4);
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.cw-item:last-of-type { border-bottom: none; }
.cw-item-name { color: var(--text-2); }
.cw-item-price { color: var(--wa-green); font-weight: 600; font-size: 12px; }
.cw-total {
  display: flex;
  justify-content: space-between;
  padding: var(--s3) var(--s4);
  background: hsl(210, 14%, 20%);
  font-size: 13px;
  font-weight: 700;
}

/* ── Reply Buttons Widget ────────────────────────────────────────────────── */
.reply-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: var(--s1);
  max-width: 320px;
}
.reply-btn {
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--r-full);
  border: 1px solid var(--wa-green-dk);
  color: var(--wa-green);
  background: transparent;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.reply-btn:hover { background: var(--wa-sent); border-color: var(--wa-green); }

/* ── Order Confirmation Widget ────────────────────────────────────────────── */
.order-confirm-widget {
  background: var(--wa-recv);
  border-radius: var(--r-lg);
  border-bottom-left-radius: var(--r-xs);
  overflow: hidden;
  max-width: 300px;
}
.ocw-header {
  padding: var(--s3) var(--s4);
  background: linear-gradient(135deg, hsl(168,75%,18%), hsl(142,60%,22%));
  text-align: center;
}
.ocw-id   { font-size: 11px; color: hsl(142,50%,70%); letter-spacing: .5px; }
.ocw-ref  { font-size: 16px; font-weight: 800; color: var(--text-1); margin: 2px 0; }
.ocw-qr   { padding: var(--s4); display: flex; justify-content: center; background: #fff; }
.ocw-qr canvas, .ocw-qr img { border-radius: var(--r-sm); }
.ocw-footer { padding: var(--s3) var(--s4); font-size: 11px; color: var(--text-3); text-align: center; line-height: 1.4; }

/* ── Payment Select Widget ────────────────────────────────────────────────── */
.payment-select-widget {
  background: var(--wa-recv);
  border-radius: var(--r-lg);
  border-bottom-left-radius: var(--r-xs);
  overflow: hidden;
  max-width: 320px;
}
.psw-title { padding: var(--s3) var(--s4); font-size: 13px; color: var(--text-2); border-bottom: 1px solid var(--border); }
.psw-btn {
  display: flex; align-items: center; gap: var(--s3);
  width: 100%;
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  transition: background var(--t-fast);
  text-align: left;
}
.psw-btn:hover { background: var(--bg-overlay); }
.psw-btn:last-child { border-bottom: none; }
.psw-btn-icon { font-size: 20px; width: 28px; text-align: center; }
.psw-btn-label { font-weight: 600; color: var(--text-1); }
.psw-btn-sub   { font-size: 11px; color: var(--text-3); }

/* ── Cart Bar ─────────────────────────────────────────────────────────────── */
.cart-bar {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) var(--s4);
  background: hsl(38, 70%, 20%);
  border-top: 1px solid hsl(38, 60%, 28%);
  flex-shrink: 0;
  font-size: 13px;
}
.cart-bar-icon  { font-size: 16px; }
.cart-bar-btn {
  margin-left: auto;
  padding: 5px 12px;
  border-radius: var(--r-full);
  border: 1px solid hsl(38, 60%, 45%);
  color: hsl(38, 90%, 75%);
  font-size: 12px;
  font-weight: 600;
  transition: all var(--t-fast);
}
.cart-bar-btn:hover { background: hsl(38, 60%, 28%); }
.cart-bar-btn--green {
  margin-left: var(--s2);
  background: var(--wa-green);
  color: #000;
  border-color: var(--wa-green);
}
.cart-bar-btn--green:hover { opacity: .85; }

/* ── Quick Prompts ────────────────────────────────────────────────────────── */
.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  padding: var(--s2) var(--s3);
  background: var(--wa-chat);
  flex-shrink: 0;
  border-top: 1px solid var(--border);
}
.quick-prompts::-webkit-scrollbar { height: 0; }
.qp-chip {
  flex: 1 1 calc(50% - var(--s2));
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  padding: 16px 20px;
  border-radius: var(--r-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-lt);
  color: var(--text-2);
  transition: all var(--t-fast);
  cursor: pointer;
}
.qp-chip:hover { background: var(--wa-sent); border-color: var(--wa-green-dk); color: var(--wa-sent-txt); }

/* ── Input Bar ────────────────────────────────────────────────────────────── */
.wa-input-bar {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) var(--s3);
  background: hsl(210, 14%, 10%);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.wa-emoji-btn {
  font-size: 22px;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-3);
  transition: color var(--t-fast);
}
.wa-emoji-btn:hover { color: var(--text-2); }
.wa-input {
  flex: 1;
  background: var(--wa-input);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: 9px 16px;
  font-size: 14px;
  color: var(--text-1);
  outline: none;
  transition: border-color var(--t-fast);
}
.wa-input::placeholder { color: var(--text-3); }
.wa-input:focus { border-color: var(--wa-green-dk); }
.wa-send-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--wa-green);
  color: #000;
  display: grid; place-items: center;
  transition: all var(--t-fast);
  flex-shrink: 0;
}
.wa-send-btn:hover { background: hsl(142, 70%, 42%); transform: scale(1.05); }
.wa-send-btn:active { transform: scale(0.95); }

/* ══════════════════════════════════════════════════════════════════════════
   ADMIN DASHBOARD — Right Panel
   ══════════════════════════════════════════════════════════════════════════ */

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s4) var(--s6);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.dash-title { font-size: 18px; font-weight: 700; }
.dash-meta  { display: flex; align-items: center; gap: var(--s3); font-size: 12px; color: var(--text-3); }
.live-indicator {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--green);
}
.live-indicator span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 1.5s infinite;
}

/* Tabs */
.tabs {
  display: flex;
  padding: 0 var(--s4);
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  flex-shrink: 0;
  gap: 0;
  overflow-x: auto;
}
.tabs::-webkit-scrollbar { height: 0; }
.tab {
  padding: var(--s3) var(--s4);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all var(--t-fast);
}
.tab:hover { color: var(--text-2); }
.tab--active { color: var(--wa-green); border-bottom-color: var(--wa-green); font-weight: 600; }

/* Tab Panels */
.tab-panel { flex: 1; overflow-y: auto; padding: var(--s4) var(--s6); display: flex; flex-direction: column; gap: var(--s4); }
.tab-panel--active { display: flex; }
.tab-hint { font-size: 12px; color: var(--text-3); background: var(--bg-elevated); padding: var(--s3) var(--s4); border-radius: var(--r-md); border: 1px solid var(--border); }

/* ── Stats Grid ──────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--s3);
}
.stat-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid hsla(0, 0%, 100%, 0.06);
  border-radius: var(--r-xl);
  padding: var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  transition: all var(--t-mid);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-color, transparent) 0%, transparent 60%);
  opacity: .08;
  pointer-events: none;
}
.stat-card:hover { border-color: var(--border-lt); transform: translateY(-2px); box-shadow: var(--sh-md); }
.stat-icon  { font-size: 20px; }
.stat-value { font-size: 26px; font-weight: 800; line-height: 1; color: var(--text-1); }
.stat-label { font-size: 11px; font-weight: 500; color: var(--text-3); letter-spacing: .5px; text-transform: uppercase; }
.stat-card--green  { --accent-color: var(--green); }
.stat-card--blue   { --accent-color: var(--blue);  }
.stat-card--amber  { --accent-color: var(--amber); }
.stat-card--red    { --accent-color: var(--red);   }
.stat-card--purple { --accent-color: var(--purple);}
.stat-card--teal   { --accent-color: var(--teal);  }

/* ── Sessions List ───────────────────────────────────────────────────────── */
.section-title { font-size: 12px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--text-3); }
.sessions-list { display: flex; flex-direction: column; gap: var(--s2); }
.session-card {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid hsla(0, 0%, 100%, 0.04);
  border-radius: var(--r-lg);
  font-size: 13px;
}
.session-phone { color: var(--text-2); font-family: 'JetBrains Mono', monospace; font-size: 12px; flex: 1; }
.session-state-badge {
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
}
.badge-GREETING       { background: hsla(0,0%,60%,.15); color: hsl(0,0%,65%); }
.badge-BROWSING       { background: hsla(217,91%,62%,.15); color: var(--blue); }
.badge-CART           { background: hsla(38,92%,50%,.15); color: var(--amber); }
.badge-CHECKOUT_INFO,
.badge-CHECKOUT_PAYMENT { background: hsla(265,80%,65%,.15); color: var(--purple); }
.badge-ORDERED        { background: hsla(142,71%,45%,.15); color: var(--green); }
.session-cart  { font-size: 11px; color: var(--text-3); }

/* ── Orders List ─────────────────────────────────────────────────────────── */
.panel-toolbar { display: flex; gap: var(--s2); align-items: center; flex-shrink: 0; }
.search-input, .filter-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-1);
  outline: none;
  transition: border-color var(--t-fast);
}
.search-input { flex: 1; }
.search-input:focus, .filter-select:focus { border-color: var(--wa-green-dk); }
.filter-select { padding-right: 24px; }
.filter-select option { background: var(--bg-elevated); }

.orders-list { display: flex; flex-direction: column; gap: var(--s3); }
.order-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all var(--t-mid);
}
.order-card:hover { border-color: var(--border-lt); box-shadow: var(--sh-sm); }
.order-card-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--border);
}
.order-id    { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; color: var(--text-1); flex: 1; }
.order-status-badge {
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.st-pending   { background: hsla(38,92%,50%,.15);  color: var(--amber);  }
.st-assigned  { background: hsla(217,91%,62%,.15); color: var(--blue);   }
.st-broadcast { background: hsla(265,80%,65%,.15); color: var(--purple); }
.st-en_route  { background: hsla(187,80%,50%,.15); color: var(--teal);   }
.st-delivered { background: hsla(142,71%,45%,.15); color: var(--green);  }
.st-failed    { background: hsla(0,84%,60%,.15);   color: var(--red);    }

.order-card-body  { padding: var(--s3) var(--s4); display: flex; flex-direction: column; gap: var(--s1); }
.order-customer   { font-size: 14px; font-weight: 600; }
.order-address    { font-size: 12px; color: var(--text-3); }
.order-amount     { font-size: 13px; color: var(--wa-green); font-weight: 700; }
.order-items-preview { font-size: 11px; color: var(--text-3); }
.order-card-foot  { display: flex; gap: var(--s2); padding: var(--s2) var(--s4); border-top: 1px solid var(--border); background: hsla(210,14%,8%,.5); }
.order-action-btn {
  flex: 1;
  padding: 6px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--r-sm);
  background: var(--bg-overlay);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: all var(--t-fast);
}
.order-action-btn:hover { background: var(--bg-elevated); color: var(--text-1); }
.order-action-btn--green { background: hsla(142,70%,49%,.15); color: var(--green); border-color: hsla(142,70%,49%,.3); }
.order-action-btn--green:hover { background: hsla(142,70%,49%,.25); }

/* ── Drivers List ────────────────────────────────────────────────────────── */
.drivers-list { display: flex; flex-direction: column; gap: var(--s3); }
.driver-card {
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: var(--s4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: all var(--t-mid);
}
.driver-card:hover { border-color: var(--border-lt); }
.driver-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--bg-overlay);
  display: grid; place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.driver-info { flex: 1; min-width: 0; }
.driver-name { font-size: 14px; font-weight: 600; }
.driver-meta { font-size: 12px; color: var(--text-3); }
.driver-status {
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
}
.ds-online  { background: hsla(142,71%,45%,.15); color: var(--green); }
.ds-offline { background: hsla(0,84%,60%,.1);   color: var(--text-4); }
.driver-stat { font-size: 12px; color: var(--text-3); text-align: right; }

/* ── AI Inspector ────────────────────────────────────────────────────────── */
.ai-inspector { display: flex; flex-direction: column; gap: var(--s4); }
.ai-inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--text-3);
}
.ai-model-badge {
  padding: 3px 8px;
  background: hsla(265,80%,65%,.15);
  color: var(--purple);
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
}
.code-block {
  background: hsl(210, 14%, 9%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s4);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: hsl(142, 60%, 75%);
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
  flex-shrink: 0;
}
.session-states { display: flex; flex-direction: column; gap: var(--s2); }

/* ── Empty State ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--s12) var(--s8);
  font-size: 13px;
  color: var(--text-4);
}

/* ══════════════════════════════════════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  padding: 0;
  animation: backdrop-in var(--t-slow) both;
}
.modal-backdrop[hidden] { display: none; }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-lt);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  padding: var(--s6);
  width: 100%;
  max-width: 480px;
  position: relative;
  animation: modal-slide-up var(--t-slow) both;
  max-height: 90dvh;
  overflow-y: auto;
}
.modal--sm { max-width: 420px; }
@keyframes modal-slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal-close {
  position: absolute;
  top: var(--s4);
  right: var(--s4);
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-overlay);
  color: var(--text-3);
  display: grid; place-items: center;
  font-size: 14px;
  transition: all var(--t-fast);
}
.modal-close:hover { background: var(--bg-elevated); color: var(--text-1); }

.modal-header { text-align: center; margin-bottom: var(--s5); }
.modal-icon   { font-size: 40px; margin-bottom: var(--s2); }
.modal-title  { font-size: 20px; font-weight: 700; }
.modal-sub    { font-size: 13px; color: var(--text-3); margin-top: var(--s1); }

/* Form */
.modal-form  { display: flex; flex-direction: column; gap: var(--s4); }
.form-group  { display: flex; flex-direction: column; gap: var(--s1); }
.form-label  { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: .3px; }
.form-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-1);
  outline: none;
  transition: border-color var(--t-fast);
  resize: vertical;
}
.form-input::placeholder { color: var(--text-4); }
.form-input:focus { border-color: var(--wa-green-dk); }
.form-textarea { min-height: 64px; }

/* Buttons */
.btn {
  padding: 12px 24px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--t-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
}
.btn--full    { width: 100%; }
.btn--primary { background: var(--wa-green); color: #000; }
.btn--primary:hover { background: hsl(142, 70%, 42%); }
.btn--ghost   { background: transparent; color: var(--text-3); border: 1px solid var(--border); }
.btn--ghost:hover { color: var(--text-2); border-color: var(--border-lt); }

/* Payment Cards */
.payment-options { display: flex; flex-direction: column; gap: var(--s3); margin-bottom: var(--s4); }
.payment-card {
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: var(--s4);
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  text-align: left;
  transition: all var(--t-mid);
  position: relative;
}
.payment-card:hover { border-color: var(--wa-green-dk); background: var(--bg-overlay); }
.payment-card.selected { border-color: var(--wa-green); background: var(--wa-sent); }
.payment-icon { font-size: 28px; flex-shrink: 0; }
.payment-info { flex: 1; }
.payment-name { font-size: 15px; font-weight: 700; color: var(--text-1); }
.payment-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.payment-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-lt);
  color: var(--bg-elevated);
  display: grid; place-items: center;
  font-size: 12px;
  font-weight: 800;
  transition: all var(--t-fast);
}
.payment-card.selected .payment-check { background: var(--wa-green); border-color: var(--wa-green); color: #000; }

/* Dispatch Modal */
.dispatch-options { display: flex; flex-direction: column; gap: var(--s3); margin-bottom: var(--s4); }
.dispatch-btn {
  display: flex; align-items: center; gap: var(--s4);
  padding: var(--s4);
  background: hsla(265,80%,65%,.1);
  border: 1px solid hsla(265,80%,65%,.3);
  border-radius: var(--r-lg);
  text-align: left;
  transition: all var(--t-mid);
}
.dispatch-btn:hover { background: hsla(265,80%,65%,.2); }
.dispatch-icon { font-size: 24px; }
.dispatch-name { font-size: 14px; font-weight: 700; color: var(--text-1); }
.dispatch-desc { font-size: 12px; color: var(--text-3); }
.dispatch-divider { text-align: center; font-size: 11px; color: var(--text-4); padding: var(--s1) 0; }

.driver-picker { display: flex; flex-direction: column; gap: var(--s2); }
.driver-pick-btn {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-align: left;
  font-size: 13px;
  transition: all var(--t-fast);
}
.driver-pick-btn:hover:not(:disabled) { border-color: var(--wa-green-dk); background: var(--wa-sent); }
.driver-pick-btn:disabled { opacity: .4; cursor: not-allowed; }
.dpb-name   { font-weight: 600; color: var(--text-1); flex: 1; }
.dpb-status { font-size: 11px; }
.dpb-status.online  { color: var(--green); }
.dpb-status.offline { color: var(--text-4); }

/* ══════════════════════════════════════════════════════════════════════════
   PREMIUM WIDGETS (BOTTOM SHEET, CAROUSEL)
   ══════════════════════════════════════════════════════════════════════════ */

/* ── CATEGORY CAROUSEL ───────────────────────────────────────────────────── */
.category-carousel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s2);
  padding: var(--s2);
  background: var(--bg-surface);
  border-radius: var(--r-md);
  margin-top: var(--s1);
  box-shadow: var(--sh-sm);
  max-width: 100%;
}
.category-carousel::-webkit-scrollbar { display: none; }

.cat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s1);
  padding: var(--s2) var(--s1);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all 0.2s ease;
}
.cat-chip:hover {
  background: var(--bg-hover);
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: var(--sh-sm);
}
.cat-chip-emoji {
  font-size: 24px;
}
.cat-chip-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  text-align: center;
}

/* ── BOTTOM SHEET ────────────────────────────────────────────────────────── */
.sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: flex-end;
  animation: fadeIn 0.2s ease;
}
.sheet-overlay[hidden] { display: none; }

.bottom-sheet {
  width: 100%;
  background: var(--bg-surface);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.4);
  padding-bottom: var(--s6);
  position: relative;
  animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet-drag-handle {
  width: 40px;
  height: 4px;
  background: var(--border-lt);
  border-radius: var(--r-sm);
  margin: var(--s3) auto;
}
.sheet-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg-hover);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.sheet-close:hover {
  background: var(--bg-highlight);
  color: var(--text-1);
}

.sheet-image {
  width: 100%;
  height: 240px;
  background: var(--bg-surface);
  margin-bottom: var(--s4);
  position: relative;
  overflow: hidden;
}
.sheet-image-carousel {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.sheet-image-carousel::-webkit-scrollbar { display: none; }
.sheet-carousel-slide {
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
  background: linear-gradient(135deg, var(--bg-hover), var(--bg-surface));
}
.sheet-carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.sheet-carousel-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.4);
  transition: all 0.3s ease;
}
.sheet-carousel-dots .dot.active {
  background: var(--text-1);
  width: 16px;
}

/* ── RELATED PRODUCTS ────────────────────────────────────────────────────── */
.related-section {
  padding-top: var(--s2);
  border-top: 1px solid var(--border);
  margin-bottom: var(--s4);
}
.related-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: var(--s3);
}
.related-carousel {
  display: flex;
  overflow-x: auto;
  gap: var(--s3);
  scrollbar-width: none;
  padding-bottom: var(--s2);
}
.related-carousel::-webkit-scrollbar { display: none; }
.related-card {
  flex: 0 0 140px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s3);
  cursor: pointer;
  transition: all 0.2s ease;
}
.related-card:hover {
  border-color: var(--brand);
  background: var(--bg-hover);
}
.related-card-emoji {
  font-size: 24px;
  margin-bottom: var(--s2);
}
.related-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.related-card-price {
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
}
.sheet-content {
  padding: 0 var(--s5);
}
.sheet-category {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-3);
  margin-bottom: var(--s1);
}
.sheet-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: var(--s2);
  line-height: 1.2;
}
.sheet-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: var(--s4);
}
.sheet-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--green);
  margin-bottom: var(--s5);
}

/* ── QUANTITY SELECTOR ───────────────────────────────────────────────────── */
.quantity-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--s4);
  border-top: 1px solid var(--border);
  margin-bottom: var(--s5);
}
.qty-label {
  font-weight: 600;
  color: var(--text-1);
}
.quantity-selector {
  display: flex;
  align-items: center;
  background: var(--bg-hover);
  border-radius: 20px;
  padding: 4px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}
.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-1);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sh-sm);
  transition: all 0.2s ease;
}
.qty-btn:hover {
  background: var(--bg-elevated);
}
.qty-value {
  width: 40px;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--text-1);
}
.sheet-footer {
  padding: 0 var(--s5);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════════════════════
   LOADING / ANIMATIONS
   ══════════════════════════════════════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-overlay) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ══════════════════════════════════════════════════════════════════════════
   WHATSAPP FLOW COMPONENTS
   ══════════════════════════════════════════════════════════════════════════ */
.flow-screen-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-surface);
  z-index: 200;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.flow-screen-overlay[hidden] {
  display: none !important;
}

.flow-header {
  display: flex;
  align-items: center;
  padding: var(--s4);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}
.flow-header-title {
  flex: 1;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
}
.flow-close {
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 20px;
  cursor: pointer;
}

.flow-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--s5);
  background: var(--bg-base);
}

/* TextHeading / TextSubheading */
.flow-heading { font-size: 20px; font-weight: 700; color: var(--text-1); margin-bottom: var(--s2); }
.flow-subheading { font-size: 14px; font-weight: 500; color: var(--text-2); margin-bottom: var(--s5); }

/* TextInput / TextArea */
.flow-input-group { margin-bottom: var(--s5); }
.flow-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: var(--s2);
}
.flow-input {
  width: 100%;
  padding: var(--s3) var(--s4);
  background: var(--bg-surface);
  border: 1px solid var(--border-lt);
  border-radius: var(--r-md);
  color: var(--text-1);
  font-family: inherit;
  font-size: 15px;
  transition: all 0.2s ease;
}
.flow-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}
.flow-input::placeholder { color: var(--text-3); }

/* RadioButtonsGroup */
.flow-radio-group { margin-bottom: var(--s5); }
.flow-radio-item {
  display: flex;
  align-items: center;
  padding: var(--s4);
  background: var(--bg-surface);
  border: 1px solid var(--border-lt);
  border-radius: var(--r-md);
  margin-bottom: var(--s3);
  cursor: pointer;
  transition: all 0.2s ease;
}
.flow-radio-item:last-child { margin-bottom: 0; }
.flow-radio-item:hover { background: var(--bg-hover); }
.flow-radio-item.selected {
  border-color: var(--brand);
  background: rgba(37, 211, 102, 0.05);
}
.flow-radio-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--text-3);
  margin-right: var(--s3);
  position: relative;
  transition: all 0.2s ease;
}
.flow-radio-item.selected .flow-radio-circle {
  border-color: var(--brand);
}
.flow-radio-item.selected .flow-radio-circle::after {
  content: '';
  position: absolute;
  top: 4px; left: 4px; right: 4px; bottom: 4px;
  background: var(--brand);
  border-radius: 50%;
}
.flow-radio-text { flex: 1; }
.flow-radio-title { font-size: 15px; font-weight: 600; color: var(--text-1); margin-bottom: 2px; }
.flow-radio-desc { font-size: 13px; color: var(--text-2); }

/* OptIn / Checkbox */
.flow-checkbox-group {
  display: flex;
  align-items: flex-start;
  margin-bottom: var(--s5);
  cursor: pointer;
}
.flow-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-lt);
  border-radius: 4px;
  margin-right: var(--s3);
  margin-top: 2px;
  position: relative;
  transition: all 0.2s ease;
}
.flow-checkbox.checked {
  background: var(--brand);
  border-color: var(--brand);
}
.flow-checkbox.checked::after {
  content: '';
  position: absolute;
  top: 2px; left: 6px;
  width: 5px; height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.flow-checkbox-text { font-size: 13px; color: var(--text-2); line-height: 1.5; }

/* Footer */
.flow-footer {
  padding: var(--s4) var(--s5);
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}


/* ══════════════════════════════════════════════════════════════════════════
   NATIVE CATALOG AND CART OVERLAYS
   ══════════════════════════════════════════════════════════════════════════ */
.native-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-surface);
  z-index: 150;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.native-overlay[hidden] {
  display: none !important;
}

.native-header {
  display: flex;
  align-items: center;
  padding: var(--s4);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-lt);
}
.native-back {
  background: none;
  border: none;
  color: var(--brand);
  font-size: 20px;
  cursor: pointer;
  margin-right: var(--s3);
}
.native-title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
}
.native-cart-btn {
  background: none;
  border: none;
  font-size: 22px;
  position: relative;
  cursor: pointer;
}
.cart-badge {
  position: absolute;
  top: -4px; right: -8px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
}

.native-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--s4);
  background: var(--bg-surface);
}

/* Catalog Grid */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--s4);
}
.catalog-item {
  border: 1px solid var(--border-lt);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  background: var(--bg-surface);
}
.catalog-item-img {
  background: var(--bg-hover);
  height: 120px;
  display: grid;
  place-items: center;
  font-size: 48px;
}
.catalog-item-info {
  padding: var(--s3);
  flex: 1;
  display: flex;
  flex-direction: column;
}
.catalog-item-title {
  font-size: 13px;
  color: var(--text-1);
  font-weight: 500;
  margin-bottom: var(--s1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.catalog-item-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  margin-top: auto;
}
.catalog-item-add {
  border: 1px solid var(--border-lt);
  background: none;
  border-radius: 50%;
  width: 28px; height: 28px;
  color: var(--brand);
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
  align-self: flex-end;
  margin-top: -24px;
}

/* PDP details */
.pdp-image-container {
  background: var(--bg-hover);
  border-radius: var(--r-lg);
  margin-bottom: var(--s4);
}
.pdp-details {
  padding: var(--s2) 0;
}
.pdp-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: var(--s2);
}
.pdp-price {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: var(--s4);
}
.pdp-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
}

/* Native Footer */
.native-footer {
  padding: var(--s4);
  border-top: 1px solid var(--border-lt);
  background: var(--bg-surface);
}

/* Cart Item List */
.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}
.cart-item-row {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  padding: var(--s3);
  border-radius: var(--r-md);
  border: 1px solid var(--border-lt);
}
.cart-item-emoji {
  font-size: 24px;
  width: 40px; height: 40px;
  background: var(--bg-hover);
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  margin-right: var(--s3);
}
.cart-item-details { flex: 1; }
.cart-item-title { font-size: 14px; font-weight: 600; color: var(--text-1); }
.cart-item-price { font-size: 13px; color: var(--text-2); }
.cart-item-qty { font-size: 14px; font-weight: 600; color: var(--text-1); padding: 0 var(--s2); }

.cart-footer {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
}

/* Message Bubble for Catalog */
.catalog-message {
  background: var(--bg-surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border-lt);
  margin-top: var(--s2);
}
.catalog-msg-img {
  height: 120px;
  background: var(--bg-hover);
  display: grid; place-items: center;
}
.catalog-msg-info {
  padding: var(--s3);
}
.catalog-msg-title { font-weight: 600; font-size: 15px; color: var(--text-1); margin-bottom: 2px; }
.catalog-msg-desc { font-size: 13px; color: var(--text-2); }
.catalog-msg-btn {
  display: block; width: 100%;
  border: none; border-top: 1px solid var(--border-lt);
  background: none;
  padding: var(--s3);
  color: var(--brand);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-align: center;
}
.catalog-msg-btn:hover { background: var(--bg-hover); }

/* ── Responsive tweaks ───────────────────────────────────────────────────── */
@media (max-width: 900px) {
  /* Transform from Dashboard to true Standalone App on mobile */
  .topbar { display: none !important; }
  .panel--right { display: none !important; }
  
  .layout { 
    display: flex; 
    flex-direction: column;
    height: 100dvh; 
    padding: 0; 
  }
  
  .panel--left { 
    height: 100dvh; 
    flex: 1;
    border: none;
  }
}
