/* 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;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 12px 40px rgba(0,0,0,.06);
}
.auth-card--wide { max-width: 520px; }
.auth-card h1 { margin: 0 0 .25rem; font-size: 1.5rem; }
.muted { color: var(--muted); font-size: .92rem; }
.auth-links { margin-top: 1.25rem; font-size: .9rem; }
.auth-links a { color: var(--leaf-dark); font-weight: 600; }

.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; }

.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; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
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; }

.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; }
@media (max-width: 900px) {
  .panel { flex-direction: column; }
  .sidebar { width: 100%; }
  .split-form { 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%; }

.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; }
