/* ═══════════════════════════════════════════════════
   PayXip Dashboard — Premium Black & White Design
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── Design Tokens ─────────────────────────────── */
:root {
  --bg-primary: #000000;
  --bg-secondary: #0A0A0A;
  --bg-card: #111111;
  --bg-card-hover: #161616;
  --bg-elevated: #1A1A1A;
  --bg-input: #0D0D0D;
  --bg-glass: rgba(255,255,255,0.03);

  --border-primary: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.15);
  --border-active: rgba(255,255,255,0.25);

  --text-primary: #FFFFFF;
  --text-secondary: rgba(255,255,255,0.6);
  --text-tertiary: rgba(255,255,255,0.35);
  --text-muted: rgba(255,255,255,0.2);

  --accent: #FFFFFF;
  --accent-dim: rgba(255,255,255,0.1);
  --success: #00D26A;
  --success-dim: rgba(0,210,106,0.12);
  --warning: #FFB800;
  --warning-dim: rgba(255,184,0,0.12);
  --danger: #FF4757;
  --danger-dim: rgba(255,71,87,0.12);
  --info: #5B8DEF;
  --info-dim: rgba(91,141,239,0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-xl: 0 16px 64px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 60px rgba(255,255,255,0.03);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-base: 250ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 400ms cubic-bezier(0.16, 1, 0.3, 1);

  --sidebar-width: 260px;
  --header-height: 64px;
}

/* ── Reset ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 14px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ── Scrollbar ─────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Auth Screen ───────────────────────────────── */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  overflow: hidden;
}

.auth-screen::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.02) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 48px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  position: relative;
  animation: authFadeIn 0.6s var(--transition-base);
}

@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
  justify-content: center;
}

.auth-logo svg { width: 36px; height: 36px; }

.auth-logo span {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.auth-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: -0.03em;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 32px;
}

.auth-subtitle strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* Auth Steps */
.auth-step {
  display: none;
  animation: authStepIn 0.35s ease-out;
}

.auth-step.active {
  display: block;
}

@keyframes authStepIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Auth Back Button */
.auth-back-btn {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  margin-bottom: 20px;
  transition: color var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.auth-back-btn:hover {
  color: var(--text-primary);
}

/* Auth Error */
.auth-error {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid rgba(255,71,87,0.2);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  animation: authErrorIn 0.3s ease-out;
}

@keyframes authErrorIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Password Input Wrap */
.password-input-wrap {
  position: relative;
}

.password-input-wrap .form-input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.password-toggle:hover {
  color: var(--text-primary);
}

/* Auth Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-primary);
}

.auth-divider span {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* Auth Button Spinner */
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0,0,0,0.15);
  border-top-color: #000;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
}

.btn-secondary .btn-spinner {
  border-color: rgba(255,255,255,0.15);
  border-top-color: #fff;
}

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

.auth-switch-btn {
  font-size: 13px;
}

/* Forgot Password Link */
.auth-forgot-link {
  display: inline-block;
  font-size: 12px;
  color: var(--text-tertiary);
  text-decoration: none;
  margin-top: 8px;
  transition: color var(--transition-fast);
}

.auth-forgot-link:hover {
  color: var(--text-primary);
}

/* Auth Footer Text */
.auth-footer-text {
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-primary);
}

.auth-link-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity var(--transition-fast);
}

.auth-link-btn:hover {
  opacity: 0.8;
}

.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.05);
}

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

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  width: 100%;
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 14px 24px;
  font-weight: 700;
}

.btn-primary:hover {
  background: rgba(255,255,255,0.9);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255,255,255,0.1);
}

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

.btn-primary:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--accent-dim);
}

.btn-sm { padding: 8px 16px; font-size: 13px; }

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--accent-dim);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid rgba(255,71,87,0.2);
}

.btn-danger:hover {
  background: rgba(255,71,87,0.2);
}

/* ── Dashboard Layout ──────────────────────────── */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition-slow);
}

.sidebar-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-primary);
  height: var(--header-height);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo svg { width: 28px; height: 28px; }

.sidebar-logo span {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  user-select: none;
}

.nav-item:hover {
  background: var(--accent-dim);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--text-primary);
  border-radius: 0 3px 3px 0;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  flex-shrink: 0;
}

.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-primary);
}

.store-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-glass);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
}

.store-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: var(--text-primary);
}

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

.store-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.store-plan {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Main Content ──────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.main-header {
  height: var(--header-height);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-primary);
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.main-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
}

.page-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  background: var(--success-dim);
  color: var(--success);
  border: 1px solid rgba(0,210,106,0.15);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}

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

.status-pill.inactive {
  background: var(--warning-dim);
  color: var(--warning);
  border-color: rgba(255,184,0,0.15);
}

.status-pill.inactive .status-dot {
  background: var(--warning);
}

/* ── Page Content ──────────────────────────────── */
.page-content {
  padding: 28px 32px;
  max-width: 1400px;
}

.page-section {
  margin-bottom: 28px;
  animation: sectionFadeIn 0.5s ease-out;
}

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

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ── Stats Grid ────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(255,255,255,0.02) 0%, transparent 70%);
  pointer-events: none;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 100px;
}

.stat-change.up {
  color: var(--success);
  background: var(--success-dim);
}

.stat-change.down {
  color: var(--danger);
  background: var(--danger-dim);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  background: var(--accent-dim);
}

.stat-icon svg { width: 20px; height: 20px; color: var(--text-secondary); }

/* ── Charts ────────────────────────────────────── */
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-base);
}

.chart-card:hover {
  border-color: var(--border-hover);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.chart-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.chart-legend {
  display: flex;
  gap: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.chart-area {
  height: 220px;
  position: relative;
}

.charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

/* ── Canvas Chart ──────────────────────────────── */
.chart-canvas-wrap {
  width: 100%;
  height: 100%;
  position: relative;
}

.chart-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ── Data Table ────────────────────────────────── */
.data-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 14px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-primary);
}

.data-table td {
  padding: 14px 20px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-primary);
  transition: background var(--transition-fast);
}

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

.data-table tr:hover td {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.order-id-cell {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-cod {
  background: var(--warning-dim);
  color: var(--warning);
}

.badge-online {
  background: var(--success-dim);
  color: var(--success);
}

.badge-razorpay {
  background: var(--info-dim);
  color: var(--info);
}

.table-empty {
  padding: 48px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
}

.table-empty svg {
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  opacity: 0.3;
}

/* ── Settings ──────────────────────────────────── */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-base);
}

.settings-card:hover {
  border-color: var(--border-hover);
}

.settings-card-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-card-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 20px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid var(--border-primary);
}

.settings-row:first-of-type { border-top: none; }

.settings-row-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.settings-row-value {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Toggle Switch ─────────────────────────────── */
.toggle {
  width: 44px;
  height: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-tertiary);
  transition: all var(--transition-fast);
}

.toggle.on {
  background: var(--text-primary);
  border-color: var(--text-primary);
}

.toggle.on::after {
  transform: translateX(20px);
  background: var(--bg-primary);
}

/* ── Select Input ──────────────────────────────── */
.form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
}

.form-select:focus {
  border-color: var(--border-active);
}

/* ── Upsells ───────────────────────────────────── */
.upsell-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upsell-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 12px;
  transition: all var(--transition-base);
}

.upsell-card:hover {
  border-color: var(--border-hover);
}

.upsell-img {
  width: 56px;
  height: 56px;
  min-width: 56px;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
}

.upsell-img-placeholder {
  width: 56px;
  height: 56px;
  min-width: 56px;
}

.upsell-info {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.upsell-body {
  flex: 1;
  min-width: 0;
}

.upsell-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upsell-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.upsell-price {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.upsell-compare {
  font-size: 12px;
  color: var(--text-tertiary);
  text-decoration: line-through;
}

.upsell-discount {
  font-size: 11px;
  font-weight: 700;
  color: var(--success);
  background: var(--success-dim);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  letter-spacing: -0.01em;
}

.upsell-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Inline Discount Input */
.upsell-discount-input {
  display: flex;
  align-items: center;
  gap: 6px;
}

.upsell-discount-label {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.upsell-discount-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.upsell-discount-field {
  width: 42px;
  padding: 4px 6px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}

.upsell-discount-field::-webkit-inner-spin-button,
.upsell-discount-field::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.upsell-discount-pct {
  font-size: 12px;
  color: var(--text-tertiary);
  padding-right: 6px;
  font-weight: 600;
}

.upsell-remove {
  padding: 6px 14px;
  background: var(--danger-dim);
  border: 1px solid rgba(255,71,87,0.15);
  color: var(--danger);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.upsell-remove:hover { background: rgba(255,71,87,0.2); }

/* ── Product Search ────────────────────────────── */
.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.search-input {
  flex: 1;
  padding: 12px 16px 12px 42px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: all var(--transition-fast);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
}

.search-input:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.05);
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.search-product {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.search-product:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

/* Search Discount Input */
.search-product-discount {
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.search-discount-input {
  width: 38px;
  padding: 5px 4px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}

.search-discount-input::-webkit-inner-spin-button,
.search-discount-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.search-discount-pct {
  font-size: 11px;
  color: var(--text-tertiary);
  padding-right: 5px;
  font-weight: 600;
}

.search-add-btn {
  padding: 6px 16px;
  background: var(--text-primary);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity var(--transition-fast);
}

.search-add-btn:hover {
  opacity: 0.85;
}

.search-product-img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-elevated);
}

.search-product-info { flex: 1; min-width: 0; }

.search-product-title {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.search-product-price {
  font-size: 13px;
  font-weight: 700;
}

/* ── Geography ─────────────────────────────────── */
.geo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.geo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.geo-list { list-style: none; }

.geo-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-primary);
  font-size: 13px;
}

.geo-list-item:last-child { border-bottom: none; }

.geo-name { color: var(--text-secondary); }

.geo-value {
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 12px;
}

.geo-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  margin: 0 16px;
}

.geo-bar {
  flex: 1;
  height: 4px;
  background: var(--accent-dim);
  border-radius: 2px;
  overflow: hidden;
}

.geo-bar-fill {
  height: 100%;
  background: var(--text-primary);
  border-radius: 2px;
  transition: width 0.8s ease;
}

/* ── Toast ─────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease;
  min-width: 280px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── Loading Skeleton ──────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, rgba(255,255,255,0.05) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 28px; width: 60%; margin-bottom: 12px; }
.skeleton-card { height: 120px; border-radius: var(--radius-lg); }

/* ── Page Visibility ───────────────────────────── */
.page { display: none; }
.page.active { display: block; animation: pageFadeIn 0.4s ease; }

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

/* ── Donut Chart ───────────────────────────────── */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
}

.donut-chart {
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}

.donut-legend { flex: 1; }

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.donut-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.donut-legend-value {
  margin-left: auto;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-primary);
}

/* ── Empty State ───────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.empty-state-icon svg {
  width: 28px;
  height: 28px;
  color: var(--text-tertiary);
}

.empty-state-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.empty-state-desc {
  font-size: 13px;
  color: var(--text-tertiary);
  max-width: 320px;
}

/* ── Responsive ────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-row { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .geo-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }

  .main-content { margin-left: 0; }

  .mobile-menu-btn { display: flex; }

  .page-content { padding: 20px 16px; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

  .stat-card { padding: 16px; }
  .stat-value { font-size: 22px; }

  .main-header { padding: 0 16px; }

  .search-results { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 32px 24px; }
}

/* ── Mobile Overlay ────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 199;
  backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

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

/* ── Pagination ────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid var(--border-primary);
}

.pagination-info {
  font-size: 12px;
  color: var(--text-tertiary);
}

.pagination-btns {
  display: flex;
  gap: 6px;
}

/* ── Inline Form Rows ──────────────────────────── */
.inline-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.inline-form .form-group { margin-bottom: 0; }

/* ── Color picker ──────────────────────────────── */
.color-picker-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-primary);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
}

.color-swatch input[type="color"] {
  width: 52px;
  height: 52px;
  border: none;
  padding: 0;
  cursor: pointer;
  margin: -8px;
}

/* ── Save Bar ──────────────────────────────────── */
.save-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 32px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  z-index: 40;
  backdrop-filter: blur(20px);
  transform: translateY(100%);
  opacity: 0;
  transition: all var(--transition-base);
}

.save-bar.visible {
  transform: translateY(0);
  opacity: 1;
}

/* ── Sparkline (mini chart) ────────────────────── */
.sparkline-wrap {
  position: absolute;
  bottom: 12px;
  right: 16px;
  width: 80px;
  height: 32px;
  opacity: 0.3;
}

.sparkline-wrap svg {
  width: 100%;
  height: 100%;
}
