/* UANG KILAT v3.4 — Reference-Matched Layout in Navy/Cobalt/Gold Palette */
* {
  box-sizing: border-box;
}

:root {
  --navy: #071b46;
  --navy-mid: #0d2b6b;
  --cobalt: #0b57d0;
  --cobalt-dark: #0842a0;
  --gold: #d4a22a;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-sub: #f8fafd;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --ink: #0f172a;
  --ink-secondary: #334155;
  --muted: #64748b;
  --success: #0f766e;
  --success-bg: #ecfdf5;
  --warning: #b45309;
  --warning-bg: #fffbeb;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --bottom-safe: calc(82px + env(safe-area-inset-bottom));
}

html {
  scroll-padding-bottom: var(--bottom-safe);
}

body {
  margin: 0;
  background-color: var(--bg);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.is-customer-app {
  background: linear-gradient(180deg, #e7eefb 0%, #eef3fc 140px, var(--bg) 260px);
  padding-bottom: var(--bottom-safe);
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Auth Screen */
.auth-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: radial-gradient(circle at 22% 12%, #0e3a8a 0%, #071b46 58%, #04102b 100%);
}

.auth-card {
  width: min(100%, 436px);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 26px;
  box-shadow: 0 24px 64px rgba(2, 10, 32, 0.45);
}

.auth-logo {
  display: block;
  width: 100%;
  max-width: 384px;
  height: auto;
  aspect-ratio: 3 / 1;
  object-fit: contain;
  border-radius: 10px;
  margin: 0 auto 10px;
}

.auth-sub {
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  margin: 4px 0 18px;
}

.auth-tabs {
  display: flex;
  gap: 6px;
  background: #eff3f9;
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.auth-tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  border-radius: 7px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-secondary);
  cursor: pointer;
}

.auth-tabs button.active {
  background: var(--navy);
  color: #fff;
}

.auth-assist {
  display: flex;
  justify-content: flex-end;
  margin: 6px 0 4px;
}

.link-btn,
.inline-link {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--cobalt);
  font-weight: 600;
  cursor: pointer;
}

.link-btn { font-size: 12.5px; }
.inline-link, .link-btn:hover { text-decoration: underline; }

.auth-note {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
  text-align: center;
  margin: 14px 4px 0;
}

.auth-preview-bar {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.auth-preview-btn {
  width: 100%;
  font-size: 13px;
}

.auth-error {
  display: block;
  margin: 12px 0 0;
  padding: 11px 13px;
  border: 1px solid #fecaca;
  border-left: 3px solid var(--danger);
  border-radius: 8px;
  background: var(--danger-bg);
  color: #991b1b;
  font-size: 12.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.otp-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #bfdbfe;
  border-left: 3px solid var(--cobalt);
  border-radius: 10px;
  background: #f8fbff;
}

.otp-info {
  margin: 0 0 8px;
  font-size: 12.5px;
  color: var(--navy);
  overflow-wrap: anywhere;
}

.otp-input {
  font-family: var(--font-mono) !important;
  text-align: center;
  font-size: 20px !important;
  font-weight: 700;
  letter-spacing: 7px;
}

.otp-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}

.password-wrap {
  position: relative;
  margin-top: 6px;
}

.password-wrap input {
  margin-top: 0 !important;
  padding-right: 48px !important;
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.password-toggle svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Loading states */
.page-loading {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: radial-gradient(circle at 25% 15%, #0e3a8a, #071b46 70%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  text-align: center;
  padding: 24px;
}

.loading-logo-img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 16px;
  border: 1.5px solid rgba(212, 162, 42, 0.7);
}

.loading-spinner,
.btn-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: ukspin 0.8s linear infinite;
}

.btn-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  vertical-align: middle;
  border-width: 2px;
  margin-right: 8px;
}

.inline-spinner {
  display: inline-block;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border: 2.5px solid #cbd5e1;
  border-top-color: var(--cobalt);
  border-radius: 50%;
  animation: ukspin 0.75s linear infinite;
}

button:disabled { opacity: 0.65; cursor: not-allowed; }
@keyframes ukspin { to { transform: rotate(360deg); } }

/* Topbar (Dark Corporate for Admin, Airy Reference Style for Customer) */
.topbar {
  background: var(--navy);
  border-bottom: 2px solid var(--gold);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.brand img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(212, 162, 42, 0.75);
}

.turnstile-box {
  margin: 12px 0 4px;
  min-height: 65px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.brand b {
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: block;
  line-height: 1.15;
}

.brand em { color: #f5c542; font-style: normal; }

.brand small {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #9fb4db;
  margin-top: 2px;
}

body.is-customer-app .topbar {
  position: static;
  background: transparent;
  border-bottom: 0;
  color: var(--navy);
}

body.is-customer-app .topbar-inner {
  max-width: 620px;
  padding: 14px 14px 4px;
}

body.is-customer-app #topbarRoleLabel {
  display: none;
}

body.is-customer-app .brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(7, 27, 70, 0.14);
  box-shadow: 0 2px 6px rgba(7, 27, 70, 0.08);
}

body.is-customer-app .brand b {
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--navy);
}

body.is-customer-app .brand em {
  color: var(--cobalt);
}

body.is-customer-app .icon-btn,
body.is-customer-app .avatar {
  border: 0;
  background: rgba(7, 27, 70, 0.06);
  color: var(--navy);
  border-radius: 999px;
}

body.is-customer-app .icon-btn:hover,
body.is-customer-app .avatar:hover {
  background: rgba(7, 27, 70, 0.11);
}

body.is-customer-app .uk-badge {
  border-color: #e7eefb;
}

.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-btn,
.avatar {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  position: relative;
  display: grid;
  place-items: center;
}

.icon-btn svg,
.avatar svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.uk-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 10px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 2px solid var(--navy);
}

/* Main Workspace */
main {
  max-width: 620px;
  margin: 0 auto;
  padding: 16px 14px 28px;
}

body.is-customer-app main {
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

body.is-admin-app main {
  max-width: 1120px;
}

/* Reference-Matched Customer Home */
.home-ticker {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(203, 213, 225, 0.65);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-secondary);
}

.ticker-dot {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #eff6ff;
  color: var(--cobalt);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.ticker-dot svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

@keyframes homeFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ctaSheen {
  0%, 100% { transform: translateX(-140%) skewX(-22deg); opacity: 0; }
  14% { opacity: 0.9; }
  48% { transform: translateX(260%) skewX(-22deg); opacity: 0; }
}

.home-ticker {
  animation: homeFadeUp 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-loan-card {
  background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px 20px 20px;
  margin-bottom: 14px;
  text-align: center;
  box-shadow: 0 10px 28px rgba(7, 27, 70, 0.06), 0 1px 2px rgba(7, 27, 70, 0.04);
  animation: homeFadeUp 0.42s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

.hero-loan-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.hero-loan-amount {
  margin: 6px 0 20px;
  font-size: clamp(34px, 7.5vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  line-height: 1.08;
  transition: transform 0.16s ease;
}

.hero-cta-pill {
  position: relative;
  overflow: hidden;
  border-radius: 999px !important;
  margin-top: 0 !important;
  padding: 14px 26px !important;
  font-size: 15px !important;
  background: linear-gradient(135deg, #0b57d0 0%, #0842a0 100%) !important;
  box-shadow: 0 8px 20px rgba(11, 87, 208, 0.26);
  transition: transform 0.18s ease, box-shadow 0.18s ease !important;
}

.hero-cta-pill::after {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 30%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.24), transparent);
  pointer-events: none;
  animation: ctaSheen 5.5s ease-in-out infinite;
}

.hero-cta-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(11, 87, 208, 0.34);
}

.hero-cta-pill:active {
  transform: scale(0.985);
}

.amount-slider-box {
  margin: 20px 0 18px;
  padding-top: 14px;
  border-top: 1px solid #edf1f7;
  text-align: left;
}

input[type="range"] {
  width: 100%;
  margin: 6px 0 8px;
  accent-color: var(--cobalt);
  cursor: pointer;
}

.range-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.amount-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.amount-chip {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-sub);
  color: var(--ink-secondary);
  padding: 7px 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.amount-chip.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.ref-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  background: transparent;
  border: 0;
  text-align: left;
}

.ref-feature-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafd 100%);
  border: 1px solid var(--border);
  border-radius: 13px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.ref-feature-item:hover {
  transform: translateY(-2px);
  border-color: #bfd4f8;
  box-shadow: 0 6px 16px rgba(7, 27, 70, 0.06);
}

.ref-ico {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid #dce7f9;
}

.ref-ico svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ico-navy { background: #eff4fc; color: var(--navy); border-color: #dce7f9; }
.ico-gold { background: #fdf8eb; color: #a16207; border-color: #f3e0b0; }
.ico-blue { background: #eef5ff; color: var(--cobalt); border-color: #d4e4fd; }
.ico-teal { background: #eff4fc; color: var(--navy); border-color: #dce7f9; }

.ref-feature-item b {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.25;
}

.ref-feature-item small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 1px;
}

/* Limit Gauge Card */
.limit-gauge-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px 20px 20px;
  box-shadow: 0 8px 24px rgba(7, 27, 70, 0.045);
  animation: homeFadeUp 0.48s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
  margin-bottom: 14px;
  text-align: center;
}

.gauge-wrap {
  position: relative;
  width: 280px;
  height: 174px;
  margin: 0 auto 6px;
}

.gauge-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.gauge-track {
  fill: none;
  stroke: #e6ecf5;
  stroke-width: 11;
  stroke-linecap: round;
}

.gauge-ticks {
  fill: none;
  stroke: #cbd5e1;
  stroke-width: 3;
  stroke-dasharray: 2 7;
}

.gauge-fill {
  fill: none;
  stroke: var(--cobalt);
  stroke-width: 11;
  stroke-linecap: round;
  stroke-dasharray: 420;
  stroke-dashoffset: 115;
  transition: stroke-dashoffset 0.35s ease;
}

.gauge-center {
  position: absolute;
  inset: 0;
  padding-top: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gauge-center small {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}

.gauge-center b {
  margin-top: 2px;
  font-size: 25px;
  font-weight: 800;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.gauge-center span {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--cobalt);
  background: #eff6ff;
  border: 1px solid #dbeafe;
  padding: 3px 12px;
  border-radius: 999px;
}

.limit-note {
  margin: 4px auto 16px;
  max-width: 440px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.gauge-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.outline-pill-btn {
  flex: 1;
  border: 1px solid var(--cobalt);
  background: #fff;
  color: var(--cobalt);
  border-radius: 999px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.outline-pill-btn:hover {
  background: #eff6ff;
}

.security-banner-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  background: linear-gradient(180deg, #f8fbff 0%, #eff5ff 100%);
  border: 1px solid #dbe6f6;
  border-radius: 16px;
  padding: 16px 18px;
}

.security-banner-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sec-ico {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--cobalt);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.sec-ico svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.security-banner-card b {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}

.security-banner-card p {
  margin: 0;
  max-width: 420px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* Unified Buttons */
.primary-btn {
  width: 100%;
  margin-top: 16px;
  border: 0;
  border-radius: 12px;
  padding: 13px 18px;
  background: var(--cobalt);
  color: #fff;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
}

.primary-btn:hover { background: var(--cobalt-dark); }

.secondary-btn {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.danger-btn {
  border: 1px solid #fecaca;
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.disclaimer {
  font-size: 12px;
  color: var(--muted);
  margin: 10px 0 0;
  line-height: 1.5;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  min-height: 64px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
  display: flex;
  justify-content: center;
  gap: 4px;
}

.bottom-nav button {
  flex: 1;
  max-width: 120px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 2px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.bottom-nav .nav-ico {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}

.bottom-nav .nav-ico svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav button.active {
  color: var(--cobalt);
  font-weight: 700;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 27, 70, 0.56);
  backdrop-filter: blur(3px);
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px 14px;
}

.modal {
  position: relative;
  background: var(--surface);
  width: min(100%, 540px);
  max-height: 90dvh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 24px 64px rgba(7, 27, 70, 0.28);
}

.modal-backdrop.page-modal .modal {
  width: min(100%, 640px);
  max-height: calc(100dvh - 40px);
  border-radius: 16px;
  padding: 24px;
}

.close {
  position: absolute;
  right: 16px;
  top: 16px;
  border: 1px solid var(--border);
  background: var(--surface-sub);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 20px;
  color: var(--ink-secondary);
  cursor: pointer;
  z-index: 10;
  display: grid;
  place-items: center;
}

.modal h2 {
  margin: 0 40px 14px 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
}

/* Reference-Matched Read List & Account Security Subpage */
.profile-read {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
}

.profile-read > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
}

.profile-read > div:last-child {
  border-bottom: 0;
}

.profile-read small {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  flex-shrink: 0;
}

.profile-read b {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  text-align: right;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.ref-subpage {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.ref-subpage-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 42px 18px 0;
}

.ref-subpage-head h2 {
  margin: 0;
}

.ref-back-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-sub);
  color: var(--navy);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.ref-back-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ref-subpage-footer {
  margin-top: auto;
  padding-top: 20px;
}

.ref-logout-pill {
  width: 100%;
  border-radius: 999px;
  border: 1.5px solid #ef4444;
  background: #fff;
  color: #dc2626;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  padding: 13px 20px;
  cursor: pointer;
}

.ref-logout-pill:hover {
  background: var(--danger-bg);
}

/* Reference-Matched Pinjaman Saya Tabs & List */
.ref-underline-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.ref-underline-tabs button {
  position: relative;
  border: 0;
  background: none;
  padding: 8px 0 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.ref-underline-tabs button.active {
  color: var(--cobalt);
  font-weight: 700;
}

.ref-underline-tabs button.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 3px;
  background: var(--cobalt);
}

.ref-history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.ref-history-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: #fff;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}

.ref-history-row:last-child { border-bottom: 0; }
.ref-history-row:hover { background: var(--surface-sub); }

.ref-history-row strong {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.ref-history-row small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.ref-history-right {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.empty-panel {
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  background: var(--surface-sub);
  padding: 36px 20px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.empty-panel svg {
  width: 40px;
  height: 40px;
  color: var(--muted);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.empty-panel b { font-size: 15px; color: var(--ink); }
.empty-panel p { margin: 0; font-size: 13px; color: var(--muted); max-width: 320px; }
.empty-panel .primary-btn { width: auto; margin-top: 8px; padding: 10px 18px; font-size: 13px; }

/* Reference-Matched "Saya" Profile Hub */
@keyframes sayaSheen {
  0%, 100% { transform: translateX(-140%) skewX(-20deg); opacity: 0; }
  15% { opacity: 0.9; }
  50% { transform: translateX(220%) skewX(-20deg); opacity: 0; }
}

@keyframes sayaFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-4px); }
}

@keyframes sayaReveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.saya-banner {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #06163a 0%, #0d2e78 56%, #071b46 100%);
  color: #fff;
  border-radius: 16px;
  padding: 20px 20px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(245, 197, 66, 0.28);
  box-shadow: 0 12px 28px rgba(7, 27, 70, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  animation: sayaReveal 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.saya-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 86% 24%, rgba(245, 197, 66, 0.22) 0%, transparent 46%),
    radial-gradient(circle at 18% 90%, rgba(56, 139, 253, 0.28) 0%, transparent 52%);
  pointer-events: none;
}

.saya-banner::after {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 36%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
  pointer-events: none;
  animation: sayaSheen 6.5s ease-in-out infinite;
}

.saya-banner > * {
  position: relative;
  z-index: 1;
}

.saya-tier {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(245, 197, 66, 0.14);
  border: 1px solid rgba(245, 197, 66, 0.55);
  color: #f5c542;
  margin-bottom: 8px;
}

.saya-banner b {
  display: block;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.saya-banner small {
  display: block;
  font-size: 12.5px;
  color: #cbd5e1;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.saya-banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.saya-crest {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  opacity: 0.92;
  animation: sayaFloat 4.5s ease-in-out infinite;
}

.saya-crest svg {
  width: 100%;
  height: 100%;
  display: block;
}

.saya-banner .icon-btn {
  border: 1px solid rgba(255, 255, 255, 0.24) !important;
  background: rgba(255, 255, 255, 0.14) !important;
  color: #ffffff !important;
  border-radius: 999px;
  transition: transform 0.18s ease, background 0.18s ease;
}

.saya-banner .icon-btn:hover {
  background: rgba(255, 255, 255, 0.24) !important;
  transform: scale(1.05);
}

.saya-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 8px;
  margin-bottom: 14px;
  text-align: center;
  animation: sayaReveal 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ref-menu-card {
  animation: sayaReveal 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ref-menu-row {
  transition: background 0.16s ease;
}

.ref-menu-row .ref-menu-val {
  transition: transform 0.16s ease;
}

.ref-menu-row:hover .ref-menu-val {
  transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
  .home-ticker,
  .hero-loan-card,
  .hero-cta-pill::after,
  .limit-gauge-card,
  .security-banner-card,
  .saya-banner,
  .saya-banner::after,
  .saya-crest,
  .saya-metrics,
  .ref-menu-card {
    animation: none !important;
  }
}

.saya-metrics > div {
  border-right: 1px solid var(--border);
}

.saya-metrics > div:last-child { border-right: 0; }

.saya-metrics b {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.saya-metrics span {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}

.ref-menu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
}

.ref-menu-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: #fff;
  padding: 15px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.ref-menu-row:last-child { border-bottom: 0; }
.ref-menu-row:hover { background: var(--surface-sub); }

.ref-menu-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ref-menu-left svg {
  width: 19px;
  height: 19px;
  color: var(--navy);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.ref-menu-val {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

/* Reference-Matched Photo Guide ("Contoh Foto") in Step 4 */
.photo-guide-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin: 10px 0 14px;
}

.photo-guide-box > b {
  display: block;
  font-size: 13px;
  color: var(--navy);
  margin-bottom: 10px;
}

.photo-guide-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
}

.photo-guide-item {
  font-size: 11px;
  color: var(--ink-secondary);
  line-height: 1.3;
}

.guide-thumb {
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 800;
}

.guide-ok { background: var(--success-bg); border-color: #a7f3d0; color: var(--success); }
.guide-bad { background: var(--danger-bg); border-color: #fecaca; color: var(--danger); }

/* Form Fields & Wizard */
.field {
  display: block;
  margin: 13px 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.field input,
.field select,
.field textarea {
  display: block;
  width: 100%;
  padding: 10px 12px;
  margin-top: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--cobalt);
  box-shadow: 0 0 0 3px rgba(11, 87, 208, 0.14);
}

.field input[readonly] {
  background: #f8fafc;
  border-color: var(--border);
  color: var(--ink-secondary);
  font-weight: 600;
}

.field-hint {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11.5px;
}

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-secondary);
  margin: 12px 0;
}

.consent input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--cobalt);
}

.status {
  padding: 12px 14px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f8fbff;
  color: var(--navy);
  font-size: 13px;
  margin: 10px 0;
}

.status.loading-state,
.stats-grid.loading-state {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  font-weight: 600;
}

.rowline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #edf1f7;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.rowline:last-child { border-bottom: 0; }
.rowline span { color: var(--muted); }
.rowline b { color: var(--ink); font-weight: 700; text-align: right; }

.wizard-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 2px 44px 12px 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
}

.wizard-head span {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--navy);
}

.wizard-head b {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--cobalt);
  background: #eff6ff;
  border: 1px solid #dbeafe;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.wizard-progress {
  height: 6px;
  border-radius: 999px;
  background: #e6ecf5;
  margin: 14px 0 18px;
  overflow: hidden;
}

.wizard-progress i {
  display: block;
  height: 100%;
  width: 25%;
  border-radius: 999px;
  background: var(--cobalt);
  transition: width 0.25s ease;
}

#loanWizard .wizard-step {
  padding: 2px 0 4px;
  border: 0;
  background: transparent;
}

#loanWizard .wizard-step h2 {
  color: var(--navy);
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
}

.amount-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.wallet {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: #eff4fb;
  border: 1px solid var(--border);
  color: var(--navy);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.wallet svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.amount-head span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.amount-head h2 { margin: 2px 0 0; font-size: 24px; color: var(--navy); font-variant-numeric: tabular-nums; }

.repayment-box {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 14px;
  margin-top: 14px;
}

.repayment-box > small {
  display: block;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 10px;
}

.signature-wrap {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  display: grid;
  gap: 10px;
}

.signature-wrap canvas {
  width: 100%;
  height: 145px;
  background: #fff;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  touch-action: none;
}

.file-preview {
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
  margin: -4px 0 12px;
}

.file-preview.is-checking {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
  color: var(--navy);
  margin: 0 0 12px;
}

.file-preview.is-valid {
  padding: 9px 12px;
  border: 1px solid #a7f3d0;
  border-left: 3px solid var(--success);
  border-radius: 8px;
  background: var(--success-bg);
  color: var(--success);
  margin: 0 0 12px;
}

.file-preview.is-error {
  padding: 9px 12px;
  border: 1px solid #fecaca;
  border-left: 3px solid var(--danger);
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger);
  margin: 0 0 12px;
}

.form-actions {
  position: sticky;
  bottom: 0;
  z-index: 8;
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding: 12px 0 2px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.req-gate-box {
  background: var(--surface-sub);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin: 12px 0;
  display: grid;
  gap: 10px;
}

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

.req-gate-head b {
  font-size: 13.5px;
  color: var(--navy);
}

.req-gate-box .secondary-btn {
  padding: 8px 12px;
  font-size: 12.5px;
}

.contacts-preview-list {
  display: grid;
  gap: 6px;
}

.contact-row-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 12.5px;
}

.contact-row-chip a {
  color: var(--cobalt);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.contact-pair-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

@media (min-width: 600px) {
  .contact-pair-grid {
    grid-template-columns: 1.1fr 0.9fr 1fr;
  }
}

.form-actions .primary-btn { margin: 0; flex: 1; }
.form-actions .secondary-btn { min-width: 110px; }

.submission-wait { text-align: center; padding: 36px 14px; }
.submission-wait p { line-height: 1.6; color: var(--muted); }

.logout-clear {
  width: 100%;
  margin-top: 10px;
  color: var(--danger);
  background: var(--danger-bg);
  border-color: #fecaca;
}

.notice-item {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 10px 0;
  background: var(--surface-sub);
}

.notice-item.uk-unread {
  border-color: #bfdbfe;
  border-left: 3px solid var(--cobalt);
  background: #f8fbff;
}

.notice-item p { margin: 5px 0; color: var(--ink-secondary); font-size: 13px; }
.notice-item small { color: var(--muted); font-size: 11.5px; }

.help-intro { font-size: 13.5px; color: var(--muted); margin: 0 0 12px; }
.my-support-messages { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }

.my-support-item,
.support-admin-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-sub);
  margin: 8px 0;
  overflow: hidden;
  padding: 0 12px;
}

.my-support-item summary,
.support-admin-item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 2px;
  cursor: pointer;
  list-style: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 13.5px;
}

.my-support-item summary::-webkit-details-marker,
.support-admin-item summary::-webkit-details-marker { display: none; }

.support-reply {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0 12px;
  color: var(--navy);
}

/* === CORPORATE ADMIN CONSOLE === */
.admin-only-panel { max-width: 1120px; margin: 0 auto 48px; }

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 16px;
}

.admin-panel-head h2 { color: var(--navy); margin: 0; font-size: 19px; font-weight: 800; }
.admin-panel-head small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.admin-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.stat-card.is-highlight {
  background: #fffbeb;
  border-color: #fde68a;
}

.stat-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-card b {
  display: block;
  margin-top: 6px;
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.stat-card span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.admin-workspace-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
}

.admin-ws-tab {
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
  border-radius: 999px;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

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

.admin-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.admin-search-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-sub);
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
}

.admin-search-input:focus {
  outline: none;
  border-color: var(--cobalt);
  background: #fff;
}

.loan-queue-list {
  display: grid;
  gap: 12px;
}

.loan-queue-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  display: grid;
  gap: 14px;
}

.loan-queue-grid {
  display: grid;
  gap: 12px;
}

.lq-col small {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 3px;
}

.lq-name {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.lq-sub {
  font-size: 12.5px;
  color: var(--ink-secondary);
  margin-top: 3px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.lq-sub a {
  color: var(--cobalt);
  font-weight: 600;
  text-decoration: none;
}

.lq-amount {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.lq-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.lq-status-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lq-status-ctrl select {
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-sub);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.vip-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  background: #fef3c7;
  color: #92400e;
}

.customer-dir-card {
  background: var(--surface-sub);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: grid;
  gap: 10px;
}

.customer-dir-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.customer-dir-top b {
  font-size: 15px;
  color: var(--navy);
}

.admin-overview-grid { display: grid; gap: 16px; margin-bottom: 16px; }

.admin-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.admin-overview-grid .admin-section { margin-bottom: 0; }
.admin-section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.admin-section h3 { font-size: 15px; font-weight: 700; color: var(--navy); margin: 0; }

.status-bars { display: grid; gap: 12px; }
.status-bar-row { display: grid; gap: 5px; }
.status-bar-meta { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; color: var(--ink-secondary); font-variant-numeric: tabular-nums; }
.status-bar-track { height: 8px; border-radius: 6px; background: #edf2f7; overflow: hidden; }
.status-bar-fill { height: 100%; border-radius: 6px; }
.fill-pending { background: #d97706; }
.fill-reviewing { background: #0b57d0; }
.fill-needs_revision { background: #7c3aed; }
.fill-approved { background: #059669; }
.fill-rejected { background: #dc2626; }

.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-tab-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
  border-radius: 8px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.admin-tab-btn.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.client-group {
  display: block;
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.client-group summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface-sub);
  border-bottom: 1px solid transparent;
  color: var(--navy);
  font-weight: 700;
  font-size: 14.5px;
  list-style: none;
  cursor: pointer;
}

.client-group[open] summary { border-bottom-color: var(--border); }
.client-group summary::-webkit-details-marker { display: none; }
.client-summary-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill-count { font-size: 11.5px; font-weight: 700; background: #e2e8f0; color: var(--ink-secondary); padding: 3px 9px; border-radius: 6px; }

.customer-room-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: #fcfdff;
  border-bottom: 1px solid var(--border);
}

.customer-room-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.customer-state { font-size: 11.5px; font-weight: 700; color: var(--success); background: var(--success-bg); border: 1px solid #a7f3d0; padding: 4px 10px; border-radius: 6px; }
.customer-state.archived { color: var(--warning); background: var(--warning-bg); border-color: #fde68a; }

.client-record { padding: 16px; border-bottom: 1px solid var(--border); font-size: 13px; overflow-wrap: anywhere; }
.client-record:last-child { border-bottom: 0; }
.record-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.record-amount { font-size: 16px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.record-date { font-size: 12px; color: var(--muted); }

.status-pill { display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 700; }
.pill-pending { background: #fef3c7; color: #92400e; }
.pill-reviewing { background: #dbeafe; color: #1e40af; }
.pill-needs_revision { background: #ede9fe; color: #5b21b6; }
.pill-approved { background: #d1fae5; color: #065f46; }
.pill-rejected { background: #fee2e2; color: #991b1b; }

.record-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px 14px;
  padding: 10px 12px;
  background: var(--surface-sub);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 12.5px;
}

.record-meta-grid div span { display: block; font-size: 11px; color: var(--muted); }
.record-meta-grid div b { color: var(--ink); font-weight: 600; }

.doc-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.doc-links button { padding: 8px 12px; font-size: 12.5px; }
.admin-detail-btn { width: auto !important; margin-top: 0 !important; border-radius: 9px !important; padding: 8px 14px !important; font-size: 12.5px !important; }

.location-row {
  background: var(--surface-sub);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cobalt);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 8px 0;
  display: grid;
  gap: 4px;
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.location-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--navy); }
.location-title span { font-size: 10px; font-weight: 700; background: var(--success-bg); color: var(--success); border: 1px solid #a7f3d0; padding: 2px 8px; border-radius: 6px; }
.location-row a { color: var(--cobalt); font-weight: 700; text-decoration: none; }

.support-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.support-actions button { flex: 1; min-width: 135px; }

.admin-detail-grid { display: grid; gap: 14px; }
.admin-detail-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; background: var(--surface-sub); }
.admin-detail-card h3 { margin: 0 0 8px; font-size: 13.5px; font-weight: 700; color: var(--navy); }
.mono-id { font-family: var(--font-mono); font-size: 11.5px; word-break: break-all; }
.admin-wa-btn { display: inline-block; margin-top: 10px; text-decoration: none; }

.admin-doc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.admin-doc-card { margin: 0; border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: var(--surface); display: grid; gap: 8px; }
.admin-doc-card figcaption { font-size: 12px; font-weight: 700; color: var(--navy); }
.admin-doc-card img, .admin-doc-single img { width: 100%; max-height: 360px; object-fit: contain; border-radius: 8px; background: #f1f5f9; border: 1px solid var(--border); }
.admin-doc-card a { font-size: 12px; font-weight: 600; color: var(--cobalt); text-decoration: none; }
.admin-doc-single { display: grid; gap: 12px; }
.admin-doc-link { text-align: center; text-decoration: none; margin-top: 0; }

/* Toast */
.toast {
  position: fixed;
  z-index: 90;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(7, 27, 70, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  max-width: min(92vw, 440px);
  text-align: center;
}
.toast.show { opacity: 1; }

/* Responsive */
@media (min-width: 600px) {
  .amount-presets { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-detail-card.is-wide { grid-column: 1 / -1; }
}

@media (min-width: 860px) {
  .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .loan-queue-grid { grid-template-columns: 1.15fr 1.15fr 0.9fr; align-items: start; }
  .admin-overview-grid { grid-template-columns: 1.15fr 1fr; }
}

@media (max-width: 640px) {
  main { padding: 12px 12px 24px; }
  .topbar-inner { padding: 10px 14px; }
  .modal-backdrop.page-modal { padding: 0; }
  .modal-backdrop.page-modal .modal {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
    padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
  }
  .modal-backdrop.page-modal #modalContent {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .photo-guide-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-panel-head { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 390px) {
  .auth-card { padding: 20px 16px; }
  .ref-feature-grid { grid-template-columns: 1fr; }
}
