/*
 * NTR Partner Portal — styles
 * Brand tokens read from trailrunningnepal.com (19 Nov 2026): primary #5EA300, navy #101828,
 * fonts Rubik (headings) and Poppins (body). #427A00 is a darker step of the brand green used
 * for buttons and links, because white text on #5EA300 is only ~3.1:1 contrast.
 */
:root {
  --green: #5EA300;
  --green-strong: #427A00;
  --green-dark: #2F5800;
  --green-tint: #F4F9EC;
  --green-line: #CFE3B0;
  --navy: #101828;
  --navy-2: #1D2939;
  --text: #373833;
  --muted: #5B5E57;
  --line: #E4E6E0;
  --line-2: #EEF0EA;
  --bg: #F6F7F4;
  --white: #FFFFFF;
  --radius: 12px;
  --font-body: Poppins, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: Rubik, Poppins, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font-body); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); }
a { color: var(--green-strong); }
a:hover { color: var(--green-dark); }
h1, h2, h3 { font-family: var(--font-head); color: var(--navy); margin: 0; font-weight: 600; line-height: 1.2; }
h1 { font-size: 28px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #8BC34A; outline-offset: 2px; }

/* ---------- layout ---------- */
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.page { padding: 28px 0 56px; display: flex; flex-direction: column; gap: 22px; }
.row { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.row > .grow { flex: 999 1 560px; min-width: 0; }
.row > .side { flex: 1 1 300px; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.between { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; justify-content: space-between; }
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.page-head { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: flex-start; }
.page-head .lead { color: var(--muted); margin-top: 6px; max-width: 760px; }

/* ---------- partner top bar ---------- */
.topbar { background: var(--white); border-bottom: 1px solid var(--line); }
.topbar-in { min-height: 68px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); }
.brand strong { font-family: var(--font-head); font-size: 16px; }
.brand span { color: var(--muted); font-size: 13px; }
.logo { width: 34px; height: 34px; flex: 0 0 auto; }
.topnav { display: flex; gap: 4px; flex-wrap: wrap; }
.topnav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 8px; color: var(--text); text-decoration: none; }
.topnav a[aria-current="page"] { background: var(--green-tint); color: var(--green-dark); font-weight: 600; }
.who { display: flex; align-items: center; gap: 12px; }
.who span { font-weight: 500; color: var(--navy); }
.preview-bar { background: #FEF3C7; color: #5C3B00; padding: 10px 24px; font-size: 13px; text-align: center; }

/* ---------- admin layout ---------- */
.admin { display: flex; flex-wrap: wrap; min-height: 100vh; }
.sidebar { flex: 1 1 232px; max-width: 100%; background: var(--navy); color: #E5E7EB; padding: 24px 16px; display: flex; flex-direction: column; gap: 26px; }
.sidebar .brand { color: #FFFFFF; }
.sidebar .brand span { color: #9CA3AF; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 12px; border-radius: 8px; color: #D1D5DB; text-decoration: none; }
.sidebar nav a:hover { color: #FFFFFF; background: rgba(255, 255, 255, .06); }
.sidebar nav a[aria-current="page"] { background: rgba(94, 163, 0, .22); color: #FFFFFF; font-weight: 500; }
.sidebar .badge { background: var(--green); color: var(--navy); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 8px; }
.sidebar .foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: #9CA3AF; }
.sidebar .foot button { color: #D1D5DB; background: none; border: 1px solid #344054; }
.admin-main { flex: 999 1 560px; min-width: 0; padding: 28px 36px 56px; display: flex; flex-direction: column; gap: 22px; }

/* ---------- cards & stats ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.card.tint { background: var(--green-tint); border-color: var(--green-line); }
.card.dark { background: var(--navy); border-color: var(--navy); color: #E5E7EB; }
.card.dark h2, .card.dark h3 { color: #FFFFFF; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.stat .label { font-size: 13px; color: var(--muted); }
.stat .value { font-family: var(--font-head); font-size: 28px; font-weight: 600; color: var(--navy); line-height: 1.15; }
.stat .sub { font-size: 12px; color: var(--muted); }
.stat.dark { background: var(--navy); border-color: var(--navy); }
.stat.dark .label, .stat.dark .sub { color: #D1D5DB; }
.stat.dark .value { color: #FFFFFF; }

/* ---------- buttons & forms ---------- */
.btn, .btn-secondary, .btn-ghost, .btn-danger {
  font: inherit; font-size: 14px; font-weight: 500; min-height: 44px; padding: 0 18px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn { background: var(--green-strong); color: #FFFFFF; border: 1px solid var(--green-strong); }
.btn:hover { background: var(--green-dark); color: #FFFFFF; }
.btn-secondary { background: var(--white); color: var(--navy); border: 1px solid #D4D7CF; }
.btn-secondary:hover { border-color: var(--navy); color: var(--navy); }
.btn-ghost { background: none; border: none; color: var(--green-strong); padding: 0 8px; }
.btn-danger { background: var(--white); color: #991B1B; border: 1px solid #F3C4C4; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
button:disabled { opacity: .5; cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 13px; font-weight: 500; color: var(--navy); }
.field .hint { font-size: 12px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], input[type="url"], input[type="tel"], select, textarea {
  font: inherit; font-size: 14px; min-height: 44px; padding: 0 12px; border: 1px solid #D4D7CF; border-radius: 8px; background: var(--white); color: var(--navy); width: 100%;
}
textarea { padding: 10px 12px; resize: vertical; min-height: 80px; }
@supports (appearance: base-select) {
  select, ::picker(select) { appearance: base-select; }
  select { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; }
  select::picker-icon { color: var(--muted); transition: rotate .15s; }
  select:open::picker-icon { rotate: 180deg; }
  select:focus-visible { outline: 2px solid var(--green-strong); outline-offset: 1px; }
  ::picker(select) { border: 1px solid #D4D7CF; border-radius: 10px; background: var(--white); box-shadow: 0 12px 32px rgba(16, 24, 40, .12); padding: 6px; margin-block: 4px; max-height: min(360px, 60vh); }
  select option { padding: 9px 12px; border-radius: 6px; color: var(--navy); font-size: 14px; gap: 8px; cursor: pointer; }
  select option:hover, select option:focus-visible { background: var(--green-tint); outline: none; }
  select option:checked { color: var(--green-dark); font-weight: 600; }
  select option::checkmark { color: var(--green-strong); }
  select optgroup { font-weight: 600; color: var(--muted); font-size: 12px; padding: 6px 12px 2px; }
}
input[readonly] { background: #F9FAF7; }
.code-input { text-transform: uppercase; font-weight: 600; letter-spacing: .5px; }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--green-strong); }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.radio-cards label { display: flex; gap: 10px; align-items: center; min-height: 48px; padding: 8px 14px; border: 1px solid #D4D7CF; border-radius: 10px; background: var(--white); cursor: pointer; }
.radio-cards input { accent-color: var(--green-strong); width: 18px; height: 18px; }
.radio-cards label:has(input:checked) { border: 2px solid var(--green-strong); background: var(--green-tint); }
fieldset { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
legend { font-family: var(--font-head); font-size: 16px; font-weight: 600; color: var(--navy); padding: 0 6px; }
.form-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; border-radius: 8px; padding: 10px 14px; font-size: 13px; }
.notice { background: #F0F9FF; color: #0C4A6E; border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.success { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.match { min-height: 44px; display: flex; align-items: center; padding: 0 14px; border-radius: 8px; font-size: 14px; }
.match.ok { background: #F0FDF4; color: #166534; }
.match.bad { background: #FEF2F2; color: #991B1B; }
.match.none { background: #F3F4F6; color: #4B5563; }

.sum-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sum-row > span:last-child { white-space: nowrap; }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { font: inherit; font-size: 13px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid #D4D7CF; background: var(--white); color: var(--navy); cursor: pointer; white-space: nowrap; }
.chips button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #FFFFFF; }

/* ---------- pills ---------- */
.pill { display: inline-block; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill-pending { background: #FEF3C7; color: #8A5300; }
.pill-earned { background: #EDE9FE; color: #5B21B6; }
.pill-paid { background: #DCFCE7; color: #166534; }
.pill-open { background: #E0F2FE; color: #075985; }
.pill-muted { background: #F3F4F6; color: #4B5563; }
.pill-danger { background: #FEE2E2; color: #991B1B; }
.pill-manual { background: #FFEDD5; color: #9A3412; }
.pill-sample { background: #FEF3C7; color: #8A5300; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; white-space: nowrap; }
.tbl td.wrap { white-space: normal; min-width: 200px; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .strong { font-weight: 500; color: var(--navy); }
.empty { color: var(--muted); font-size: 13px; padding: 12px 0; }

/* ---------- link builder / payout ---------- */
.link-out { display: flex; flex-wrap: wrap; gap: 8px; }
.link-out input { flex: 1 1 320px; width: auto; font-size: 13px; }
.result { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; background: var(--green-tint); border: 1px solid var(--green-line); border-radius: 12px; padding: 16px; }
.qr { flex: 0 0 96px; height: 96px; border: 1px dashed #A8AD9F; border-radius: 8px; background: var(--white); display: flex; align-items: center; justify-content: center; text-align: center; font-size: 11px; color: var(--muted); }
.progress { height: 10px; border-radius: 5px; background: var(--line-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--green); border-radius: 5px; }
.card.dark .progress { background: #344054; }

/* ---------- funnel ---------- */
.funnel { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px; }
.funnel .step { display: flex; flex-direction: column; gap: 6px; }
.funnel .step .value { font-family: var(--font-head); font-size: 28px; font-weight: 600; color: var(--navy); }

/* ---------- journey dots ---------- */
.journey { display: inline-flex; align-items: center; }
.journey i { width: 12px; height: 12px; border-radius: 50%; background: #D4D7CF; display: inline-block; }
.journey b { width: 14px; height: 3px; background: #D4D7CF; display: inline-block; }
.journey .on { background: var(--green-strong); }
.journey .done { background: var(--navy); }
.journey .x { background: #FFFFFF; border: 2px solid #9CA3AF; }

/* ---------- feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.feed li:last-child { border-bottom: none; }
.feed .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: 0 0 auto; background: var(--green); }
.feed .dot.lost, .feed .dot.cancelled { background: #9CA3AF; }
.feed .dot.completed { background: var(--navy); }
.feed .dot.paid { background: #166534; }
.feed .dot.request { background: #5B21B6; }
.feed .when { font-size: 12px; color: var(--muted); }

/* ---------- creator hub (phone-first) ---------- */
.hub { max-width: 520px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.hub-head { background: var(--navy); color: #FFFFFF; padding: 16px 18px 24px; display: flex; flex-direction: column; gap: 16px; }
.hub-head .brand { color: #FFFFFF; }
.hub-head .big { font-family: var(--font-head); font-size: 32px; font-weight: 600; line-height: 1.1; }
.hub-head .sub { font-size: 13px; color: #D1D5DB; }
.hub-head a, .hub-head button.btn-ghost { color: #D1D5DB; }
.hub-plain { background: var(--white); border-bottom: 1px solid var(--line); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.hub-main { flex: 1 1 auto; padding: 16px 16px 96px; display: flex; flex-direction: column; gap: 16px; }
.hub .card { border-radius: 16px; padding: 16px; }
.hub .grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hub .stat { border-radius: 14px; padding: 14px; }
.hub .stat .value { font-size: 22px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--white); border-top: 1px solid var(--line); }
.tabbar nav { max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 4px 4px 10px; }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; font-size: 11px; color: var(--muted); text-decoration: none; }
.tabbar a[aria-current="page"] { color: var(--green-strong); font-weight: 600; }
.list-card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.list-card .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.list-card .title { font-size: 14px; font-weight: 500; color: var(--navy); }
.camp-picker { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.camp-picker button { font: inherit; text-align: left; flex: 0 0 180px; min-height: 64px; padding: 10px 14px; border-radius: 14px; border: 1px solid #D4D7CF; background: var(--white); color: var(--navy); cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.camp-picker button[aria-pressed="true"] { border: 2px solid var(--green-strong); background: var(--green-tint); }
.caption { white-space: pre-line; background: #F9FAF7; border-radius: 10px; padding: 12px; color: var(--navy); line-height: 1.6; }
.code-big { font-family: var(--font-head); font-size: 34px; font-weight: 700; letter-spacing: 3px; color: var(--navy); text-align: center; }

/* ---------- sign-in ---------- */
.auth { display: flex; flex-wrap: wrap; min-height: 100vh; }
.auth-brand { flex: 1 1 420px; background: var(--navy); color: #FFFFFF; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-brand h1 { color: #FFFFFF; font-size: 42px; }
.auth-brand p { color: #D1D5DB; font-size: 17px; max-width: 520px; }
.auth-form { flex: 1 1 460px; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-form form { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 18px; }
.bullets { display: flex; flex-direction: column; gap: 10px; color: #E5E7EB; font-size: 15px; }
.bullets span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 10px; vertical-align: middle; }
.demo-box { border: 1px dashed #A8AD9F; border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }

/* ---------- dialog & toast ---------- */
dialog { border: none; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(16, 24, 40, .25); }
dialog::backdrop { background: rgba(16, 24, 40, .45); }
dialog form { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--navy); color: #FFFFFF; padding: 12px 18px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 640px) {
  .admin-main { padding: 20px 16px 48px; }
  .auth-brand { padding: 32px 24px; }
  .auth-brand h1 { font-size: 32px; }
  h1 { font-size: 24px; }
}

/* ---------- dashboard extras ---------- */
.next-dep { text-decoration: none; gap: 4px; }
.next-dep:hover { background: var(--navy-2); }
.logo-box { width: 140px; height: 70px; border: 1px dashed #A8AD9F; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--white); overflow: hidden; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.placeholder { background: #FEF3C7; color: #8A5300; padding: 0 4px; border-radius: 4px; }

/* ---------- printable documents ---------- */
.print-body { background: #E9EBE5; }
.print-toolbar { max-width: 820px; margin: 0 auto; padding: 16px 24px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.sheet { position: relative; max-width: 820px; margin: 0 auto 40px; background: #FFFFFF; padding: 48px 56px; display: flex; flex-direction: column; gap: 18px; overflow: hidden; box-shadow: 0 2px 12px rgba(16, 24, 40, .08); }
.sheet::before { content: attr(data-watermark); position: absolute; top: 45%; left: -10%; right: -10%; text-align: center; transform: rotate(-24deg); font-family: var(--font-head); font-size: 44px; font-weight: 700; color: rgba(16, 24, 40, .06); pointer-events: none; white-space: nowrap; }
.sheet-head { display: flex; flex-direction: column; gap: 12px; border-bottom: 2px solid var(--green); padding-bottom: 14px; }
.confidential { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.sheet-foot { border-top: 1px solid var(--line); padding-top: 12px; color: var(--muted); }
.partner-logo { display: flex; align-items: center; gap: 12px; }
.partner-logo img { max-height: 60px; max-width: 200px; object-fit: contain; }
.paid-stamp { border: 3px solid #166534; color: #166534; font-family: var(--font-head); font-weight: 700; font-size: 22px; padding: 2px 14px; border-radius: 8px; transform: rotate(-6deg); }
@media print {
  .no-print, .preview-bar, .toast { display: none !important; }
  .print-body { background: #FFFFFF; }
  .sheet { box-shadow: none; margin: 0; max-width: none; padding: 0; }
  .sheet::before { color: rgba(16, 24, 40, .08); }
}
