:root {
  --sky: #87ceeb;
  --sky-deep: #4fa8d3;
  --brand-navy: #0d2a5a;
  --brand-red: #d9102f;
  --ink: #182033;
  --muted: #5b6882;
  --border: #e2ecf5;
  --shadow: 0 18px 50px rgba(8, 24, 56, 0.18);
  --radius: 16px;
  --tier-a: #1b7f3b;
  --tier-b: #1f6feb;
  --tier-c: #c38300;
  --tier-d: #c83c3c;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100vh;
}

body {
  font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% 0%, #b9e3f4 0%, transparent 45%),
    radial-gradient(circle at 0% 100%, #cfeaf7 0%, transparent 55%),
    linear-gradient(180deg, var(--sky) 0%, var(--sky-deep) 100%);
  background-attachment: fixed;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

/* ==========================
   Login / Auth screen
   ========================== */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-shell {
  flex-direction: column;
  gap: 18px;
}

.auth-card {
  width: min(440px, 100%);
  background: #fff;
  padding: 26px 24px 22px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 0 10px;
}

.logo {
  width: 200px;
  max-width: 70%;
  height: auto;
  display: block;
}

.logo-sm {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form h2 {
  margin: 6px 0 0;
  color: var(--brand-navy);
  text-align: center;
  font-size: 1.4rem;
  letter-spacing: 0.2px;
}

/* ==========================
   Persona selection
   ========================== */

.persona-step {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.persona-step h2 {
  margin: 4px 0 0;
  color: var(--brand-navy);
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 0.2px;
  line-height: 1.25;
}

.persona-intro {
  text-align: center;
  margin: 0 0 4px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.brand-badge {
  align-self: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0d2a5a, #1a47a3);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(13, 42, 90, 0.25);
}

.ai-footnote {
  margin: 8px 0 0;
  font-size: 0.76rem;
  color: var(--muted);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ai-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1b7f3b;
  box-shadow: 0 0 0 0 rgba(27, 127, 59, 0.6);
  animation: ai-pulse 1.8s ease-out infinite;
  display: inline-block;
}

@keyframes ai-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(27, 127, 59, 0.5);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(27, 127, 59, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(27, 127, 59, 0);
  }
}

.persona-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.persona-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 14px;
  row-gap: 4px;
  align-items: start;
  text-align: left;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f9fcff;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    transform 0.1s ease, background 0.15s ease;
}

.persona-card:hover {
  border-color: var(--sky-deep);
  background: #fff;
  box-shadow: 0 8px 22px rgba(13, 42, 90, 0.1);
}

.persona-card:focus-visible {
  outline: 2px solid var(--sky-deep);
  outline-offset: 2px;
}

.persona-icon {
  grid-row: 1 / span 3;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--sky), var(--sky-deep));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-top: 2px;
}

.persona-tags {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--brand-navy);
  background: #e6f1fb;
  letter-spacing: 0.2px;
  text-transform: none;
}

.persona-title {
  font-weight: 700;
  color: var(--brand-navy);
  font-size: 1rem;
  letter-spacing: 0.2px;
}

.persona-sub {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
}

.link-btn {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--brand-navy);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  text-transform: none;
}

.link-btn:hover {
  text-decoration: underline;
}

.muted-link {
  color: var(--muted);
}

.staff-link-wrap {
  margin: 14px 0 0;
  text-align: center;
}
.staff-link-wrap .link-btn {
  align-self: center;
}

.form .muted {
  text-align: center;
  margin: 0;
  font-size: 0.92rem;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.78rem;
  color: #55637f;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

input,
select,
button {
  font: inherit;
  border-radius: 10px;
}

input,
select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #d6deec;
  background: #fff;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder {
  color: #9aa6bd;
  font-weight: 400;
}

input:focus,
select:focus {
  outline: 2px solid #9ac9ee;
  border-color: var(--sky-deep);
}

button {
  cursor: pointer;
  border: none;
}

button[type="submit"],
.primary-btn {
  width: 100%;
  margin-top: 4px;
  padding: 14px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-size: 0.92rem;
  color: #fff;
  background: linear-gradient(90deg, var(--brand-navy), #1a47a3);
  transition: transform 0.1s ease, box-shadow 0.2s ease, opacity 0.2s;
  box-shadow: 0 6px 20px rgba(13, 42, 90, 0.25);
}

button[type="submit"]:hover,
.primary-btn:hover {
  opacity: 0.95;
}

button[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
}

.status {
  min-height: 20px;
  margin: 10px 0 0;
  font-size: 0.9rem;
  text-align: center;
  color: var(--brand-red);
}

.status.success {
  color: #1b7f3b;
}

.status.error {
  color: var(--brand-red, #c0272d);
  font-weight: 600;
  background: #fff2f2;
  border: 1px solid #f5c2c4;
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 12px;
}

.disclaimer {
  margin: 14px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}

/* ==========================
   Dashboard
   ========================== */

.dashboard {
  min-height: 100vh;
  padding: 22px clamp(16px, 4vw, 40px) 30px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dash-header {
  background: #fff;
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow);
}

.dash-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-brand h1 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--brand-navy);
}

.dash-brand p {
  margin: 2px 0 0;
  font-size: 0.82rem;
}

.logout-btn {
  background: #f3f4f8;
  color: var(--brand-navy);
  padding: 10px 14px;
  font-weight: 600;
  border-radius: 10px;
}

.logout-btn:hover {
  background: #e6eaf5;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 18px;
}

.dash-grid.single-col {
  grid-template-columns: minmax(0, 640px);
  justify-content: center;
}

.dash-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.dash-card h3 {
  margin: 0 0 12px;
  color: var(--brand-navy);
  font-size: 1rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.profile-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}

.profile-card dt {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  align-self: end;
}

.profile-card dd {
  margin: 0 0 10px;
  font-weight: 600;
  color: var(--ink);
  font-size: 0.95rem;
}

.eligibility-card .amount {
  margin: 4px 0 2px;
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  color: var(--brand-red);
  font-weight: 800;
  letter-spacing: -0.5px;
}

.loan-controls {
  margin: 14px 0 10px;
  display: grid;
  gap: 10px;
}

.loan-controls label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.loan-controls input[type="number"],
.loan-controls select {
  margin-top: 6px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  background: #fff;
  color: var(--brand-navy);
}

.loan-controls input[type="number"]:focus,
.loan-controls select:focus {
  outline: 2px solid rgba(213, 34, 31, 0.25);
  border-color: var(--brand-red);
}

.headroom-note {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

.loan-stats {
  list-style: none;
  padding: 0;
  margin: 12px 0 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.loan-stats li {
  background: #f7fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.loan-stats span {
  font-size: 0.76rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.loan-stats strong {
  color: var(--brand-navy);
  font-size: 1rem;
}

.dash-footer {
  text-align: center;
  color: rgba(13, 42, 90, 0.7);
  font-size: 0.85rem;
  margin-top: auto;
}


/* ==========================
   Responsive
   ========================== */

@media (max-width: 820px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .dash-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .logout-btn {
    align-self: stretch;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 22px 18px;
  }
  .logo {
    width: 180px;
  }
  .profile-card dl,
  .loan-stats {
    grid-template-columns: 1fr;
  }
  .dash-brand h1 {
    font-size: 1rem;
  }
}

/* ==========================
   Borrower: My Applications
   ========================== */

.my-applications {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.my-apps-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.my-apps-head h3 {
  margin: 0;
  color: var(--brand-navy);
  font-size: 1rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.my-apps-hint {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
}

.my-apps-table {
  min-width: 720px;
}

/* ==========================
   Admin dashboard
   ========================== */

.admin-dashboard {
  gap: 16px;
}

.admin-head-actions {
  display: flex;
  gap: 8px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.kpi {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi span {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.kpi strong {
  font-size: 1.6rem;
  color: var(--brand-navy);
  font-weight: 800;
  line-height: 1.1;
}

.kpi small {
  font-size: 0.76rem;
}

.admin-tabs {
  display: flex;
  gap: 6px;
  background: #fff;
  border-radius: 12px;
  padding: 6px;
  box-shadow: var(--shadow);
  align-self: flex-start;
  max-width: 100%;
  overflow-x: auto;
}

.admin-tab {
  background: transparent;
  padding: 9px 18px;
  border-radius: 8px;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
}

.admin-tab.active {
  background: var(--brand-navy);
  color: #fff;
}

.admin-tab-panel {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.toolbar-field {
  display: grid;
  gap: 6px;
}

.toolbar-field input,
.toolbar-field select {
  padding: 10px 12px;
  font-size: 0.9rem;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.admin-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.admin-table thead {
  background: #f3f7fb;
}

.admin-table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.admin-table th.num,
.admin-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--ink);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: #fafcff;
}

.admin-table code {
  background: #f3f6fb;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.76rem;
  color: var(--brand-navy);
}

.cell-primary {
  font-weight: 600;
  color: var(--brand-navy);
}

.cell-secondary {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 2px;
}

.empty-row td {
  text-align: center;
  padding: 28px 12px;
  color: var(--muted);
  font-style: italic;
}

.status-pill {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #fff;
  background: var(--muted);
}

.status-pill[data-status="PENDING"] {
  background: var(--tier-c);
}
.status-pill[data-status="APPROVED"] {
  background: var(--tier-b);
}
.status-pill[data-status="DISBURSED"] {
  background: var(--tier-a);
}
.status-pill[data-status="REPAID"] {
  background: #0b6bc9;
}
.status-pill[data-status="REJECTED"] {
  background: var(--tier-d);
}
.status-pill[data-status="ACTIVE"] {
  background: var(--tier-a);
}
.status-pill[data-status="SUSPENDED"] {
  background: var(--tier-d);
}

.transfer-meta {
  margin-top: 6px;
}

.transfer-pill {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  border: 1px solid #d7dfef;
  background: #f6f8fc;
  color: #415678;
}

.transfer-pill[data-settlement="success"] {
  background: #e8f7ef;
  border-color: #c5e9d4;
  color: #116a3c;
}

.transfer-pill[data-settlement="processing"] {
  background: #f1f7ff;
  border-color: #ccddf7;
  color: #1f4a9f;
}

.transfer-pill[data-settlement="failed"] {
  background: #fdf0f0;
  border-color: #f0c8c8;
  color: #9e2a2a;
}

.transfer-pill[data-settlement="otp_required"] {
  background: #fff5e8;
  border-color: #f2d7ae;
  color: #8a5210;
}

/* Employer rating + auto-disbursement badges */
.rating-cell {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.1;
}
.rating-cell .rating-stars {
  color: #d39a00;
  font-size: 0.95rem;
  letter-spacing: 1px;
}
.rating-cell[data-tier="PREMIUM"] .rating-stars,
.rating-cell[data-tier="HIGHLY_RATED"] .rating-stars {
  color: #0e7c3a;
}
.rating-cell[data-tier="WATCH"] .rating-stars,
.rating-cell[data-tier="HIGH_RISK"] .rating-stars {
  color: #9e2a2a;
}

.form-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.form-section h4 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.rating-card {
  grid-column: 1 / -1;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  background: #f7faf6;
}
.rating-card[data-tier="PREMIUM"],
.rating-card[data-tier="HIGHLY_RATED"] {
  background: #ecf8ef;
  border-color: #b9dfc4;
}
.rating-card[data-tier="WATCH"],
.rating-card[data-tier="HIGH_RISK"] {
  background: #fdf1ef;
  border-color: #f0c8c0;
}
.rating-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.rating-card .rating-stars {
  color: #d39a00;
  font-size: 1.2rem;
  letter-spacing: 2px;
}
.rating-card[data-tier="PREMIUM"] .rating-stars,
.rating-card[data-tier="HIGHLY_RATED"] .rating-stars {
  color: #0e7c3a;
}
.rating-card .rating-score {
  font-weight: 600;
}
.rating-card .rating-tier {
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin-top: 4px;
  color: #555;
}
.rating-card[data-tier="PREMIUM"] .rating-tier,
.rating-card[data-tier="HIGHLY_RATED"] .rating-tier {
  color: #0e7c3a;
}
.rating-card[data-tier="WATCH"] .rating-tier,
.rating-card[data-tier="HIGH_RISK"] .rating-tier {
  color: #9e2a2a;
}
.rating-card .rating-hint {
  margin-top: 6px;
  font-size: 0.85rem;
}
.rating-card .rating-note {
  margin-top: 4px;
  font-size: 0.78rem;
}

.fast-track-pill,
.auto-disb-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-top: 4px;
}
.fast-track-pill {
  background: #fff5e0;
  border: 1px solid #f2d7ae;
  color: #8a5210;
}
.auto-disb-pill {
  background: #ecf8ef;
  border: 1px solid #b9dfc4;
  color: #0e7c3a;
}

.actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  white-space: nowrap;
}

.mini-btn {
  padding: 6px 10px;
  border-radius: 8px;
  background: #f1f5fb;
  color: var(--brand-navy);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
}

.mini-btn:hover {
  background: #e4eefb;
}

.mini-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.mini-btn.primary {
  background: var(--brand-navy);
  color: #fff;
}
.mini-btn.primary:hover {
  background: #1a47a3;
}
.mini-btn.approve {
  background: #e5f5ec;
  color: var(--tier-a);
}
.mini-btn.approve:hover {
  background: #d1ecdd;
}
.mini-btn.reject {
  background: #fdeceb;
  color: var(--tier-d);
}
.mini-btn.reject:hover {
  background: #fad8d5;
}

/* Modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 24, 52, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
  backdrop-filter: blur(3px);
}

.modal {
  width: min(560px, 100%);
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(8, 24, 56, 0.35);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

/* Employer workspace — near full-viewport panel */
.modal-backdrop.modal-backdrop--employer-max {
  padding: 6px;
  align-items: stretch;
  justify-content: center;
}

.modal.modal--employer-detail {
  width: 100%;
  max-width: calc(100vw - 12px);
  height: calc(100vh - 12px);
  max-height: calc(100vh - 12px);
  height: calc(100dvh - 12px);
  max-height: calc(100dvh - 12px);
}

.modal.modal--employer-detail .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 20px;
  gap: 0;
  background: linear-gradient(180deg, #f6f8fc 0%, #fff 48px);
}

/* Taller data grids inside the maximized employer modal */
.modal.modal--employer-detail .table-scroll {
  max-height: min(58vh, 720px);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-head h3 {
  margin: 0;
  color: var(--brand-navy);
  font-size: 1.05rem;
}

.modal-close {
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--muted);
  padding: 0 4px;
  cursor: pointer;
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kv {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}

.kv:last-child {
  border-bottom: none;
}

.kv span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
}

.kv strong {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  word-break: break-word;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid label {
  display: grid;
  gap: 6px;
}

.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 900px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .kv {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* --- Payments UI ---------------------------------------------------- */

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.balance-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  line-height: 1.15;
}

.balance-cell small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.pay-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  background: #f5f8fd;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 16px;
}

.pay-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}

.pay-summary-row:last-child {
  border-bottom: none;
}

.pay-summary-row span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
}

.pay-summary-row strong {
  color: var(--ink);
  font-weight: 700;
}

.pay-summary-row.highlight {
  background: #fff8e6;
  border: 1px solid #f3d58a;
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 6px;
}

.pay-summary-row.highlight strong {
  color: #a66300;
  font-size: 1.05rem;
}

.pay-history {
  max-height: 260px;
  overflow-y: auto;
}

.pay-history table {
  width: 100%;
  font-size: 0.85rem;
}

/* --- OTP login step ------------------------------------------------- */

.otp-input {
  text-align: center;
  letter-spacing: 0.6rem;
  font-size: 1.6rem;
  font-weight: 700;
  padding-left: 1.2rem;
  font-variant-numeric: tabular-nums;
}

.otp-resend {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.otp-resend .link-btn {
  font-weight: 600;
}

.otp-resend .link-btn:disabled {
  color: var(--muted);
  cursor: not-allowed;
  text-decoration: none;
}

/* --- Employers tab --------------------------------------------------- */

.toolbar-action {
  align-self: end;
}

.primary-btn {
  background: var(--brand-navy, #0e1e50);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.primary-btn:hover {
  background: #1a47a3;
}

.badge-info {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #0b6bc9;
  background: #e7f1fb;
  border: 1px solid #b9d9f3;
  border-radius: 999px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  cursor: help;
}

.form-grid.two-col {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.switch-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.switch-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}

.employer-detail-head {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* --- Employer detail modal (organized workspace) ------------------------ */

.employer-detail-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.employer-detail-hero {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(15, 35, 71, 0.04);
}

.employer-detail-hero__avatar {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(145deg, #1e4a9e 0%, #2d6fd4 100%);
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.employer-detail-hero__main {
  flex: 1;
  min-width: 0;
}

.employer-detail-hero__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 6px;
}

.employer-detail-hero__name {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand-navy);
  line-height: 1.25;
}

.employer-detail-hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.employer-detail-hero__meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.employer-detail-hero__meta code {
  font-size: 0.8rem;
  background: #eef2f8;
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--ink);
}

.detail-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
}

.detail-section__title {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-navy);
}

.detail-section__lead {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.detail-section__hint {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

.detail-section--collapse {
  padding: 0;
  overflow: hidden;
}

.detail-section--collapse > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--brand-navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.detail-section--collapse > summary::-webkit-details-marker {
  display: none;
}

.detail-section--collapse > summary::after {
  content: "▾";
  font-size: 0.75rem;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.detail-section--collapse[open] > summary::after {
  transform: rotate(-180deg);
}

.detail-section--collapse .detail-section__inner {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

.detail-dl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px 20px;
}

.detail-dl-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.detail-dl-item__label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.detail-dl-item__value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
  line-height: 1.35;
}

.detail-dl-item__value--muted {
  font-weight: 500;
  color: var(--muted);
}

.employer-kpi-strip {
  margin: 0;
}

.employer-kpi-strip .kpi {
  border: 1px solid rgba(15, 35, 71, 0.08);
  background: #fafbfd;
}

.employer-tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin-top: 4px;
}

.employer-checkoff-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
  margin-top: 6px;
}

.employer-table-card .table-scroll {
  margin-top: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid transparent;
}

.status-chip.status-success {
  color: #1a6b3c;
  background: #e8f5ec;
  border-color: #b8dfc6;
}

.status-chip.status-warning {
  color: #8a5a00;
  background: #fff8e6;
  border-color: #e8d49a;
}

.status-chip.status-neutral {
  color: #4a5568;
  background: #f0f2f6;
  border-color: #d8dde6;
}

.status-chip.status-info {
  color: #0b5cab;
  background: #e8f2fc;
  border-color: #b9d4f0;
}

.kpi-grid-sm {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin: 8px 0 4px;
}

.kpi-grid-sm .kpi {
  padding: 10px 12px;
}

.kpi-grid-sm .kpi strong {
  font-size: 1.2rem;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin-top: 6px;
}

.phone-missing-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #8a2b2b;
  background: #fde6e6;
  border: 1px solid #f3b5b5;
  border-radius: 999px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  cursor: help;
}

.input-error {
  border-color: var(--brand-red, #c0272d) !important;
  background: #fff5f5 !important;
  animation: otp-shake 0.38s ease;
}

@keyframes otp-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}
