/* ===== RESET & ROOT ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== THEME: WHITE WITH PURPLE (Default / Light) ===== */
:root, [data-theme="light"] {
  --bg: #F8F6FC;
  --surface: #FFFFFF;
  --surface2: #F3EEFC;
  --surface3: #EADEFB;
  --border: #E5D9F8;
  --border2: #D2BEF2;

  --text: #180D2E;
  --text2: #5A4876;
  --text3: #9382AB;

  --accent: #7C3AED;
  --accent-light: #F3E8FF;
  --accent-hover: #6D28D9;
  --accent-glow: rgba(124, 58, 237, 0.25);

  --green: #10B981;
  --green-bg: #ECFDF5;
  --red: #EF4444;
  --red-bg: #FEF2F2;
  --orange: #F59E0B;
  --orange-bg: #FFFBEB;
  --purple: #7C3AED;
  --purple-bg: #F5F3FF;
  --purple-glow: rgba(124, 58, 237, 0.25);

  --sidebar-bg: #FFFFFF;
  --sidebar-border: #E5D9F8;
  --card-bg: #FFFFFF;
  --modal-bg: #FFFFFF;

  /* Marketplace colors */
  --amazon: #FF9900;
  --flipkart: #2874F0;
  --meesho: #F43397;
  --myntra: #FF3F6C;
  --ajio: #8B1A4A;

  --sidebar-w: 230px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(124, 58, 237, 0.05), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 14px rgba(124, 58, 237, 0.08), 0 2px 4px rgba(0,0,0,0.03);
  --shadow-lg: 0 12px 32px rgba(124, 58, 237, 0.12), 0 4px 10px rgba(0,0,0,0.05);

  --font: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'DM Mono', monospace;
  --brand-gradient: linear-gradient(135deg, #7C3AED 0%, #9333EA 100%);
}

/* ===== THEME: BLACK (PRIMARY) WITH PURPLE (SECONDARY) (Dark Theme) ===== */
[data-theme="dark"] {
  /* Black as Primary Base */
  --bg: #000000;
  --surface: #0B0B0E;
  --surface2: #131318;
  --surface3: #1C1A22;
  --sidebar-bg: #050507;
  --sidebar-border: #1E1729;
  --card-bg: #0B0B0E;
  --modal-bg: #0E0E12;

  /* Purple as Secondary Accent / Highlight */
  --border: #221634;
  --border2: #382256;

  --text: #FFFFFF;
  --text2: #D5C7EE;
  --text3: #8C7BA8;

  --accent: #A855F7;
  --accent-light: rgba(168, 85, 247, 0.16);
  --accent-hover: #C084FC;
  --accent-glow: rgba(168, 85, 247, 0.45);

  --green: #10B981;
  --green-bg: rgba(16, 185, 129, 0.15);
  --red: #F87171;
  --red-bg: rgba(239, 68, 68, 0.15);
  --orange: #FBBF24;
  --orange-bg: rgba(245, 158, 11, 0.15);
  --purple: #C084FC;
  --purple-bg: rgba(168, 85, 247, 0.18);
  --purple-glow: rgba(168, 85, 247, 0.45);

  --shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 1px rgba(168, 85, 247, 0.3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.85), 0 0 12px rgba(168, 85, 247, 0.15);
  --shadow-lg: 0 14px 44px rgba(0, 0, 0, 0.95), 0 0 26px rgba(168, 85, 247, 0.22);
  --brand-gradient: linear-gradient(135deg, #A855F7 0%, #C084FC 100%);
}

html, body {
  height: 100%;
  background: var(--bg);
  font-family: var(--font);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* ===== LAYOUT ===== */
#app { display: flex; height: 100vh; overflow: hidden; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
}
.brand-icon {
  font-size: 24px;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  filter: drop-shadow(0 2px 6px var(--accent-glow));
}
.brand-name { display: block; font-weight: 700; font-size: 14.5px; letter-spacing: -0.3px; }
.brand-sub { display: block; font-size: 10.5px; color: var(--text3); letter-spacing: 0.3px; }

.sidebar-nav { padding: 10px 10px; flex: 1; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 12px;
  background: none; border: none; border-radius: var(--radius);
  color: var(--text2); font-family: var(--font); font-size: 13.5px; font-weight: 500;
  cursor: pointer; text-align: left; transition: all 0.15s ease;
  position: relative;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-icon { font-size: 14px; width: 18px; text-align: center; }
.nav-badge {
  margin-left: auto; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 600; padding: 1px 5px;
  border-radius: 10px; line-height: 1.4;
}

.sidebar-marketplaces { padding: 12px 16px; border-top: 1px solid var(--border); }
.mp-label { font-size: 10px; font-weight: 700; letter-spacing: 0.8px; color: var(--text3); margin-bottom: 8px; }
.mp-pills { display: flex; gap: 5px; flex-wrap: wrap; }
.mp-pill {
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 4px; letter-spacing: 0.3px;
}
.mp-pill.amazon { background: #FFF3E0; color: var(--amazon); }
.mp-pill.flipkart { background: #E3F0FF; color: var(--flipkart); }
.mp-pill.meesho { background: #FDE8F2; color: var(--meesho); }
.mp-pill.myntra { background: #FFE8ED; color: var(--myntra); }
.mp-pill.ajio { background: #F3E5ED; color: var(--ajio); }

[data-theme="dark"] .mp-pill.amazon { background: rgba(255, 153, 0, 0.15); color: #FFA726; border: 1px solid rgba(255, 153, 0, 0.3); }
[data-theme="dark"] .mp-pill.flipkart { background: rgba(40, 116, 240, 0.15); color: #60A5FA; border: 1px solid rgba(40, 116, 240, 0.3); }
[data-theme="dark"] .mp-pill.meesho { background: rgba(244, 51, 151, 0.15); color: #F472B6; border: 1px solid rgba(244, 51, 151, 0.3); }
[data-theme="dark"] .mp-pill.myntra { background: rgba(255, 63, 108, 0.15); color: #FB7185; border: 1px solid rgba(255, 63, 108, 0.3); }
[data-theme="dark"] .mp-pill.ajio { background: rgba(139, 26, 74, 0.2); color: #E879F9; border: 1px solid rgba(139, 26, 74, 0.35); }

/* ===== THEME SWITCHER CONTROLS ===== */
.sidebar-footer { padding: 12px 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }

.theme-switch-container {
  display: flex;
  background: var(--surface2);
  padding: 3px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  gap: 3px;
}
.theme-btn {
  flex: 1;
  padding: 6px 6px;
  border: none;
  background: transparent;
  color: var(--text2);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.theme-btn:hover {
  color: var(--text);
}
.theme-btn.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}
[data-theme="dark"] .theme-btn.active {
  background: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.sync-btn {
  width: 100%; padding: 9px 12px; border-radius: var(--radius);
  background: var(--brand-gradient); color: #fff;
  border: none; font-family: var(--font); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s ease;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 2px 8px var(--purple-glow);
}
.sync-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--purple-glow);
}
.sync-btn.spinning #sync-icon { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== MAIN CONTENT ===== */
.main-content { flex: 1; overflow-y: auto; background: var(--bg); }
.page { display: none; padding: 28px 32px; min-height: 100%; animation: fadeIn 0.2s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===== PAGE HEADER ===== */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-title { font-size: 20px; font-weight: 600; letter-spacing: -0.4px; }
.page-sub { font-size: 13px; color: var(--text3); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; align-items: center; }

/* ===== STAT CARDS ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
  box-shadow: var(--shadow);
}
.stat-label { font-size: 11px; font-weight: 600; letter-spacing: 0.6px; color: var(--text3); text-transform: uppercase; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 600; letter-spacing: -1px; line-height: 1; }
.stat-sub { font-size: 12px; color: var(--text3); margin-top: 4px; }
.stat-card.green .stat-value { color: var(--green); }
.stat-card.red .stat-value { color: var(--red); }
.stat-card.orange .stat-value { color: var(--orange); }
.stat-card.blue .stat-value { color: var(--accent); }

/* ===== CARDS ===== */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  overflow: hidden; margin-bottom: 20px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 14px; font-weight: 600; }
.card-body { padding: 20px; }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--surface2); }
th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.5px; color: var(--text3); text-transform: uppercase; white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }
.empty-row td { text-align: center; color: var(--text3); padding: 40px; font-size: 13px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius);
  font-family: var(--font); font-size: 13px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent; transition: all 0.15s;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border2); }
.btn-secondary:hover { background: var(--surface2); }
.btn-danger { background: var(--red-bg); color: var(--red); border-color: #FECACA; }
.btn-danger:hover { background: #FEE2E2; }
.btn-success { background: var(--green-bg); color: var(--green); border-color: #BBF7D0; }
.btn-success:hover { background: #DCFCE7; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { background: none; border: none; cursor: pointer; padding: 5px; color: var(--text3); border-radius: 5px; font-size: 14px; transition: all 0.15s; }
.btn-icon:hover { background: var(--surface2); color: var(--text); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.2px;
}
.badge-pending { background: var(--orange-bg); color: var(--orange); }
.badge-accepted { background: var(--accent-light); color: var(--accent); }
.badge-processing { background: var(--purple-bg); color: var(--purple); }
.badge-shipped { background: var(--green-bg); color: var(--green); }
.badge-delivered { background: #ECFDF5; color: #065F46; }
.badge-cancelled { background: #FEE2E2; color: #B91C1C; }
.badge-active { background: var(--green-bg); color: var(--green); }
.badge-inactive { background: var(--surface2); color: var(--text3); }

/* Marketplace badges */
.badge-amazon { background: #FFF3E0; color: var(--amazon); }
.badge-flipkart { background: #E3F0FF; color: var(--flipkart); }
.badge-meesho { background: #FDE8F2; color: var(--meesho); }
.badge-myntra { background: #FFE8ED; color: var(--myntra); }
.badge-ajio { background: #F3E5ED; color: var(--ajio); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; gap: 14px; margin-bottom: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
label { display: block; font-size: 12px; font-weight: 500; color: var(--text2); margin-bottom: 5px; }
input, select, textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border2);
  border-radius: var(--radius); font-family: var(--font); font-size: 13.5px;
  color: var(--text); background: var(--surface); transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
select option { background: var(--surface); color: var(--text); }
textarea { resize: vertical; min-height: 80px; }
.input-group { display: flex; align-items: center; }
.input-prefix { padding: 8px 10px; background: var(--surface2); border: 1px solid var(--border2); border-right: none; border-radius: var(--radius) 0 0 var(--radius); font-size: 13px; color: var(--text3); }
.input-group input { border-radius: 0 var(--radius) var(--radius) 0; }

/* ===== ACCOUNT BADGE ===== */
.account-badge {
  background: var(--mp-bg);
  color: var(--mp-color);
  border: 1px solid color-mix(in srgb, var(--mp-color) 35%, transparent);
  font-weight: 600;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}
[data-theme="dark"] .account-badge {
  background: color-mix(in srgb, var(--mp-color) 16%, #110B1E);
  border-color: color-mix(in srgb, var(--mp-color) 45%, transparent);
}

/* ===== SEARCH BAR ===== */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; background: var(--surface);
  border: 1px solid var(--border2); border-radius: var(--radius);
  flex: 1; max-width: 320px;
}
.search-bar input { border: none; padding: 0; font-size: 13.5px; background: transparent; flex: 1; color: var(--text); }
.search-bar input:focus { box-shadow: none; }
.search-icon { color: var(--text3); font-size: 14px; }

/* ===== FILTER BAR ===== */
.filter-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.filter-select { padding: 7px 10px; font-size: 13px; min-width: 130px; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px); z-index: 100; display: none;
}
[data-theme="dark"] .modal-overlay {
  background: rgba(0,0,0,0.75);
}
.modal-overlay.active { display: block; }
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -55%);
  background: var(--modal-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); z-index: 101; width: 90%; max-width: 580px;
  max-height: 85vh; overflow-y: auto; display: none; padding: 28px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.modal.active { display: block; transform: translate(-50%, -50%); }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 6px;
  width: 28px; height: 28px; cursor: pointer; font-size: 13px; color: var(--text2);
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--surface3); color: var(--text); }
.modal h2 { font-size: 17px; font-weight: 600; margin-bottom: 20px; }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ===== TOAST ===== */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 16px; border-radius: var(--radius);
  background: var(--text); color: #fff;
  font-size: 13px; font-weight: 450; box-shadow: var(--shadow-md);
  animation: slideUp 0.25s ease; min-width: 240px; max-width: 340px;
  display: flex; align-items: center; gap: 8px;
}
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
.toast.warning { background: var(--orange); }
@keyframes slideUp { from { opacity:0; transform: translateY(12px); } to { opacity:1; transform:none; } }

/* ===== STOCK INDICATOR ===== */
.stock-bar { display: flex; align-items: center; gap: 8px; }
.stock-num { font-family: var(--mono); font-size: 13px; font-weight: 500; min-width: 36px; }
.stock-num.low { color: var(--orange); }
.stock-num.out { color: var(--red); }
.stock-num.ok { color: var(--green); }

/* ===== MARKETPLACE BADGE ===== */
.mp-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 4px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.3px;
}

/* ===== ORDER CARD ===== */
.order-row-expand { background: var(--surface2); }
.order-expand-content { padding: 14px 20px; }
.order-items-list { display: flex; flex-direction: column; gap: 6px; }
.order-item-row { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.order-item-row:last-child { border-bottom: none; }

/* ===== LABEL MODAL ===== */
.label-modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); z-index: 200; width: 440px;
  max-height: 90vh; overflow-y: auto;
}
.label-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.label-modal-header h3 { font-size: 15px; font-weight: 600; }
.label-modal-actions { display: flex; gap: 8px; align-items: center; }
.label-modal-body { padding: 20px; }

/* ===== SHIPMENT LABEL ===== */
.label-print {
  border: 2px solid var(--text); border-radius: 8px;
  padding: 20px; font-family: var(--mono);
}
.label-header { display: flex; justify-content: space-between; margin-bottom: 14px; border-bottom: 2px solid var(--text); padding-bottom: 12px; }
.label-marketplace { font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.label-awb { font-size: 11px; color: var(--text2); }
.label-section { margin-bottom: 12px; }
.label-section-title { font-size: 9px; letter-spacing: 1px; font-weight: 700; color: var(--text3); margin-bottom: 4px; }
.label-section-value { font-size: 13px; font-weight: 500; line-height: 1.5; }
.label-barcode {
  text-align: center; padding: 12px; background: var(--surface2);
  border-radius: 6px; margin-top: 14px;
  font-size: 24px; letter-spacing: 8px; font-weight: 700;
}
.label-barcode-num { font-size: 11px; letter-spacing: 2px; margin-top: 4px; color: var(--text2); }

/* ===== SYNC PAGE ===== */
.sync-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.sync-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow);
}
.sync-card-mp { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.sync-card-count { font-size: 22px; font-weight: 600; margin-bottom: 2px; }
.sync-card-meta { font-size: 11px; color: var(--text3); margin-bottom: 14px; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.sync-dot.ok { background: var(--green); }
.sync-dot.warn { background: var(--orange); }
.sync-dot.never { background: var(--border2); }

/* ===== TOGGLE SWITCH ===== */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  vertical-align: middle;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border2);
  transition: .2s ease;
  border-radius: 20px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s ease;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
input:checked + .slider {
  background-color: var(--green);
}
input:checked + .slider:before {
  transform: translateX(16px);
}

/* ===== PROGRESS / LOADING ===== */
.loading { display: flex; align-items: center; justify-content: center; padding: 60px; color: var(--text3); gap: 10px; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--border2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }

/* ===== TABS ===== */
.tab-bar { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  padding: 10px 18px; background: none; border: none; border-bottom: 2px solid transparent;
  font-family: var(--font); font-size: 13.5px; color: var(--text3); cursor: pointer;
  transition: all 0.15s; margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }

/* ===== SKU CODE ===== */
.sku-code { font-family: var(--mono); font-size: 11.5px; color: var(--text3); background: var(--surface2); padding: 2px 6px; border-radius: 4px; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 10px; }

/* ===== UTILITY ===== */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text3); }
.text-sm { font-size: 12px; }
.mono { font-family: var(--mono); }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.fw-6 { font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ===== PRINT ===== */
@media print {
  body * { visibility: hidden; }
  .label-print, .label-print * { visibility: visible; }
  .label-print { position: fixed; top: 20px; left: 20px; width: 400px; }
}

/* ===== TOGGLE SWITCH ===== */
.switch-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
}
.switch-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
  margin: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border2);
  transition: .2s ease;
  border-radius: 20px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s ease;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
input:checked + .slider {
  background-color: var(--accent);
}
input:focus + .slider {
  box-shadow: 0 0 1px var(--accent);
}
input:checked + .slider:before {
  transform: translateX(16px);
}

/* ===== SYNC PROGRESS BAR ===== */
.sync-progress-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.sync-progress-bar-wrap {
  width: 100%;
  height: 14px;
  background: var(--surface3);
  border-radius: 20px;
  overflow: hidden;
  margin: 10px 0;
  position: relative;
}
.sync-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #6366f1);
  border-radius: 20px;
  transition: width 0.25s ease-out;
  background-size: 28px 28px;
  background-image: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.25) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.25) 50%,
    rgba(255, 255, 255, 0.25) 75%,
    transparent 75%,
    transparent
  );
  animation: progressStripe 1s linear infinite;
}
.sync-progress-bar-fill.done {
  background: #22c55e !important;
  animation: none !important;
}
@keyframes progressStripe {
  0% { background-position: 0 0; }
  100% { background-position: 28px 0; }
}
