/* ==========================================================================
   Lumina Bookstore & Chatbot - Premium Design System
   Midnight Library & Amber Gold Aesthetic
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Prompt:wght@300;400;500;600;700&display=swap');

:root {
  /* Color Palette */
  --bg-dark: #0a0e17;
  --bg-surface: #111827;
  --bg-card: rgba(17, 24, 39, 0.78);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-glass: rgba(15, 23, 42, 0.65);
  
  --primary: #f59e0b;
  --primary-hover: #d97706;
  --primary-glow: rgba(245, 158, 11, 0.25);
  --primary-light: #fef3c7;

  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-green: #10b981;
  --accent-pink: #ec4899;

  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.15);
  --border-glow: rgba(245, 158, 11, 0.4);

  --bot-bubble-bg: #1e293b;
  --user-bubble-bg: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(245, 158, 11, 0.2);

  --font-thai: 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-en: 'Outfit', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-thai);
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(245, 158, 11, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.05) 0%, transparent 60%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
.navbar {
  height: 72px;
  background: rgba(11, 15, 25, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
  animation: subtleFloat 4s ease-in-out infinite;
}

@keyframes subtleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.brand-info h1 {
  font-family: var(--font-en);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.15);
  color: var(--primary);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.brand-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

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

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.nav-btn.sheets-btn {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.nav-btn.sheets-btn:hover {
  background: rgba(16, 185, 129, 0.2);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.25);
}

/* User Profile in Nav */
.user-nav-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 4px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
}

.user-nav-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--primary);
}

.user-nav-details {
  display: flex;
  flex-direction: column;
}

.user-nav-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.user-nav-email {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-signout {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-full);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s;
}

.btn-signout:hover {
  color: #f87171;
}

/* ==========================================================================
   Main Application Layout
   ========================================================================== */
.app-container {
  flex: 1;
  display: grid;
  grid-template-columns: 360px 1fr;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 24px;
  gap: 24px;
  height: calc(100vh - 72px);
}

/* Left Sidebar - Bookstore Catalog & Status */
.store-sidebar {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.sidebar-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sheet-status-pill {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 12px;
  color: #34d399;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Category Quick Chips */
.category-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-chip {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.category-chip:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--primary);
  transform: translateY(-1px);
}

/* Bestseller Mini List */
.bestsellers-mini-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mini-book-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mini-book-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(245, 158, 11, 0.3);
  transform: translateX(4px);
}

.mini-book-cover {
  width: 44px;
  height: 58px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.mini-book-cover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: rgba(255, 255, 255, 0.35);
}

.mini-book-details {
  flex: 1;
  min-width: 0;
}

.mini-book-title {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.mini-book-author {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.mini-book-price {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-top: 4px;
}

/* Sidebar Footer Info */
.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.15);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================================
   Chatbot Main Panel (Right Side)
   ========================================================================== */
.chat-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(17, 24, 39, 0.85);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-user {
  display: flex;
  align-items: center;
  gap: 14px;
}

.chat-avatar-wrapper {
  position: relative;
}

.chat-bot-avatar {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.online-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: #10b981;
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-surface);
}

.chat-header-meta h3 {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-ai-model {
  font-size: 10px;
  font-family: var(--font-en);
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.chat-status-text {
  font-size: 12px;
  color: var(--accent-green);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Messages Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Message Styles */
.chat-message {
  display: flex;
  gap: 12px;
  max-width: 82%;
  animation: fadeInMsg 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.chat-message.bot-msg {
  align-self: flex-start;
}

.chat-message.user-msg {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.bot-avatar-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  position: relative;
}

.online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: var(--radius-full);
  border: 1px solid #111827;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--primary);
}

.message-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bot-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.bot-name {
  font-weight: 600;
  color: var(--primary);
}

.sync-tag {
  color: #34d399;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.1);
}

.message-bubble {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.6;
  position: relative;
  word-break: break-word;
}

.bot-bubble {
  background: var(--bot-bubble-bg);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-top-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.bot-bubble strong {
  color: #fde68a;
}

.bot-bubble code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  color: #6ee7b7;
  font-family: monospace;
}

.user-msg .message-bubble {
  background: var(--user-bubble-bg);
  color: #111827;
  font-weight: 500;
  border-top-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.message-time {
  font-size: 11px;
  color: var(--text-muted);
}

.user-msg .message-time {
  text-align: right;
}

/* Typing Indicator */
.typing-bubble {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
}

.typing-text {
  font-size: 12px;
  color: var(--text-secondary);
}

.dot {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: var(--radius-full);
  animation: bounceDot 1.4s infinite ease-in-out both;
}

.dot:nth-child(2) { animation-delay: -0.32s; }
.dot:nth-child(3) { animation-delay: -0.16s; }

@keyframes bounceDot {
  0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   Book Cards in Chat
   ========================================================================== */
.book-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.book-card-item {
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.book-card-item:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), var(--shadow-glow);
}

.book-cover-wrap {
  height: 140px;
  padding: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
  overflow: hidden;
}

.book-cover-spine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 10px;
  background: linear-gradient(90deg, rgba(0,0,0,0.6) 0%, rgba(255,255,255,0.2) 50%, rgba(0,0,0,0.4) 100%);
}

.book-cover-inner {
  position: relative;
  z-index: 1;
}

.book-badge {
  position: absolute;
  top: -24px;
  right: 0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.book-cover-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.book-cover-author {
  font-size: 11px;
  opacity: 0.9;
  margin-top: 4px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.book-info-wrap {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.book-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.book-category-pill {
  font-size: 11px;
  color: var(--primary);
  background: rgba(245, 158, 11, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

.book-rating {
  font-size: 12px;
  font-weight: 600;
  color: #facc15;
}

.book-title-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-author-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.book-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding: 8px 0;
  border-top: 1px solid var(--border-color);
}

.discount-price {
  font-size: 16px;
  font-weight: 700;
  color: #10b981;
}

.original-price {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 6px;
}

.stock-status {
  font-size: 11px;
  font-weight: 500;
}

.stock-status.in-stock { color: #34d399; }
.stock-status.out-stock { color: #f87171; }

.book-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.btn-detail, .btn-order-now {
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-detail {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}
.btn-detail:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-order-now {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #111827;
}
.btn-order-now:hover {
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
  transform: translateY(-1px);
}

/* ==========================================================================
   Quick Replies
   ========================================================================== */
.quick-replies-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.quick-reply-chip {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--primary-light);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.quick-reply-chip:hover {
  background: var(--primary);
  color: #111827;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* ==========================================================================
   Chat Input Bar
   ========================================================================== */
.chat-input-area {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: rgba(17, 24, 39, 0.95);
}

.chat-form {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 6px 8px 6px 20px;
  transition: all 0.2s ease;
}

.chat-form:focus-within {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
}

.chat-input-field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14px;
  padding: 8px 0;
}

.chat-input-field::placeholder {
  color: var(--text-muted);
}

.btn-send {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: none;
  color: #111827;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-send:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.chat-input-hint {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}

/* ==========================================================================
   Modals & Drawers
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: #111827;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.modal-overlay.active .modal-box {
  transform: scale(1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.modal-body {
  padding: 24px;
}

/* Detail Modal Specifics */
.detail-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
}

.detail-cover-art {
  height: 280px;
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag-pill {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 4px;
}

.detail-cat-badge {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
}

.detail-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  margin: 4px 0;
}

.detail-orig {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.detail-meta-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

.detail-price-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0;
}

.current-price {
  font-size: 24px;
  font-weight: 700;
  color: #10b981;
}

.old-price {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 8px;
}

.save-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  margin-left: 8px;
}

.detail-synopsis {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.detail-synopsis h4 {
  color: var(--text-main);
  margin-bottom: 6px;
  font-size: 14px;
}

.detail-actions {
  display: flex;
  gap: 12px;
}

/* Form Styles */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--primary);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.payment-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.payment-option-btn {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.payment-option-btn.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--primary);
  color: var(--primary-light);
  font-weight: 600;
}

/* PromptPay QR Preview Card */
.promptpay-card {
  margin-top: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: #003764;
  color: #fff;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.qr-code-box {
  width: 140px;
  height: 140px;
  background: #fff;
  border-radius: 8px;
  margin: 12px auto;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-code-box img {
  width: 100%;
  height: 100%;
}

/* General Buttons */
.btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #111827;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   Google Sheets Monitor Drawer (Right Slide-over)
   ========================================================================== */
.sheets-drawer {
  position: fixed;
  top: 0;
  right: -800px;
  width: 780px;
  max-width: 95vw;
  height: 100vh;
  background: #0f172a;
  border-left: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.sheets-drawer.active {
  right: 0;
}

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

.drawer-header h3 {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #34d399;
}

.sync-status-bar {
  padding: 8px 24px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sync-status-bar.live { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.sync-status-bar.mock { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.indicator-dot.live { background: #10b981; }
.indicator-dot.mock { background: #f59e0b; }

.sheet-tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
  padding: 0 16px;
}

.sheet-tab-btn {
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.sheet-tab-btn:hover {
  color: #fff;
}

.sheet-tab-btn.active {
  color: #34d399;
  border-bottom-color: #34d399;
  font-weight: 600;
}

.sheet-tab-panel {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.sheet-tab-panel.active {
  display: block;
}

/* Sheets Table View */
.table-responsive {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.sheet-table th {
  background: #1e293b;
  color: var(--text-secondary);
  padding: 10px 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.sheet-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  vertical-align: middle;
}

.table-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
}

.user-row-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-status {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
}
.badge-status.status-done { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-status.status-pending { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }

.badge-verified {
  font-size: 10px;
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
}

.code-box-preview {
  background: #020617;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-family: monospace;
  font-size: 12px;
  color: #a7f3d0;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  margin-top: 12px;
}

/* Success Banner */
.success-banner {
  text-align: center;
  margin-bottom: 20px;
}

.success-icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.2);
  border: 2px solid #10b981;
  color: #10b981;
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.order-id-badge {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

.success-details-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.summary-row:last-child {
  border-bottom: none;
}

.highlight-price {
  color: #10b981;
  font-size: 16px;
}

.sheet-sync-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 12px;
  color: #34d399;
  margin-bottom: 20px;
}

.success-modal-actions {
  display: flex;
  gap: 12px;
}

/* ==========================================================================
   Responsive Design (Mobile / Tablet)
   ========================================================================== */
@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 1fr;
    height: auto;
  }
  
  .store-sidebar {
    display: none; /* Can be toggled on mobile if needed */
  }

  .chat-panel {
    height: 80vh;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 0 16px;
  }

  .brand-sub {
    display: none;
  }

  .chat-panel {
    height: calc(100vh - 100px);
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-cover-art {
    height: 180px;
  }
}
