/*
  DHCOS design system, taken from the InvoiceCore templates (Handoff.html).
  Admin console, sign-in and the member portal share these tokens; Bootstrap classes in existing views are re-skinned here.
*/
:root {
  --ink: #14181F;
  --ink-2: #4A525C;
  --muted: #626B75;
  --line-strong: #D5D9D3;
  --line: #E3E6E1;
  --line-soft: #EEF0EC;
  --ground: #F4F5F2;
  --surface: #FFFFFF;
  --brand: #0F6E5C;
  --brand-hover: #0A4E41;
  --brand-soft: #E3F1EC;
  --brand-ink: #0B5B4B;
  --danger: #A3243B;

  --nav-bg: #14181F;
  --nav-hover: #20262E;
  --nav-edge: #2E353F;
  --nav-text: #C9CFC8;
  --nav-label: #9AA39B;
  --nav-dot: #4FD1A5;

  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Bricolage Grotesque", "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --bs-primary: var(--brand);
  --bs-primary-rgb: 15, 110, 92;
  --bs-link-color: var(--brand);
  --bs-link-color-rgb: 15, 110, 92;
  --bs-link-hover-color: var(--brand-hover);
  --bs-body-bg: var(--ground);
  --bs-body-color: var(--ink);
  --bs-body-font-family: var(--font-body);
  --bs-secondary-color: var(--muted);
  --bs-border-color: var(--line);
  --bs-border-radius: 10px;
}

html { font-size: 15px; position: relative; min-height: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
a:hover { color: var(--brand-hover); }
h1, h2, h3, h4, h5 { font-weight: 600; letter-spacing: -0.01em; }
code, .font-monospace { font-family: var(--font-mono) !important; font-size: .92em; }
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.text-muted { color: var(--muted) !important; }
.sr { position: absolute; left: -9999px; }

/* ---- buttons ----------------------------------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 10px; font-size: 14px; font-weight: 600; white-space: nowrap; line-height: 1.2;
}
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-lg { min-height: 52px; padding: 0 20px; font-size: 15px; }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; box-shadow: none; }
.btn-primary, .btn-success {
  --bs-btn-color: #fff; --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--brand-hover); --bs-btn-hover-border-color: var(--brand-hover);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--brand-hover); --bs-btn-active-border-color: var(--brand-hover);
  --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
}
.btn-secondary, .btn-outline-secondary, .btn-outline-primary, .btn-light {
  --bs-btn-color: var(--ink); --bs-btn-bg: #fff; --bs-btn-border-color: var(--line-strong);
  --bs-btn-hover-color: var(--ink); --bs-btn-hover-bg: var(--ground); --bs-btn-hover-border-color: var(--line-strong);
  --bs-btn-active-color: var(--ink); --bs-btn-active-bg: var(--ground); --bs-btn-active-border-color: var(--line-strong);
  --bs-btn-disabled-color: var(--muted); --bs-btn-disabled-bg: #fff; --bs-btn-disabled-border-color: var(--line);
}
.btn-outline-primary { --bs-btn-color: var(--brand-ink); }
.btn-dark {
  --bs-btn-color: #fff; --bs-btn-bg: var(--ink); --bs-btn-border-color: var(--ink);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #2a313a; --bs-btn-hover-border-color: #2a313a;
}
.btn-danger, .btn-outline-danger {
  --bs-btn-color: #fff; --bs-btn-bg: var(--danger); --bs-btn-border-color: var(--danger);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #861c30; --bs-btn-hover-border-color: #861c30;
  --bs-btn-active-bg: #861c30; --bs-btn-active-border-color: #861c30;
}
.btn-outline-danger { --bs-btn-color: var(--danger); --bs-btn-bg: #fff; --bs-btn-border-color: #E3B7C0; }
.btn-warning { --bs-btn-color: #6B3A05; --bs-btn-bg: #FBEBD9; --bs-btn-border-color: #F2D4B0; --bs-btn-hover-bg: #F6DDBF; --bs-btn-hover-border-color: #F2D4B0; --bs-btn-hover-color: #6B3A05; }
.btn-info { --bs-btn-color: #234E9C; --bs-btn-bg: #E4ECF8; --bs-btn-border-color: #C9D8F0; --bs-btn-hover-bg: #D6E3F5; --bs-btn-hover-border-color: #C9D8F0; --bs-btn-hover-color: #234E9C; }
.btn-link { color: var(--muted); text-decoration: none; }
.btn-link:hover { color: var(--ink); text-decoration: underline; }

/* ---- forms ------------------------------------------------------------------------------------------------------- */
.form-label { font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.form-control, .form-select {
  min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; font-size: 14px; color: var(--ink); background-color: #fff; box-shadow: none;
}
textarea.form-control { padding: 10px 12px; min-height: 2.9rem; }
.form-select { padding-right: 2.25rem; }
.form-control-sm, .form-select-sm { min-height: 36px; padding: 0 10px; font-size: 13px; border-radius: 9px; }
textarea.form-control-sm { padding: 6px 10px; }
.form-control:focus, .form-select:focus { border-color: var(--line-strong); outline: 2px solid var(--brand); outline-offset: -1px; box-shadow: none; }
.form-control::placeholder { color: #8b949d; }
.form-control:disabled, .form-control[readonly] { background: #F8F9F7; }
.form-check-input { width: 1.15em; height: 1.15em; border-color: var(--line-strong); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(15, 110, 92, .18); }
.form-text { color: var(--muted); }
.input-group > .form-control, .input-group > .form-select { min-height: 44px; }
.input-group-text { border-color: var(--line-strong); background: #F8F9F7; color: var(--ink-2); font-size: 14px; }

/* ---- cards, tables, chips, alerts -------------------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: none; }
.card-header { padding: 14px 20px; background: transparent; border-bottom: 1px solid var(--line); font-size: 16px; font-weight: 600; }
.card-body { padding: 18px 20px; }
.card-footer { background: transparent; border-top: 1px solid var(--line); }

.table { --bs-table-bg: transparent; margin-bottom: 0; font-size: 14px; }
.table > thead > tr > th {
  padding: 10px 12px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table > tbody > tr > td, .table > tbody > tr > th { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table-sm > :not(caption) > * > * { padding: 8px 12px; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #F8F9F7; }

.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 18px; white-space: nowrap; }
.badge.fs-6 { font-size: 13px !important; }
.badge.bg-success { background-color: #E3F1EC !important; color: #0B5B4B !important; }
.badge.bg-primary, .badge.bg-info { background-color: #E4ECF8 !important; color: #234E9C !important; }
.badge.bg-warning { background-color: #FBEBD9 !important; color: #8A4A07 !important; }
.badge.bg-danger { background-color: #F8E5E8 !important; color: #8F1D33 !important; }
.badge.bg-secondary, .badge.bg-light { background-color: #ECEEEB !important; color: #4A525C !important; }
.badge.bg-dark { background-color: var(--ink) !important; color: #fff !important; }

.alert { padding: 12px 16px; border-radius: 12px; border: 1px solid transparent; font-size: 14px; }
.alert-success { background: #E3F1EC; border-color: #C8E3D9; color: #0B5B4B; }
.alert-info { background: #E4ECF8; border-color: #C9D8F0; color: #234E9C; }
.alert-warning { background: #FBEBD9; border-color: #F2D4B0; color: #6B3A05; }
.alert-danger { background: #F8E5E8; border-color: #EFC4CC; color: #8F1D33; }
.alert-secondary { background: #ECEEEB; border-color: var(--line); color: var(--ink-2); }
.alert .alert-link { color: inherit; font-weight: 600; }
.validation-summary-valid { display: none; }
.validation-summary-errors ul { margin: 0; padding-left: 1.1rem; }
.text-danger, .field-validation-error { color: #8F1D33 !important; }

.list-group { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.list-group-item { border-color: var(--line-soft); padding: 12px 16px; }

.nav-pills { gap: 4px; }
.nav-pills .nav-link { min-height: 44px; display: inline-flex; align-items: center; border-radius: 10px; padding: 0 14px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.nav-pills .nav-link:hover { background: #ECEEEB; }
.nav-pills .nav-link.active { background: var(--ink); color: #fff; }
.nav-tabs { border-bottom: 1px solid var(--line); }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; min-height: 44px; padding: 0 4px; margin-right: 18px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.nav-tabs .nav-link.active { background: transparent; color: var(--ink); font-weight: 600; border-bottom-color: var(--brand); }

/* ---- the admin shell: 232px ink rail + page ----------------------------------------------------------------------- */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.app-side {
  background: var(--nav-bg); color: #E8EAE6; padding: 24px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 22px; scrollbar-width: thin; scrollbar-color: #2a3750 transparent;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: #E8EAE6; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.ws { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--nav-hover); border: 1px solid var(--nav-edge); }
.ws-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--nav-label); }
.ws-name { font-weight: 600; font-size: 14px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.nav-group.bottom { margin-top: auto; }
.nav-title { padding: 0 12px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--nav-label); }
.nav-item-link {
  display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 8px;
  color: var(--nav-text); text-decoration: none;
}
.nav-item-link:hover { background: var(--nav-hover); color: #fff; }
.nav-item-link.active { background: var(--nav-hover); color: #fff; font-weight: 600; }
.nav-dot { width: 6px; height: 6px; border-radius: 3px; background: var(--nav-dot); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--nav-hover); border: 1px solid var(--nav-edge); }
.avatar { width: 32px; height: 32px; border-radius: 16px; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.side-name { color: inherit; text-decoration: none; flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-signout { all: unset; cursor: pointer; padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--nav-text); }
.side-signout:hover { background: #2a313a; color: #fff; }
.side-signout:focus-visible { outline: 2px solid var(--nav-dot); }

.app-main { min-width: 0; }
.content { padding: 28px 40px 48px; }

/* page headings: display face for the page title, heading weight for sections */
.content h2, .content h3, .content h5 { font-family: var(--font-body); font-size: 16px; font-weight: 600; letter-spacing: 0; margin: 0 0 12px; }
.content > h1, .content > h2, .content > header h1, .content > .d-flex:first-child > h2, .content > .d-flex:first-child > h1 {
  font-family: var(--font-display); font-weight: 700; font-size: 34px; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 20px;
}
.content > .d-flex:first-child { margin-bottom: 20px !important; }
.content > .d-flex:first-child > h2, .content > .d-flex:first-child > h1 { margin-bottom: 0; }
.content h2.h4, .content h2.h5, .content h1.h3 { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }

/* a table that stands on the page gets its own surface; inside a card it uses the card's */
.content .table { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.content .table > tbody > tr:last-child > td, .content .table > tbody > tr:last-child > th { border-bottom: 0; }
.content .card .table, .content .card-body .table { border: 0; border-radius: 0; background: transparent; }
.content .table .table { border: 0; }
.content .table a { font-weight: 500; text-decoration: none; }
.content .table a:hover { text-decoration: underline; }
.content td.text-end, .content th.text-end { font-family: var(--font-mono); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.content th.text-end { font-family: var(--font-body); font-size: 12px; }

/* KPI tiles: label, mono value */
.card-body > .fs-4 { font-family: var(--font-mono); font-size: 26px !important; font-weight: 500; letter-spacing: -0.02em; margin: 6px 0; }
.card-body > .text-muted.small:first-child { font-size: 13px; font-weight: 500; color: var(--ink-2) !important; }

/* data-entry forms and filter bars */
.content > form.row[method="post"] {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px 24px; margin: 0 0 16px;
}
.content > form[method="get"] { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; align-items: center; }
.content > form[method="get"].row { margin: 0 0 16px; }

@media (max-width: 1023.98px) { .content { padding-left: 32px; padding-right: 32px; } }

/* phones: the rail becomes a sticky scroll bar at the top */
@media (max-width: 760px) {
  .app { display: block; }
  .app-side { position: sticky; top: 0; z-index: 5; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; overflow-x: auto; overflow-y: hidden; }
  .app-side > * { flex: none; }
  .ws, .nav-title, .brand-name, .side-name { display: none; }
  .nav-group { flex-direction: row; margin-top: 0 !important; }
  .nav-item-link { white-space: nowrap; }
  .side-user { padding: 4px 6px; background: transparent; border: 0; }
  .content { padding: 20px 16px 40px; }
  .content > .d-flex:first-child { flex-wrap: wrap; gap: 12px; }
  .content > .d-flex:first-child > .d-flex { flex-wrap: wrap; }
  /* tables scroll inside their own card, never the page */
  .content .table { display: block; overflow-x: auto; max-width: 100%; }
  .content > h1, .content > h2, .content > header h1, .content > .d-flex:first-child > h2 { font-size: 28px; }
}

/* ---- sign-in (SignIn.html): ink panel on the left, form on the right ---------------------------------------------- */
.auth { display: flex; flex-wrap: wrap; min-height: 100vh; background: var(--ground); }
.auth-hero {
  flex: 1 1 420px; background: var(--ink); color: #E8EAE6; padding: 48px 56px; box-sizing: border-box;
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px; min-height: 320px;
}
.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-brand .brand-mark { width: 34px; height: 34px; border-radius: 9px; }
.auth-brand .brand-name { font-size: 21px; }
.hero-copy { display: flex; flex-direction: column; gap: 18px; max-width: 480px; }
.hero-copy h1 { margin: 0; font-family: var(--font-display); font-size: 42px; line-height: 1.08; letter-spacing: -0.025em; font-weight: 700; text-wrap: balance; }
.hero-copy p { margin: 0; font-size: 16px; line-height: 1.55; color: var(--nav-text); }
.hero-foot { font-family: var(--font-mono); font-size: 13px; color: var(--nav-label); }
.auth-main { flex: 1 1 520px; display: flex; align-items: center; justify-content: center; padding: 48px 24px; box-sizing: border-box; }
.auth-form { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 22px; }
.auth-form h2 { margin: 0; font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -0.015em; }
.auth-lead { margin: 0; color: var(--ink-2); font-size: 15px; }
.auth-form .form-control { min-height: 48px; font-size: 15px; padding: 0 14px; }
.auth-form .form-control:focus { border-color: var(--line-strong); }
.auth-form .form-label .req { color: var(--danger); }
.pw { position: relative; }
.pw .form-control { padding-right: 3rem; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.pw-toggle:hover { color: var(--ink); background: #ECEEEB; }
.auth-btn { height: 48px; width: 100%; font-size: 15px; }
.auth-fine { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }

@media (max-width: 760px) {
  .auth-hero { min-height: 0; padding: 24px 20px; gap: 16px; }
  .hero-copy h1 { font-size: 28px; }
  .hero-foot { display: none; }
  .auth-main { padding: 28px 16px; }
}

/* ---- member portal --------------------------------------------------------------------------------------------- */
.nav-count { font-size: 11px; font-weight: 600; color: #1B1F26; background: #F2B872; border-radius: 999px; padding: 1px 7px; }
.portal-auth h2 { margin: 0 0 6px; }
.portal-auth .btn { min-height: 48px; font-size: 15px; }
.portal-auth hr { border-color: var(--line); opacity: 1; margin: 18px 0 12px; }
.content > h1 + .text-muted { margin-top: -12px; margin-bottom: 20px !important; }
/* a top-level h1.h3 is a page title (portal and older admin views), so it gets the display size */
.content > h1.h3 { font-size: 34px; letter-spacing: -0.02em; margin: 0 0 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
@media (max-width: 760px) { .content > h1.h3 { font-size: 28px; } }

/* ---- brand ---------------------------------------------------------------------------------------------------- */
.brand-logo { display: block; height: 38px; width: auto; }
.hero-logo { display: block; width: 280px; max-width: 100%; height: auto; }
@media (max-width: 760px) {
  .brand-logo { height: 28px; }
  .hero-logo { width: 200px; }
}

/* ---- polish: logo gradient, icons, tiles, welcome banner --------------------------------------------------------- */
:root {
  --logo-navy: #0B2F57;
  --logo-blue: #0B6F9E;
  --logo-teal: #0FA39A;
  --logo-green: #5FC14E;
  --grad-brand: linear-gradient(120deg, var(--logo-navy) 0%, var(--logo-blue) 50%, var(--logo-teal) 80%, var(--logo-green) 120%);
}

/* sidebar */
.app-side { background: linear-gradient(180deg, #141a22 0%, #10171e 100%); }
.nav-item-link { justify-content: flex-start; gap: 10px; transition: background .15s, color .15s; }
.nav-label { flex: 1; min-width: 0; }
.nav-item-link .ico { flex: none; opacity: .7; transition: opacity .15s, color .15s; }
.nav-item-link:hover .ico { opacity: 1; }
.nav-item-link.active { background: linear-gradient(90deg, rgba(15, 163, 154, .22), rgba(95, 193, 78, .06)); box-shadow: inset 3px 0 0 var(--nav-dot); }
.nav-item-link.active .ico { opacity: 1; color: #7fe3cf; }
.side-signout { display: inline-flex; align-items: center; gap: 6px; }

/* stat tiles */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi-grid-6 { grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); }
.kpi { display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px; transition: transform .15s ease, box-shadow .15s ease; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(20, 24, 31, .08); }
.kpi-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.kpi-ico.t1 { background: #E3EEF8; color: #0B4F8A; }
.kpi-ico.t2 { background: #DDF3F3; color: #007C80; }
.kpi-ico.t3 { background: #E4F4E1; color: #2E8B3A; }
.kpi-ico.t4 { background: var(--grad-brand); color: #fff; }
.kpi-label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.kpi-value { font-family: var(--font-mono); font-size: 24px; font-weight: 500; letter-spacing: -0.02em; margin-top: 4px; line-height: 1.2; overflow-wrap: anywhere; }
.kpi-value.kpi-text { font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
.kpi-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* welcome banner (member dashboard) */
.welcome {
  position: relative; overflow: hidden; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px;
  padding: 28px 30px; margin-bottom: 20px; border-radius: 18px; color: #fff;
  background: radial-gradient(circle at 88% 10%, rgba(95, 193, 78, .45), transparent 42%), var(--grad-brand);
}
.welcome::after { content: ""; position: absolute; right: -40px; bottom: -70px; width: 260px; height: 260px; background: url("../img/mark-white.png") no-repeat center / contain; opacity: .1; pointer-events: none; }
.welcome-text, .welcome-actions { position: relative; z-index: 1; }
.welcome h1 { margin: 6px 0 14px; font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -0.02em; color: #fff; }
.welcome-eyebrow { font-size: 13px; color: rgba(255, 255, 255, .78); }
.welcome-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.welcome-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .24); }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.welcome .btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: #fff; --bs-btn-color: var(--logo-navy); --bs-btn-hover-bg: #EEF6F6; --bs-btn-hover-border-color: #EEF6F6; --bs-btn-hover-color: var(--logo-navy); }
.welcome .btn-outline-light { --bs-btn-color: #fff; --bs-btn-border-color: rgba(255, 255, 255, .55); --bs-btn-hover-bg: rgba(255, 255, 255, .14); --bs-btn-hover-border-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-bg: rgba(255, 255, 255, .2); --bs-btn-active-color: #fff; }

/* sign-in panel: soft brand glows and a faint mark */
.auth-hero {
  position: relative; overflow: hidden;
  background: radial-gradient(55% 45% at 100% 100%, rgba(15, 163, 154, .34), transparent 70%),
              radial-gradient(45% 40% at 0% 0%, rgba(11, 111, 158, .32), transparent 70%), var(--ink);
}
.auth-hero::after { content: ""; position: absolute; right: -90px; bottom: -80px; width: 440px; height: 440px; background: url("../img/mark-white.png") no-repeat center / contain; opacity: .06; pointer-events: none; }
.auth-hero > * { position: relative; z-index: 1; }

/* small finishing touches */
.content .table > thead > tr > th { background: #FAFBF9; }
.card-header { display: flex; align-items: center; gap: 10px; }
.alert { border-left-width: 4px; }
.btn-primary { box-shadow: 0 1px 2px rgba(15, 110, 92, .25); }

@media (max-width: 760px) {
  .welcome { padding: 22px 20px; }
  .welcome h1 { font-size: 26px; }
  .welcome-actions, .welcome-actions .btn { width: 100%; }
  .nav-item-link .ico { display: none; }
}
.card.kpi { flex-direction: row; }
.card .list-group, .card .list-group-flush { border: 0; border-radius: 0; background: transparent; }
.card .list-group-item { background: transparent; }
.side-signout .nav-label { display: none; }
.side-signout { padding: 8px; }
.kpi-grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1600px) { .kpi-grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 760px) { .kpi-grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi { padding: 14px; gap: 10px; } .kpi-value { font-size: 19px; } }
@media (max-width: 760px) {
  .card.kpi { flex-direction: column; }
  .kpi-ico { width: 36px; height: 36px; border-radius: 10px; }
  .kpi-value { font-size: 18px; overflow-wrap: normal; white-space: nowrap; }
  .kpi-value.kpi-text { white-space: normal; font-size: 17px; }
}


/* ---- member portal: network pages ------------------------------------------------------------------------------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; max-width: 640px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 16px; margin-bottom: 16px; }
.stat { padding: 18px 20px; transition: transform .15s ease, box-shadow .15s ease; }
.stat:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(20, 24, 31, .08); }
.stat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.stat-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat-ico { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--brand); background: #F8FBFA; }
.stat-value { font-family: var(--font-mono); font-size: 28px; font-weight: 500; letter-spacing: -0.02em; margin-top: 10px; }
.stat-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.callout { display: flex; gap: 12px; padding: 14px 16px; margin-bottom: 16px; border-radius: 12px; background: #EAF6F7; border: 1px solid #BFE3E6; color: #11505A; font-size: 14px; }
.callout-ico { flex: none; color: #0A7F8C; margin-top: 1px; }
.callout strong { display: block; color: #0C3F47; }
.callout p { margin: 4px 0 0; line-height: 1.5; }

.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0 !important; font-family: var(--font-body); font-size: 16px; font-weight: 600; }
.card-head span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.card-link { font-size: 13.5px; font-weight: 600; text-decoration: none; }
.card-note { margin: 0; padding: 12px 20px; font-size: 12.5px; color: var(--muted); }
.mono { font-family: var(--font-mono); }

.net-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; margin-bottom: 16px; align-items: start; }
.level-table td.lvl { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); }
.level-table tr.is-empty td:not(:last-child) { color: #A3AAB1; }
.level-table tfoot td { padding: 12px; font-weight: 600; background: #FAFBF9; border-top: 1px solid var(--line); font-family: var(--font-mono); }
.level-table tfoot td:first-child { font-family: var(--font-body); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.level-table td a { font-size: 13px; font-weight: 600; }
.share { display: block; width: 72px; height: 6px; border-radius: 3px; background: #ECEEEB; overflow: hidden; }
.share-bar { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--logo-teal), var(--logo-green)); }
.share-0 { width: 0%; }
.share-5 { width: 5%; }
.share-10 { width: 10%; }
.share-15 { width: 15%; }
.share-20 { width: 20%; }
.share-25 { width: 25%; }
.share-30 { width: 30%; }
.share-35 { width: 35%; }
.share-40 { width: 40%; }
.share-45 { width: 45%; }
.share-50 { width: 50%; }
.share-55 { width: 55%; }
.share-60 { width: 60%; }
.share-65 { width: 65%; }
.share-70 { width: 70%; }
.share-75 { width: 75%; }
.share-80 { width: 80%; }
.share-85 { width: 85%; }
.share-90 { width: 90%; }
.share-95 { width: 95%; }
.share-100 { width: 100%; }

.position dl { margin: 0; padding: 16px 20px 4px; display: grid; gap: 12px; }
.position dt { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.position dd { margin: 2px 0 0; font-weight: 600; font-size: 14.5px; }
.maintains { margin: 12px 16px 16px; padding: 14px; border-radius: 12px; background: #F6F8F6; }
.maintains-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.maintains ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: 13px; color: var(--ink-2); }
.maintains li { display: flex; align-items: center; gap: 6px; }
.maintains li .ico { color: var(--brand); }

.downline { margin-bottom: 16px; }
.tree { list-style: none; margin: 0; padding: 0; }
.tree-row { display: flex; align-items: center; gap: 10px; padding: 10px 20px; border-bottom: 1px solid var(--line-soft); transition: background .12s; }
.tree-row:last-child { border-bottom: 0; }
.tree-row:hover { background: #F8FAF9; }
.tree-row.depth-2 { padding-left: 40px; }
.tree-row.depth-3 { padding-left: 60px; }
.tree-row .lvl { width: 22px; font-family: var(--font-mono); font-size: 11px; color: #9AA1A8; flex: none; }
.who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.who-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-code { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.cbu { font-family: var(--font-mono); font-size: 13px; min-width: 96px; text-align: right; color: var(--ink-2); }
.rank-chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #EEF0EC; color: #3E464F; border: 1px solid #E1E4DF; white-space: nowrap; }
.rank-chip.muted { color: var(--muted); font-weight: 500; }
.avatar-sm { width: 32px; height: 32px; border-radius: 16px; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; flex: none; }
.tone-1 { background: #E6EEF9; color: #2B5597; } .tone-2 { background: #E2F4EE; color: #16795B; } .tone-3 { background: #F3E8FA; color: #6D3C99; }
.tone-4 { background: #FDF0DD; color: #95560B; } .tone-5 { background: #FBE7EC; color: #9B2C4C; } .tone-6 { background: #E3F2F5; color: #146C7B; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 20px; color: var(--muted); text-align: center; }
.empty p { margin: 0; max-width: 420px; }

.directs-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.ref-body { padding: 16px 20px 4px; }
.ref-code { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #F8F9F7; font-size: 16px; letter-spacing: .03em; }
.ref-hint { font-size: 12.5px; color: var(--muted); margin: 8px 0 12px; }
.ref-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ref-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 4px; }
.ref-stats div { padding: 12px; border: 1px solid var(--line); border-radius: 10px; text-align: center; }
.ref-stats strong { display: block; font-family: var(--font-mono); font-size: 18px; font-weight: 500; }
.ref-stats span { font-size: 12px; color: var(--muted); }
.ref-card .card-note { padding: 8px 0 14px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.filter-bar .search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--muted); background: #fff; }
.filter-bar .search:focus-within { outline: 2px solid var(--brand); outline-offset: -1px; }
.filter-bar .search input { flex: 1; min-width: 0; border: 0; outline: none; font-size: 14px; color: var(--ink); background: transparent; }
.filter-bar .form-select { flex: 0 1 180px; }
.member-cell { display: flex; align-items: center; gap: 10px; }
.member-table .who-name { white-space: normal; }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line-soft); }
.content .card .table-responsive .table { border: 0; }

.toast-note { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; flex-direction: column; gap: 2px; padding: 12px 16px 12px 40px; border-radius: 12px; background: #fff; border: 1px solid var(--line); box-shadow: 0 14px 34px rgba(20, 24, 31, .16); font-size: 13.5px; max-width: 340px; animation: toast-in .2s ease; }
.toast-note::before { content: "\2713"; position: absolute; left: 14px; top: 11px; color: var(--brand); font-weight: 700; }
.toast-note span { color: var(--muted); font-size: 12.5px; font-family: var(--font-mono); overflow-wrap: anywhere; }
.toast-note.out { opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 1100px) { .net-grid, .directs-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .page-head h1 { font-size: 26px; }
  .page-actions, .page-actions .btn { width: 100%; }
  .tree-row { padding-left: 14px; padding-right: 14px; flex-wrap: wrap; }
  .tree-row.depth-2 { padding-left: 26px; } .tree-row.depth-3 { padding-left: 38px; }
  .tree-row .cbu { min-width: 0; }
  .filter-bar .form-select, .filter-bar .btn { flex: 1 1 auto; }
}
.level-table td.text-end a { font-family: var(--font-body); }
@media (max-width: 760px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; }
  .stat-ico { display: none; }
  .stat-value { font-size: 22px; margin-top: 6px; }
}


/* ---- member portal: my rank ------------------------------------------------------------------------------------- */
.rank-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.rank-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.rank-hero { display: flex; align-items: center; gap: 14px; }
.rank-medal { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); flex: none; }
.rank-name { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.rank-sub { font-size: 13px; color: var(--muted); }
.qual-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.qual-box p { margin: 8px 0 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.qual-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.qual-label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.pill-ok { background: #E3F4EE; color: #0B6B53; border-color: #BFE5D6; }
.pill-warn { background: #FDF1DE; color: #8A5A07; border-color: #F4D9A9; }
.pill.dot::before { content: ""; width: 6px; height: 6px; border-radius: 3px; background: currentColor; }
.rank-facts { margin: 0; }
.rank-facts div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.rank-facts dt { font-weight: 400; color: var(--ink-2); }
.rank-facts dd { margin: 0; font-family: var(--font-mono); font-weight: 500; }
.rank-facts dd.plain { font-family: var(--font-body); font-weight: 600; }
.access-box { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: #E8F6F1; border: 1px solid #BFE5D6; }
.access-box strong { font-family: var(--font-mono); font-size: 18px; font-weight: 500; color: #0B4F3F; }
.access-box span:last-child { font-size: 12px; color: #2E6B5B; }

.crit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; padding: 18px 20px 16px; }
.crit { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.crit-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; }
.crit-value { margin: 10px 0 10px; }
.crit-value strong { font-family: var(--font-mono); font-size: 22px; font-weight: 500; }
.crit-value span { font-size: 13px; color: var(--muted); }
.crit-bar { display: block; height: 6px; border-radius: 3px; background: #ECEEEB; overflow: hidden; }
.crit-bar .share-bar.partial { background: linear-gradient(90deg, var(--logo-blue), var(--logo-teal)); }

.ladder .rank-cell, .rank-bottom .rank-cell { font-weight: 600; }
.ladder tr.is-current > td { background: #F1FAF6; }
.ladder td.text-end .pill { font-family: var(--font-body); }

.rank-bottom { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; margin-bottom: 16px; }
.note-stack { display: flex; flex-direction: column; gap: 12px; }
.note { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; background: #EEF4FB; border: 1px solid #CFE0F3; color: #24476E; font-size: 13.5px; }
.note > .ico { flex: none; margin-top: 2px; }
.note strong { display: block; color: #17375A; margin-bottom: 2px; }
.note p { margin: 0; line-height: 1.55; }
.note-ok { background: #E8F6F1; border-color: #BFE5D6; color: #1D5B4B; }
.note-ok strong { color: #0B4F3F; }

@media (max-width: 1100px) { .rank-grid, .rank-bottom { grid-template-columns: minmax(0, 1fr); } }

/* ---- member portal: normal and founder plans -------------------------------------------------------------------- */
.callout a { color: inherit; font-weight: 600; }
.callout-warn { background: #FDF6E7; border-color: #F1DDAE; color: #6B4A0B; }
.callout-warn .callout-ico { color: #B7791F; }
.callout-warn strong { color: #5A3D07; }

.ratio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px; margin-bottom: 20px; }
.ratio-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.ratio-card strong { font-size: 16px; font-weight: 600; }
.ratio-card p { margin: 0; font-size: 12.5px; color: var(--muted); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tab { appearance: none; border: 0; background: transparent; padding: 10px 14px; font-size: 14px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; cursor: pointer; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--brand); }
a.tab { text-decoration: none; }
.rewards-picker { max-width: 44rem; }
.rewards-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .rewards-split { grid-template-columns: minmax(0, 1fr); } }
.empty strong { color: var(--ink); }
.tab:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: 6px 6px 0 0; }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 16px; margin-bottom: 16px; }
.plan-card { padding: 18px 20px; display: flex; flex-direction: column; transition: box-shadow .15s ease; }
.plan-card:hover { box-shadow: 0 12px 28px rgba(20, 24, 31, .07); }
.plan-card.is-mine { border: 2px solid var(--brand); padding: 17px 19px; }
.plan-card.is-founder { border: 2px solid #E5B53A; padding: 17px 19px; background: linear-gradient(180deg, #FFFCF3, #fff 120px); }
.plan-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 26px; }
.plan-name { font-weight: 600; font-size: 15px; }
.plan-price { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin: 2px 0 8px; }
.plan-desc { font-size: 13px; color: var(--ink-2); margin: 0 0 8px; }
.plan-figs { margin: 0 0 16px; }
.plan-figs div { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.plan-figs div:last-child { border-bottom: 0; }
.plan-figs dt { font-weight: 400; font-size: 13.5px; color: var(--ink-2); }
.plan-figs dt small { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: 2px; }
.plan-figs dd { margin: 0; font-family: var(--font-mono); font-weight: 500; font-size: 14.5px; }
.plan-actions { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.plan-actions form { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.plan-blocked { margin: 0; padding: 10px 12px; border-radius: 10px; background: #F6F7F5; font-size: 12.5px; color: var(--muted); }
.plan-gives summary { display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; padding: 4px 0; list-style: none; }
.plan-gives summary::-webkit-details-marker { display: none; }
.plan-gives summary:hover { color: var(--brand); }
.plan-gives ul { margin: 8px 0 0; padding: 10px 12px 10px 28px; border-radius: 10px; background: #F6F8F6; font-size: 12.5px; color: var(--ink-2); display: grid; gap: 4px; }
.plan-gives p { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.plan-compare .rank-cell { font-weight: 600; }
.plan-compare tr.is-current > td { background: #F1FAF6; }
.plan-compare td.text-end, .plan-compare th.text-end { font-family: var(--font-mono); }
.plan-compare th.text-end { font-family: var(--font-body); }

.pill-gold { background: #FDF3D7; color: #8A5A07; border-color: #F0D58C; }
.access-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; margin-bottom: 6px; border-radius: 999px; border: 1px solid var(--line); background: #F8F9F7; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }

.founder-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; margin-bottom: 16px; align-items: start; }
.req-list, .benefit-list { list-style: none; margin: 0; padding: 8px 20px; }
.req-list li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.req-list li:last-child { border-bottom: 0; }
.req-list li > div { flex: 1; min-width: 0; }
.req-list strong { font-size: 14px; font-weight: 600; }
.req-list p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.req-list a.pill { text-decoration: none; }
.req-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; background: #FDF1DE; color: #8A5A07; }
.req-ico.ok { background: #E3F4EE; color: #0B6B53; }
.benefit-list li { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; font-size: 13.5px; color: var(--ink-2); }
.benefit-list li .ico { color: #B7791F; flex: none; margin-top: 2px; }

.founder-mine { margin-bottom: 16px; padding: 16px 20px; border-radius: 14px; background: #FFF8E6; border: 1px solid #F0D58C; }
.founder-mine-head { display: flex; align-items: center; gap: 12px; }
.founder-mine-head > div { flex: 1; min-width: 0; }
.founder-mine-head strong { display: block; color: #5A3D07; }
.founder-mine-head span { font-size: 12.5px; color: #8A5A07; }
.founder-mine p { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid #F0DFA9; font-size: 13px; color: #6B4A0B; }
.founder-badge { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: #FDECB8; color: #8A5A07; flex: none; }
.upgrade-path { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 16px 20px; }
.path-step { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: #F8F9F7; font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.path-step.is-current { background: #FDF3D7; border-color: #F0D58C; color: #8A5A07; font-weight: 600; }
.path-arrow { color: #A3AAB1; display: inline-flex; }

@media (max-width: 1100px) { .founder-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .founder-mine-head { flex-wrap: wrap; } .founder-mine-head .btn { width: 100%; } }

/* ---- admin: plans --------------------------------------------------------------------------------------------------- */
.plan-table td { vertical-align: middle; }
.plan-table td.num, .plan-table th.num { text-align: right; }
.plan-table td.num { font-family: var(--font-mono); font-size: 13.5px; white-space: nowrap; }
.plan-table .plan-code { font-family: var(--font-mono); font-size: 12px; color: var(--muted); display: block; }
.plan-table .plan-title { font-weight: 600; }
.figs-fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 4px; }
.figs-fieldset legend { float: none; width: auto; padding: 0 6px; margin: 0; font-size: 13px; font-weight: 600; }

/* ---- profile & KYC ---------------------------------------------------------------------------------------------- */
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; max-width: 1080px; }
.profile-main, .profile-side { display: grid; gap: 20px; min-width: 0; }
@media (max-width: 1100px) { .profile-grid { grid-template-columns: minmax(0, 1fr); } }
.pill-info { background: #E4ECF8; color: #234E9C; border-color: #C9D8F0; }
.pill-muted { background: var(--ground); color: var(--muted); border-color: var(--line); }
.pill.caps { text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.id-card { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.avatar-lg { width: 44px; height: 44px; border-radius: 22px; font-size: 15px; background: #FDF3D7; color: #8A5A07; }
.id-name { display: flex; flex-direction: column; }
.id-name span { font-size: 12.5px; color: var(--muted); }
.id-pills { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .form-actions { grid-column: 1 / -1; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } .form-grid > div:empty { display: none; } }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 16px; margin-top: 4px; border-top: 1px solid var(--line-soft); }
.form-label .req { color: var(--danger); }
.form-control:disabled, .form-control[readonly] { background: var(--ground); }
.pw-field { position: relative; }
.pw-field .form-control { padding-right: 40px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); padding: 4px 6px; border-radius: 6px; }
.pw-toggle:hover, .pw-toggle.on { color: var(--brand); }
.card-body .sub-head { font-size: 14px; font-weight: 600; margin: 0 0 10px; padding-top: 22px; }
.session-list, .pref-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.session-list li, .pref-list li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.session-ico { color: var(--muted); flex: none; }
.session-what, .pref-list li > div { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.session-what span, .pref-list li span { font-size: 12.5px; color: var(--muted); }
.session-list form { margin: 0; }
.pref-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); flex: none; cursor: pointer; }
.pref-check .form-check-input { margin: 0; }
.stack { display: grid; gap: 10px; }
.standing { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.standing-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.standing p { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.note-box { padding: 10px 12px; border-radius: 10px; background: var(--ground); font-size: 13px; margin-bottom: 12px; }
.kv { margin: 0; display: grid; gap: 8px; }
.kv > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13.5px; }
.kv dt { font-weight: 400; color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; }
.kyc-status { display: flex; align-items: center; gap: 14px; }
.kyc-status > div { display: flex; flex-direction: column; margin-right: auto; }
.kyc-status strong { font-size: 18px; }
.kyc-status > div > span { font-size: 13px; color: var(--muted); }
.kyc-badge { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--ground); color: var(--muted); flex: none; }
.kyc-badge.is-ok { background: var(--brand-soft); color: var(--brand); }
.cell-sub { display: block; font-size: 12.5px; color: var(--muted); }
.kyc-table td { vertical-align: middle; }
.kyc-table td .btn-link { font-family: var(--font-body); font-weight: 600; text-decoration: none; }
.stepper { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 0 10px; padding: 0; font-size: 13.5px; color: var(--muted); }
.stepper li { display: inline-flex; align-items: center; gap: 8px; }
.stepper li.on, .stepper li.done { color: var(--ink); font-weight: 600; }
.step-n { width: 24px; height: 24px; border-radius: 12px; display: grid; place-items: center; font-size: 12px; background: var(--ground); border: 1px solid var(--line); }
.stepper li.on .step-n, .stepper li.done .step-n { background: var(--brand); border-color: var(--brand); color: #fff; }
.step-bar { height: 4px; border-radius: 2px; background: var(--line-soft); margin-bottom: 18px; overflow: hidden; }
.step-bar span { display: block; height: 100%; background: var(--brand); transition: width .2s; }
.step-bar.s1 span { width: 33%; }
.step-bar.s2 span { width: 66%; }
.step-bar.s3 span { width: 100%; }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 20px; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: #FAFBF9; text-align: center; cursor: pointer; }
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-soft); }
.dropzone.has-file { border-style: solid; border-color: var(--brand); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone > span:not(.dz-ico) { font-size: 12.5px; color: var(--muted); }
.dz-ico { width: 40px; height: 40px; border-radius: 20px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); color: var(--muted); }
.next-steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 14px; }
.next-steps li { counter-increment: s; display: grid; grid-template-columns: 24px 1fr; column-gap: 10px; }
.next-steps li::before { content: counter(s); grid-row: span 2; width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; font-size: 11.5px; font-weight: 600; background: var(--ground); border: 1px solid var(--line); }
.next-steps strong { font-size: 13.5px; }
.next-steps span { font-size: 12.5px; color: var(--muted); }
.callout-plain { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.callout-plain .callout-ico { color: var(--muted); }
.callout-plain strong { color: var(--ink); }
a.tab { text-decoration: none; display: inline-block; }
.review-form { display: flex; gap: 6px; align-items: center; margin: 0; min-width: 320px; }

/* ---- plan checkout ---------------------------------------------------------------------------------------------- */
.checkout-grid { grid-template-columns: minmax(0, 1fr) 340px; }
@media (max-width: 1100px) { .checkout-grid { grid-template-columns: minmax(0, 1fr); } }
.step-bar.of4.s1 span { width: 25%; }
.step-bar.of4.s2 span { width: 50%; }
.step-bar.of4.s3 span { width: 75%; }
.step-bar.of4.s4 span { width: 100%; }
.pay-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; margin-bottom: 16px; border-radius: 12px; background: var(--brand-soft); border: 1px solid #C4E2D7; color: var(--brand-ink); font-size: 14px; }
.pay-banner form { margin: 0; }
.checkout-lead { font-size: 14px; color: var(--ink-2); margin: 0 0 14px; line-height: 1.5; }
.checkout-hint { font-size: 12.5px; color: var(--muted); margin: -4px 0 10px; }
.choice-list { display: grid; gap: 10px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; cursor: pointer; background: var(--surface); }
.choice:hover { border-color: var(--line-strong); color: var(--ink); background: #FAFBF9; }
.choice.on, .choice:has(input:checked) { border: 1.5px solid var(--brand); padding: 13.5px 15.5px; background: #F6FBF9; }
.choice:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.choice-dot { flex: none; width: 16px; height: 16px; border-radius: 8px; border: 1.5px solid var(--line-strong); background: #fff; }
.choice.on .choice-dot, .choice:has(input:checked) .choice-dot { border: 5px solid var(--brand); }
.choice-what { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.choice-what span { font-size: 12.5px; color: var(--muted); }
.choice-price { font-weight: 600; white-space: nowrap; }
.term-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.term { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 14px; }
.term span { font-size: 12.5px; color: var(--muted); }
.term:hover { border-color: var(--line-strong); color: var(--ink); }
.term.on { border: 1.5px solid var(--brand); padding: 9.5px 7.5px; background: #F6FBF9; color: var(--brand-ink); }
.confirm-kv { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; }
.kv .kv-total { padding-top: 8px; border-top: 1px solid var(--line-soft); }
.kv .kv-total dd { font-size: 16px; }
.confirm-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.confirm-check .form-check-input { flex: none; margin-top: 2px; }
.sum-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.sum-head > div { display: flex; flex-direction: column; margin-right: auto; }
.sum-head > div span { font-size: 12.5px; color: var(--muted); }
.sum-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--ground); color: var(--muted); flex: none; }
.sum-ico.is-founder { background: #FDF3D7; color: #8A5A07; }
.sum-amount { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.gen-box { display: grid; gap: 6px; margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: #F3FAF7; border: 1px solid #C4E2D7; }
.gen-box > div { display: flex; justify-content: space-between; font-size: 13.5px; }
.gen-box small { font-size: 11.5px; color: var(--muted); }
.sum-note { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* Rules page: each tab's Save button stays in view while its long table scrolls; unsaved edits are flagged */
.save-bar { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 0 -16px -16px; padding: 12px 16px; background: var(--surface); border-top: 1px solid var(--line); }
.save-bar-note { display: none; color: #861c30; font-size: 13px; font-weight: 600; }
form.is-dirty .save-bar-note { display: inline; }
form.is-dirty .save-bar { box-shadow: 0 -6px 16px rgba(20, 24, 31, .08); }
.nav-link.tab-dirty::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: #c2410c; vertical-align: middle; }
