/* web/css/components.css — S.P. Auto Dealers Light Theme UI Components */

/* ─── Layout Shell ─────────────────────────────────────────────────────────── */
.app-container {
  display: flex;
  height: 100%;
  max-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
  background-color: var(--bg-app);
}

/* ─── Left Sidebar ─────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--sp-4) var(--sp-3);
  z-index: 40;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              min-width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.2s ease;
  overflow-x: hidden;
  overflow-y: hidden;
}

/* Desktop Collapsed state */
.sidebar.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  border-right: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden;
}

/* Mobile Sidebar Backdrop Overlay */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 35;
}

.sidebar-backdrop.active {
  display: block;
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 280px;
    min-width: 280px;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
    visibility: visible;
  }
  .sidebar.open {
    transform: translateX(0);
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
  }
}

/* Sidebar Brand Logo */
.brand-wrap {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--sp-5);
  padding: 0 var(--sp-2);
}

.brand-logo-img {
  max-width: 165px;
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  transition: opacity 0.15s ease;
}

.brand-logo-img:hover {
  opacity: 0.92;
}

.brand-logo-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.brand-red-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--brand-red);
  color: var(--brand-red);
  font-weight: 800;
  font-size: 15px;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 4px;
  letter-spacing: -0.5px;
}

.brand-name {
  font-size: 21px;
  font-weight: 800;
  color: var(--slate-900);
  display: inline-flex;
  align-items: center;
  letter-spacing: -0.5px;
}

.brand-wheel,
.brand-wheel-svg {
  display: inline-flex;
  align-items: center;
  margin-left: 3px;
  color: var(--slate-700);
}


.brand-sub {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--primary-700);
  margin-top: 4px;
}

/* Sidebar Action Buttons */
.sidebar-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  width: 100%;
  padding: 10px 16px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-new-chat {
  background-color: #f0f7ff;
  border-color: #bae6fd;
  color: #0284c7;
}

.btn-new-chat:hover {
  background-color: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
}

.btn-back-chat {
  background-color: var(--bg-card);
  border-color: var(--border-light);
  color: var(--slate-700);
}

.btn-back-chat:hover {
  background-color: var(--slate-100);
  color: var(--slate-900);
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--slate-400);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Sidebar Recent Chats Section (ChatGPT Style) */
.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--sp-4) var(--sp-1) var(--sp-2) var(--sp-1);
}

.clear-all-sessions-btn {
  background: none;
  border: none;
  color: var(--slate-400);
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.clear-all-sessions-btn:hover {
  color: #ef4444;
  background-color: #fee2e2;
}

.chat-sessions-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 240px);
  padding-right: 2px;
}

.chat-sessions-list::-webkit-scrollbar {
  width: 4px;
}
.chat-sessions-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.chat-session-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-600);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  border: 1px solid transparent;
}

.chat-session-item:hover {
  background-color: var(--slate-100);
  color: var(--slate-900);
}

.chat-session-item.active {
  background-color: #eff6ff;
  border-color: #bfdbfe;
  color: #0284c7;
  font-weight: 600;
}

.chat-session-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  flex-shrink: 0;
}

.chat-session-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  line-height: 1.2;
}

.chat-session-delete {
  opacity: 0.65;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--slate-500);
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.chat-session-item:hover .chat-session-delete,
.chat-session-item.active .chat-session-delete {
  opacity: 1;
  color: var(--slate-700);
}

.chat-session-delete:hover {
  color: #dc2626 !important;
  background-color: #fee2e2;
  transform: scale(1.1);
}

.no-sessions-hint {
  font-size: 12px;
  color: var(--slate-400);
  padding: 12px 8px;
  text-align: center;
  font-style: italic;
}

.sidebar-nav-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--slate-600);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-nav-item:hover {
  background-color: var(--slate-100);
  color: var(--slate-900);
}

.sidebar-nav-item.active {
  background-color: var(--primary-600);
  color: #ffffff;
}

.sidebar-nav-item .badge-count {
  background-color: rgba(255, 255, 255, 0.25);
  color: inherit;
  font-size: 12px;
  padding: 1px 7px;
  border-radius: var(--r-pill);
}

.sidebar-nav-item:not(.active) .badge-count {
  background-color: var(--slate-200);
  color: var(--slate-700);
}

/* Sidebar Spacer */
.sidebar-spacer {
  flex: 1;
}

/* Bottom Party Card Badge */
.party-badge-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background-color: var(--party-bg);
  border: 1px solid var(--party-border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.party-badge-card:hover {
  border-color: #6ee7b7;
  box-shadow: var(--shadow-xs);
}

.party-badge-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: var(--r-sm);
  background-color: #d1fae5;
  color: var(--party-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.party-badge-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.party-badge-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--party-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.party-badge-sub {
  font-size: 11px;
  color: var(--party-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Main Content Shell ───────────────────────────────────────────────────── */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  position: relative;
  background-color: var(--bg-app);
}

/* ─── Top Header Bar ───────────────────────────────────────────────────────── */
.topbar {
  height: var(--header-h);
  min-height: var(--header-h);
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-5);
  z-index: 20;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.hamburger-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--slate-600);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hamburger-btn:hover {
  background-color: var(--slate-100);
  color: var(--slate-900);
}

.live-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 2px #d1fae5;
}

.header-title-box {
  display: flex;
  flex-direction: column;
}

.header-main-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--slate-900);
  line-height: 1.2;
}

.header-sub-title {
  font-size: 12px;
  color: var(--slate-500);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* Pill / Outline Buttons */
.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border-light);
  background-color: #ffffff;
  color: var(--slate-700);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-pill:hover {
  background-color: var(--slate-100);
  border-color: var(--slate-300);
  color: var(--slate-900);
}

.btn-pill-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
  background-color: #ffffff;
  color: var(--slate-700);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-pill-icon:hover {
  background-color: var(--slate-100);
  color: var(--slate-900);
}

.cart-icon-btn {
  position: relative;
}

.cart-badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: var(--primary-600);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
}

/* ─── Chat Flow & Messages Area ────────────────────────────────────────────── */
.chat-scroll-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--sp-4) var(--sp-4);
  display: flex;
  flex-direction: column;
  width: 100%;
}

.chat-inner-container {
  width: 100%;
  max-width: 100% !important;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  flex: 1;
  min-height: 100%;
}

/* Centered Welcome Card (Hero) */
.welcome-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 16px 12px 16px;
  margin: auto 0;
  width: 100%;
  max-width: 100%;
}

.welcome-icon-box {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 28px;
  box-shadow: 0 8px 20px -4px rgba(37, 99, 235, 0.3);
  margin-bottom: var(--sp-3);
}

.welcome-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--slate-900);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.welcome-description {
  max-width: 600px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--slate-600);
  margin-bottom: var(--sp-4);
}

/* Quick Suggestion Chips */
.suggestion-chips-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-2);
  max-width: 660px;
}

.suggestion-chip {
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--slate-700);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-xs);
}

.suggestion-chip:hover {
  background-color: var(--slate-100);
  border-color: var(--slate-300);
  color: var(--primary-700);
  transform: translateY(-1px);
}

/* Chat Message Bubbles */
.message-row {
  display: flex;
  width: 100%;
  margin-bottom: var(--sp-3);
}

.message-row.user {
  justify-content: flex-end;
}

.message-row.bot {
  justify-content: flex-start;
  align-items: flex-start;
  gap: var(--sp-3);
}

.bot-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 8px;
  background-color: var(--slate-900);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-bubble {
  max-width: 80%;
  padding: 12px 18px;
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  border-radius: 18px 18px 4px 18px;
  font-size: 14.5px;
  line-height: 1.5;
  box-shadow: var(--shadow-xs);
  word-break: break-word;
}

.bot-bubble {
  max-width: 88%;
  padding: 16px 20px;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--slate-800);
  border-radius: 4px 18px 18px 18px;
  font-size: 14.5px;
  line-height: 1.6;
  box-shadow: var(--shadow-xs);
  word-break: break-word;
}

.bot-bubble p {
  margin-bottom: 8px;
}
.bot-bubble p:last-child {
  margin-bottom: 0;
}

.bot-bubble-list {
  margin: 6px 0 10px 0;
  padding-left: 22px;
  list-style-type: disc;
}
.bot-bubble-list:last-child {
  margin-bottom: 0;
}
.bot-bubble-list li {
  margin-bottom: 5px;
  line-height: 1.55;
  color: var(--slate-800);
}
.bot-bubble-list li:last-child {
  margin-bottom: 0;
}
.bot-bubble-list li strong {
  color: var(--slate-900);
  font-weight: 600;
}
ol.bot-bubble-list {
  list-style-type: decimal;
}

/* Typing Indicator */
.typing-dots {
  display: inline-flex;
  gap: 4px;
  padding: 4px 8px;
}
.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--slate-400);
  animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Parts Scrollable Card Container */
.parts-scroll-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  padding: 12px;
  margin-top: 10px;
  box-shadow: var(--shadow-xs);
  width: 100%;
}

.parts-scroll-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}

.parts-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.parts-search-icon {
  position: absolute;
  left: 11px;
  color: var(--slate-400);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.parts-search-input {
  width: 100%;
  padding: 8px 34px 8px 34px;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-900);
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.parts-search-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
  font-size: 12.5px;
}

.parts-search-input:focus {
  background: #ffffff;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.parts-search-clear {
  position: absolute;
  right: 10px;
  background: #f1f5f9;
  border: none;
  color: var(--slate-500);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.parts-search-clear:hover {
  color: #ffffff;
  background: var(--slate-600);
}

.parts-empty-state {
  text-align: center;
  padding: 24px 12px;
  color: var(--slate-500);
  font-size: 12.5px;
}

.parts-scroll-status {
  text-align: center;
  font-size: 11.5px;
  color: var(--slate-500);
  padding: 8px 0 2px 0;
  border-top: 1px dashed #e2e8f0;
  margin-top: 6px;
}

.parts-scroll-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--slate-800);
}

.parts-scroll-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-700);
  background: var(--primary-50);
  padding: 2px 8px;
  border-radius: 10px;
}

.parts-scroll-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.parts-scroll-list::-webkit-scrollbar {
  width: 6px;
}

.parts-scroll-list::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.parts-scroll-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.parts-scroll-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.parts-load-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 14px;
  margin-top: 10px;
  background: var(--slate-50);
  border: 1px dashed var(--slate-300);
  border-radius: var(--r-sm);
  color: var(--primary-700);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.parts-load-more-btn:hover {
  background: var(--primary-50);
  border-color: var(--primary-400);
}

/* Part Result Cards */
.part-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-top: 8px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.part-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.part-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--slate-900);
}

.part-brand {
  font-size: 12px;
  color: var(--slate-500);
  margin-top: 2px;
}

.part-number-badge {
  font-family: monospace;
  font-size: 12px;
  padding: 2px 7px;
  background-color: var(--slate-100);
  border-radius: var(--r-sm);
  color: var(--slate-700);
}

.part-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.part-price-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--slate-900);
}

.btn-add-order {
  padding: 6px 12px;
  border-radius: var(--r-sm);
  background-color: var(--primary-600);
  color: #ffffff;
  border: none;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-add-order:hover {
  background-color: var(--primary-700);
}

/* ─── Brand List UI (Row layout for range/brands overview) ─────────────────── */
.brand-list-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  width: 100%;
}

.brand-list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.brand-list-row:hover {
  background: #f8fafc;
  border-color: var(--primary-400);
  transform: translateX(2px);
  box-shadow: var(--shadow-sm);
}

.brand-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.brand-row-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--slate-100);
  color: var(--slate-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.brand-list-row:hover .brand-row-icon {
  background: var(--primary-50);
  color: var(--primary-700);
}

.brand-row-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

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

.brand-row-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--slate-900);
  letter-spacing: -0.2px;
}

.brand-row-sub {
  font-size: 11.5px;
  color: var(--slate-500);
  line-height: 1.3;
}

.brand-row-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 12px;
}

.brand-row-count {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary-700);
  background: var(--primary-50);
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid var(--primary-100);
}

.brand-row-arrow {
  color: var(--slate-400);
  font-size: 16px;
  line-height: 1;
  transition: transform 0.15s ease, color 0.15s ease;
}

.brand-list-row:hover .brand-row-arrow {
  color: var(--primary-600);
  transform: translateX(2px);
}

.brand-expand-wrap {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.brand-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary-700);
  background: #ffffff;
  border: 1px solid var(--primary-200);
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
}

.brand-expand-btn:hover {
  background: var(--primary-50);
  border-color: var(--primary-400);
  color: var(--primary-800);
}

/* ─── Bottom Chat Input Area ───────────────────────────────────────────────── */
.chat-bottom-wrapper {
  background: var(--bg-app);
  padding: 0 var(--sp-4) var(--sp-3) var(--sp-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  z-index: 20;
}

.chat-input-pill-box {
  width: 60%;
  min-width: 320px;
  max-width: 960px;
  margin: 0 auto;
  background-color: var(--bg-input-bar);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 8px 12px 8px 18px;
  gap: 4px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

@media (max-width: 768px) {
  .chat-input-pill-box {
    width: 100%;
    min-width: 0;
    padding: 6px 10px 6px 14px;
  }
}

.chat-input-main-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
}

/* ─── ChatGPT-Style Clean Image Attachment Preview ────────────────────────── */
.chat-attachment-container {
  display: flex;
  align-items: flex-start;
  padding: 4px 0 6px 2px;
  animation: attachFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes attachFadeIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.attachment-thumb-wrap {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 13px;
  overflow: visible;
  display: inline-block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.attachment-thumb-img {
  width: 62px;
  height: 62px;
  object-fit: cover;
  border-radius: 13px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: block;
  background-color: #f1f5f9;
}

.attachment-spinner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 13px;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: opacity 0.2s ease;
}

.chatgpt-spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: chatgptSpin 0.75s linear infinite;
}

@keyframes chatgptSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.attachment-remove-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1e293b;
  color: #ffffff;
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  z-index: 10;
  padding: 0;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.attachment-remove-btn:hover {
  background-color: #ef4444;
  transform: scale(1.15);
}

.chat-input-pill-box:focus-within {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.chat-textarea {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14.5px;
  color: var(--slate-900);
  resize: none;
  line-height: 1.4;
  max-height: 120px;
  padding: 6px 0;
}

.chat-textarea::placeholder {
  color: var(--slate-400);
}

.input-icon-btn {
  background: none;
  border: none;
  color: var(--slate-400);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.input-icon-btn:hover {
  color: var(--slate-700);
  background-color: var(--slate-100);
}

.btn-send-pill {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background-color: var(--primary-600);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-send-pill:hover:not(:disabled) {
  background-color: var(--primary-700);
  transform: scale(1.05);
}

.btn-send-pill:disabled {
  background-color: var(--slate-200);
  color: var(--slate-400);
  cursor: not-allowed;
}

.chat-footer-note {
  font-size: 11.5px;
  color: var(--slate-400);
  margin-top: 8px;
  text-align: center;
}

/* ─── Customer Orders & Dispatch Page (Screenshot 3 Style) ─────────────────── */
.orders-page-container {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-6) var(--sp-8);
}

.orders-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-5);
}

.orders-title-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.orders-main-heading {
  font-size: 22px;
  font-weight: 800;
  color: var(--slate-900);
}

.badge-pill-counter {
  background-color: #dbeafe;
  color: #1d4ed8;
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--r-pill);
}

.orders-header-actions {
  display: flex;
  gap: var(--sp-2);
}

/* Orders Filter Bar */
.orders-filter-bar {
  display: flex;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.search-input-pill {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--r-pill);
  padding: 8px 16px;
  box-shadow: var(--shadow-xs);
}

.search-input-pill input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13.5px;
  color: var(--slate-800);
}

.date-select-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--r-pill);
  padding: 8px 16px;
  font-size: 13px;
  color: var(--slate-700);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
}

.date-select-pill select {
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: var(--slate-700);
  cursor: pointer;
}

/* Status Filter Tabs (Pills) */
.status-tabs-row {
  display: flex;
  gap: 8px;
  margin-bottom: var(--sp-6);
  overflow-x: auto;
  padding-bottom: 4px;
}

.status-tab-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--slate-600);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.status-tab-pill:hover {
  background-color: var(--slate-100);
}

.status-tab-pill.active {
  background-color: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.status-dot-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dot-all { background-color: var(--slate-500); }
.dot-pending { background-color: var(--status-pending); }
.dot-confirmed { background-color: var(--status-confirmed); }
.dot-packed { background-color: var(--status-packed); }
.dot-shipped { background-color: var(--status-shipped); }
.dot-delivered { background-color: var(--status-delivered); }
.dot-cancelled { background-color: var(--status-cancelled); }

/* Order Card (Screenshot 3 Design) */
.order-card {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: var(--sp-4);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.order-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.order-card-id-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.order-card-num {
  font-size: 15px;
  font-weight: 800;
  color: var(--slate-900);
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-pending   { background-color: var(--status-pending-bg); color: var(--status-pending-tx); }
.badge-confirmed { background-color: var(--status-confirmed-bg); color: var(--status-confirmed-tx); }
.badge-packed    { background-color: var(--status-packed-bg); color: var(--status-packed-tx); }
.badge-shipped   { background-color: var(--status-shipped-bg); color: var(--status-shipped-tx); }
.badge-delivered { background-color: var(--status-delivered-bg); color: var(--status-delivered-tx); }
.badge-cancelled { background-color: var(--status-cancelled-bg); color: var(--status-cancelled-tx); }

.order-card-meta-right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.order-date-text {
  font-size: 12.5px;
  color: var(--slate-500);
}

.order-status-select {
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--border-light);
  background-color: #ffffff;
  color: var(--slate-700);
  cursor: pointer;
  outline: none;
}

/* Order Card Body (2 Columns) */
.order-card-body-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: var(--sp-6);
}

@media (max-width: 1024px) {
  .order-card-body-grid {
    grid-template-columns: 1fr;
  }
}

.order-party-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-party-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--slate-900);
  line-height: 1.3;
}

.order-party-id-badge {
  font-size: 11px;
  background-color: var(--slate-100);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  color: var(--slate-600);
  margin-left: 6px;
  font-weight: 500;
}

.order-contact-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: 13px;
  margin-top: 4px;
}

.order-phone-link {
  color: var(--primary-600);
  text-decoration: none;
  font-weight: 600;
}

.order-wa-link {
  color: #16a34a;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* Right Table of Parts */
.order-items-table-box {
  background-color: var(--slate-50);
  border-radius: var(--r-md);
  padding: 12px 16px;
}

.order-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.order-mini-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--slate-400);
  letter-spacing: 0.5px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.order-mini-table th:last-child,
.order-mini-table td:last-child {
  text-align: right;
}

.order-mini-table td {
  padding: 8px 0;
  color: var(--slate-800);
  border-bottom: 1px solid var(--border-subtle);
}

.order-grand-total-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 12px;
  font-size: 15px;
  font-weight: 800;
  color: var(--primary-700);
}

/* ─── Modals & Toasts ──────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: var(--sp-4);
}

.modal-card {
  background-color: #ffffff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 460px;
  padding: var(--sp-6);
  border: 1px solid var(--border-light);
}

.modal-header {
  margin-bottom: var(--sp-4);
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--slate-900);
}

.modal-sub {
  font-size: 13px;
  color: var(--slate-500);
  margin-top: 4px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--sp-4);
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
}

.field input {
  padding: 10px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-light);
  font-size: 14px;
  color: var(--slate-900);
  outline: none;
  transition: border-color 0.15s ease;
}

.field input:focus {
  border-color: var(--primary-600);
}

.field-error {
  color: var(--brand-red);
  font-size: 12.5px;
  margin-top: 4px;
}

/* User Type Selector (Single-select checkbox style) */
.user-type-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 2px;
}

.user-type-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--r-md);
  background-color: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.user-type-card:hover {
  border-color: var(--primary-300);
  background-color: var(--slate-50);
}

.user-type-card.active {
  border-color: var(--primary-600) !important;
  background-color: rgba(37, 99, 235, 0.06) !important;
}

.user-type-card input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-600);
  cursor: pointer;
  margin: 0;
}

.user-type-card .user-type-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--slate-700);
  white-space: nowrap;
}

.user-type-card.active .user-type-label {
  color: var(--primary-700) !important;
  font-weight: 700 !important;
}

/* Mobile Already Registered Notice */
.mobile-notice-box {
  margin-top: 6px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  font-size: 12.5px;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  transition: all 0.2s ease;
}

.mobile-notice-box.registered {
  background-color: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.mobile-notice-box.available {
  background-color: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
}

.mobile-notice-box .notice-login-link {
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-size: 12.5px;
  display: inline;
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 110;
}

.toast {
  padding: 10px 18px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  background-color: #0f172a;
  color: #ffffff;
  box-shadow: var(--shadow-md);
}

.toast-success {
  background-color: #047857;
}

.toast-error {
  background-color: #b91c1c;
}

/* ─── Cart Slide-in Sidebar Drawer ─────────────────────────────────────────── */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 200;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.cart-drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  width: 420px;
  max-width: 90vw;
  height: 100%;
  background: #ffffff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-drawer-overlay.active .cart-drawer {
  transform: translateX(0);
}

.cart-drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.cart-drawer-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--primary-50);
  color: var(--primary-700);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-drawer-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--slate-900);
  margin: 0;
}

.cart-drawer-subtitle {
  font-size: 12px;
  color: var(--slate-500);
}

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item-card {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cart-item-card:hover {
  border-color: var(--primary-300);
  box-shadow: var(--shadow-sm);
}

.cart-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.cart-item-name {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--slate-900);
  line-height: 1.3;
}

.cart-item-brand {
  font-size: 11px;
  color: var(--slate-500);
  margin-top: 2px;
}

.cart-item-remove-btn {
  background: none;
  border: none;
  color: var(--slate-400);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  display: flex;
  align-items: center;
}

.cart-item-remove-btn:hover {
  color: var(--brand-red);
  background: #fee2e2;
}

.cart-item-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
  border-top: 1px dashed var(--border-light);
  font-size: 12.5px;
}

.cart-item-qty {
  font-weight: 600;
  color: var(--slate-700);
}

.cart-item-price {
  font-weight: 800;
  color: var(--primary-700);
  font-size: 14px;
}

.cart-drawer-footer {
  border-top: 1px solid var(--border-light);
  padding: 16px 20px;
  background: #f8fafc;
}

.cart-drawer-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--slate-600);
}

.cart-summary-row.grand {
  font-size: 15px;
  font-weight: 800;
  color: var(--slate-900);
  padding-top: 6px;
  border-top: 1px solid var(--border-light);
}

.cart-summary-row.grand span:last-child {
  color: var(--primary-700);
  font-size: 17px;
}

.cart-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 16px;
  color: var(--slate-500);
  gap: 12px;
}

.cart-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--slate-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slate-400);
}
