/*
 * 灯泡闲鱼上货 — InApp Dashboard Style
 * Based on InApp Inventory Admin Dashboard design language
 * Pure CSS, zero framework dependencies
 * v11
 */

/* ===========================================
   01. CSS Custom Properties
   =========================================== */
:root {
  --brand: #E66239;
  --brand-hover: #D4552E;
  --brand-light: rgba(230, 98, 57, 0.08);
  --brand-ring: rgba(230, 98, 57, 0.2);

  --success: #00C951;
  --success-light: #e6f9ef;
  --danger: #FB2C36;
  --danger-light: #ffeaea;
  --info: #00B8DB;
  --info-light: #e6f8fc;
  --warning: #F0B100;
  --warning-light: #fff8e6;

  --text: #171717;
  --text-secondary: #525252;
  --text-muted: #737373;

  --bg: #f5f5f5;
  --card-bg: #ffffff;
  --sidebar-bg: #ffffff;
  --input-bg: #ffffff;
  --header-bg: #ffffff;

  --border: #e5e5e5;
  --border-light: #f0f0f0;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 40px;

  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-heading: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --transition: 0.2s ease;
  --sidebar-width: 230px;
}

/* ===========================================
   02. Reset & Base
   =========================================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ===========================================
   03. App Layout
   =========================================== */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ===========================================
   04. Sidebar Navigation
   =========================================== */
.tabs {
  position: sticky;
  top: 0;
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  z-index: 100;
  display: flex; flex-direction: column; overflow-y: auto;
}

/* Sidebar brand */
.tabs::before {
  content: '⚡ 灯泡闲鱼上货';
  display: block;
  padding: 24px 20px 20px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  border-bottom: 1px solid #fff;
  margin-bottom: 8px;
}


.tab {
  display: flex;
  align-items: center;
  padding: 11px 20px;
  margin: 2px 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  width: calc(100% - 24px);
}

.tab:hover {
  color: var(--text);
  background: var(--bg);
}

.tab.active {
  color: var(--brand);
  background: var(--brand-light);
  font-weight: 600;
}

/* ===========================================
   05. Main Content Area
   =========================================== */
#mainContent {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.tab-content {
  display: none;
  flex: 1;
  overflow: hidden;
  padding: 0 24px;
}

.tab-content.active { padding-bottom: 5px;
  display: flex;
  overflow-y: auto;
  flex-direction: column;
}

/* ===========================================
   06. Topbar / Header
   =========================================== */
.header {
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.header h1 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.header h1 span {
  font-weight: 400;
  opacity: 0.6;
  font-size: 13px;
}

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

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-xl);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
}

/* User avatar */
#userAvatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--brand-light);
  border: none;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: var(--brand);
  transition: all var(--transition);
}
.btn-page-active{background:#E66239;color:#fff;border:1px solid #E66239;font-weight:600}.btn-page-active:hover{background:#D4552E}

#userAvatar:hover {
  background: rgba(230, 98, 57, 0.18);
}

/* User menu dropdown */
#userMenu {
  display: none;
  position: absolute;
  right: 0;
  top: 44px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 12px 16px;
  min-width: 160px;
  z-index: 200;
}

#menuUsername { font-weight: 600; font-size: 13px; color: var(--text); }
#menuExpire { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }

#userMenu hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 6px 0;
}

#userMenu button {
  display: block;
  width: 100%;
  padding: 6px 0;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  font-family: var(--font-body);
  transition: color var(--transition);
}

#userMenu button:hover { color: var(--danger); }

/* ===========================================
   07. Toolbar
   =========================================== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* ===========================================
   08. Buttons
   =========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1.4;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

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

.btn-outline {
  background: #fff;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-outline:hover {
  background: var(--bg);
  border-color: #d4d4d4;
  color: var(--text);
}

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.btn-success:hover {
  background: #00b348;
}

.btn-danger {
  background: #fff;
  color: var(--danger);
  border-color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 5px 11px;
  font-size: 12px;
}

/* ===========================================
   09. Inputs & Selects
   =========================================== */
.input, .select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  transition: all var(--transition);
  outline: none;
  min-width: 120px;
}

.input:focus, .select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

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

.select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23737373'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.select option { background: #fff; color: var(--text); }

/* ===========================================
   10. Cards
   =========================================== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.card:hover {
  box-shadow: var(--shadow);
}

.card-list {
  display: grid;
  gap: 10px;
  display: flex; flex-direction: column; overflow: visible;
  flex: 1;
  min-height: 0;
  align-content: start;
}

/* Form card */
.form-card {
  max-width: 520px;
  margin-bottom: 16px;
}

.form-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text);
}

/* Form groups */
.form-group {
  margin-bottom: 12px;
}

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

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  transition: all var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.form-actions .btn { min-width: 80px; }

/* ===========================================
   11. Tables
   =========================================== */
.table-wrap {
  flex: 1;
  overflow: auto;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  min-height: 0;
}

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

th {
  background: #fafafa;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tr:hover td {
  background: #fafafa;
}

/* ===========================================
   12. Status Tags
   =========================================== */
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-xl);
  font-size: 11px;
  font-weight: 500;
}

.status-tag::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
}

.status-online { background: var(--success-light); color: #007931; }
.status-online::before { background: var(--success); }

.status-offline { background: #f5f5f5; color: #737373; }
.status-offline::before { background: #a3a3a3; }

.status-audit { background: var(--warning-light); color: #996e00; }
.status-audit::before { background: var(--warning); }

.status-pending { background: var(--warning-light); color: #996e00; }
.status-pending::before { background: var(--warning); }

.status-shipped { background: var(--info-light); color: #005a6e; }
.status-shipped::before { background: var(--info); }

.status-done { background: var(--success-light); color: #007931; }
.status-done::before { background: var(--success); }

.status-closed { background: #f5f5f5; color: #737373; }
.status-closed::before { background: #a3a3a3; }

/* ===========================================
   13. Pagination
   =========================================== */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 0;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.pager button {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: #fff;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}

.pager button:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-light);
}

.pager button:disabled { opacity: 0.35; cursor: default; }

.pager .pager-active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  font-weight: 600;
}

.pager .pager-ellipsis {
  border: none;
  color: var(--text-muted);
  cursor: default;
  background: transparent;
}

.pager .pager-info {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0 6px;
}

/* ===========================================
   14. Modal
   =========================================== */
.modal-overlay {
  display: flex;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeOverlay 0.15s ease;
}

@keyframes fadeOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 95%;
  max-width: 860px;
  max-height: 90vh;
  display: flex; flex-direction: column; overflow: visible;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
}

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

.modal-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 2;
}

.modal-header span {
  font-size: 15px;
  font-weight: 600;
}

.modal-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--bg);
  color: var(--text);
}

.modal-body{flex:1;overflow-y:auto;padding:16px 20px;min-height:0}

/* ===========================================
   15. Confirm Dialog
   =========================================== */
.confirm-overlay {
  display: flex;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeOverlay 0.15s ease;
}

.confirm-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px 20px;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
}

.confirm-box p {
  font-size: 14px;
  margin-bottom: 20px;
  color: var(--text);
}

.confirm-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.confirm-actions .btn { min-width: 80px; }

/* ===========================================
   16. Toast Notifications
   =========================================== */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 3000;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  max-width: 380px;
  box-shadow: var(--shadow-md);
  animation: slideInRight 0.25s ease;
}

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

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

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

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--info); }

/* ===========================================
   17. Empty State
   =========================================== */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 40px;
  margin-bottom: 10px;
}

.empty-state p { font-size: 14px; }

/* ===========================================
   18. Stats Bar
   =========================================== */
.stats-bar {
  display: flex;
  gap: 12px;
  padding: 16px 0 0;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.stats-bar:empty { display: none; }

.stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  min-width: 130px;
  flex: 1;
}

.stat-card:hover {
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  background: var(--brand-light);
}

.stat-info { display: flex; flex-direction: column; }

.stat-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 1px;
}

/* ===========================================
   19. Settings Panel
   =========================================== */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.settings-grid .full-width { grid-column: 1 / -1; }

.set-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: visible;
}

.set-card:hover { box-shadow: var(--shadow); }

.set-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: #fafafa;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.set-card-head .sc-icon { font-size: 14px; }

.set-card-body { padding: 12px 14px; }

.set-card-body .fg { margin-bottom: 8px; }

.set-card-body .fg:last-child { margin-bottom: 8px; }

.set-card-body .fg label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 3px;
  font-weight: 500;
}

.set-card-body .fg input,
.set-card-body .fg select,
.set-card-body .fg textarea {
  width: 100%;
  padding: 7px 10px;
  font-size: 13px;
  font-family: var(--font-body);
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  transition: all var(--transition);
  outline: none;
}

.set-card-body .fg input:focus,
.set-card-body .fg select:focus,
.set-card-body .fg textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-ring);
}

.set-card-body .fg textarea { resize: vertical; min-height: 48px; }

.set-card-body .fg-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.set-card-body .fg-inline input[type=number] {
  width: 64px;
  text-align: center;
}

.set-card-body .fg-inline span {
  color: var(--text-secondary);
  font-size: 13px;
}

.set-card-body .fg-radio {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.set-card-body .fg-radio label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
}

.set-card-body .fg-radio input[type=radio] {
  width: auto;
  accent-color: var(--brand);
}

.replace-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
}

.replace-row input {
  padding: 5px 8px;
  font-size: 12px;
  font-family: var(--font-body);
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  transition: all var(--transition);
  flex: 1;
}

.replace-row input:focus { border-color: var(--brand); outline: none; }

.replace-row .arr { color: var(--text-muted); font-size: 13px; }

.replace-row .del-btn {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 15px;
  padding: 1px 4px;
}

.replace-row .del-btn:hover { opacity: 0.7; }

.add-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  color: var(--brand);
  cursor: pointer;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  background: transparent;
  transition: all var(--transition);
  font-family: var(--font-body);
}

.add-link:hover {
  background: var(--brand-light);
  border-color: var(--brand);
}

.settings-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
  grid-column: 1 / -1;
}

.settings-footer .btn { min-width: 80px; }

/* ===========================================
   20. Address Selector
   =========================================== */
.addr-display {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  transition: all var(--transition);
  min-height: 38px;
  background: #fff;
}

.addr-display:hover { border-color: #d4d4d4; }

.addr-display.disabled {
  background: #fafafa;
  color: var(--text-muted);
  cursor: not-allowed;
}

.addr-arrow { font-size: 9px; color: var(--text-muted); }

.addr-panel {
  margin-top: 6px;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
}

.addr-row { display: flex; gap: 6px; }

.addr-row select {
  flex: 1;
  padding: 6px 8px;
  font-size: 13px;
  font-family: var(--font-body);
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  transition: all var(--transition);
  outline: none;
}

.addr-row select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-ring);
}

/* ===========================================
   21. Bulk Table
   =========================================== */
#tab-bulk .table-wrap { flex: 1; overflow: auto; min-height: 0; }

#bulkTable { table-layout: auto; }

#bulkTable thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fafafa;
}

#bulkTable td {
  padding: 5px 7px;
  font-size: 13px;
  vertical-align: middle;
}

#bulkTable td.col-title {
  max-width: 200px;
  padding-right: 3px;
}
#bulkTable td.col-price {
  width: 90px;
  padding-left: 4px;
  white-space: nowrap;
}
#bulkTable td.changed { color: var(--brand); font-weight: 600; }

.result-cell { text-align: center; min-width: 90px; }

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

.result-ok { color: var(--success); font-weight: 600; font-size: 12px; }

.result-fail { color: var(--danger); font-weight: 600; font-size: 12px; }

/* ===========================================
   22. Detail Table
   =========================================== */
.detail-table {
  font-size: 13px;
  width: 100%;
}

.detail-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-light);
}

.detail-table td:first-child {
  color: var(--text-secondary);
  width: 120px;
  vertical-align: top;
  font-weight: 500;
}

.detail-table td:last-child { word-break: break-all; }

/* ===========================================
   23. Shop Chips
   =========================================== */
.shop-chip {
  display: inline-block;
  margin: 3px 6px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
  background: #fff;
}

.shop-chip:hover,
.shop-chip:active {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-light);
}

/* ===========================================
   24. Loading / Skeleton
   =========================================== */
.loading {
  text-align: center;
  padding: 36px;
  color: var(--text-muted);
  font-size: 13px;
  flex-shrink: 0;
}

.loading::before {
  content: '';
  display: block;
  width: 24px; height: 24px;
  margin: 0 auto 8px;
  border: 2.5px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.skeleton {
  background: linear-gradient(90deg, #f5f5f5, #e5e5e5, #f5f5f5);
  background-size: 600px 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: -300px 0; }
  100% { background-position: 300px 0; }
}

/* ===========================================
   25. Scrollbar
   =========================================== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d4d4d4; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a3a3a3; }

/* ===========================================
   26. Login Page
   =========================================== */
#loginOverlay {
  display: flex;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  background: #f5f5f5 !important;
}

#loginOverlay > div {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: 100%;
  max-width: 390px;
  box-shadow: var(--shadow-lg);
}

#loginTitle {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

#loginOverlay .form-group input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  transition: all var(--transition);
  outline: none;
}

#loginOverlay .form-group input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

#loginBtn {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  transition: all var(--transition);
}

#loginBtn:hover {
  background: var(--brand-hover);
}

/* ===========================================
   27. Progress Bar
   =========================================== */
#progressBarWrap {
  background: var(--border);
  border-radius: 3px;
  height: 5px;
  margin-bottom: 10px;
  overflow: visible;
}

#progressBar {
  height: 5px;
  border-radius: 3px;
  background: var(--brand);
  width: 0%;
  transition: width 0.3s ease;
}

#progressStatus {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

#progressList {
  max-height: 50vh;
  display: flex; flex-direction: column; overflow: visible;
  font-size: 12px;
}

#progressList > div {
  padding: 3px 0;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ===========================================
   28. Publish Modal Shop List
   =========================================== */
#publishShopList {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

#publishShopSearch {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: all var(--transition);
}

#publishShopSearch:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

/* ===========================================
   29. Progress Minimize Animation
   =========================================== */
#progressModal {
  transition: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: top right;
}

#progressModal.minimizing {
  transform: scale(0.05) translate(40vw, -45vh);
  opacity: 0;
  pointer-events: none;
}

#progressModal.restoring {
  transform: scale(0.05) translate(40vw, -45vh);
  opacity: 0;
}

#miniProgressBar {
  transition: opacity 0.2s ease;
}

/* ===========================================
   30. Responsive
   =========================================== */
@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }

  #app { flex-direction: column; }

  .tabs {
    position: sticky;
    top: 0;
    width: 100%;
    min-width: 100%;
    height: auto;
    flex-direction: row;
    padding: 0 8px;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-wrap: nowrap;
  }

  .tabs::before { display: none; }

  .tab {
    flex-shrink: 0;
    padding: 10px 12px;
    font-size: 12px;
    margin: 0;
    width: auto;
    border-radius: 0;
    border-bottom: 2px solid transparent;
  }

  .tab.active {
    border-bottom-color: var(--brand);
    background: transparent;
  }

  #mainContent { padding: 0; }

  .tab-content { padding: 12px 10px; }

  .header { padding: 0 12px; height: 50px; }
  .header h1 { font-size: 14px; }

  .stats-bar { gap: 6px; }
  .stat-card { min-width: 100px; padding: 10px 12px; }
  .stat-num { font-size: 17px; }

  .settings-grid { grid-template-columns: 1fr; }
  .settings-grid .full-width { grid-column: 1; }

  .toolbar { gap: 5px; }

  .modal {
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin-top: auto;
    max-height: 85vh;
  }

  .pager { gap: 3px; }
  .pager button { padding: 5px 9px; font-size: 11px; }
}

.modal-footer{position:sticky;bottom:0;background:#fff;padding:12px 20px;border-top:1px solid #e5e5e5;display:flex;gap:10px;justify-content:flex-end;z-index:10}
#tab-recharge .card{margin-top:14px}
