/* Admin & client panels */
:root {
  --bg: #f4f1eb;
  --surface: #fff;
  --ink: #1a1816;
  --muted: #5c564f;
  --line: #e5e0d8;
  --leaf: #4d7c0f;
  --leaf-dark: #3f6212;
  --accent: #b45309;
  --danger: #b91c1c;
  --radius: 12px;
  --font: system-ui, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.5; }

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 120% 80% at 100% 0%, rgba(251, 191, 36, 0.25), transparent 50%),
    radial-gradient(ellipse 90% 60% at 0% 100%, rgba(99, 102, 241, 0.2), transparent 45%),
    radial-gradient(ellipse 70% 50% at 50% 25%, rgba(236, 72, 153, 0.12), transparent 55%),
    linear-gradient(180deg, #eef2ff 0%, #fdf4ff 45%, #fff7ed 100%);
}
.auth-card {
  background: linear-gradient(145deg, #ffffff 0%, #faf5ff 100%);
  border: 2px solid rgba(99, 102, 241, 0.18);
  border-radius: 20px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 16px 48px rgba(99, 102, 241, 0.18);
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(236, 72, 153, 0.28), rgba(168, 85, 247, 0.08));
  pointer-events: none;
}
.auth-card::after {
  content: "";
  position: absolute;
  bottom: -46px;
  left: -46px;
  width: 150px;
  height: 150px;
  border-radius: 999px;
  background: radial-gradient(circle at 65% 35%, rgba(59, 130, 246, 0.22), rgba(14, 165, 233, 0.08));
  pointer-events: none;
}
.auth-card--wide { max-width: 520px; }
.auth-card__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #4338ca;
  background: linear-gradient(135deg, #ede9fe, #fce7f3);
  border: 1px solid rgba(99, 102, 241, 0.2);
  position: relative;
  z-index: 1;
}
.auth-card h1 {
  margin: 0 0 .25rem;
  font-size: 1.5rem;
  background: linear-gradient(135deg, #4f46e5, #db2777);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
  z-index: 1;
}
.muted { color: var(--muted); font-size: .92rem; }
.auth-links { margin-top: 1.25rem; font-size: .9rem; }
.auth-links a { color: #5b21b6; font-weight: 700; }
.auth-card .form,
.auth-card .auth-links,
.auth-card .alert {
  position: relative;
  z-index: 1;
}
.auth-card .form input,
.auth-card .form select,
.auth-card .form textarea {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(99, 102, 241, 0.2);
}
.auth-card .field-label {
  display: inline-block;
}
.auth-card .form-grid {
  align-items: start;
}
.auth-card .form-grid > label {
  min-width: 0;
}
.auth-card .form input:focus,
.auth-card .form select:focus,
.auth-card .form textarea:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}
.auth-card .btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
}
.auth-card .btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.panel { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: #1a1816;
  color: #f6f3ee;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0;
  flex-shrink: 0;
}
.sidebar-brand { padding: 0 1.25rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand a { color: #fff; font-weight: 700; font-size: 1.05rem; text-decoration: none; display: block; }
.sidebar-brand small { display: block; color: #a8a29e; font-size: .75rem; margin-top: .25rem; text-transform: uppercase; letter-spacing: .05em; }
.sidebar-nav { flex: 1; padding: 1rem 0; display: flex; flex-direction: column; gap: .15rem; }
.sidebar-nav a {
  color: #d6d3d1;
  text-decoration: none;
  padding: .55rem 1.25rem;
  font-size: .92rem;
  font-weight: 500;
}
.sidebar-nav a:hover,
.sidebar-nav a.is-active { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav a.is-active {
  background: rgba(190, 242, 100, 0.15);
  color: #ecfccb;
  font-weight: 600;
}
.sidebar-foot { padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .85rem; }
.sidebar-foot span { display: block; margin-bottom: .5rem; color: #a8a29e; }
.sidebar-foot a { color: #bef264; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.main-head {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.main-head h1 { margin: 0; font-size: 1.35rem; }
.main-body { padding: 1.5rem 1.75rem; flex: 1; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem;
}
.card strong { display: block; font-size: 1.35rem; margin-top: .35rem; }
.card span { font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.section-title { font-size: 1.05rem; margin: 0 0 .85rem; font-weight: 700; color: var(--ink); }
.cards--dashboard { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card--stat { display: flex; flex-direction: column; gap: .15rem; }
.card--stat small {
  display: block;
  margin-top: .35rem;
  font-size: .8rem;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.35;
}
.card--stat code { font-size: .78rem; background: var(--bg); padding: .1rem .35rem; border-radius: 4px; }
.card--link {
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.card--link:hover {
  border-color: var(--leaf);
  box-shadow: 0 4px 16px rgba(77, 124, 15, .12);
}
.card--link:hover strong { color: var(--leaf-dark); }

.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .92rem; }
.alert--error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert--success { background: #ecfccb; color: var(--leaf-dark); border: 1px solid #bef264; }
.alert--info { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.alert--warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

.profile-lock-notice {
  margin-bottom: 0;
}

.profile-request-form {
  margin: 0.75rem 0 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.form { display: flex; flex-direction: column; gap: 1rem; max-width: 480px; }
.form-grid { max-width: 100%; }
.form label { display: flex; flex-direction: column; gap: .35rem; font-size: .88rem; font-weight: 600; }
.form input, .form select, .form textarea {
  padding: .6rem .75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .6rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: .9rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--leaf-dark); color: #fff; }
.btn-primary:hover { background: var(--leaf); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn-sm { padding: .35rem .65rem; font-size: .8rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.05); }
.sidebar-nav a.nav-link--danger { color: #fca5a5; }
.sidebar-nav a.nav-link--danger:hover { color: #fff; background: rgba(185, 28, 28, 0.35); }
.danger-zone {
  padding: 1.25rem;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  background: #fef2f2;
}
.danger-zone h2 { margin-top: 0; color: var(--danger); }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

.list-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .65rem .85rem;
  margin-bottom: .65rem;
  padding: .75rem .85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.list-table-toolbar__label {
  display: block;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: .25rem;
}
.list-table-toolbar__search-wrap { flex: 1 1 12rem; min-width: 10rem; }
.list-table-toolbar__sort-wrap { flex: 0 1 10rem; min-width: 8rem; }
.list-table-toolbar__search,
.list-table-toolbar__sort-col {
  width: 100%;
  padding: .5rem .65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: .88rem;
  background: #fff;
}
.list-table-toolbar__sort-dir {
  flex: 0 0 auto;
  min-width: 2.5rem;
  font-size: 1rem;
  line-height: 1;
  padding: .45rem .55rem;
}
.list-table-toolbar__count {
  flex: 1 1 100%;
  font-size: .78rem;
  color: var(--muted);
}
@media (min-width: 640px) {
  .list-table-toolbar__count {
    flex: 1 1 auto;
    margin-left: auto;
    text-align: right;
  }
}
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: .65rem .85rem; text-align: left; border-bottom: 1px solid var(--line); }
th { background: #faf8f5; font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
tr:last-child td { border-bottom: none; }

.table-money-stack {
  min-width: 6.75rem;
  vertical-align: top;
  line-height: 1.35;
}

.table-money-stack strong {
  display: block;
  font-size: 0.88rem;
}

.table-money-stack small {
  display: block;
  font-size: 0.74rem;
  margin-top: 0.12rem;
}

.cards .card small.muted {
  display: block;
  margin-top: .2rem;
  font-size: .78rem;
  font-weight: 500;
}

.withdrawal-status-cards .withdrawal-status-card {
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.withdrawal-status-cards .withdrawal-status-card:hover {
  border-color: var(--accent, #84cc16);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}
.withdrawal-status-card--active {
  border-color: var(--accent, #84cc16);
  box-shadow: 0 0 0 2px rgba(132, 204, 22, .2);
}
.withdrawal-status-card--pending strong { color: #b45309; }
.withdrawal-status-card--approved strong { color: #1d4ed8; }
.withdrawal-status-card--paid strong { color: #047857; }
.withdrawal-status-card--rejected strong { color: var(--danger, #dc2626); }

.badge {
  display: inline-block;
  padding: .2rem .5rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.badge--pending { background: #fef3c7; color: #92400e; }
.badge--approved { background: #dbeafe; color: #1e40af; }
.badge--paid { background: #ecfccb; color: var(--leaf-dark); }
.badge--rejected { background: #fee2e2; color: var(--danger); }

.section { margin-bottom: 2rem; }
.section h2 { font-size: 1.1rem; margin: 0 0 1rem; }
.plan-box {
  background: linear-gradient(135deg, #ecfccb, #fff);
  border: 1px solid #bef264;
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.plan-box ul { margin: .5rem 0 0; padding-left: 1.2rem; }
.plan-box li { margin-bottom: .35rem; font-size: .9rem; }

.split-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 720px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 100%;
}

/* Panel shell — desktop sidebar, mobile drawer */
.panel-bottom-nav {
  display: none;
}

.panel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(26, 24, 22, 0.5);
}
.panel-overlay.is-open {
  display: block;
}

.panel-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar-close {
  display: none;
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.sidebar-brand {
  position: relative;
}

.main-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.main-head h1 {
  flex: 1;
  min-width: 0;
  font-size: clamp(1.1rem, 4vw, 1.35rem);
}

.panel-export-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

body.panel-menu-open {
  overflow: hidden;
}

@media (max-width: 991px) {
  .panel {
    display: block;
  }

  .panel-menu-btn {
    display: inline-flex;
  }

  .sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, 88vw);
    z-index: 160;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    pointer-events: none;
  }

  .sidebar.is-open {
    transform: translateX(0);
    pointer-events: auto;
  }

  .main {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .main-head {
    padding: 1rem 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
    flex-wrap: wrap;
  }

  .main-body {
    padding: 1rem;
    flex: 1;
    min-width: 0;
  }

  .panel--client .main-body {
    padding-bottom: 4.75rem;
  }

  .panel-bottom-nav {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 140;
    background: var(--surface);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
    padding-bottom: max(0.25rem, env(safe-area-inset-bottom, 0px));
  }

  .panel-bottom-nav__scroll {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.4rem 0.5rem;
    scrollbar-width: none;
  }

  .panel-bottom-nav__scroll::-webkit-scrollbar {
    display: none;
  }

  .panel-bottom-nav__link {
    flex: 0 0 auto;
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--muted);
    white-space: nowrap;
    line-height: 1.2;
  }

  .panel-bottom-nav__link:hover {
    color: var(--leaf-dark);
    background: #f7fee7;
  }

  .panel-bottom-nav__link.is-active {
    color: var(--leaf-dark);
    background: #ecfccb;
  }

  body.panel-menu-open .panel-bottom-nav {
    z-index: 120;
  }

  .cards,
  .cards--dashboard {
    grid-template-columns: 1fr;
  }

  .split-form,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .dash-member__meta div {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .network-level-cards {
    grid-template-columns: 1fr 1fr;
  }

  .doc-grid {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 0.5rem 0.55rem;
    font-size: 0.8rem;
  }

  .table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrap table {
    width: max-content !important;
    min-width: 100% !important;
    table-layout: auto;
  }

  .table-wrap th,
  .table-wrap td {
    white-space: nowrap;
  }

  .form {
    max-width: 100%;
  }

  .panel-export-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .auth-card {
    padding: 1.35rem;
  }

  .referral-box {
    flex-direction: column;
  }

  .referral-box__input {
    flex: 1 1 auto;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .network-level-cards {
    grid-template-columns: 1fr;
  }

  .network-summary-card__stats {
    grid-template-columns: 1fr;
  }
}

.thumb { max-width: 120px; max-height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.doc-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}
.doc-card h3 { margin: 0 0 .5rem; font-size: .92rem; }
.doc-card--highlight {
  border-color: #bef264;
  background: linear-gradient(165deg, #f7fee7, #fff);
  box-shadow: 0 0 0 2px rgba(190, 242, 100, 0.35);
}
.doc-card input[type="file"] { font-size: .8rem; margin: .5rem 0; width: 100%; }

.doc-view-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 420px;
}

.doc-view-row__meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.doc-view-row__title {
  font-size: 0.92rem;
}

.doc-view-row__date {
  font-size: 0.82rem;
}

.file-view-dialog {
  border: none;
  padding: 0;
  width: min(920px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  background: transparent;
}

.file-view-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

.file-view-dialog__inner {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.file-view-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}

.file-view-dialog__head h3 {
  margin: 0;
  font-size: 1rem;
}

.file-view-dialog__close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 0.15rem 0.35rem;
}

.file-view-dialog__close:hover {
  color: var(--ink);
}

.file-view-dialog__body {
  padding: 0.75rem;
  background: #0f172a;
  max-height: calc(100vh - 8rem);
  overflow: auto;
}

.file-view-dialog__img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 9rem);
  margin: 0 auto;
  border-radius: 8px;
}

.file-view-dialog__frame {
  display: block;
  width: 100%;
  min-height: min(70vh, 720px);
  border: none;
  border-radius: 8px;
  background: #fff;
}

.form h2 { margin: 1.5rem 0 .75rem; font-size: 1.05rem; }
.form h2:first-child { margin-top: 0; }

.username-field { position: relative; }
.username-hint { margin: .35rem 0 0; font-size: .82rem; }
.username-hint--ok { color: var(--leaf-dark); }
.username-hint--warn { color: #9a3412; }
.username-hint--error { color: var(--danger); }
.username-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 20;
  margin-top: .25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .5rem .65rem;
  max-height: 220px;
  overflow-y: auto;
}
.username-suggest__title {
  margin: 0 0 .35rem;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  font-weight: 600;
}
.username-suggest ul { list-style: none; margin: 0; padding: 0; }
.username-suggest li { margin: 0; }
.username-suggest__pick {
  display: block;
  width: 100%;
  text-align: left;
  padding: .45rem .5rem;
  border: none;
  background: transparent;
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--leaf-dark);
}
.username-suggest__pick:hover { background: var(--leaf-soft); }

.req { color: var(--danger); }
.invite-link { display: block; word-break: break-all; font-size: .85rem; padding: .5rem; background: var(--bg); border-radius: 8px; }

.dash-member {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  padding: 1.25rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
@media (max-width: 768px) {
  .dash-member { grid-template-columns: 1fr; }
}
.dash-member__title {
  margin: 0 0 .85rem;
  font-size: 1.25rem;
}
.dash-member__meta {
  display: grid;
  gap: .65rem;
  margin: 0;
}
.dash-member__meta div {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: .5rem;
  align-items: baseline;
}
.dash-member__meta dt {
  margin: 0;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.dash-member__meta dd {
  margin: 0;
  font-size: .95rem;
}
.dash-member__tag {
  margin-left: .35rem;
  font-size: .82rem;
  background: var(--bg);
  padding: .1rem .35rem;
  border-radius: 4px;
}
.dash-member__referral .section-title {
  margin-top: 0;
}
.referral-box {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .65rem 0;
}
.referral-box__input {
  flex: 1 1 220px;
  min-width: 0;
  padding: .55rem .75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: .85rem;
  background: var(--bg);
}

.pincode-status {
  margin: -.35rem 0 .5rem;
  font-size: .82rem;
  color: var(--leaf-dark);
}
.pincode-status--error { color: var(--danger); }
#city[readonly], #state[readonly], #area[readonly] {
  background: var(--bg);
  cursor: default;
}
#area-wrap select,
#area-wrap input {
  width: 100%;
  padding: .6rem .75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}
.profile-login-note {
  margin-bottom: 1rem;
  padding: .85rem 1rem;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: .9rem;
}
.profile-login-note p { margin: 0 0 .35rem; }
.profile-login-note p:last-child { margin-bottom: 0; }

.ifsc-status {
  margin: -.35rem 0 .5rem;
  font-size: .82rem;
  color: var(--leaf-dark);
}
.ifsc-status--error { color: var(--danger); }
#ifsc_code { text-transform: uppercase; }
#payout_bank_name[readonly], #payout_branch[readonly] {
  background: var(--bg);
  cursor: default;
}

.income-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.25rem;
}
.income-subnav__link {
  padding: .45rem .9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: .88rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.income-subnav__link:hover { border-color: var(--leaf); color: var(--leaf-dark); }
.income-subnav__link.is-active {
  background: var(--leaf-dark);
  border-color: var(--leaf-dark);
  color: #fff;
}
.amount-credit { color: var(--leaf-dark); font-weight: 700; }

.network-totals { margin-bottom: 1rem; }

.network-jump {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1rem;
}
.network-jump a {
  display: inline-block;
  padding: .35rem .65rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-size: .82rem;
  font-weight: 600;
  color: var(--leaf-dark);
  text-decoration: none;
}
.network-jump a:hover {
  border-color: var(--leaf);
  background: #f7fee7;
}

.network-summary-table { font-size: .92rem; }
.network-summary-total td { background: #f0ebe3; font-weight: 600; }

.table-total-row td {
  background: #f0ebe3;
  font-weight: 600;
  border-top: 2px solid var(--line-strong);
}
.network-summary-table a { color: var(--leaf-dark); font-weight: 600; text-decoration: none; }
.network-summary-table a:hover { text-decoration: underline; }

.network-level-block {
  border-top: 2px solid var(--line);
  padding-top: 1.5rem;
  scroll-margin-top: 1rem;
}
.network-level-block__title { margin: 0 0 1rem; font-size: 1.2rem; }
.network-level-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
.network-level-cards .card { padding: .75rem 1rem; }
.network-downline-heading {
  margin: 0 0 .65rem;
  font-size: .95rem;
  font-weight: 600;
  color: var(--muted);
}

.bank-readonly label {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.network-sponsor { margin-bottom: 1.25rem; }
.network-sponsor-card {
  margin-top: .75rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.bank-readonly-val {
  display: block;
  padding: .55rem .75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8f6f2;
  font-weight: 600;
  color: var(--ink);
}

/* Admin — member full view (user.php) */
.admin-member-head {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1rem;
  padding: 1rem 1.15rem;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.admin-member-head__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.admin-member-tabs-wrap {
  margin-bottom: 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.15rem;
}

.admin-member-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  min-width: min-content;
  padding: 0.35rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.admin-member-tabs__link {
  display: inline-block;
  flex: 0 0 auto;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.2;
}

.admin-member-tabs__link:hover {
  border-color: var(--leaf);
  color: var(--leaf-dark);
  background: #f7fee7;
}

.admin-member-tabs__link.is-active {
  background: var(--leaf-dark);
  border-color: var(--leaf-dark);
  color: #fff;
}

.admin-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.admin-member-preview {
  padding: 1rem 1.15rem;
}

.admin-member-preview__links {
  margin: 0.85rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

@media (min-width: 768px) {
  .admin-member-tabs {
    flex-wrap: wrap;
  }
}
