/* ═══════════════════════════════════════════════════════
   SAFEGATE — dashboard-seller.css
   Premium fintech dashboard — SafeGate design system
═══════════════════════════════════════════════════════ */

/* ── DARK THEME ── */
[data-theme="dark"] {
  --bg-base:        #0B0E11;
  --bg-card:        #141920;
  --bg-subtle:      #1E2530;
  --bg-elevated:    #222B38;
  --border:         rgba(42,50,64,0.85);
  --border-hi:      rgba(94,104,230,0.3);
  --text-primary:   #F0F4F8;
  --text-body:      #C8D4E0;
  --text-muted:     #8A9BB0;
  --sidebar-bg:     #0D1117;
  --sidebar-border: rgba(255,255,255,0.04);
  --topbar-bg:      rgba(11,14,17,0.85);
  --input-bg:       #1E2530;
  --input-border:   #2A3240;
  --shadow-card:    0 4px 24px rgba(0,0,0,0.35);
  --shadow-modal:   0 24px 80px rgba(0,0,0,0.6);
  --danger:         #E5534B;
  --danger-bg:      rgba(229,83,75,0.10);
  --danger-border:  rgba(229,83,75,0.25);

  /* Liquid glass — same recipe as index.html/auth.css/pay.css/etc. */
  --glass-bg:
    linear-gradient(160deg, rgba(255,255,255,0.26) 0%, rgba(255,255,255,0) 22%, rgba(255,255,255,0) 78%, rgba(255,255,255,0.1) 100%),
    linear-gradient(135deg, rgba(126,113,250,0.22) 0%, rgba(94,104,230,0.16) 50%, rgba(126,113,250,0.2) 100%);
  --glass-border: rgba(190,185,255,0.28);
  --glass-shadow: 0 1px 0 rgba(255,255,255,0.16) inset, 0 8px 32px rgba(0,0,0,0.5);
  --glass-blur: 22px;
}

/* ── LIGHT THEME ── */
[data-theme="light"] {
  --bg-base:        #F0F4F8;
  --bg-card:        #FFFFFF;
  --bg-subtle:      #E4EAF3;
  --bg-elevated:    #FFFFFF;
  --border:         rgba(208,217,232,0.9);
  --border-hi:      rgba(118,113,250,0.3);
  --text-primary:   #07244C;
  --text-body:      #2A3A54;
  --text-muted:     #7E7F9C;
  --sidebar-bg:     #07244C;
  --sidebar-border: rgba(255,255,255,0.07);
  --topbar-bg:      rgba(240,244,248,0.88);
  --input-bg:       #F0F4F8;
  --input-border:   #D0D9E8;
  --shadow-card:    0 4px 24px rgba(7,36,76,0.08);
  --shadow-modal:   0 24px 80px rgba(7,36,76,0.18);
  --danger:         #D94040;
  --danger-bg:      rgba(217,64,64,0.08);
  --danger-border:  rgba(217,64,64,0.2);

  /* Liquid glass — same recipe as index.html/auth.css light theme */
  --glass-bg:
    linear-gradient(160deg, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0) 22%, rgba(255,255,255,0) 78%, rgba(255,255,255,0.15) 100%),
    linear-gradient(135deg, rgba(94,104,230,0.28) 0%, rgba(94,104,230,0.2) 50%, rgba(94,104,230,0.26) 100%);
  --glass-border: rgba(94,104,230,0.32);
  --glass-shadow: 0 1px 0 rgba(255,255,255,0.85) inset, 0 8px 32px rgba(94,104,230,0.14);
  --glass-blur: 22px;
}

/* ── SHARED TOKENS ── */
:root {
  --blue:         #5E68E6;
  --blue-hover:   #4A54D4;
  --blue-light:   #7671FA;
  --amber:        #CD873C;
  --amber-hover:  #B8762E;
  --success:      #2ECC8A;
  --success-dark: #1DB87A;
  --danger-red:   #E5534B;
  --mid:          #8A9BB0;

  --sidebar-w:    240px;
  --topbar-h:     64px;
  --bottom-nav-h: 64px;

  --font-head:    'Space Grotesk', sans-serif;
  --font-body:    'Inter', sans-serif;

  --radius-sm:    6px;
  --radius-md:    12px;
  --radius-lg:    18px;
  --radius-xl:    24px;
  --radius-full:  9999px;

  --tr:           0.22s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-body);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font-body); }
input, select, textarea { font-family: var(--font-body); }

/* ══════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 300;
  transition: transform var(--tr);
  overflow: hidden;
}

/* Subtle texture overlay on sidebar */
.sidebar::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 20% 20%, rgba(94,104,230,0.06) 0%, transparent 60%);
  pointer-events: none;
}

/* ── Logo ── */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.logo-shield {
  width: 26px; height: 26px;
  color: var(--blue);
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 800;
  color: #F0F4F8;
  letter-spacing: -0.01em;
}
.logo-text span { color: var(--blue); }

/* ── Nav ── */
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(138,155,176,0.5);
  padding: 8px 8px 4px;
  margin-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: rgba(138,155,176,0.8);
  font-size: 0.875rem;
  font-weight: 500;
  position: relative;
  transition: all var(--tr);
  white-space: nowrap;
}

.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: #F0F4F8;
}

.nav-item.active {
  background: rgba(94,104,230,0.12);
  color: #F0F4F8;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  flex-shrink: 0;
}

.nav-active-bar {
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--blue);
  border-radius: var(--radius-full) 0 0 var(--radius-full);
  opacity: 0;
  transition: opacity var(--tr);
}
.nav-item.active .nav-active-bar { opacity: 1; }

.nav-badge {
  margin-left: auto;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.nav-badge-new {
  background: rgba(94,104,230,0.18);
  color: var(--blue);
}
.nav-badge-soon {
  background: rgba(138,155,176,0.14);
  color: rgba(138,155,176,0.75);
}
.nav-item.nav-item-disabled {
  cursor: default;
  opacity: 0.65;
}
.nav-item.nav-item-disabled:hover {
  background: none;
  color: rgba(138,155,176,0.8);
}

/* ── Sidebar footer ── */
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.sidebar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #8b94f0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.72rem;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #F0F4F8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.68rem;
  color: rgba(138,155,176,0.7);
}

.sidebar-logout {
  background: none;
  border: none;
  color: rgba(138,155,176,0.6);
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: all var(--tr);
  flex-shrink: 0;
}
.sidebar-logout:hover { color: var(--danger-red); background: var(--danger-bg); }

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 299;
  backdrop-filter: blur(4px);
}
.sidebar-overlay.visible { display: block; }

/* ══════════════════════════════════════════
   MAIN WRAP
══════════════════════════════════════════ */
.main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ── Top bar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--topbar-h);
  background: var(--topbar-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  gap: 16px;
  transition: background 0.3s;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: color var(--tr);
}
.menu-toggle:hover { color: var(--text-primary); }

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
}

.breadcrumb-page {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

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

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 6px;
  display: flex;
  align-items: center;
  transition: color var(--tr);
}
.theme-toggle:hover { color: var(--amber); }

.topbar-icon-btn {
  position: relative;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--tr);
}
.topbar-icon-btn:hover { border-color: var(--blue); color: var(--text-primary); }

.notif-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  background: var(--amber);
  border-radius: 50%;
  border: 2px solid var(--bg-base);
  display: none;
}
.notif-dot.visible { display: block; }

.btn-create {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: var(--blue);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  transition: all var(--tr);
  box-shadow: 0 4px 16px rgba(94,104,230,0.28);
  white-space: nowrap;
}
.btn-create:hover {
  background: var(--blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(94,104,230,0.38);
}

/* ── Verification banner ── */
.verify-banner {
  background: rgba(205,135,60,0.1);
  border-bottom: 1px solid rgba(205,135,60,0.25);
}

.verify-banner-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  font-size: 0.85rem;
  color: var(--amber);
}

.verify-banner-inner i { flex-shrink: 0; }

.verify-banner-inner span { flex: 1; }

.verify-banner-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: var(--amber);
  white-space: nowrap;
  transition: opacity var(--tr);
}
.verify-banner-link:hover { opacity: 0.8; }

/* Free-transactions promo banner — same layout as verify-banner, but
   success-green instead of amber-warning since this is good news. */
.promo-banner {
  background: rgba(46,204,138,0.1);
  border-bottom: 1px solid rgba(46,204,138,0.25);
}

.promo-banner-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  font-size: 0.85rem;
  color: var(--success);
}

.promo-banner-inner i { flex-shrink: 0; }

.promo-banner-inner span { flex: 1; }

/* ══════════════════════════════════════════
   PAGE CONTENT
══════════════════════════════════════════ */
.page-content {
  flex: 1;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 1200px;
  width: 100%;
}

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
}

/* Greeting row: emoji + text */
.greeting-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.greet-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
  user-select: none;
}

.page-title {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

/* Track-record badge — distinct from NIN identity verification. Means
   "has actually delivered 5+ times with no dispute against them", not
   "identity checked". */
.vendor-badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(46,204,138,0.12);
  border: 1px solid rgba(46,204,138,0.28);
  color: var(--success);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.seller-rating-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(205,135,60,0.12);
  border: 1px solid rgba(205,135,60,0.28);
  color: var(--amber);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.seller-rating-chip svg { fill: var(--amber); }

.page-subtitle {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-header-date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 6px 11px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   STATS CARDS
══════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 16px;
}

/* Hero card (stat-card-4) moves to column 1 */
.stat-card-4 { grid-column: 1; grid-row: 1; }
.stat-card-1 { grid-column: 2; grid-row: 1; }
.stat-card-2 { grid-column: 3; grid-row: 1; }
.stat-card-3 { grid-column: 4; grid-row: 1; }

.stat-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: transform var(--tr), box-shadow var(--tr), border-color var(--tr);
  cursor: default;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.stat-card-inner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.stat-icon-wrap {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon-wrap.blue  { background: rgba(94,104,230,0.12); color: var(--blue); }
.stat-icon-wrap.amber { background: rgba(205,135,60,0.12); color: var(--amber); }
.stat-icon-wrap.green { background: rgba(46,204,138,0.12); color: var(--success); }
.stat-icon-wrap.red   { background: rgba(229,83,75,0.12);  color: var(--danger-red); }

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.stat-value {
  font-family: var(--font-head);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-trend {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 10px;
  position: relative;
  z-index: 1;
}

/* Glow effects */
.stat-card-glow {
  position: absolute;
  bottom: -20px; right: -20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.15;
  pointer-events: none;
  transition: opacity var(--tr);
}
.stat-card:hover .stat-card-glow { opacity: 0.25; }
.glow-blue  { background: var(--blue); }
.glow-amber { background: var(--amber); }
.glow-green { background: var(--success); }

/* Staggered entrance animation */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: revealUp 0.5s ease forwards;
}
.stat-card-1 { animation-delay: 0.05s; }
.stat-card-2 { animation-delay: 0.10s; }
.stat-card-3 { animation-delay: 0.15s; }
.stat-card-4 { animation-delay: 0.20s; }
.table-section { animation-delay: 0.25s; }

@keyframes revealUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════
   DESKTOP HERO CARD (stat-card-4)
══════════════════════════════════════════ */
.stat-card-4 {
  background: var(--glass-bg);
  border-color: rgba(94,104,230,0.25);
  padding: 20px 22px 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.stat-card-4::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 80% -10%, rgba(94,104,230,0.18) 0%, transparent 60%);
  pointer-events: none;
}

/* Top row: label + ring */
.sc4-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.sc4-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-top: 2px;
}

.sc4-ring { flex-shrink: 0; }

/* Amount */
.sc4-amount {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

/* Trend badge */
.sc4-trend {
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

/* Bar chart */
.sc4-chart {
  height: 72px;
  flex-shrink: 0;
  margin-top: auto;
  position: relative;
  z-index: 1;
}

/* Bars inside the desktop hero card — slightly brighter */
.stat-card-4 .mhbar {
  background: rgba(94,104,230,0.25);
}
[data-theme="light"] .stat-card-4 .mhbar {
  background: rgba(94,104,230,0.18);
}
.stat-card-4 .mhbar-active {
  background: var(--blue) !important;
}

/* Mini stat cards (1, 2, 3) — compact on desktop */
.stat-card-1,
.stat-card-2,
.stat-card-3 {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-card-1 .stat-card-inner,
.stat-card-2 .stat-card-inner,
.stat-card-3 .stat-card-inner {
  flex-direction: column;
  gap: 10px;
}

.stat-card-1 .stat-icon-wrap,
.stat-card-2 .stat-icon-wrap,
.stat-card-3 .stat-icon-wrap {
  width: 36px; height: 36px;
}

/* ══════════════════════════════════════════
   TABLE SECTION
══════════════════════════════════════════ */
.table-section {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}

.table-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-title {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.table-count {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.table-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Search */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-input {
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-md);
  padding: 8px 12px 8px 30px;
  font-size: 0.82rem;
  color: var(--text-primary);
  width: 200px;
  outline: none;
  transition: border-color var(--tr);
}
.search-input::placeholder { color: var(--text-muted); opacity: 0.7; }
.search-input:focus { border-color: var(--blue); }

/* Filter */
.filter-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.filter-select {
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-md);
  padding: 8px 30px 8px 12px;
  font-size: 0.82rem;
  color: var(--text-primary);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color var(--tr);
}
.filter-select:focus { border-color: var(--blue); }
.filter-chevron {
  position: absolute;
  right: 10px;
  color: var(--text-muted);
  pointer-events: none;
}

/* ── Table ── */
.table-wrap {
  overflow-x: auto;
}

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

.txn-table thead tr {
  background: var(--bg-subtle);
}

.txn-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.txn-table td {
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--text-body);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}

.txn-table tbody tr {
  transition: background var(--tr);
}
.txn-table tbody tr:hover { background: var(--bg-subtle); }
.txn-table tbody tr:last-child td { border-bottom: none; }

.txn-id {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.txn-product {
  font-weight: 500;
  color: var(--text-primary);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.txn-amount {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.9rem;
}

/* ── Status badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-dot-sm {
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-pending   { background: rgba(205,135,60,0.13); color: var(--amber); }
.badge-pending .badge-dot-sm   { background: var(--amber); }
.badge-paid      { background: rgba(94,104,230,0.13); color: var(--blue); }
.badge-paid .badge-dot-sm      { background: var(--blue); }
.badge-shipped   { background: rgba(94,104,230,0.13); color: var(--blue); }
.badge-shipped .badge-dot-sm   { background: var(--blue); }
.badge-completed { background: rgba(46,204,138,0.13); color: var(--success); }
.badge-completed .badge-dot-sm { background: var(--success); }
.badge-dispute   { background: rgba(229,83,75,0.13); color: var(--danger-red); }
.badge-dispute .badge-dot-sm   { background: var(--danger-red); }
.badge-frozen    { background: rgba(138,155,176,0.13); color: var(--mid); }
.badge-frozen .badge-dot-sm    { background: var(--mid); }
.badge-expired    { background: rgba(138,155,176,0.13); color: var(--mid); }
.badge-expired .badge-dot-sm    { background: var(--mid); }

/* ── Action buttons in table ── */
.action-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-muted);
  transition: all var(--tr);
}
.action-btn:hover { border-color: var(--blue); color: var(--blue); background: rgba(94,104,230,0.08); }
.action-btn.danger:hover { border-color: var(--danger-red); color: var(--danger-red); background: var(--danger-bg); }

/* ── Mobile transaction cards ── */
.txn-cards { display: none; padding: 12px; }

.txn-card-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 10px;
  transition: border-color var(--tr);
}
.txn-card-item:hover { border-color: rgba(94,104,230,0.3); }

.txn-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.txn-card-product {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.txn-card-id {
  font-family: monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.txn-card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.txn-card-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.txn-card-meta-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.txn-card-meta-value {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-body);
}

.txn-card-meta-value.amount {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--text-primary);
}

.txn-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.txn-card-btn {
  flex: 1;
  min-width: 80px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  transition: all var(--tr);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.txn-card-btn:hover { border-color: var(--blue); color: var(--blue); }
.txn-card-btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.txn-card-btn.primary:hover { background: var(--blue-hover); }

/* ── Empty & loading states ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
  gap: 12px;
}

.empty-icon {
  width: 72px; height: 72px;
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.empty-state h3 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 280px;
  line-height: 1.6;
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.loading-spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

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

.page-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--tr);
}
.page-btn:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.page-info {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════
   BUTTONS (shared)
══════════════════════════════════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--tr);
  box-shadow: 0 4px 16px rgba(94,104,230,0.28);
  cursor: pointer;
}
.btn-primary:hover:not(:disabled) {
  background: var(--blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(94,104,230,0.38);
}
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--tr);
  cursor: pointer;
}
.btn-secondary:hover { border-color: var(--blue); color: var(--text-primary); }

.btn-spinner {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn-primary.loading .btn-text { display: none; }
.btn-primary.loading .btn-spinner { display: block; }

/* ══════════════════════════════════════════
   MODALS
══════════════════════════════════════════ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-backdrop.visible {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-shadow), var(--shadow-modal);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}
.modal-backdrop.visible .modal { transform: translateY(0); }

.modal-sm { max-width: 440px; }

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 24px 0;
  gap: 16px;
}

.modal-title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-id {
  font-family: monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}

.modal-close {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--tr);
}
.modal-close:hover { background: var(--danger-bg); border-color: var(--danger-red); color: var(--danger-red); }

.modal-body {
  padding: 20px 24px;
  flex: 1;
}

.modal-footer {
  padding: 0 24px 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Modal detail rows */
.modal-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.modal-detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-detail-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.modal-detail-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.modal-detail-value.large {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
}

.modal-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* Modal link box */
.modal-link-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.modal-link-text {
  flex: 1;
  font-family: monospace;
  font-size: 0.76rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-copy-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  transition: all var(--tr);
}
.modal-copy-btn:hover { border-color: var(--blue); color: var(--blue); }

/* ── Input field (shared) ── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.field label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}
.input-wrap input {
  width: 100%;
  height: 46px;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-md);
  padding: 0 14px 0 36px;
  font-size: 0.875rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--tr);
}
.input-wrap input::placeholder { color: var(--text-muted); opacity: 0.7; }
.input-wrap input:focus { border-color: var(--blue); }

.field textarea {
  width: 100%;
  min-height: 90px;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.875rem;
  color: var(--text-primary);
  outline: none;
  resize: vertical;
  font-family: inherit;
  transition: border-color var(--tr);
}
.field textarea::placeholder { color: var(--text-muted); opacity: 0.7; }
.field textarea:focus { border-color: var(--blue); }

.dispatch-proof-dropzone {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  background: var(--input-bg);
  border: 1.5px dashed var(--input-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color var(--tr), color var(--tr);
}
.dispatch-proof-dropzone:hover { border-color: var(--blue); color: var(--text-primary); }
.dispatch-proof-dropzone.has-file {
  border-style: solid;
  border-color: var(--success);
  color: var(--text-primary);
}
.dispatch-proof-dropzone img.dispatch-proof-thumb {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.field-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ══════════════════════════════════════════
   TOAST
══════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
  z-index: 1000;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  white-space: nowrap;
}
.toast svg { color: var(--success); }
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ══════════════════════════════════════════
   BOTTOM NAV (mobile)
══════════════════════════════════════════ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: var(--topbar-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  z-index: 300;
  padding: 0 8px;
  align-items: stretch;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 500;
  transition: color var(--tr);
  padding: 8px 4px;
}
.bottom-nav-item.active { color: var(--blue); }
.bottom-nav-item:hover { color: var(--text-primary); }

/* ══════════════════════════════════════════
   RESPONSIVE — TABLET (≤ 1024px)
══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: 1.6fr 1fr 1fr; }
  /* On tablet, hide stat-card-3 to keep it clean */
  .stat-card-3 { display: none; }
  .stat-card-1 { grid-column: 2; }
  .stat-card-2 { grid-column: 3; }
  .search-input { width: 160px; }
}

/* ── Hide mobile-only elements on desktop/tablet ── */
@media (min-width: 769px) {
  .mobile-hero { display: none !important; }
  .spills-wrap { display: none !important; }
}

/* ══════════════════════════════════════════
   RESPONSIVE — MOBILE (≤ 768px)
══════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Sidebar becomes off-canvas */
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,0.4);
  }

  /* Main fills full width */
  .main-wrap { margin-left: 0; }

  /* Show hamburger */
  .menu-toggle { display: flex; }

  /* Hide desktop create btn text */
  .btn-create span { display: none; }
  .btn-create { padding: 9px; }

  /* Page content padding */
  .page-content { padding: 16px; gap: 16px; }

  /* Top bar padding */
  .topbar { padding: 0 16px; }

  /* Hide desktop table, show cards */
  .table-wrap { display: none; }
  .txn-cards { display: block; }

  /* Table controls wrap */
  .table-header { padding: 16px; }
  .table-controls { width: 100%; }
  .search-input { width: 100%; flex: 1; }
  .filter-select { width: 100%; }
  .table-controls { flex-direction: column; }

  /* Show bottom nav */
  .bottom-nav { display: flex; }

  /* Modal full width on mobile */
  .modal { border-radius: var(--radius-lg); }
  .modal-detail-grid { grid-template-columns: 1fr; }

  /* ── SHOW GREETING on mobile ── */
  .page-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .page-header-date {
    display: flex;
  }

  .page-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.15;
  }

  /* ── HIDE desktop stats on mobile ── */
  .stats-grid { display: none; }
}

/* ══════════════════════════════════════════
   RESPONSIVE — SMALL (≤ 480px)
══════════════════════════════════════════ */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 1.35rem; }
  #notifDropdown { width: calc(100vw - 32px) !important; right: -8px !important; max-height: 70vh !important; }
  #notifList { max-height: calc(70vh - 60px) !important; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ══════════════════════════════════════════
   CLICKABLE ROWS
══════════════════════════════════════════ */
.txn-row-clickable {
  cursor: pointer;
  transition: background var(--tr), transform var(--tr);
}

tr.txn-row-clickable:hover td {
  background: rgba(94,104,230,0.06) !important;
}

.txn-card-item.txn-row-clickable:hover {
  border-color: rgba(94,104,230,0.35);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(94,104,230,0.1);
}

/* ══════════════════════════════════════════
   STAT MODAL ROWS
══════════════════════════════════════════ */
.stat-modal-body {
  padding: 8px 0;
  max-height: 60vh;
  overflow-y: auto;
}

.stat-modal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  transition: background var(--tr);
  border-bottom: 1px solid var(--border);
}

.stat-modal-row:last-child { border-bottom: none; }

.stat-modal-row:hover { background: var(--bg-subtle); }

.stat-modal-row-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.stat-modal-product {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-modal-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stat-modal-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}

.stat-modal-amount {
  font-family: var(--font-head);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ══════════════════════════════════════════
   TOPBAR ENHANCEMENTS
══════════════════════════════════════════ */

/* Theme toggle — rounded square like notifBtn */
.theme-toggle {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all var(--tr);
}
.theme-toggle:hover { border-color: var(--blue); color: var(--amber); }

/* User avatar chip in topbar (mobile only) */
.topbar-avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--blue), #8b94f0);
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.7rem;
  color: #fff;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  user-select: none;
}

/* ══════════════════════════════════════════
   ACCORDION TRANSACTION CARDS (redesign)
══════════════════════════════════════════ */

/* Reset old card padding & bg */
.txn-card-item {
  background: var(--glass-bg);
  border: 1.5px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  transition: border-color var(--tr), box-shadow var(--tr);
}
.txn-card-item:hover         { border-color: rgba(94,104,230,0.25); transform: none; box-shadow: none; }
.txn-card-item.expanded      { border-color: var(--blue); box-shadow: 0 4px 20px rgba(94,104,230,0.13); }
.txn-card-item.txn-row-clickable:hover { transform: none; box-shadow: none; }

/* Card header (always visible, tap to expand) */
.txn-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  transition: background var(--tr);
}
.txn-card-header:active { background: rgba(94,104,230,0.05); }

/* Product icon circle */
.txn-card-icon-wrap {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: rgba(94,104,230,0.1);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

/* product name — reuse existing .txn-card-product */
.txn-card-product {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.txn-card-buyer-email {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.txn-card-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}

.txn-card-price {
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.txn-card-chevron {
  color: var(--text-muted);
  transition: transform 0.25s ease;
}
.txn-card-item.expanded .txn-card-chevron { transform: rotate(180deg); }

/* Expanded body */
.txn-card-body {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}
.txn-card-item.expanded .txn-card-body {
  display: block;
  animation: cardBodyIn 0.2s ease forwards;
}
@keyframes cardBodyIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Progress timeline ── */
.progress-steps {
  display: flex;
  align-items: flex-start;
  padding: 16px 0 14px;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.progress-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background var(--tr), box-shadow var(--tr);
}
.progress-step.done   .progress-dot { background: var(--blue); }
.progress-step.active .progress-dot {
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(94,104,230,0.22);
  width: 12px; height: 12px;
}

.progress-label {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: center;
}
.progress-step.done .progress-label,
.progress-step.active .progress-label { color: var(--blue); }

.progress-connector {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin-top: 4px;
  align-self: flex-start;
  transition: background var(--tr);
}
.progress-connector.done { background: var(--blue); }

/* ── Detail grid ── */
.txn-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 0 0 14px;
}

.txn-detail-item   { display: flex; flex-direction: column; gap: 3px; }

.txn-detail-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.txn-detail-value {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
}
.txn-detail-value.mono { font-family: monospace; font-size: 0.75rem; }

/* ── Card action buttons ── */
.txn-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.txn-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--tr);
}
.txn-action-btn.ship {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 2px 10px rgba(94,104,230,0.3);
}
.txn-action-btn.ship:hover  { background: var(--blue-hover); box-shadow: 0 4px 16px rgba(94,104,230,0.4); }
.txn-action-btn.copy {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.txn-action-btn.copy:hover  { border-color: var(--blue); color: var(--blue); }

/* ── FAB — New Transaction (mobile) ── */
.seller-fab {
  position: fixed;
  bottom: 28px; right: 20px;
  width: 54px; height: 54px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(94,104,230,0.45);
  z-index: 250;
  transition: all var(--tr);
}
.seller-fab:hover { transform: translateY(-2px) scale(1.06); box-shadow: 0 10px 32px rgba(94,104,230,0.55); }

/* Two-row card header */
.txn-card-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.txn-card-row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.txn-card-row2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.txn-card-row2-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   MOBILE OVERRIDES FOR NEW DESIGN
══════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Rounded square menu toggle */
  .menu-toggle {
    display: flex;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    width: 36px; height: 36px;
    border-radius: var(--radius-md);
    align-items: center;
    justify-content: center;
    padding: 0;
  }
  .menu-toggle:hover { color: var(--text-primary); border-color: var(--blue); }

  /* Show user avatar in topbar */
  .topbar-avatar { display: flex; }

  /* Replace create btn with FAB */
  .btn-create { display: none; }
  .seller-fab { display: flex; }

  /* Table section — transparent, no card wrapper on mobile */
  .table-section {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
  }

  /* Table header — plain on mobile */
  .table-header {
    padding: 0 0 16px 0;
    border-bottom: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  /* Bigger "Recent Transactions" heading on mobile */
  .table-title { font-size: 1.4rem; font-weight: 800; }

  .table-count {
    background: var(--bg-elevated);
    border-color: var(--border);
    font-size: 0.78rem;
    padding: 3px 10px;
  }

  /* Search + filter side-by-side (override column stacking) */
  .table-controls {
    width: 100%;
    flex-direction: row !important;
    gap: 10px;
    align-items: center;
  }

  /* Search takes remaining width */
  .search-wrap { flex: 1; }
  .search-input {
    width: 100%;
    border-radius: var(--radius-xl);
    height: 44px;
    padding-left: 36px;
  }
  .search-icon { left: 12px; }

  /* Filter stays compact */
  .filter-wrap { flex: 0 0 auto; }
  .filter-select {
    border-radius: var(--radius-xl);
    height: 44px;
    padding: 0 30px 0 14px;
    min-width: 80px;
    width: auto;
  }

  /* Cards container — no extra padding (page-content handles it) */
  .txn-cards { padding: 0; }
}

/* ══════════════════════════════════════════
   MOBILE EARNINGS HERO CARD
══════════════════════════════════════════ */
.mobile-hero {
  display: block;
  background: var(--glass-bg);
  border: 1px solid rgba(94,104,230,0.2);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-xl);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.mobile-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 80% -10%, rgba(94,104,230,0.18) 0%, transparent 60%);
  pointer-events: none;
}

.mhero-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.mhero-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-top: 4px;
}

/* ── Ring ── */
.mhero-ring {
  position: relative;
  width: 60px; height: 60px;
  flex-shrink: 0;
}

.mhero-ring-svg { width: 100%; height: 100%; }

[data-theme="light"] #mhRingArc {
  stroke: var(--blue);
}
[data-theme="light"] .mhero-ring-svg circle:first-child {
  stroke: rgba(94,104,230,0.18);
}

.mhero-ring-text {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.mhero-ring-fraction {
  font-family: var(--font-head);
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.mhero-ring-done {
  font-size: 0.38rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Amount ── */
.mhero-amount {
  font-family: var(--font-head);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

/* ── Trend badge ── */
.mhero-trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(46,204,138,0.14);
  color: var(--success);
  border: 1px solid rgba(46,204,138,0.25);
  padding: 5px 11px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

/* ── Bar chart ── */
.mhero-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 64px;
  position: relative;
  z-index: 1;
}

.mhbc {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  height: 100%;
}

.mhbar {
  width: 100%;
  height: var(--h, 40%);
  background: rgba(138,155,176,0.2);
  border-radius: 4px 4px 2px 2px;
  min-height: 4px;
  transition: height 0.6s cubic-bezier(0.34,1.56,0.64,1), filter 0.2s, transform 0.2s;
}

[data-theme="light"] .mhbar {
  background: rgba(94,104,230,0.12);
}

.mhbar-active {
  background: var(--blue) !important;
}

.mhbc > span {
  font-size: 0.56rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  transition: color var(--tr);
}

/* Clickable bar columns */
.mhbc {
  cursor: pointer;
  border-radius: 4px 4px 0 0;
}

.mhbc:hover .mhbar {
  filter: brightness(1.4);
  transform: scaleY(1.08);
  transform-origin: bottom;
}

.mhbc:hover > span {
  color: var(--text-primary);
}

/* Active (today) bar pulse */
.mhbar-active {
  animation: barPulse 2.4s ease-in-out infinite;
}

@keyframes barPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.75; }
}

/* ══════════════════════════════════════════
   STATUS FILTER PILLS (mobile)
══════════════════════════════════════════ */
.spills-wrap {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 -2px;
}
.spills-wrap::-webkit-scrollbar { display: none; }

.spills-scroll {
  display: flex;
  gap: 8px;
  padding: 2px 2px 4px;
  width: max-content;
}

.spill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 15px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--tr);
}

.spill:active { transform: scale(0.97); }

.spill.spill-active {
  background: var(--bg-elevated, var(--bg-subtle));
  border-color: var(--blue);
  color: var(--text-primary);
}

.spill-count {
  font-weight: 700;
  color: inherit;
}

.spill-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.spill-amber { background: var(--amber); }
.spill-blue  { background: var(--blue); }
.spill-green { background: var(--success); }
.spill-red   { background: var(--danger-red); }
.spill-grey  { background: var(--mid); }

/* ══════════════════════════════════════════
   AVATAR UPLOAD MODAL
══════════════════════════════════════════ */

/* Clickable cursor on all avatar chips — these are links to Settings */
.sidebar-avatar, .topbar-avatar {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.sidebar-avatar:hover, .topbar-avatar:hover { opacity: 0.82; transform: scale(1.05); }

/* When a real photo is set */
.sidebar-avatar.has-photo,
.topbar-avatar.has-photo { padding: 0; overflow: hidden; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }

/* Backdrop */
.av-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.av-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Card */
.av-modal {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-xl);
  padding: 28px 22px 22px;
  width: 100%;
  max-width: 310px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.55), 0 0 0 1px rgba(94,104,230,0.1);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.26s cubic-bezier(0.34,1.56,0.64,1);
  overflow: hidden;
}
.av-backdrop.open .av-modal { transform: translateY(0) scale(1); }

/* Decorative glow blob top-right */
.av-glow {
  position: absolute;
  top: -50px; right: -50px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(94,104,230,0.22) 0%, transparent 65%);
  border-radius: 50%;
  pointer-events: none;
}

/* Close button */
.av-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--tr);
}
.av-close:hover { background: rgba(229,83,75,0.12); color: var(--danger-red); border-color: var(--danger-red); }

/* Animated gradient ring around avatar */
.av-ring-wrap {
  position: relative;
  display: inline-flex;
  margin-bottom: 14px;
}
.av-ring {
  width: 90px; height: 90px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--blue), var(--lavender), #cd873c, var(--blue));
  background-size: 300% 300%;
  animation: avRingPulse 5s ease infinite;
}
@keyframes avRingPulse {
  0%   { background-position: 0%   50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}
.av-circle {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue) 0%, #8b94f0 100%);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-weight: 700; font-size: 1.45rem; color: #fff;
  letter-spacing: 1px;
  overflow: hidden;
}
.av-circle.has-photo { background: transparent; }

/* Camera badge */
.av-cam-btn {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border: 2px solid var(--bg-card);
  transition: background var(--tr), transform var(--tr);
}
.av-cam-btn:hover { background: var(--lavender); transform: scale(1.1); }

/* Title / hint */
.av-title {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 3px;
}
.av-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin: 0 0 16px;
}

/* Drop zone */
.av-drop {
  display: block;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--bg-subtle);
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.av-drop:hover, .av-drop:focus-within { border-color: var(--blue); background: rgba(94,104,230,0.07); }
.av-drop.drag-over { border-color: var(--lavender); background: rgba(118,113,250,0.12); border-style: solid; }

.av-drop-inner {
  display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  pointer-events: none;
}
.av-drop-emoji { font-size: 1.5rem; line-height: 1; margin-bottom: 4px; }
.av-drop-text { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.av-drop-sub { font-size: 0.67rem; color: var(--text-muted); }

/* Action buttons row */
.av-btns { display: flex; gap: 10px; }

.av-btn-ghost {
  flex: 1;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: all var(--tr);
}
.av-btn-ghost:hover { border-color: var(--danger-red); color: var(--danger-red); background: rgba(229,83,75,0.08); }

.av-btn-primary {
  flex: 2;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, var(--blue), var(--lavender));
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all var(--tr);
}
.av-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(94,104,230,0.45);
}
.av-btn-primary:disabled { opacity: 0.42; cursor: not-allowed; transform: none; }

@media (max-width: 480px) {
  .av-modal { padding: 22px 16px 18px; }
}

.spin { animation: spinIcon 0.8s linear infinite; }
@keyframes spinIcon { to { transform: rotate(360deg); } }

/* iOS Safari zooms the whole page when a tapped input/select/textarea has a
   computed font-size under 16px. Force 16px on mobile to stop it. */
@media (max-width: 768px) {
  .search-input,
  .filter-select,
  .input-wrap input,
  .field textarea {
    font-size: 16px;
  }
}

/* Browsers without backdrop-filter support fall back to a solid card. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .page-header, .stat-card, .stat-card-4, .table-section, .modal,
  .txn-card-item, .mobile-hero, .av-modal {
    background: var(--bg-card);
  }
}
