/* ═══════════════════════════════════════════════════════════════
   Parfum Central Admin — Dark Luxury Command Center
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg-deep: #0d0d1a;
  --bg-base: #131325;
  --bg-card: #1a1a33;
  --bg-elevated: #222244;
  --bg-hover: rgba(212, 175, 55, 0.06);
  --bg-input: #16162e;

  --gold: #d4af37;
  --gold-dim: #a88a2a;
  --gold-glow: rgba(212, 175, 55, 0.15);
  --gold-border: rgba(212, 175, 55, 0.2);

  --text-primary: rgba(255, 255, 255, 0.92);
  --text-secondary: rgba(255, 255, 255, 0.55);
  --text-muted: rgba(255, 255, 255, 0.3);
  --text-gold: #e8c84a;

  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);

  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --info: #60a5fa;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --sidebar-width: 220px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

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

/* Fix: hidden attribute must override explicit display rules */
[hidden] { display: none !important; }

body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════════════════════════════ */

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(212, 175, 55, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(100, 80, 200, 0.03) 0%, transparent 50%),
    var(--bg-deep);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: var(--bg-deep);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.login-brand h1 {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

.login-brand p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

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

.login-card input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}

.login-card input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.login-card button[type="submit"] {
  width: 100%;
  padding: 12px;
  margin-top: 20px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: var(--bg-deep);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
}

.login-card button[type="submit"]:hover { opacity: 0.9; transform: translateY(-1px); }
.login-card button[type="submit"]:active { transform: translateY(0); }

.login-error {
  text-align: center;
  color: var(--danger);
  font-size: 13px;
  margin-top: 14px;
}

/* ═══════════════════════════════════════════════════════════════
   APP SHELL
   ═══════════════════════════════════════════════════════════════ */

.app {
  min-height: 100vh;
}

/* ═══ Sidebar ═══ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-base);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: var(--bg-deep);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.brand-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.nav-list {
  list-style: none;
  padding: 12px 8px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 400;
  transition: all var(--transition);
  position: relative;
}

.nav-link svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity var(--transition);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-link:hover svg { opacity: 0.8; }

.nav-link.active {
  color: var(--text-gold);
  background: var(--bg-hover);
}

.nav-link.active svg { opacity: 1; color: var(--gold); }

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

.sidebar-logout {
  margin: 8px 12px 16px;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.sidebar-logout:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* ═══ Mobile Header ═══ */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
  align-items: center;
  padding: 0 16px;
  z-index: 90;
  gap: 12px;
}

.menu-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
}

.mobile-brand {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-gold);
}

/* ═══ Main Content ═══ */
.main {
  margin-left: var(--sidebar-width);
  padding: 28px 32px;
  min-height: 100vh;
}

.view { animation: fadeIn 0.25s ease; }

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

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

.view-header h2 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* ═══════════════════════════════════════════════════════════════
   SHARED COMPONENTS
   ═══════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: var(--bg-deep);
}

.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-gold {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-border);
}

.btn-gold:hover { background: var(--gold-glow); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}

.btn-ghost:hover { color: var(--text-primary); border-color: var(--text-secondary); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn-danger:hover { background: rgba(248, 113, 113, 0.1); }

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: var(--radius-sm);
}

.btn-danger-ghost {
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.25);
}

.btn-danger-ghost:hover {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.4);
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.input, .select, .textarea {
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
}

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

.select { cursor: pointer; }

.textarea {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
}

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.filters-bar .input { flex: 1; min-width: 200px; }
.filters-bar .select { min-width: 140px; }

.loading-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ═══ Stat Cards ═══ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  transition: border-color var(--transition);
}

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

.stat-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.stat-value.gold { color: var(--gold); }

.stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ═══ Breakdown Grid ═══ */
.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.breakdown-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.breakdown-card h3 {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
}

.breakdown-label {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.breakdown-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.breakdown-value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ═══ Sparkline ═══ */
.sparkline-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 28px;
}

.sparkline-container h3 {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.sparkline-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 80px;
}

.sparkline-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.sparkline-bar {
  width: 100%;
  min-height: 4px;
  background: linear-gradient(180deg, var(--gold), var(--gold-dim));
  border-radius: 3px 3px 0 0;
  transition: height 0.5s ease;
}

.sparkline-label {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.sparkline-count {
  font-size: 10px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* ═══ Tables ═══ */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-strong);
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table td {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover {
  background: var(--bg-hover);
}

.data-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.data-table tbody tr:nth-child(even):hover {
  background: var(--bg-hover);
}

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.mono { font-family: var(--font-mono); font-size: 12px; }

/* ═══ Badges ═══ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-whale { background: rgba(212, 175, 55, 0.15); color: var(--gold); }
.badge-collector { background: rgba(96, 165, 250, 0.15); color: var(--info); }
.badge-repeat { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.badge-none { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); }
.badge-active { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.badge-paused { background: rgba(251, 191, 36, 0.15); color: var(--warning); }
.badge-cancelled { background: rgba(248, 113, 113, 0.15); color: var(--danger); }
.badge-new { background: rgba(96, 165, 250, 0.15); color: var(--info); }
.badge-low { background: rgba(248, 113, 113, 0.12); color: #f59e6b; }
.badge-engaged { background: rgba(52, 211, 153, 0.15); color: var(--success); }

/* ═══ Pagination ═══ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

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

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

.page-btn {
  padding: 5px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all var(--transition);
}

.page-btn:hover:not(:disabled) {
  border-color: var(--gold-border);
  color: var(--text-primary);
}

.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.page-btn.active { background: var(--gold-glow); border-color: var(--gold-border); color: var(--gold); }

/* ═══ Customer Detail Panel ═══ */
.customer-detail {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 800px; }
}

.customer-detail td {
  padding: 16px 20px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.detail-item {
  padding: 8px 0;
}

.detail-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.detail-value {
  font-size: 13px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  word-break: break-all;
}

/* ═══ Email Preview ═══ */
.preview-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
}

.preview-controls .input { flex: 1; min-width: 200px; }
.preview-controls .select { min-width: 200px; }

.preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.preview-frame {
  width: 100%;
  min-height: 600px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
}

.preview-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 12px;
}

.preview-meta-label {
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 6px;
}

.preview-meta-value {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* ═══ Send Email ═══ */
.send-form { max-width: 700px; }

.form-row {
  margin-bottom: 18px;
}

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

.form-row .input, .form-row .textarea { width: 100%; }

.form-row:last-child {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.send-tabs {
  display: flex;
  gap: 1px;
  margin-bottom: 10px;
  background: var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: fit-content;
}

.tab-btn {
  padding: 6px 14px;
  background: var(--bg-card);
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.tab-btn.active {
  background: var(--bg-elevated);
  color: var(--text-gold);
}

.tab-btn:hover:not(.active) { color: var(--text-primary); }

#send-status {
  margin-top: 14px;
  font-size: 13px;
}

.status-success { color: var(--success); }
.status-error { color: var(--danger); }

#send-preview-frame {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* ═══ Settings ═══ */
.settings-grid {
  display: grid;
  gap: 16px;
  max-width: 700px;
}

.setting-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.setting-card h3 {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}

.setting-label { color: var(--text-secondary); }

.setting-value {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  transition: all var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--gold-glow);
  border-color: var(--gold);
}

.toggle-switch input:checked + .toggle-slider::before {
  background: var(--gold);
  transform: translateX(20px);
}

.env-var-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.env-tag {
  padding: 3px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

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

.cron-list li {
  padding: 4px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

/* ═══ Confirm Overlay ═══ */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.15s ease;
}

.confirm-box {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 400px;
  width: 90%;
}

.confirm-box h3 {
  font-size: 16px;
  margin-bottom: 10px;
}

.confirm-box p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

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

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open { transform: translateX(0); }

  .mobile-header { display: flex; }

  .main {
    margin-left: 0;
    padding: 68px 16px 24px;
  }

  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .breakdown-grid { grid-template-columns: 1fr; }

  .filters-bar { flex-direction: column; }
  .filters-bar .input, .filters-bar .select { min-width: 0; width: 100%; }

  .preview-controls { flex-direction: column; }
  .preview-controls .input, .preview-controls .select { min-width: 0; width: 100%; }

  .form-row:last-child { flex-direction: column; }

  .pagination { flex-direction: column; gap: 10px; }
}

/* Sidebar overlay on mobile */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  display: none;
}

.sidebar-overlay.visible { display: block; }

/* ═══ Scrollbar ═══ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══ Test Mode Banner ═══ */
.test-mode-banner {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 50;
  padding: 8px 20px;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.08));
  border-bottom: 1px solid var(--gold-border);
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: center;
}

.test-mode-banner span {
  background: var(--gold);
  color: var(--bg-deep);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  margin-right: 4px;
}

.app.test-mode-active .main { padding-top: calc(32px + 36px); }

/* ═══ History Tabs ═══ */
.history-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.history-tabs .tab-btn {
  padding: 8px 16px;
  font-size: 13px;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
}

.history-tabs .tab-btn:hover { color: var(--text-primary); }
.history-tabs .tab-btn.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ═══ Auto-Refresh Toggle ═══ */
.auto-refresh-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
}

.auto-refresh-toggle input {
  appearance: none;
  width: 32px;
  height: 18px;
  background: var(--border-strong);
  border-radius: 9px;
  position: relative;
  cursor: pointer;
  transition: background var(--transition);
}

.auto-refresh-toggle input::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: transform var(--transition), background var(--transition);
}

.auto-refresh-toggle input:checked { background: var(--gold-border); }
.auto-refresh-toggle input:checked::after {
  transform: translateX(14px);
  background: var(--gold);
}

/* ═══ Activity Feed ═══ */
.activity-feed {
  margin-top: 20px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.activity-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  min-width: 70px;
}

.activity-flow {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.activity-recipient {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  flex: 1;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ═══ Send Mode Tabs ═══ */
.send-mode-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.send-mode-tabs .tab-btn {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.send-mode-tabs .tab-btn:hover { color: var(--text-secondary); }
.send-mode-tabs .tab-btn.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ═══ Wishlist Items in Detail ═══ */
.wishlist-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: none;
  border: none;
  padding: 4px 0;
  cursor: pointer;
}
.wishlist-toggle:hover span:last-child { color: var(--gold); }
.wishlist-list { margin-top: 8px; }
.wishlist-header {
  display: grid;
  grid-template-columns: 2fr 1fr 80px 60px;
  gap: 8px;
  padding: 4px 0;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.wishlist-item {
  display: grid;
  grid-template-columns: 2fr 1fr 80px 60px;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 12px;
  color: var(--text-secondary);
}
.wishlist-item:last-child { border-bottom: none; }
.wishlist-title { font-weight: 500; color: var(--text-primary); }
.wishlist-brand { color: var(--text-muted); }
.wishlist-price { font-family: var(--font-mono); color: var(--gold); }
.wishlist-source { font-size: 11px; color: var(--text-muted); }

@media (max-width: 768px) {
  .test-mode-banner { left: 0; }
  .history-tabs .tab-btn { padding: 6px 12px; font-size: 12px; }
  .wishlist-header, .wishlist-item { grid-template-columns: 1fr 80px; }
  .wishlist-brand, .wishlist-source { display: none; }
}
