/* ===========================================================================
   Cybex Partner Portal — Cybex Innovation theme
   ---------------------------------------------------------------------------
   A financial portal. Partners check their money here, so clarity beats
   decoration everywhere. Money is always green, bold and tabular.
   Written mobile-first: partners work from their phones at 360px.
   =========================================================================== */

:root {
  --cx-white:        #FFFFFF;
  --cx-bg:           #F5F8FA;
  --cx-surface:      #FFFFFF;
  --cx-border:       #E3E9EF;

  --cx-black:        #101418;
  --cx-black-soft:   #1C2128;

  --cx-blue:         #0B5FD9;
  --cx-blue-dark:    #084AAB;
  --cx-blue-light:   #E8F1FE;

  --cx-green:        #12B76A;
  --cx-green-dark:   #0E9155;
  --cx-green-light:  #E6F8EF;

  --cx-amber:        #F59E0B;
  --cx-amber-light:  #FEF3E2;
  --cx-red:          #E5484D;
  --cx-red-light:    #FDECEC;
  --cx-grey-light:   #EEF1F5;

  --cx-text:         #101418;
  --cx-text-muted:   #667085;

  --cx-radius:       10px;
  --cx-radius-sm:    6px;
  --cx-shadow:       0 1px 3px rgba(16, 20, 24, .08);
  --cx-shadow-lg:    0 8px 24px rgba(16, 20, 24, .12);

  --cx-sidebar-w:    248px;
  --cx-topbar-h:     60px;

  --cx-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
             'Helvetica Neue', Arial, sans-serif;
}

/* --- Reset ---------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--cx-font);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--cx-text);
  background: var(--cx-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { margin: 0 0 .5rem; font-weight: 600; line-height: 1.3; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: .95rem; }
p  { margin: 0 0 1rem; }

a { color: var(--cx-blue); text-decoration: none; }
a:hover { color: var(--cx-blue-dark); text-decoration: underline; }

img, svg { max-width: 100%; vertical-align: middle; }

hr { border: 0; border-top: 1px solid var(--cx-border); margin: 1.25rem 0; }

code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Focus ring — visible for keyboard users, absent for mouse clicks. */
:focus-visible {
  outline: 2px solid var(--cx-blue);
  outline-offset: 2px;
  border-radius: 3px;
}

/* --- Typography utilities ------------------------------------------------- */

.text-muted    { color: var(--cx-text-muted); }
.text-small    { font-size: .82rem; }
.text-xs       { font-size: .74rem; }
.text-right    { text-align: right; }
.text-center   { text-align: center; }
.text-bold     { font-weight: 600; }
.text-green    { color: var(--cx-green-dark); }
.text-red      { color: var(--cx-red); }
.text-amber    { color: var(--cx-amber); }
.text-blue     { color: var(--cx-blue); }
.text-uppercase{ text-transform: uppercase; letter-spacing: .04em; }
.text-nowrap   { white-space: nowrap; }
.truncate      { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* THE money style. Every rupee figure in the app uses this. */
.money {
  color: var(--cx-green-dark);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  white-space: nowrap;
}
.money-lg  { font-size: 1.6rem; letter-spacing: -.02em; }
.money-xl  { font-size: 2rem;   letter-spacing: -.02em; }
.money-neg { color: var(--cx-red); }
.money-muted { color: var(--cx-text-muted); font-weight: 600; }

/* Any numeric column should align on the decimal. */
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* --- Layout shell --------------------------------------------------------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--cx-sidebar-w);
  flex: 0 0 var(--cx-sidebar-w);
  background: var(--cx-black);
  color: rgba(255, 255, 255, .72);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 40;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 1rem 1.15rem;
  color: var(--cx-white);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -.01em;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  min-height: var(--cx-topbar-h);
}
.sidebar-brand:hover { text-decoration: none; color: var(--cx-white); }

.sidebar-brand .mark {
  width: 30px; height: 30px;
  flex: 0 0 30px;
  border-radius: 8px;
  background: var(--cx-blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: .82rem;
}

.sidebar-nav { padding: .6rem 0 1.5rem; flex: 1; }

.nav-section {
  padding: 1rem 1.15rem .35rem;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .38);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem 1.15rem;
  color: rgba(255, 255, 255, .72);
  font-size: .89rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background .12s, color .12s;
}
.nav-item:hover {
  background: rgba(255, 255, 255, .05);
  color: var(--cx-white);
  text-decoration: none;
}
.nav-item.active {
  background: rgba(11, 95, 217, .16);
  border-left-color: var(--cx-blue);
  color: var(--cx-white);
  font-weight: 600;
}
.nav-item .ico { width: 17px; flex: 0 0 17px; opacity: .85; }
.nav-item .count {
  margin-left: auto;
  background: var(--cx-blue);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: .05rem .4rem;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}
.nav-item .count.amber { background: var(--cx-amber); }

.sidebar-foot {
  padding: .85rem 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: .72rem;
  color: rgba(255, 255, 255, .4);
}

/* Main column */
.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--cx-sidebar-w);
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--cx-topbar-h);
  background: var(--cx-white);
  border-bottom: 1px solid var(--cx-border);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.35rem;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar h1 { font-size: 1.12rem; margin: 0; font-weight: 600; }
.topbar .spacer { flex: 1; }

.sidebar-toggle {
  display: none;
  background: none;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius-sm);
  width: 36px; height: 36px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--cx-text);
  flex: 0 0 auto;
}

.content { padding: 1.35rem; flex: 1; }
.content-narrow { max-width: 820px; }

/* User menu */
.usermenu { position: relative; }
.usermenu-btn {
  display: flex;
  align-items: center;
  gap: .55rem;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--cx-radius-sm);
  padding: .3rem .5rem;
  cursor: pointer;
  font: inherit;
  color: var(--cx-text);
}
.usermenu-btn:hover { background: var(--cx-bg); border-color: var(--cx-border); }

.avatar {
  width: 32px; height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  background: var(--cx-blue-light);
  color: var(--cx-blue-dark);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
}

.usermenu-name { font-size: .86rem; font-weight: 600; line-height: 1.15; }
.usermenu-role { font-size: .7rem; color: var(--cx-text-muted); line-height: 1.15; }

.dropdown {
  position: absolute;
  right: 0; top: calc(100% + .4rem);
  min-width: 208px;
  background: var(--cx-surface);
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  box-shadow: var(--cx-shadow-lg);
  padding: .35rem;
  display: none;
  z-index: 50;
}
.dropdown.open { display: block; }
.dropdown a, .dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: .45rem .6rem;
  border-radius: var(--cx-radius-sm);
  color: var(--cx-text);
  font-size: .86rem;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.dropdown a:hover, .dropdown button:hover { background: var(--cx-bg); text-decoration: none; }
.dropdown .divider { height: 1px; background: var(--cx-border); margin: .35rem 0; }
.dropdown .danger { color: var(--cx-red); }

/* --- Cards ---------------------------------------------------------------- */

.card {
  background: var(--cx-surface);
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  box-shadow: var(--cx-shadow);
  margin-bottom: 1.15rem;
}

.card-head {
  padding: .9rem 1.15rem;
  border-bottom: 1px solid var(--cx-border);
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.card-head h2, .card-head h3 { margin: 0; font-size: 1rem; }
.card-head .spacer { flex: 1; }

.card-body { padding: 1.15rem; }
.card-body.tight { padding: .8rem 1.15rem; }
.card-foot {
  padding: .8rem 1.15rem;
  border-top: 1px solid var(--cx-border);
  background: #FBFCFD;
  border-radius: 0 0 var(--cx-radius) var(--cx-radius);
  display: flex;
  gap: .6rem;
  align-items: center;
  flex-wrap: wrap;
}

/* --- Stat cards ----------------------------------------------------------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.stat {
  background: var(--cx-surface);
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  box-shadow: var(--cx-shadow);
  padding: 1.05rem 1.15rem;
  position: relative;
  overflow: hidden;
}
.stat-label {
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--cx-text-muted);
  margin-bottom: .45rem;
}
.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.stat-value.money { color: var(--cx-green-dark); }
.stat-sub { font-size: .78rem; color: var(--cx-text-muted); margin-top: .3rem; }

/* Accent stripe by meaning */
.stat.accent-green::before,
.stat.accent-blue::before,
.stat.accent-amber::before,
.stat.accent-red::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
}
.stat.accent-green::before { background: var(--cx-green); }
.stat.accent-blue::before  { background: var(--cx-blue); }
.stat.accent-amber::before { background: var(--cx-amber); }
.stat.accent-red::before   { background: var(--cx-red); }

/* --- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .5rem .95rem;
  border-radius: var(--cx-radius-sm);
  border: 1px solid transparent;
  background: var(--cx-blue);
  color: #fff;
  font: 600 .875rem/1.4 var(--cx-font);
  cursor: pointer;
  transition: background .12s, border-color .12s, opacity .12s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { background: var(--cx-blue-dark); color: #fff; text-decoration: none; }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; }

.btn-success { background: var(--cx-green); }
.btn-success:hover { background: var(--cx-green-dark); }

.btn-danger { background: var(--cx-red); }
.btn-danger:hover { background: #C93B3F; }

.btn-secondary {
  background: var(--cx-white);
  color: var(--cx-text);
  border-color: var(--cx-border);
}
.btn-secondary:hover { background: var(--cx-bg); color: var(--cx-text); border-color: #D3DBE4; }

.btn-ghost { background: transparent; color: var(--cx-blue); }
.btn-ghost:hover { background: var(--cx-blue-light); color: var(--cx-blue-dark); }

.btn-sm  { padding: .3rem .6rem; font-size: .79rem; }
.btn-lg  { padding: .7rem 1.4rem; font-size: .95rem; }
.btn-block { display: flex; width: 100%; }

.btn-group { display: flex; gap: .5rem; flex-wrap: wrap; }

/* --- Badges --------------------------------------------------------------- */

.badge {
  display: inline-block;
  padding: .16rem .5rem;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.45;
  white-space: nowrap;
}
.badge-grey        { background: var(--cx-grey-light);  color: #52606D; }
.badge-blue        { background: var(--cx-blue-light);  color: var(--cx-blue-dark); }
.badge-amber       { background: var(--cx-amber-light); color: #B26B00; }
.badge-green       { background: var(--cx-green-light); color: var(--cx-green-dark); }
.badge-green-solid { background: var(--cx-green);       color: #fff; }
.badge-red         { background: var(--cx-red-light);   color: #C3282D; }

/* --- Alerts --------------------------------------------------------------- */

.alert {
  padding: .75rem 1rem;
  border-radius: var(--cx-radius-sm);
  border: 1px solid transparent;
  margin-bottom: 1rem;
  font-size: .875rem;
  display: flex;
  gap: .6rem;
  align-items: flex-start;
}
.alert-success { background: var(--cx-green-light); border-color: #B9EBD2; color: #0A6B3F; }
.alert-error   { background: var(--cx-red-light);   border-color: #F7C7C8; color: #A31E22; }
.alert-warning { background: var(--cx-amber-light); border-color: #FBE0B0; color: #8A5300; }
.alert-info    { background: var(--cx-blue-light);  border-color: #C3DCFD; color: var(--cx-blue-dark); }
.alert p:last-child { margin-bottom: 0; }

.flash-stack { position: relative; }

/* --- Forms ---------------------------------------------------------------- */

.form-row { margin-bottom: 1rem; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}
.form-grid .span-2 { grid-column: 1 / -1; }

label, .label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: .3rem;
  color: var(--cx-text);
}
.label .req { color: var(--cx-red); font-weight: 700; }

.input, input[type="text"], input[type="email"], input[type="password"],
input[type="tel"], input[type="number"], input[type="date"], input[type="month"],
input[type="search"], input[type="url"], select, textarea {
  width: 100%;
  padding: .53rem .7rem;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius-sm);
  background: var(--cx-white);
  color: var(--cx-text);
  font: 400 .89rem/1.5 var(--cx-font);
  transition: border-color .12s, box-shadow .12s;
  /* 16px on mobile stops iOS zooming the viewport on focus */
}
.input:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--cx-blue);
  box-shadow: 0 0 0 3px rgba(11, 95, 217, .12);
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--cx-bg);
  color: var(--cx-text-muted);
  cursor: not-allowed;
}
textarea { min-height: 92px; resize: vertical; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23667085' d='M1.4 0L6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .7rem center;
  padding-right: 2rem;
}

.input.is-invalid, input.is-invalid, select.is-invalid, textarea.is-invalid {
  border-color: var(--cx-red);
}
.field-error { color: var(--cx-red); font-size: .77rem; margin-top: .25rem; }
.field-hint  { color: var(--cx-text-muted); font-size: .77rem; margin-top: .25rem; }

/* Prefix group — ₹ / +91 */
.input-group { display: flex; }
.input-group .addon {
  display: flex;
  align-items: center;
  padding: 0 .7rem;
  background: var(--cx-bg);
  border: 1px solid var(--cx-border);
  border-right: 0;
  border-radius: var(--cx-radius-sm) 0 0 var(--cx-radius-sm);
  font-size: .86rem;
  color: var(--cx-text-muted);
  font-weight: 600;
}
.input-group input { border-radius: 0 var(--cx-radius-sm) var(--cx-radius-sm) 0; }

/* Checkbox / radio */
.check {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  font-size: .875rem;
  font-weight: 400;
  margin-bottom: .6rem;
  cursor: pointer;
}
.check input[type="checkbox"], .check input[type="radio"] {
  width: 17px; height: 17px;
  flex: 0 0 17px;
  margin-top: .13rem;
  accent-color: var(--cx-blue);
  cursor: pointer;
}
.check-box {
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius-sm);
  padding: .7rem .85rem;
  background: var(--cx-white);
  margin-bottom: .6rem;
}
.check-box:hover { border-color: #D3DBE4; }

/* --- Tables --------------------------------------------------------------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table { width: 100%; border-collapse: collapse; font-size: .875rem; }

.table th {
  text-align: left;
  padding: .6rem .85rem;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--cx-text-muted);
  background: #FBFCFD;
  border-bottom: 1px solid var(--cx-border);
  white-space: nowrap;
}
.table td {
  padding: .68rem .85rem;
  border-bottom: 1px solid var(--cx-border);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FAFCFE; }
.table th.num, .table td.num { text-align: right; }

.table-compact td, .table-compact th { padding: .45rem .7rem; }

/* Key/value table for detail screens */
.kv { width: 100%; font-size: .875rem; border-collapse: collapse; }
.kv th {
  text-align: left;
  font-weight: 500;
  color: var(--cx-text-muted);
  padding: .42rem 1rem .42rem 0;
  width: 40%;
  vertical-align: top;
  white-space: normal;
}
.kv td { padding: .42rem 0; font-weight: 500; }

.empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--cx-text-muted);
}
.empty .empty-title { font-weight: 600; color: var(--cx-text); margin-bottom: .25rem; }

/* --- Filters bar ---------------------------------------------------------- */

.filters {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  align-items: flex-end;
}
.filters .form-row { margin-bottom: 0; min-width: 150px; flex: 1 1 150px; }
.filters .actions { display: flex; gap: .5rem; }

/* --- Pagination ----------------------------------------------------------- */

.pagination {
  display: flex;
  gap: .3rem;
  align-items: center;
  flex-wrap: wrap;
  padding: .8rem 1.15rem;
  border-top: 1px solid var(--cx-border);
  font-size: .82rem;
}
.pagination .spacer { flex: 1; }
.pagination a, .pagination span.page {
  padding: .28rem .6rem;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius-sm);
  color: var(--cx-text);
  min-width: 32px;
  text-align: center;
}
.pagination a:hover { background: var(--cx-bg); text-decoration: none; }
.pagination .current {
  background: var(--cx-blue);
  border-color: var(--cx-blue);
  color: #fff;
  font-weight: 600;
}
.pagination .disabled { opacity: .45; pointer-events: none; }

/* --- Progress tracker (partner application status) ------------------------ */

.tracker { display: flex; gap: 0; margin: 0 0 1.25rem; overflow-x: auto; }

.tracker-step {
  flex: 1 1 0;
  min-width: 92px;
  text-align: center;
  position: relative;
  padding-top: 30px;
  font-size: .74rem;
  color: var(--cx-text-muted);
}
.tracker-step::before {                 /* connector line */
  content: '';
  position: absolute;
  top: 11px; left: 0; right: 0;
  height: 2px;
  background: var(--cx-border);
}
.tracker-step:first-child::before { left: 50%; }
.tracker-step:last-child::before  { right: 50%; }
.tracker-step::after {                  /* node */
  content: '';
  position: absolute;
  top: 4px; left: 50%;
  transform: translateX(-50%);
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--cx-white);
  border: 2px solid var(--cx-border);
}
.tracker-step.done::before   { background: var(--cx-green); }
.tracker-step.done::after    { background: var(--cx-green); border-color: var(--cx-green); }
.tracker-step.done           { color: var(--cx-green-dark); font-weight: 600; }
.tracker-step.current::after { background: var(--cx-blue); border-color: var(--cx-blue);
                               box-shadow: 0 0 0 4px var(--cx-blue-light); }
.tracker-step.current        { color: var(--cx-blue-dark); font-weight: 600; }

/* --- Auth screens --------------------------------------------------------- */

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem 1rem;
  background: var(--cx-bg);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--cx-surface);
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  box-shadow: var(--cx-shadow-lg);
  padding: 1.85rem;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  justify-content: center;
  margin-bottom: 1.4rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--cx-text);
}
.auth-brand .mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--cx-black);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: .8rem;
}
.auth-title { text-align: center; margin-bottom: .3rem; }
.auth-sub { text-align: center; color: var(--cx-text-muted); font-size: .85rem; margin-bottom: 1.4rem; }
.auth-foot { text-align: center; margin-top: 1.15rem; font-size: .82rem; color: var(--cx-text-muted); }

/* --- Misc utilities ------------------------------------------------------- */

.stack > * + * { margin-top: 1rem; }
.row-flex { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.mt-0 { margin-top: 0; }    .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: .5rem; }  .mb-1 { margin-bottom: .5rem; }
.mt-2 { margin-top: 1rem; }   .mb-2 { margin-bottom: 1rem; }
.mt-3 { margin-top: 1.5rem; } .mb-3 { margin-bottom: 1.5rem; }

.hide { display: none !important; }

.divider-v { width: 1px; align-self: stretch; background: var(--cx-border); }

.page-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1.15rem;
}
.page-head h1 { margin: 0; }
.page-head .spacer { flex: 1; }

.backlink {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .82rem;
  color: var(--cx-text-muted);
  margin-bottom: .5rem;
}
.backlink:hover { color: var(--cx-blue); text-decoration: none; }

/* Scrim behind the mobile sidebar */
.scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 20, 24, .45);
  z-index: 35;
}
.scrim.open { display: block; }

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: var(--cx-shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .sidebar-toggle { display: inline-flex; }
}

@media (max-width: 640px) {
  body { font-size: 14px; }

  .content { padding: .9rem; }
  .card-body { padding: .9rem; }
  .card-head { padding: .75rem .9rem; }
  .card-foot { padding: .75rem .9rem; }

  .topbar { padding: 0 .9rem; }
  .topbar h1 { font-size: 1rem; }

  /* Stop iOS zooming the page when a field takes focus. */
  input, select, textarea { font-size: 16px; }

  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
  .stat { padding: .85rem .9rem; }
  .stat-value { font-size: 1.45rem; }

  .form-grid { grid-template-columns: 1fr; }

  .usermenu-name, .usermenu-role { display: none; }

  .btn-group .btn { flex: 1 1 auto; }

  .table th, .table td { padding: .55rem .6rem; }

  .kv th { width: auto; }
}

/* At 360px the money figure must still be the loudest thing on screen. */
@media (max-width: 400px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-grid .stat.wide { grid-column: 1 / -1; }
  .money-lg { font-size: 1.4rem; }
  .money-xl { font-size: 1.7rem; }
}

@media print {
  .sidebar, .topbar, .btn, .pagination, .filters, .scrim { display: none !important; }
  .main { margin-left: 0; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
}

/* ===========================================================================
   Public landing page
   =========================================================================== */

.pub-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--cx-border);
}
.pub-nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: .75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.pub-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  color: var(--cx-text);
  font-size: 1.02rem;
}
.pub-brand:hover { text-decoration: none; color: var(--cx-text); }
.pub-brand .mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--cx-black);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: .78rem;
}

.pub-wrap { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; }

.hero { padding: 4rem 0 3rem; text-align: center; }
.hero h1 {
  font-size: clamp(1.9rem, 5vw, 3rem);
  letter-spacing: -.03em;
  line-height: 1.12;
  margin-bottom: .9rem;
  font-weight: 700;
}
.hero p.lede {
  font-size: 1.06rem;
  color: var(--cx-text-muted);
  max-width: 40rem;
  margin: 0 auto 1.75rem;
}

.eyebrow {
  display: inline-block;
  background: var(--cx-blue-light);
  color: var(--cx-blue-dark);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .28rem .7rem;
  border-radius: 20px;
  margin-bottom: 1.1rem;
}

.hero-rate {
  color: var(--cx-green-dark);
  font-variant-numeric: tabular-nums;
}

.section { padding: 3rem 0; border-top: 1px solid var(--cx-border); }
.section-head { text-align: center; margin-bottom: 2rem; }
.section-head h2 { font-size: 1.5rem; letter-spacing: -.02em; }
.section-head p { color: var(--cx-text-muted); max-width: 36rem; margin: 0 auto; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.15rem;
}

.feature {
  background: var(--cx-surface);
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  padding: 1.35rem;
  box-shadow: var(--cx-shadow);
}
.feature .num {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--cx-green-light);
  color: var(--cx-green-dark);
  font-weight: 800;
  font-size: .85rem;
  margin-bottom: .7rem;
  text-align: center;
}
.feature h3 { font-size: 1rem; margin-bottom: .35rem; }
.feature p { color: var(--cx-text-muted); font-size: .88rem; margin: 0; }

.product-card {
  background: var(--cx-surface);
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  padding: 1.25rem;
  box-shadow: var(--cx-shadow);
  border-top: 3px solid var(--cx-blue);
}
.product-card h3 { font-size: 1.05rem; margin-bottom: .2rem; }
.product-card .industry {
  font-size: .76rem;
  color: var(--cx-text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .6rem;
}
.product-card p { font-size: .88rem; color: var(--cx-text-muted); margin-bottom: .8rem; }
.product-card .rate {
  font-size: .82rem;
  font-weight: 600;
  color: var(--cx-green-dark);
}

.steps { counter-reset: step; max-width: 40rem; margin: 0 auto; }
.step {
  display: flex;
  gap: 1rem;
  padding: .9rem 0;
  border-bottom: 1px solid var(--cx-border);
}
.step:last-child { border-bottom: 0; }
.step .dot {
  flex: 0 0 28px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--cx-black);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: .8rem;
  font-weight: 700;
}
.step h3 { font-size: .95rem; margin-bottom: .15rem; }
.step p { font-size: .86rem; color: var(--cx-text-muted); margin: 0; }

.cta-band {
  background: var(--cx-black);
  color: #fff;
  border-radius: var(--cx-radius);
  padding: 2.25rem 1.5rem;
  text-align: center;
  margin: 3rem 0;
}
.cta-band h2 { color: #fff; font-size: 1.5rem; letter-spacing: -.02em; }
.cta-band p { color: rgba(255,255,255,.66); max-width: 32rem; margin: 0 auto 1.35rem; }

.pub-foot {
  border-top: 1px solid var(--cx-border);
  padding: 1.75rem 0 2.5rem;
  font-size: .82rem;
  color: var(--cx-text-muted);
  text-align: center;
}

.honest-note {
  background: var(--cx-amber-light);
  border: 1px solid #FBE0B0;
  border-radius: var(--cx-radius);
  padding: 1.15rem 1.35rem;
  font-size: .88rem;
  color: #8A5300;
  max-width: 40rem;
  margin: 0 auto;
}
.honest-note ul { margin: .6rem 0 0; padding-left: 1.15rem; }
.honest-note li { margin-bottom: .3rem; }

/* Wider auth card for the multi-field signup form */
.auth-card.auth-wide { max-width: 560px; }

@media (max-width: 640px) {
  .hero { padding: 2.5rem 0 2rem; }
  .section { padding: 2.25rem 0; }
  .cta-band { padding: 1.75rem 1.15rem; }
}
