/* ===== Variables ===== */
:root {
  --bg: #0d0d0d;
  --card: #1a1a1a;
  --card2: #222;
  --card3: #2a2a2a;
  --accent: #c8ff00;
  --accent2: #00d4ff;
  --text: #f0f0f0;
  --text2: #888;
  --text3: #555;
  --border: #2a2a2a;
  --success: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --wechat: #07c160;
  --alipay: #1677ff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
}

[data-theme="light"] {
  --bg: #f5f5f5;
  --card: #ffffff;
  --card2: #f0f0f0;
  --card3: #e5e5e5;
  --accent: #c8ff00;
  --accent2: #00d4ff;
  --text: #1a1a1a;
  --text2: #666;
  --text3: #999;
  --border: #e0e0e0;
  --success: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
}

/* 蓝色主题 */
[data-theme="blue"] {
  --bg: #0a1628;
  --card: #132244;
  --card2: #1e3a5f;
  --card3: #2a4a7f;
  --accent: #64b5f6;
  --accent2: #90caf9;
  --text: #e3f2fd;
  --text2: #90b4c8;
  --text3: #5f8aa8;
  --border: #1e3a5f;
  --success: #4caf50;
  --warn: #ffb74d;
  --danger: #ef5350;
}

/* 紫色主题 */
[data-theme="purple"] {
  --bg: #1a0a2e;
  --card: #2d1b4e;
  --card2: #3d2a5e;
  --card3: #4d3b7e;
  --accent: #ce93d8;
  --accent2: #e1bee7;
  --text: #f3e5f5;
  --text2: #b39ddb;
  --text3: #9575cd;
  --border: #3d2a5e;
  --success: #81c784;
  --warn: #ffb74d;
  --danger: #ef5350;
}

/* 绿色主题 */
[data-theme="green"] {
  --bg: #0a1f0a;
  --card: #1a3d1a;
  --card2: #2a5a2a;
  --card3: #3a7a3a;
  --accent: #a5d6a7;
  --accent2: #c8e6c9;
  --text: #e8f5e9;
  --text2: #a5d6a7;
  --text3: #81c784;
  --border: #2a5a2a;
  --success: #66bb6a;
  --warn: #ffb74d;
  --danger: #ef5350;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Noto Sans SC', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  padding-bottom: 80px;
}

/* ===== Tab Pages ===== */
.tab-page { display: none; }
.tab-page.active { display: block; }
.page-inner { max-width: 600px; margin: 0 auto; padding: 0 16px 20px; }

/* ===== Top Bar ===== */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 12px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
.top-bar__logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.top-bar__cart {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 8px 16px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.top-bar__cart span {
  background: var(--accent);
  color: #000;
  border-radius: 50%;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}

/* ===== Filter Row ===== */
.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-pill {
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 6px 16px;
  color: var(--text2);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.filter-pill.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 600;
}

/* ===== Product Cards ===== */
.product-list { display: flex; flex-direction: column; gap: 12px; }

.prod-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s;
  border: 1px solid var(--border);
}
.prod-card:active { transform: scale(0.98); }

.prod-img {
  height: 140px;
  background: var(--card2);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.prod-img img { width: 100%; height: 100%; object-fit: cover; }
.prod-img-placeholder { font-size: 48px; opacity: 0.3; }

.prod-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--accent);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}
.prod-badge.rec { background: #ff9500; color: #fff; }

.prod-body { padding: 12px; }
.prod-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.prod-type { font-size: 12px; color: var(--text2); margin-bottom: 6px; }
.prod-specs { font-size: 12px; color: var(--text2); line-height: 1.4; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod-foot { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.prod-price { font-size: 22px; font-weight: 700; color: var(--accent); }
.prod-price span { font-size: 13px; font-weight: 400; color: var(--text2); margin-left: 2px; }
.prod-add-btn {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 50px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.prod-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.prod-tag {
  background: var(--card2);
  color: var(--text2);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ===== Bottom Tabs ===== */
.bottom-tabs {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
  z-index: 100;
}
.tab-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text3);
  font-size: 10px;
  padding: 4px 20px;
  border-radius: 8px;
  transition: all 0.2s;
}
.tab-btn.active { color: var(--accent); }
.tab-icon { font-size: 22px; }

/* ===== Cart Drawer ===== */
.cart-drawer {
  position: fixed;
  bottom: -100%;
  left: 0; right: 0;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  z-index: 200;
  transition: bottom 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.cart-drawer.open { bottom: 0; }
.cart-drawer-handle {
  width: 36px; height: 4px;
  background: var(--text3);
  border-radius: 2px;
  margin: 10px auto 0;
  cursor: pointer;
}
.cart-drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.cart-drawer-head h3 { font-size: 16px; }
.cart-close {
  background: var(--card2); border: none; border-radius: 50%;
  width: 28px; height: 28px; color: var(--text2); cursor: pointer; font-size: 14px;
}
.cart-drawer-items { flex: 1; overflow-y: auto; padding: 12px 20px; }
.cart-empty { text-align: center; color: var(--text2); padding: 40px; }
.ci-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.ci-name { font-size: 14px; font-weight: 600; }
.ci-price { font-size: 13px; color: var(--text2); margin-top: 2px; }
.ci-remove { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 16px; padding: 4px; }
.cart-drawer-foot {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
}
.cart-total { font-size: 15px; }
.cart-total strong { font-size: 20px; color: var(--accent); margin-left: 4px; }
.cart-checkout-btn {
  background: var(--accent); color: #000; border: none;
  border-radius: 50px; padding: 12px 24px;
  font-size: 15px; font-weight: 700; cursor: pointer;
}
.cart-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 199;
  display: none;
}
.cart-overlay.show { display: block; }

/* ===== Checkout ===== */
.checkout-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 0 12px;
}
.back-btn {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px;
  color: var(--text); cursor: pointer; font-size: 14px;
}
.checkout-head h1 { font-size: 18px; font-weight: 700; }
.co-section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.co-section-title {
  font-size: 13px; font-weight: 600;
  color: var(--text2);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.co-item {
  display: flex; justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.co-item:last-of-type { border-bottom: none; }
.co-item span:last-child { color: var(--accent); font-weight: 600; }
.co-total {
  text-align: right;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 10px;
}
.co-input {
  width: 100%;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  margin-bottom: 10px;
  display: block;
}
.co-input:focus { outline: none; border-color: var(--accent); }
.co-select { appearance: none; }
.co-textarea { resize: vertical; min-height: 60px; }

/* ===== Payment ===== */
.pay-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.pay-tab {
  flex: 1; padding: 10px;
  background: var(--card2); border: 2px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text2);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all 0.2s;
}
.pay-tab.active { border-color: var(--accent); color: var(--accent); }
.pay-tab[data-pay="alipay"].active { border-color: var(--alipay); color: var(--alipay); }
.qr-box {
  background: #fff; border-radius: var(--radius-sm);
  padding: 12px; text-align: center; margin-bottom: 10px;
}
.qr-box img { max-width: 180px; border-radius: 8px; }
.pay-hint { font-size: 12px; color: var(--text2); text-align: center; margin-bottom: 10px; }
.upload-label { display: block; }
.upload-btn {
  background: var(--card2);
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  color: var(--text2);
  font-size: 14px;
  cursor: pointer;
}
.screenshot-preview {
  max-width: 100%; border-radius: 8px; margin-top: 10px;
  display: block;
}
.submit-btn {
  width: 100%;
  background: var(--accent); color: #000;
  border: none; border-radius: 50px;
  padding: 16px;
  font-size: 17px; font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
}
.submit-btn:disabled { opacity: 0.5; }

/* ===== Success ===== */
.success-box {
  text-align: center; padding: 60px 20px;
}
.success-icon { font-size: 72px; margin-bottom: 20px; }
.success-box h2 { font-size: 24px; margin-bottom: 16px; }
.success-order {
  background: var(--card);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  font-family: monospace;
  letter-spacing: 2px;
  margin-bottom: 16px;
  word-break: break-all;
}
.success-tip { color: var(--text2); font-size: 14px; margin-bottom: 24px; line-height: 1.5; }
.success-box .lookup-btn { margin-bottom: 12px; }

/* ===== Lookup ===== */
.lookup-header { padding: 40px 0 24px; text-align: center; }
.lookup-title { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.lookup-sub { color: var(--text2); font-size: 14px; }
.lookup-form {
  background: var(--card); border-radius: var(--radius);
  padding: 16px; border: 1px solid var(--border); margin-bottom: 16px;
}
.lookup-input {
  width: 100%; background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; color: var(--text);
  font-size: 16px; font-family: inherit; margin-bottom: 12px; display: block;
}
.lookup-input:focus { outline: none; border-color: var(--accent); }
.lookup-btn {
  width: 100%; background: var(--accent); color: #000;
  border: none; border-radius: 50px; padding: 14px;
  font-size: 16px; font-weight: 700; cursor: pointer;
}
.lookup-results { }
.result-count { font-size: 13px; color: var(--text2); margin-bottom: 12px; padding-left: 4px; }

/* ===== Order Cards ===== */
.order-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.oc-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.oc-num { font-size: 13px; font-weight: 700; font-family: monospace; letter-spacing: 0.5px; }
.oc-status {
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 50px;
}
.s-pending { background: rgba(245,158,11,0.2); color: var(--warn); }
.s-paid { background: rgba(0,212,255,0.15); color: var(--accent2); }
.s-accepted { background: rgba(34,197,94,0.15); color: var(--success); }
.s-done { background: rgba(136,136,136,0.2); color: var(--text2); }

.oc-body { padding: 10px 14px; }
.oc-row {
  display: flex; justify-content: space-between;
  font-size: 13px; padding: 4px 0; color: var(--text2);
}
.oc-row span:last-child { color: var(--text); font-weight: 500; }
.oc-price { color: var(--accent) !important; font-weight: 700 !important; }
.oc-actions {
  display: flex; gap: 8px; padding: 10px 14px;
  border-top: 1px solid var(--border);
}
.oc-act {
  flex: 1; padding: 8px; border: none; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.oc-act.accept { background: var(--success); color: #fff; }
.oc-act.done { background: var(--accent2); color: #000; }
.oc-act.ss { background: var(--card2); color: var(--text2); border: 1px solid var(--border); }
.oc-act.delete { background: #dc3545; color: #fff; }

/* ===== Admin ===== */
.admin-login-box {
  text-align: center; padding: 60px 20px;
}
.admin-login-icon { font-size: 48px; margin-bottom: 16px; }
.admin-login-box h2 { font-size: 20px; margin-bottom: 20px; }
.admin-login-box .lookup-input { margin-bottom: 12px; }
.admin-hint { font-size: 12px; color: var(--text3); margin-top: 12px; }
.admin-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 0 12px;
}
.admin-header h2 { font-size: 18px; }
.admin-logout {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 12px;
  color: var(--text2); font-size: 13px; cursor: pointer;
}
.admin-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab {
  flex-shrink: 0; background: var(--card); border: 1px solid var(--border);
  border-radius: 50px; padding: 6px 12px;
  color: var(--text2); font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 4px;
}
.admin-tab.active { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 600; }
.tab-count {
  background: rgba(0,0,0,0.2); border-radius: 50px; padding: 0 5px;
  font-size: 11px;
}
.admin-tab.active .tab-count { background: rgba(0,0,0,0.3); }

/* ===== Screenshot Modal ===== */
.ss-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.9);
  display: flex; align-items: center; justify-content: center;
  z-index: 300; padding: 20px;
}
.ss-modal img { max-width: 100%; max-height: 90vh; border-radius: 12px; }
.ss-close {
  position: absolute; top: 20px; right: 20px;
  background: rgba(255,255,255,0.1); border: none;
  border-radius: 50%; width: 40px; height: 40px;
  color: #fff; font-size: 18px; cursor: pointer;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8);
  z-index: 200; display: flex; align-items: flex-end;
}
.modal-content {
  background: var(--card);
  border-radius: 20px 20px 0 0;
  width: 100%; max-height: 90vh; overflow-y: auto;
}
.modal-close {
  position: absolute; top: 12px; right: 12px;
  background: var(--card2); border: none; border-radius: 50%;
  width: 32px; height: 32px; color: var(--text); cursor: pointer; font-size: 14px;
}
.modal-img { height: 200px; background: var(--card2); display: flex; align-items: center; justify-content: center; }
.modal-img img { width: 100%; height: 100%; object-fit: cover; }
.modal-body { padding: 16px; }
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.modal-sub { color: var(--text2); font-size: 13px; margin-bottom: 8px; }
.modal-core { color: var(--text2); font-size: 13px; line-height: 1.5; margin-bottom: 12px; }
.spec-list { margin-bottom: 12px; }
.spec-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.spec-k { color: var(--text2); }
.spec-v { font-weight: 600; }
.modal-feel { font-size: 12px; color: var(--text2); margin-bottom: 12px; line-height: 1.5; }
.modal-price { font-size: 28px; font-weight: 700; color: var(--accent); margin-bottom: 16px; }
.modal-price span { font-size: 14px; font-weight: 400; color: var(--text2); margin-left: 4px; }
.modal-add-btn {
  width: 100%; background: var(--accent); color: #000;
  border: none; border-radius: 50px; padding: 14px;
  font-size: 16px; font-weight: 700; cursor: pointer;
}

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 100px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text); color: #000;
  padding: 10px 24px; border-radius: 50px;
  font-size: 14px; font-weight: 600;
  z-index: 9999; opacity: 0;
  transition: all 0.3s;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .toast {
    bottom: 80px;
    padding: 8px 18px;
    font-size: 13px;
    max-width: calc(100vw - 40px);
    white-space: normal;
    text-align: center;
  }
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Sidebar ===== */
.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 199;
  display: none;
}
.sidebar-overlay.show { display: block; }

.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 56px; height: 100vh;
  background: var(--card);
  z-index: 200;
  transition: width 0.3s ease;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.sidebar.expanded { width: 280px; }

.sidebar-header {
  display: flex; align-items: center;
  padding: 16px 12px;
  border-bottom: 1px solid var(--border);
  height: 56px;
  gap: 12px;
}
.sidebar-header h2 {
  font-size: 16px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}
.sidebar.expanded .sidebar-header h2 { opacity: 1; }
.sidebar-toggle {
  background: var(--card2); border: none; border-radius: 8px;
  width: 32px; height: 32px; color: var(--text); cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s;
}
.sidebar.expanded .sidebar-toggle { transform: rotate(180deg); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.2s;
}
.sidebar.expanded .header-actions { opacity: 1; }

.top-bar__theme {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 6px;
  width: 28px; height: 28px;
  color: var(--text); cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}

.theme-select {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 6px; color: var(--text);
  font-size: 11px; cursor: pointer;
  max-width: 60px;
}

.sidebar-close {
  display: none;
}

.sidebar-nav {
  flex: 1; padding: 8px;
  display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto;
}
.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  font-size: 11px;
  border-top: 1px solid var(--border);
}
.sidebar-footer .sf-badge {
  color: var(--accent, #c8ff00);
  font-weight: 700;
  font-size: 11px;
}
.sidebar-footer .sf-sep {
  color: var(--text3, #666);
  font-size: 11px;
}
.sidebar-footer .sf-date {
  color: var(--text3, #888);
  font-size: 11px;
}
.sidebar-footer .sf-btn {
  background: none;
  border: 1px solid var(--border, #333);
  color: var(--text2, #888);
  font-size: 10px;
  cursor: pointer;
  padding: 3px 10px;
  border-radius: 20px;
  margin-left: auto;
}
.sidebar-footer .sf-btn:hover {
  border-color: var(--accent, #c8ff00);
  color: var(--accent, #c8ff00);
}
.sidebar-footer .sf-danger {
  border-color: #ff4757;
  color: #ff4757;
  margin-left: 4px;
}
.sidebar-footer .sf-danger:hover {
  background: rgba(255, 71, 87, 0.1);
}
.sidebar-version-panel {
  display: none;
  position: fixed;
  left: 280px;
  bottom: 60px;
  background: var(--card, #1a1a1a);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 12px;
  padding: 16px 20px;
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 201;
}
.sidebar-version-panel.show {
  display: block;
  animation: svFadeIn 0.2s ease;
}
@keyframes svFadeIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
.sidebar-version-panel .sv-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent, #c8ff00);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border, #333);
}
.sidebar-version-panel .sv-item {
  font-size: 12px;
  color: var(--text, #ccc);
  line-height: 1.5;
  padding: 3px 0;
}
.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: var(--radius-sm);
  color: var(--text2);
  text-decoration: none;
  font-size: 15px;
  transition: all 0.2s;
  white-space: nowrap;
  min-height: 44px;
}
.sidebar-link:hover { background: var(--card2); color: var(--text); }
.sidebar-link.active { background: var(--accent); color: #000; font-weight: 600; }
.sidebar-link.disabled { opacity: 0.5; cursor: not-allowed; }
.sidebar-icon { font-size: 20px; flex-shrink: 0; width: 24px; text-align: center; }
.sidebar-link span:not(.sidebar-icon) {
  opacity: 0;
  transition: opacity 0.2s;
}
.sidebar.expanded .sidebar-link span:not(.sidebar-icon) { opacity: 1; }
.sidebar-badge {
  margin-left: auto;
  background: var(--accent); color: #000;
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
}
.sidebar-link.active .sidebar-badge { background: #000; color: var(--accent); }
.sidebar-soon {
  margin-left: auto;
  background: var(--card2);
  font-size: 10px; padding: 2px 6px; border-radius: 4px;
  color: var(--text3);
}

.sidebar-group { margin-top: 8px; }
.sidebar-group-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 12px 4px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}
.sidebar.expanded .sidebar-group-title { opacity: 1; }

/* ===== Top Bar Menu ===== */
.top-bar__menu {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; width: 36px; height: 36px;
  color: var(--text); cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}

.top-bar__theme {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; width: 36px; height: 36px;
  color: var(--text); cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  margin-right: 8px;
}

.theme-switcher {
  display: flex; align-items: center; gap: 4px; margin-right: 8px;
}

.theme-select {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 8px; color: var(--text);
  font-size: 12px; cursor: pointer;
}

.top-bar__back,
.top-bar__close {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

/* ===== Utilities ===== */
.empty-state, .loading {
  text-align: center; padding: 40px;
  color: var(--text2); font-size: 14px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  /* Sidebar - overlay on mobile, hidden by default */
  .sidebar {
    width: 0;
    z-index: 201;
  }
  .sidebar.expanded {
    width: 280px;
  }
  .sidebar-header h2 {
    opacity: 0;
    width: 0;
    overflow: hidden;
  }
  .sidebar.expanded .sidebar-header h2 {
    opacity: 1;
    width: auto;
  }

  /* Main content - no margin on mobile */
  .page-inner,
  .content {
    margin-left: 0 !important;
  }

  /* Home page */
  .home-page {
    margin-left: 0;
    padding: 20px 16px;
  }

  /* Top bar */
  .top-bar {
    padding: 12px 16px;
  }
  .top-bar__logo {
    font-size: 18px;
  }
  .top-bar__menu,
  .top-bar__theme,
  .top-bar__cart {
    width: 36px;
    height: 36px;
  }

  /* Form inputs */
  .form-input {
    font-size: 16px;
  }

  /* Product cards */
  .product-list {
    gap: 8px;
  }

  /* Modal */
  .modal-content {
    max-height: 90vh;
    overflow-y: auto;
  }
}

@media (min-width: 480px) {
  .product-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
}

@media (min-width: 769px) {
  /* Desktop: sidebar visible, mode-nav visible */
  .sidebar {
    width: 56px;
  }
  .sidebar.expanded {
    width: 280px;
  }
  .sidebar-header h2 {
    opacity: 0;
    width: 0;
    overflow: hidden;
  }
  .sidebar.expanded .sidebar-header h2 {
    opacity: 1;
    width: auto;
  }
}
