/* ========================================
   FULLZSHOP - Modern UI Design
   ======================================== */

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

:root {
  /* Dark Theme Colors */
  --bg-primary: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #242424;
  --bg-elevated: #2a2a2a;
  --bg-card: #1e1e1e;
  
  --text-primary: #e8e8e8;
  --text-secondary: #a0a0a0;
  --text-tertiary: #6b6b6b;
  
  --accent-primary: #ff3366;
  --accent-secondary: #ff5588;
  --accent-dark: #cc0044;
  --accent-glow: rgba(255, 51, 102, 0.3);
  
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  
  --border-primary: #333333;
  --border-secondary: #404040;
  --border-light: #4a4a4a;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.7);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  
  --blur-sm: blur(8px);
  --blur-md: blur(16px);
  --blur-lg: blur(24px);
}

html.light-mode,
html.light-mode body {
  --bg-primary: #f8f9fa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f3f5;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-tertiary: #8a8a8a;
  
  --accent-primary: #ff3366;
  --accent-secondary: #ff5588;
  --accent-dark: #dd0033;
  --accent-glow: rgba(255, 51, 102, 0.15);
  
  --border-primary: #e0e0e0;
  --border-secondary: #d0d0d0;
  --border-light: #f0f0f0;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
  --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.2);
}

/* ========== BASE STYLES ========== */
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Helvetica Neue', Arial, sans-serif;
  min-height: 100vh;
  min-height: 100dvh; /* Use dynamic viewport height to avoid bottom bars */
  line-height: 1.6;
  transition: background var(--transition-base), color var(--transition-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.hidden {
  display: none !important;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-primary);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* ========== HEADER ========== */
header {
  background: rgba(26, 26, 26, 0.8);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

html.light-mode header {
  background: rgba(255, 255, 255, 0.9);
}

.admin-head-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  font-size: 26px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  cursor: pointer;
  transition: var(--transition-base);
}

.logo:hover {
  filter: brightness(1.2);
}

nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.desktop-nav {
  display: none; /* Hidden by default, shown via media query on desktop */
  align-items: center;
  gap: 8px;
}

nav button {
  background: transparent;
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
  padding: 10px 20px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
}

nav button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-primary);
  opacity: 0;
  transition: var(--transition-base);
  z-index: -1;
}

nav button:hover::before {
  opacity: 0.1;
}

nav button:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-1px);
}

nav button.active {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px var(--accent-glow);
}

nav button.active:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--accent-glow);
}

#auth-area {
  margin-left: 16px;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.balance {
  background: var(--bg-tertiary);
  color: var(--accent-primary);
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  border: 1px solid var(--border-primary);
  cursor: pointer;
  transition: var(--transition-base);
}

.balance:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
  transform: translateY(-1px);
}

/* ========== MAIN CONTENT ========== */
main {
  padding: 32px;
  max-width: 1600px;
  margin: 0 auto;
  animation: fadeIn 0.4s ease-out;
}

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

/* ========== CATEGORY TABS ========== */
.category-tabs {
  margin-bottom: 32px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-sm);
}

.category-tabs button {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  padding: 12px 28px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: var(--transition-base);
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}

.category-tabs button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  opacity: 0;
  transition: var(--transition-base);
}

.category-tabs button:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.category-tabs button.active {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.category-tabs button.active:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

/* ========== ITEMS GRID ========== */
#items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  animation: fadeIn 0.5s ease-out;
}

.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  padding: 0;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  transition: var(--transition-base);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.item-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-primary), transparent);
  opacity: 0;
  transition: var(--transition-base);
  pointer-events: none;
}

.item-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.item-card:hover::before {
  opacity: 0.05;
}

.item-thumb {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--bg-tertiary);
  transition: var(--transition-slow);
}

.item-card:hover .item-thumb {
  transform: scale(1.05);
}

.item-card-content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.item-card h4 {
  color: var(--text-primary);
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
  line-height: 1.3;
}

.item-card p {
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-detail {
  font-size: 11px;
  color: var(--text-tertiary);
  margin: 3px 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.item-badge {
  display: inline-block;
  font-size: 10px;
  color: var(--success);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 6px;
  padding: 3px 8px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: var(--radius-sm);
}

.item-card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-primary);
}

.price {
  color: var(--accent-primary);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.3px;
  margin-bottom: 10px;
  display: block;
}

.item-card button {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  color: white;
  padding: 10px;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  border-radius: var(--radius-md);
  transition: var(--transition-base);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.item-card button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.item-card button:active {
  transform: translateY(0);
}

/* ========== PAGINATION ========== */
#pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 40px 0 20px;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
}

#pagination-controls button {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: var(--transition-base);
}

#pagination-controls button:hover:not(:disabled) {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
  transform: translateY(-1px);
}

#pagination-controls button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

#page-info {
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 120px;
  text-align: center;
}

/* ========== CART ========== */
#cart-items {
  margin: 20px 0;
}

.cart-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-secondary);
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
  transition: var(--transition-base);
}

.cart-row:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
  transform: translateX(2px);
}

.cart-row span:first-child {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 14px;
}

.cart-row span:nth-child(2) {
  color: var(--accent-primary);
  font-weight: 600;
  font-size: 15px;
}

.cart-row button {
  background: transparent;
  border: 1px solid var(--error);
  color: var(--error);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  transition: var(--transition-base);
}

.cart-row button:hover {
  background: var(--error);
  color: white;
}

#cart-total {
  font-size: 24px;
  color: var(--accent-primary);
  margin: 20px 0;
  font-weight: 700;
  letter-spacing: -0.5px;
  padding: 18px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  text-align: center;
  display: none; /* Hidden by default, shown when cart has items */
}

#cart-total:not(:empty) {
  display: block; /* Show when it has content */
}

#checkout-btn {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  color: white;
  padding: 14px 32px;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: var(--transition-base);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: var(--shadow-md);
  width: 100%;
}

#checkout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--accent-glow);
}

#checkout-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========== ORDERS ========== */
.order-block {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  padding: 18px;
  margin-bottom: 16px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.order-block p {
  margin-bottom: 8px;
  font-size: 14px;
}

.order-block strong {
  color: var(--accent-primary);
  font-size: 16px;
}

.order-block pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg-tertiary);
  padding: 16px;
  margin-top: 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  border: 1px solid var(--border-primary);
}

/* Continue in next part... */

/* ========== MODALS ========== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  overflow: hidden;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-primary);
}

.modal-head h3 {
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.modal-close {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-primary);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  transition: var(--transition-base);
}

.modal-close:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
  transform: rotate(90deg);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 24px;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-primary);
}

.modal-note {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent-primary);
}

/* ========== FORMS ========== */
.field {
  margin-bottom: 20px;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.2px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  transition: var(--transition-base);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.field textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

/* ========== BUTTONS ========== */
.btn {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  color: white;
  padding: 12px 24px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: var(--transition-base);
  letter-spacing: 0.3px;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-block {
  width: 100%;
  padding: 14px;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
  padding: 10px 20px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition-base);
}

.btn-ghost:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.form-msg {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  border-radius: var(--radius-sm);
  color: var(--error);
  font-size: 14px;
  text-align: center;
}

.form-msg:empty {
  display: none;
}

/* ========== DEPOSIT / WALLET ========== */
.address-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}

.address-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  transition: var(--transition-base);
}

.address-item:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.address-coin {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  font-weight: 700;
  font-size: 14px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
}

.address-value {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: var(--text-secondary);
  word-break: break-all;
}

.copy-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition-base);
}

.copy-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.deposit-live {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  text-align: center;
}

.deposit-live strong {
  color: var(--accent-primary);
  font-size: 16px;
}

.mono {
  font-family: 'Courier New', monospace;
  background: var(--bg-primary);
  padding: 12px 16px;
  margin: 12px 0;
  border-radius: var(--radius-sm);
  word-break: break-all;
  font-size: 13px;
  border: 1px solid var(--border-primary);
}

/* ========== ORDER SUCCESS ========== */
.order-success {
  text-align: center;
  margin-bottom: 24px;
}

.order-success .tick {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--success), #34d399);
  color: white;
  font-size: 48px;
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
  animation: scaleIn 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes scaleIn {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.order-success h4 {
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 600;
}

.order-summary {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 20px;
}

.order-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-primary);
  font-size: 14px;
}

.order-line:last-child {
  border-bottom: none;
}

.order-line.total {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  padding-top: 16px;
  margin-top: 8px;
  border-top: 2px solid var(--border-primary);
}

.order-line.balance {
  color: var(--success);
  font-weight: 500;
}

/* ========== CHAT ========== */
.chat-shell {
  display: flex;
  flex-direction: column;
  max-width: 800px;
  height: 600px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-primary);
}

.chat-avatar {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  font-weight: 700;
  font-size: 18px;
}

.chat-head-text h3 {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.chat-head-text span {
  font-size: 13px;
  color: var(--text-secondary);
}

.chat-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--success);
  font-weight: 500;
}

.chat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 12px var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-primary);
}

.chat-empty {
  margin: auto;
  text-align: center;
  color: var(--text-tertiary);
}

.chat-empty .icon {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
  opacity: 0.3;
}

.chat-day {
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 16px 0;
}

.chat-day span {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: 6px 16px;
}

.chat-row {
  display: flex;
  gap: 12px;
  max-width: 80%;
  animation: slideIn 0.3s ease-out;
}

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

.chat-row.user {
  margin-left: auto;
  flex-direction: row-reverse;
}

.chat-row.admin {
  margin-right: auto;
}

.chat-bubble {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.chat-row.user .chat-bubble {
  background: linear-gradient(135deg, rgba(255, 51, 102, 0.15), rgba(255, 85, 136, 0.1));
  border-color: rgba(255, 51, 102, 0.3);
  border-bottom-right-radius: 4px;
}

.chat-row.admin .chat-bubble {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(52, 211, 153, 0.1));
  border-color: rgba(16, 185, 129, 0.3);
  border-bottom-left-radius: 4px;
}

.chat-bubble .who {
  font-size: 11px;
  color: var(--text-tertiary);
  display: block;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  font-weight: 600;
  text-transform: uppercase;
}

.chat-row.user .chat-bubble .who {
  color: var(--accent-primary);
}

.chat-row.admin .chat-bubble .who {
  color: var(--success);
}

.chat-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

.chat-form {
  display: flex;
  gap: 12px;
  padding: 20px;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-primary);
}

.chat-form input {
  flex: 1;
  padding: 14px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 24px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  transition: var(--transition-base);
}

.chat-form input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.chat-form button {
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.chat-form button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.chat-form button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-attach-btn {
  background: var(--bg-secondary) !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border-primary) !important;
  box-shadow: none !important;
}

.chat-attach-btn:hover {
  background: var(--bg-tertiary) !important;
  color: var(--accent-primary) !important;
  border-color: var(--accent-primary) !important;
  box-shadow: 0 2px 8px var(--shadow-sm) !important;
}

.chat-attachment {
  margin-top: 8px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition-base);
  max-width: 300px;
}

.chat-attachment:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-primary);
}

.chat-attachment-icon {
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--accent-primary);
  color: white;
  padding: 8px;
  border-radius: var(--radius-sm);
  min-width: 40px;
  text-align: center;
}

.chat-attachment-info {
  flex: 1;
  min-width: 0;
}

.chat-attachment-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--accent-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.chat-attachment-size {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.chat-attachment-download {
  padding: 6px 12px;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-base);
  text-decoration: none;
  display: inline-block;
}

.chat-attachment-download:hover {
  background: var(--accent-secondary);
  transform: translateY(-1px);
}

.chat-attachment img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin-top: 8px;
  cursor: pointer;
}

#chat-msg {
  padding: 0 20px 12px;
  font-size: 13px;
  color: var(--error);
  min-height: 0;
}

/* Continue in next part... */

/* ========== SIDE NAVIGATION ========== */
.side-nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.side-nav-scrim.show {
  opacity: 1;
  pointer-events: auto;
}

.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1300;
  width: min(320px, 90vw);
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
  box-shadow: var(--shadow-xl);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow-y: auto;
}

.side-nav.open {
  transform: translateX(0);
}

.side-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid var(--border-primary);
  background: var(--bg-tertiary);
}

.side-nav-title {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.side-nav-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-primary);
  background: transparent;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
}

.side-nav-close:hover {
  color: white;
  border-color: var(--accent-primary);
  background: var(--accent-primary);
  transform: rotate(90deg);
}

.side-nav nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
}

.menu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.menu-list button,
.menu-list a {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-decoration: none;
  text-align: left;
  padding: 14px 16px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition-base);
}

.menu-list button:hover,
.menu-list a:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--bg-elevated);
  transform: translateX(4px);
}

.menu-list button.active {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.menu-list .count {
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  background: var(--accent-primary);
  color: white;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-list button.active .count {
  background: white;
  color: var(--accent-primary);
}

/* Balance display in side menu */
.menu-balance-item {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-primary);
}

.menu-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.balance-label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.balance-amount {
  color: var(--accent-primary);
  font-size: 16px;
  font-weight: 700;
}

.nav-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--accent-primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-hint {
  padding: 16px 20px;
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 1.6;
  border-top: 1px solid var(--border-primary);
  margin-top: auto;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition-base);
}

.menu-toggle:hover {
  border-color: var(--accent-primary);
  background: var(--accent-primary);
  color: white;
}

body.has-side-menu .menu-toggle {
  display: inline-flex;
}

/* Keep menu open on large screens for admin AND shop */
@media (min-width: 1024px) {
  body.admin-body .side-nav,
  body.has-side-menu .side-nav {
    transform: translateX(0) !important;
  }
  body.admin-body .side-nav-scrim,
  body.has-side-menu .side-nav-scrim {
    display: none !important;
  }
  body.admin-body .side-nav-close,
  body.has-side-menu .side-nav-close {
    display: none;
  }
  body.admin-body .menu-toggle,
  body.has-side-menu .menu-toggle {
    display: none !important;
  }
  body.admin-body.has-side-menu,
  body.has-side-menu {
    padding-left: 320px;
  }
}

/* ========== CUSTOM PROMPT/DIALOG MODALS ========== */
.prompt-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.prompt-overlay.show {
  opacity: 1;
}

.prompt-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-primary);
  background: var(--bg-tertiary);
}

.prompt-head h3 {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.prompt-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-primary);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition-base);
  flex-shrink: 0;
}

.prompt-close:hover {
  background: var(--error);
  border-color: var(--error);
  color: white;
  transform: rotate(90deg);
}

.prompt-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.prompt-body p {
  margin: 0 0 16px 0;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
}

.prompt-body .field {
  margin-bottom: 16px;
}

.prompt-body .field span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.prompt-body input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  transition: var(--transition-base);
}

.prompt-body input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.prompt-actions {
  display: flex;
  gap: 12px;
  padding: 18px 20px;
  border-top: 1px solid var(--border-primary);
  background: var(--bg-tertiary);
}

.prompt-btn {
  flex: 1;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-base);
  border: none;
}

.prompt-btn.primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.prompt-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.prompt-btn.danger {
  background: var(--error);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.prompt-btn.danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.prompt-btn:not(.primary):not(.danger) {
  background: transparent;
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
}

.prompt-btn:not(.primary):not(.danger):hover {
  background: var(--bg-elevated);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* ========== TOASTS ========== */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  cursor: pointer;
  transition: var(--transition-base);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast:hover {
  transform: translateX(-4px);
}

.toast.leaving {
  animation: slideOutRight 0.2s ease-out forwards;
}

@keyframes slideOutRight {
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.toast.success {
  border-color: var(--success);
}

.toast.error {
  border-color: var(--error);
}

.toast-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 16px;
}

.toast.success .toast-icon {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.toast.error .toast-icon {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

.toast span:last-child {
  flex: 1;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
}

/* ========== ADMIN PANELS ========== */
body.admin-body {
  background: var(--bg-primary);
}

.admin-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

.admin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-primary);
  padding-bottom: 20px;
  margin-bottom: 32px;
}

.admin-head h1 {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  font-size: 28px;
}

.panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.panel h3 {
  color: var(--text-primary);
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.panel p {
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.panel label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.panel input,
.panel select,
.panel textarea {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  width: 100%;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition-base);
}

.panel input:focus,
.panel select:focus,
.panel textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.panel textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

.row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.row > * {
  flex: 1 1 200px;
}

/* Optimized table styling */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 16px;
  overflow-x: auto;
  display: block;
}

thead {
  background: var(--bg-tertiary);
}

th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border-primary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  white-space: nowrap;
}

tbody {
  display: table-row-group;
}

td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-primary);
  color: var(--text-primary);
  font-size: 13px;
}

tr:hover {
  background: var(--bg-tertiary);
}

/* Make table scrollable on mobile */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-container table {
  display: table;
  min-width: 600px;
}

th {
  color: var(--accent-primary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
}

tbody tr {
  transition: var(--transition-base);
}

tbody tr:hover {
  background: var(--bg-tertiary);
}

.admin-msg {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  border-radius: var(--radius-sm);
  color: var(--error);
  font-size: 14px;
  min-height: 0;
}

.admin-msg:empty {
  display: none;
}

.admin-msg.ok {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--success);
  color: var(--success);
}

.thumb {
  width: 60px;
  height: 80px;
  object-fit: cover;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
}

.inline {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inline input {
  width: 100px;
  margin-bottom: 0;
  padding: 8px 12px;
}

/* ========== THEME TOGGLE (IN HEADER) ========== */
.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: var(--transition-base);
}

.theme-toggle .moon-icon {
  fill: currentColor;
  stroke: none;
}

/* ========== SKELETON LOADERS ========== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 0%,
    var(--bg-elevated) 50%,
    var(--bg-tertiary) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 0;
  overflow: hidden;
}

.skeleton-image {
  width: 100%;
  height: 160px;
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 0%,
    var(--bg-elevated) 50%,
    var(--bg-tertiary) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-content {
  padding: 12px;
}

.skeleton-title {
  height: 18px;
  width: 70%;
  margin-bottom: 8px;
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 0%,
    var(--bg-elevated) 50%,
    var(--bg-tertiary) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 14px;
  width: 90%;
  margin-bottom: 6px;
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 0%,
    var(--bg-elevated) 50%,
    var(--bg-tertiary) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-price {
  height: 20px;
  width: 40%;
  margin-top: 12px;
  margin-bottom: 10px;
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 0%,
    var(--bg-elevated) 50%,
    var(--bg-tertiary) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-button {
  height: 38px;
  width: 100%;
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 0%,
    var(--bg-elevated) 50%,
    var(--bg-tertiary) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

/* Loading spinner */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border-primary);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.loading-overlay .loading-spinner {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

/* ========== AUTH PAGE ========== */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  flex-direction: column;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.auth-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  padding: 32px 24px;
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.5s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.auth-card h2 {
  color: var(--text-primary);
  margin-bottom: 24px;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

#auth-form input {
  display: block;
  width: 100%;
  margin-bottom: 14px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  transition: var(--transition-base);
}

#auth-form input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

#auth-form button {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  padding: 12px 20px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  margin-right: 10px;
  transition: var(--transition-base);
  box-shadow: 0 4px 12px var(--accent-glow);
}

#auth-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

#auth-form button[type="button"] {
  background: transparent;
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
  box-shadow: none;
}

#auth-form button[type="button"]:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: transparent;
}

#auth-msg {
  color: var(--error);
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  border-radius: var(--radius-sm);
  font-size: 14px;
  text-align: center;
}

#auth-msg:empty {
  display: none;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 860px) {
  header {
    padding: 16px 20px;
  }
  
  main {
    padding: 20px;
  }
  
  .category-tabs {
    padding: 16px;
  }
  
  #items-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
  }
  
  .toast-stack {
    left: 16px;
    right: 16px;
    max-width: none;
  }
}

@media (max-width: 600px) {
  header {
    padding: 12px 16px;
  }
  
  /* Optimize header title/logo for mobile */
  .logo {
    font-size: 18px !important;
    letter-spacing: -0.3px;
  }
  
  header h1 {
    font-size: 18px !important;
    letter-spacing: -0.3px;
  }
  
  .admin-head-left {
    gap: 10px;
  }
  
  /* Optimize menu toggle button */
  .menu-toggle {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
  
  /* Optimize theme toggle */
  .theme-toggle {
    width: 36px;
    height: 36px;
  }
  
  .theme-toggle svg {
    width: 18px;
    height: 18px;
  }
  
  main {
    padding: 16px;
  }
  
  /* Optimize section headers */
  h2 {
    font-size: 20px !important;
  }
  
  h3 {
    font-size: 17px !important;
  }
  
  h4 {
    font-size: 15px !important;
  }
  
  /* Optimize category tabs */
  .category-tabs {
    padding: 12px 16px;
    gap: 8px;
  }
  
  .category-tabs button {
    padding: 8px 14px;
    font-size: 13px;
  }
  
  #items-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  /* Optimize item cards for mobile */
  .item-card h4 {
    font-size: 14px !important;
  }
  
  .item-card p {
    font-size: 12px !important;
  }
  
  .item-card .price {
    font-size: 16px !important;
  }
  
  .item-card button {
    font-size: 12px;
    padding: 8px;
  }
  
  /* Optimize cart */
  .cart-row {
    padding: 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .cart-row span:first-child {
    font-size: 13px;
    flex: 1 1 100%;
  }
  
  .cart-row span:nth-child(2) {
    font-size: 14px;
  }
  
  .cart-row button {
    font-size: 11px;
    padding: 5px 10px;
  }
  
  #cart-total {
    font-size: 20px;
    padding: 14px;
  }
  
  #checkout-btn {
    padding: 12px 24px;
    font-size: 14px;
  }
  
  /* Optimize orders */
  .order-block {
    padding: 14px;
  }
  
  .order-block p {
    font-size: 13px;
  }
  
  .order-block strong {
    font-size: 15px !important;
  }
  
  /* Optimize chat */
  .chat-shell {
    height: 70vh;
  }
  
  .chat-head {
    padding: 12px;
  }
  
  .chat-head h3 {
    font-size: 15px !important;
  }
  
  .chat-head span {
    font-size: 12px;
  }
  
  .chat-bubble {
    max-width: 75%;
    padding: 10px 12px;
  }
  
  .chat-bubble .who {
    font-size: 11px;
  }
  
  .chat-bubble div {
    font-size: 13px;
  }
  
  .chat-meta {
    font-size: 11px;
  }
  
  .chat-row {
    max-width: 90%;
  }
  
  /* Optimize modals */
  .modal-content {
    max-width: 100%;
    margin: 16px;
  }
  
  .modal-head {
    padding: 18px;
  }
  
  .modal-head h3 {
    font-size: 18px !important;
  }
  
  .modal-body {
    padding: 18px;
    font-size: 14px;
  }
  
  .modal-foot {
    padding: 18px;
  }
  
  /* Optimize buttons */
  .btn {
    padding: 9px 16px;
    font-size: 13px;
  }
  
  .btn-ghost {
    padding: 7px 14px;
    font-size: 12px;
  }
  
  .btn-block {
    padding: 11px;
  }
  
  /* Smaller action buttons in admin tables */
  table button {
    padding: 6px 12px !important;
    font-size: 11px !important;
    margin: 2px;
  }
  
  /* Optimize prompt/dialog modals for mobile */
  .prompt-modal {
    max-width: 95%;
    margin: 10px;
  }
  
  .prompt-head {
    padding: 14px 16px;
  }
  
  .prompt-head h3 {
    font-size: 16px !important;
  }
  
  .prompt-close {
    width: 28px;
    height: 28px;
    font-size: 18px;
  }
  
  .prompt-body {
    padding: 16px;
  }
  
  .prompt-body p {
    font-size: 13px;
    margin-bottom: 12px;
  }
  
  .prompt-body .field {
    margin-bottom: 12px;
  }
  
  .prompt-body .field span {
    font-size: 12px;
    margin-bottom: 5px;
  }
  
  .prompt-body input {
    padding: 9px 12px;
    font-size: 14px;
  }
  
  .prompt-actions {
    padding: 14px 16px;
    gap: 10px;
  }
  
  .prompt-btn {
    padding: 10px 16px;
    font-size: 13px;
  }
  
  /* Optimize forms */
  input[type="text"],
  input[type="password"],
  input[type="number"],
  input[type="email"],
  textarea,
  select {
    font-size: 14px;
    padding: 10px 12px;
  }
  
  label {
    font-size: 13px;
  }
  
  /* Better auth card on mobile */
  .auth-card {
    padding: 24px 20px;
    width: 100%;
    max-width: 100%;
    margin: 0 16px;
  }
  
  .auth-card h2 {
    font-size: 20px;
    margin-bottom: 20px;
  }
  
  #auth-form input {
    padding: 11px 14px;
    font-size: 16px; /* Prevents zoom on iOS */
    margin-bottom: 12px;
  }
  
  #auth-form button {
    padding: 11px 18px;
    font-size: 14px;
    margin-right: 8px;
  }
  
  .auth-page {
    padding: 16px;
  }
  
  /* Optimize admin panel elements */
  .panel {
    padding: 16px;
    margin-bottom: 16px;
  }
  
  .panel h3 {
    font-size: 16px !important;
    margin-bottom: 10px;
  }
  
  .panel p {
    font-size: 13px;
  }
  
  /* Better input sizing on mobile */
  .panel input,
  .panel select,
  .panel textarea {
    padding: 9px 12px;
    font-size: 14px;
  }
  
  /* Optimize tables for mobile - keep them scrollable */
  table {
    font-size: 11px;
    display: table;
    min-width: 100%;
  }
  
  th {
    padding: 8px 6px;
    font-size: 10px;
  }
  
  td {
    padding: 8px 6px;
    font-size: 11px;
  }
  
  /* Make table container scrollable horizontally */
  .panel {
    overflow-x: auto;
  }
  
  /* Smaller buttons in tables */
  td button {
    padding: 5px 10px;
    font-size: 11px;
  }
  
  /* Optimize side menu on mobile */
  .side-nav {
    width: min(280px, 85vw);
  }
  
  .side-nav-title {
    font-size: 18px !important;
  }
  
  .menu-list button,
  .menu-list a {
    padding: 12px 14px;
    font-size: 13px;
  }
  
  .menu-hint {
    font-size: 11px;
    padding: 12px 16px;
  }
  
  /* Optimize pagination */
  #pagination-controls {
    margin: 24px 0 16px;
  }
  
  #pagination-controls button {
    padding: 8px 14px;
    font-size: 13px;
  }
  
  #page-info {
    font-size: 13px;
  }
}

/* ========== MENU TOGGLE (HAMBURGER) - ALWAYS VISIBLE ========== */
.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
  font-size: 20px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition-base);
}

.menu-toggle:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
}

/* Desktop nav removed - all navigation in side menu */
.desktop-nav {
  display: none !important; /* Force hide any desktop nav */
}

nav button[data-view],
nav .balance,
nav #auth-area {
  display: none !important; /* Hide any desktop nav buttons */
}

body.menu-open {
  overflow: hidden;
}

/* ========== ADMIN CHAT LAYOUT ========== */
.chat-layout {
  display: flex;
  gap: 20px;
  align-items: stretch;
}

.chat-list {
  width: 280px;
  flex-shrink: 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 16px;
  max-height: 600px;
  overflow-y: auto;
}

.chat-list-head {
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  font-weight: 600;
}

.conv-item {
  display: block;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition-base);
}

.conv-item:hover {
  border-color: var(--accent-primary);
  transform: translateX(2px);
}

.conv-item.active {
  border-color: var(--accent-primary);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.conv-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-weight: 500;
}

.conv-last {
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unread {
  background: var(--accent-primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  padding: 3px 8px;
  flex-shrink: 0;
}

.chat-thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.chat-thread-head {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-primary);
  padding: 16px 20px;
}

.chat-box {
  flex: 1;
  height: 400px;
  overflow-y: auto;
  background: var(--bg-primary);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-send-btn {
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.chat-send-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 860px) {
  .chat-layout {
    flex-direction: column;
  }
  
  .chat-list {
    width: 100%;
    max-height: 300px;
  }
}
