/* ============================================================
   Axcendy Marketplace — Fintech Monochromatic Design System
   No shadows | Clean | Professional
   ============================================================ */

:root {
  --bg:        #0a0a0a;
  --surface:   #111111;
  --surface2:  #1a1a1a;
  --border:    #2a2a2a;
  --border2:   #333333;
  --text:      #f0f0f0;
  --text2:     #888888;
  --text3:     #555555;
  --accent:    #ffffff;
  --accent2:   #cccccc;
  --green:     #22c55e;
  --red:       #ef4444;
  --yellow:    #eab308;
  --blue:      #3b82f6;
  --radius:    4px;
  --radius2:   8px;
  --font:      'Inter', 'Helvetica Neue', Arial, sans-serif;
  --mono:      'JetBrains Mono', 'Fira Code', monospace;
  --sidebar-w: 264px;
}

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

html { font-size: 14px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent2); }

/* ---- Typography ---- */
h1 { font-size: 1.75rem; font-weight: 600; letter-spacing: -.02em; }
h2 { font-size: 1.35rem; font-weight: 600; }
h3 { font-size: 1.1rem;  font-weight: 600; }
p  { color: var(--text2); }

/* ---- Utility ---- */
.mt1 { margin-top: .5rem;  }
.mt2 { margin-top: 1rem;   }
.mt3 { margin-top: 1.5rem; }
.mb1 { margin-bottom: .5rem;  }
.mb2 { margin-bottom: 1rem;   }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap1 { gap: .5rem; }
.gap2 { gap: 1rem;  }
.w-full { width: 100%; }
.text-sm { font-size: .85rem; }
.text-xs { font-size: .75rem; }
.text-mono { font-family: var(--mono); }
.text-green  { color: var(--green);  }
.text-red    { color: var(--red);    }
.text-yellow { color: var(--yellow); }
.text-muted  { color: var(--text2);  }
.uppercase { text-transform: uppercase; letter-spacing: .06em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Icon base ---- */
.icon { display: inline-block; flex-shrink: 0; vertical-align: middle; pointer-events: none; }

/* ---- Layout: Sidebar ---- */
.layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  transition: width .22s ease, transform .22s ease;
  z-index: 100;
}
/* Mobile backdrop */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 99;
}

/* ---- Confirm modal ---- */
.confirm-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 1100;
  align-items: center;
  justify-content: center;
}
.confirm-modal-backdrop.active { display: flex; }
.confirm-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 1.5rem 1.75rem;
  max-width: 380px;
  width: calc(100% - 2rem);
  box-shadow: 0 8px 32px rgba(0,0,0,.55);
}
.confirm-modal__icon {
  font-size: 1.6rem;
  margin-bottom: .75rem;
}
.confirm-modal__msg {
  font-size: .93rem;
  color: var(--text);
  margin-bottom: 1.35rem;
  line-height: 1.55;
}
.confirm-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
}

/* Brand */
.sidebar__brand {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 64px;
  flex-shrink: 0;
}
.sidebar__logo-mark {
  width: 30px;
  height: 30px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -.03em;
}
.sidebar__brand-text {
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: -.01em;
  line-height: 1.25;
  white-space: nowrap;
}
.sidebar__brand-text span {
  color: var(--text3);
  font-weight: 400;
  font-size: .72rem;
  display: block;
  margin-top: .05rem;
}

/* Nav */
.sidebar__nav {
  flex: 1;
  padding: .75rem 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.nav-group { margin-bottom: 1.25rem; }
.nav-group__label {
  padding: 0 1.25rem .3rem;
  font-size: .65rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .12em;
  white-space: nowrap;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem 1.25rem;
  color: var(--text2);
  font-size: .85rem;
  font-weight: 500;
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav-item.active {
  color: var(--text);
  background: rgba(255,255,255,.06);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 55%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.nav-item .icon { opacity: .6; }
.nav-item:hover .icon { opacity: .9; }
.nav-item.active .icon { opacity: 1; }

/* Sidebar collapsible dropdown group */
.nav-dropdown__trigger {
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}
.nav-dropdown__chev {
  margin-left: auto;
  flex-shrink: 0;
  transition: transform .2s;
  opacity: .5;
}
.nav-dropdown.open .nav-dropdown__chev { transform: rotate(180deg); opacity: .9; }
.nav-dropdown__menu {
  display: none;
  background: rgba(0,0,0,.15);
  border-left: 2px solid var(--accent);
  margin: 2px 0 4px 12px;
  border-radius: 0 6px 6px 0;
}
.nav-dropdown.open .nav-dropdown__menu { display: block; }
.nav-item--sub {
  padding-left: 1.1rem;
  font-size: .82rem;
}
.nav-item--sub::before { display: none !important; }

/* Footer / user */
.sidebar__footer {
  padding: .85rem 1.1rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar__user {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.sidebar__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  font-size: .7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: .02em;
}
.sidebar__user-info {
  flex: 1;
  min-width: 0;
}
.sidebar__user-name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar__user-email {
  font-size: .7rem;
  color: var(--text3);
}
.sidebar__logout {
  width: 26px;
  height: 26px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  flex-shrink: 0;
  transition: color .15s, background .15s;
}
.sidebar__logout:hover { color: var(--text); background: var(--surface2); }

/* ---- Main / Topbar ---- */
.main { flex: 1; overflow: auto; min-width: 0; }
.topbar {
  height: 54px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  gap: 1rem;
}
.topbar__left {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex: 1;
  min-width: 0;
}
.topbar__title { font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__right { display: flex; align-items: center; gap: .85rem; font-size: .83rem; color: var(--text2); flex-shrink: 0; }
.topbar__right a:hover { color: var(--text); }
.topbar__sep { width: 1px; height: 18px; background: var(--border2); }
.topbar__user { display: flex; align-items: center; gap: .5rem; }
.topbar__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text2);
  font-size: .68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: .02em;
}
.topbar__user-name { font-size: .83rem; color: var(--text2); }
.topbar__logout {
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  border: 1px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
}
.topbar__logout:hover { color: var(--text); background: var(--surface2); border-color: var(--border2); }

.page { padding: 1.25rem 1.5rem; }

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 1.1rem 1.25rem;
}
.card__label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text3);
  margin-bottom: .3rem;
}
.card__value {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.03em;
}
.card__sub { font-size: .75rem; color: var(--text3); margin-top: .15rem; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.stats-grid .stat {
  background: var(--surface);
  padding: 1rem 1.25rem;
}

/* ---- Table ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}
table thead th {
  padding: .45rem .75rem;
  text-align: left;
  font-weight: 700;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  white-space: nowrap;
}
table tbody td {
  padding: .55rem .75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
}
table tbody tr:hover td { background: var(--surface2); }
.tr-link { cursor: pointer; }
.tr-link:hover td { background: var(--surface2) !important; }
table tbody tr:last-child td { border-bottom: 0; }

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border-radius: var(--radius);
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.badge-green  { background: rgba(34,197,94,.12);  color: var(--green);  border: 1px solid rgba(34,197,94,.25); }
.badge-red    { background: rgba(239,68,68,.12);  color: var(--red);    border: 1px solid rgba(239,68,68,.25); }
.badge-yellow { background: rgba(234,179,8,.12);  color: var(--yellow); border: 1px solid rgba(234,179,8,.25); }
.badge-gray   { background: rgba(255,255,255,.06); color: var(--text2);  border: 1px solid var(--border2); }
.badge-blue   { background: rgba(59,130,246,.12); color: var(--blue);   border: 1px solid rgba(59,130,246,.25); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1rem;
  border-radius: var(--radius);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s;
  letter-spacing: .02em;
  white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary  { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent2); border-color: var(--accent2); }
.btn-outline  { background: transparent; color: var(--text2); border-color: var(--border2); }
.btn-outline:hover { color: var(--text); border-color: var(--accent2); }
.btn-danger   { background: transparent; color: var(--red); border-color: rgba(239,68,68,.35); }
.btn-danger:hover { background: rgba(239,68,68,.1); }
.btn-sm { padding: .28rem .7rem; font-size: .75rem; }
.btn-xs { padding: .15rem .5rem; font-size: .68rem; }

/* ---- Forms ---- */
.form-group { margin-bottom: .9rem; }
.form-group label {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .3rem;
}
.form-control {
  width: 100%;
  padding: .5rem .75rem;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: .85rem;
  transition: border-color .15s;
  outline: none;
}
.form-control:focus { border-color: var(--accent2); }
.form-control::placeholder { color: var(--text3); }
select.form-control { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.form-hint { font-size: .7rem; color: var(--text3); margin-top: .2rem; }

/* ---- Alerts ---- */
.alert {
  padding: .6rem .9rem;
  border-radius: var(--radius);
  font-size: .8rem;
  margin-bottom: .85rem;
  border: 1px solid;
}
.alert-success { background: rgba(34,197,94,.08);  color: var(--green);  border-color: rgba(34,197,94,.2); }
.alert-error   { background: rgba(239,68,68,.08);  color: var(--red);    border-color: rgba(239,68,68,.2); }
.alert-info    { background: rgba(59,130,246,.08); color: var(--blue);   border-color: rgba(59,130,246,.2); }

/* ---- Section header ---- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

/* ---- Two-column content grids ---- */
.grid-2col {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
}
.grid-form-table {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 20px;
  align-items: start;
}

/* ---- Code / Link copy ---- */
.copy-field {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  overflow: hidden;
}
.copy-field input {
  flex: 1;
  padding: .55rem .85rem;
  background: none;
  border: none;
  color: var(--text2);
  font-family: var(--mono);
  font-size: .78rem;
  outline: none;
}
.copy-field button {
  padding: .55rem .9rem;
  background: var(--border2);
  border: none;
  color: var(--text2);
  cursor: pointer;
  font-size: .75rem;
  font-weight: 600;
}
.copy-field button:hover { color: var(--text); }

/* ---- Pagination ---- */
.pagination { display: flex; gap: .25rem; margin-top: 1rem; }
.pagination a, .pagination span {
  padding: .45rem .8rem;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  font-size: .8rem;
  color: var(--text2);
}
.pagination a:hover { color: var(--text); border-color: var(--accent2); }
.pagination .current { background: var(--surface2); color: var(--text); }

/* ---- Login page ---- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 1rem;
}
.login-box {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 2rem;
}
.login-logo {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: .3rem;
  letter-spacing: -.02em;
}
.login-logo span { color: var(--text3); font-weight: 400; }
.login-sub { font-size: .83rem; color: var(--text3); margin-bottom: 2rem; }
.login-footer { margin-top: 1.5rem; font-size: .78rem; color: var(--text3); text-align: center; }

/* ---- Pay page ---- */
.pay-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 1rem;
}
.pay-box {
  width: min(480px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 2rem;
}
.pay-amount {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -.04em;
  margin: .35rem 0;
}
.pay-currency { font-size: 1.1rem; color: var(--text2); vertical-align: super; font-weight: 400; }
.pay-divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.pay-gateway-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  width: 100%;
  padding: .75rem;
  margin-bottom: .6rem;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid;
  transition: background .15s;
}
.pay-stripe { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.pay-stripe:hover { background: var(--accent2); }
.pay-paypal { background: #ffc439; color: #003087; border-color: #ffc439; }
.pay-paypal:hover { background: #f0b824; }

/* ---- Sidebar toggle button ---- */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text3);
  cursor: pointer;
  flex-shrink: 0;
  transition: color .15s, border-color .15s, background .15s;
}
.sidebar-toggle:hover { color: var(--text); border-color: var(--text3); background: var(--surface2); }

/* ---- Sidebar collapsed state ---- */
.sidebar--collapsed { width: 58px; }
.sidebar--collapsed .sidebar__brand-text,
.sidebar--collapsed .nav-group__label,
.sidebar--collapsed .nav-item span,
.sidebar--collapsed .sidebar__user-info,
.sidebar--collapsed .sidebar__logout { display: none; }
.sidebar--collapsed .sidebar__brand { justify-content: center; padding: 1rem; gap: 0; }
.sidebar--collapsed .sidebar__footer { padding: .85rem 0; display: flex; justify-content: center; }
.sidebar--collapsed .sidebar__user { justify-content: center; }
.sidebar--collapsed .nav-item {
  justify-content: center;
  padding: .65rem 0;
}
.sidebar--collapsed .nav-item.active::before { display: none; }
.sidebar--collapsed .nav-group { margin-bottom: .5rem; }
.sidebar--collapsed .sidebar__nav { padding: .75rem 0; }
/* Tooltip on hover when collapsed */
.sidebar--collapsed .nav-item::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: .3rem .7rem;
  border-radius: var(--radius);
  font-size: .78rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
  z-index: 200;
}
.sidebar--collapsed .nav-item:hover::after { opacity: 1; }

/* ============================================================
   RESPONSIVE — mobile-first overrides
   ============================================================ */

/* ---- Tablet (≤ 900px) ---- */
@media (max-width: 900px) {
  /* Push sidebar off-screen; it slides in via JS */
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: var(--sidebar-w) !important;
    transform: translateX(-100%);
    z-index: 100;
    transition: transform .22s ease;
  }
  .sidebar--open { transform: translateX(0); }
  .sidebar-backdrop.active { display: block; }
  .sidebar--collapsed { width: var(--sidebar-w) !important; }

  /* Restore full labels when open on mobile */
  .sidebar .sidebar__brand-text,
  .sidebar .nav-group__label,
  .sidebar .nav-item span,
  .sidebar .sidebar__user-info,
  .sidebar .sidebar__logout { display: revert; }
  .sidebar .sidebar__brand { justify-content: flex-start; padding: 1.1rem 1.25rem; gap: .75rem; }
  .sidebar .sidebar__footer { padding: .85rem 1.1rem; display: block; }
  .sidebar .sidebar__user { justify-content: flex-start; }
  .sidebar .nav-item { justify-content: flex-start; padding: .6rem 1.25rem; }
  .sidebar .nav-item.active::before { display: block; }

  /* Main takes full width */
  .main { width: 100%; }
}

/* ---- Dashboard grid classes (base styles for desktop) ---- */
.dash-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dash-hero-grid {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}
.dash-main-row {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  margin-bottom: 20px;
}
.dash-analytics-row {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  margin-bottom: 20px;
}

/* ---- Mobile (≤ 768px) ---- */
@media (max-width: 768px) {
  /* Page chrome */
  .page    { padding: .85rem .9rem; }
  .topbar  { padding: 0 .9rem; }
  .topbar__user-name { display: none; }
  .topbar__sep       { display: none; }

  /* Typography */
  h1 { font-size: 1.25rem; }
  h2 { font-size: 1.05rem; }
  h3 { font-size: .95rem; }

  /* Section headers wrap on small screens */
  .section-header {
    flex-wrap: wrap;
    gap: .6rem;
  }

  /* Stats: 2 columns on mobile */
  .stats-grid { grid-template-columns: 1fr 1fr; }

  /* Dashboard grids: stack on mobile */
  .dash-page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }
  .dash-page-header h2 { width: 100%; }
  .dash-header-btns { width: 100%; flex-wrap: wrap; }
  
  /* Dashboard hero: single column */
  .dash-hero-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  .dash-hero-periods { padding: 0 !important; border-left: none !important; border-right: none !important; gap: .75rem !important; }
  .dash-hero-cta { gap: .5rem !important; }
  
  /* Dashboard main row: single column */
  .dash-main-row {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  
  /* Dashboard analytics row: single column */
  .dash-analytics-row {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Forms */
  .form-row { grid-template-columns: 1fr; }

  /* --- Dashboard / Payouts two-column grids: stack --- */
  .grid-2col,
  .grid-form-table {
    grid-template-columns: 1fr !important;
    gap: .9rem !important;
  }

  /* Tables: allow horizontal scroll, shrink font slightly */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { font-size: .75rem; }
  table thead th,
  table tbody td { padding: .4rem .55rem; }

  /* Admin vendor edit, payouts, etc. */
  div[style*="grid-template-columns:repeat(auto-fit,minmax(320px"],
  div[style*="grid-template-columns: repeat(auto-fit, minmax(320px"] {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  /* Cards shrink padding on mobile */
  .card { padding: 1rem !important; }

  /* Buttons */
  .btn { padding: .5rem .8rem; }

  /* Inputs/selects smaller on mobile */
  input, select, textarea { font-size: 16px !important; }

  /* Margin bottoms */
  .mb1 { margin-bottom: .6rem; }
  .mb2 { margin-bottom: .9rem; }
  .mb3 { margin-bottom: 1rem; }
}

/* ---- Tablet (769px - 1024px) ---- */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Main takes full width */
  .main { width: 100%; }
  
  /* Table: allow horizontal scroll, extend to card edges */
  .table-wrap { 
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* ---- Desktop (≥ 1025px) ---- */
@media (min-width: 1025px) {
  /* Table: extend to card edges for better visual flow */
  .table-wrap { 
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
  }

  /* Cards */
  .card { border-radius: var(--radius); }

  /* Payout balance cards: full width */
  div[style*="grid-template-columns:1fr 1fr;"] > .card,
  .stats-grid .card { padding: 14px 16px !important; }

  /* Buttons in flex rows: allow wrap */
  .flex.gap1, .flex.gap2 { flex-wrap: wrap; }

  /* Section header title spacing */
  .section-title { font-size: 1rem; }

  /* Copy field */
  .copy-field { flex-wrap: wrap; }
  .copy-field input  { min-width: 0; }

  /* Pagination */
  .pagination { flex-wrap: wrap; }
}

/* ---- Small phones (≤ 480px) ---- */
@media (max-width: 480px) {
  .page   { padding: .7rem .75rem; }
  .topbar { height: 50px; }

  /* Stats keep 2 cols — single column only at 360px */
  .card__value { font-size: 1.3rem; }

  /* Buttons */
  .btn-xs, .btn-sm { font-size: .65rem; }
  .btn { padding: .4rem .8rem; font-size: .78rem; }

  /* Tables compact */
  table { font-size: .72rem; }

  /* Login / Pay box */
  .login-box, .pay-box { padding: 1.25rem 1rem; }

  /* Section header stacks label and button */
  .section-header { align-items: flex-start; }
}

/* ---- Very small phones (≤ 360px) ---- */
@media (max-width: 360px) {
  .page   { padding: .6rem .65rem; }
  .card__value { font-size: 1.15rem; }
  .stats-grid .stat { padding: .8rem .9rem; }
}

/* ═══════════════════════════════════════════════════════
   Payout Hero Block
   ═══════════════════════════════════════════════════════ */
.payout-hero {
  padding: 0;
  overflow: hidden;
  margin-bottom: 12px;
}

.payout-hero__row {
  display: flex;
  align-items: stretch;
}

.payout-hero__cell {
  flex: 1;
  padding: 18px 20px;
  min-width: 0;
}

.payout-hero__cell--main {
  flex: 1.25;
}

.payout-hero__divider {
  width: 1px;
  background: var(--border);
  flex-shrink: 0;
  margin: 14px 0;
}

.payout-hero__label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text3);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.payout-hero__value {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
  color: var(--text);
}

.payout-hero__hint {
  font-size: .72rem;
  color: var(--text3);
  margin-top: 5px;
  line-height: 1.35;
}

/* Hold schedule strip */
.payout-hero__hold-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 20px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
}

.hold-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: .7rem;
}

.hold-pill__amt  { font-weight: 600; color: var(--yellow); }
.hold-pill__date { color: var(--text2); }
.hold-pill__days { background: var(--yellow-bg, rgba(255,190,0,.12)); color: var(--yellow);
                   border-radius: 10px; padding: 0 5px; font-size: .65rem; }

/* ═══════════════════════════════════════════════════════
   Mini Stat Strip
   ═══════════════════════════════════════════════════════ */
.payout-mini-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.mini-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: .72rem;
  color: var(--text2);
  line-height: 1;
}

.mini-stat svg { flex-shrink: 0; opacity: .65; }
.mini-stat__sub { opacity: .6; margin-left: 3px; }

.mini-stat--warn {
  border-color: rgba(255,160,0,.4);
  background: rgba(255,160,0,.07);
  color: var(--yellow);
}
.mini-stat--warn svg { opacity: 1; }

.mini-stat--info {
  border-color: rgba(90,140,255,.35);
  background: rgba(90,140,255,.06);
  color: var(--blue, #5a8cff);
}

/* ═══════════════════════════════════════════════════════
   Payout hero responsive
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .payout-hero__row {
    flex-wrap: wrap;
  }
  .payout-hero__cell {
    flex: 1 1 calc(50% - 1px);
    padding: 14px 16px;
  }
  .payout-hero__divider {
    display: none;
  }
  .payout-hero__cell:nth-child(odd) {
    border-right: 1px solid var(--border);
  }
  .payout-hero__cell:nth-child(n+3) {
    border-top: 1px solid var(--border);
  }
  .payout-hero__value { font-size: 1.2rem; }
}

@media (max-width: 480px) {
  .payout-hero__cell {
    flex: 1 1 100%;
    border-right: none !important;
  }
  .payout-hero__cell + .payout-hero__cell {
    border-top: 1px solid var(--border);
  }
}
