:root {
  --green-950: #24070b;
  --green-900: #3a0b11;
  --green-800: #852832;
  --green-100: #f6e9eb;
  --gold-600: #9d7431;
  --gold-500: #c19745;
  --gold-100: #f8f0df;
  --ink: #271e20;
  --muted: #74696b;
  --line: #e1d9da;
  --soft: #f6f4f4;
  --white: #ffffff;
  --danger: #a53a35;
  --danger-soft: #fff0ee;
  --success: #176b4f;
  --success-soft: #e8f5ef;
  --warning: #8a5a08;
  --warning-soft: #fff7df;
  --shadow: 0 8px 24px rgba(48, 12, 18, 0.09);
  --portal-panel-gutter: 24px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--soft);
  font-synthesis: none;
}

* { box-sizing: border-box; }

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

body { background: var(--soft); color: var(--ink); font-size: 14px; }

button, input, select, textarea { font: inherit; letter-spacing: 0; }

button, .link-button {
  min-height: 40px;
  border: 1px solid var(--green-800);
  border-radius: 5px;
  padding: 9px 15px;
  background: var(--green-800);
  color: var(--white);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.link-button { display: inline-flex; align-items: center; justify-content: center; min-width: 54px; white-space: nowrap; }

button:hover, .link-button:hover { background: var(--green-900); border-color: var(--green-900); }
button:disabled { cursor: not-allowed; opacity: 0.48; }

a { color: var(--green-800); text-decoration: none; }
a:hover { color: var(--green-950); }

input, select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d4cacc;
  border-radius: 5px;
  padding: 9px 11px;
  background: var(--white);
  color: var(--ink);
  outline: none;
}

textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green-800); box-shadow: 0 0 0 3px rgba(133, 40, 50, 0.12); }
label { display: grid; gap: 7px; color: #493c3f; font-size: 12px; font-weight: 700; }

.portal-login-body {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
  background: #f4f2f3;
  overflow-x: hidden;
}

.portal-login-spectrum {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 1fr 1.1fr;
  opacity: 0.14;
  pointer-events: none;
}
.portal-login-spectrum span:nth-child(1) { background: #ee5a5a; clip-path: polygon(0 0, 62% 0, 28% 100%, 0 100%); }
.portal-login-spectrum span:nth-child(2) { background: #f1bd42; clip-path: polygon(50% 0, 100% 0, 62% 100%, 0 100%); }
.portal-login-spectrum span:nth-child(3) { background: #45b8a5; clip-path: polygon(25% 0, 100% 0, 100% 100%, 0 100%); }
.portal-login-spectrum span:nth-child(4) { background: #5b65d9; clip-path: polygon(50% 0, 100% 0, 100% 100%, 5% 100%); }

.portal-login-main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(420px, 1.08fr) minmax(390px, 0.92fr);
  justify-content: center;
  align-items: stretch;
  width: min(1120px, calc(100% - 64px));
  min-height: 650px;
  margin: 42px auto 28px;
  border: 1px solid rgba(68, 35, 41, 0.18);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 26px 70px rgba(47, 17, 25, 0.18);
  overflow: hidden;
}

.portal-login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  min-width: 0;
  padding: 38px 44px 34px;
  background-color: #21070c;
  background-image:
    linear-gradient(125deg, rgba(226, 62, 76, 0.22), transparent 43%),
    linear-gradient(300deg, rgba(52, 186, 173, 0.15), transparent 48%);
  color: var(--white);
}
.portal-login-brand::after { content: ""; position: absolute; inset: 0; border-right: 1px solid rgba(255,255,255,0.08); pointer-events: none; }
.portal-login-lockup { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; }
.portal-login-lockup img { width: 54px; height: 54px; border: 1px solid rgba(255,255,255,0.28); border-radius: 6px; object-fit: cover; box-shadow: 0 10px 28px rgba(0,0,0,0.28); }
.portal-login-lockup > span { display: grid; gap: 3px; }
.portal-login-lockup strong { font-family: Georgia, "Times New Roman", serif; font-size: 20px; font-weight: 600; }
.portal-login-lockup small { color: #e4c66d; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.portal-login-story { position: relative; z-index: 1; width: min(480px, 100%); padding: 54px 0 42px; }
.portal-login-kicker { color: #dfc56e; font-size: 10px; font-weight: 800; }
.portal-login-prism {
  margin: 18px 0 20px;
  background: linear-gradient(95deg, #fff 2%, #ffd75e 28%, #ff7f83 49%, #76e2d2 70%, #98a6ff 92%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 43px;
  font-weight: 600;
  line-height: 1.25;
  animation: login-title-shine 7s ease-in-out infinite, login-title-float 4.5s ease-in-out infinite;
}
.portal-login-story p { max-width: 430px; margin: 0; color: #dacdd0; font-size: 14px; line-height: 1.8; }
.portal-login-capabilities { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); width: 100%; border-top: 1px solid rgba(255,255,255,0.15); border-bottom: 1px solid rgba(255,255,255,0.15); }
.portal-login-capabilities span { display: grid; gap: 8px; min-width: 0; padding: 16px 12px; border-right: 1px solid rgba(255,255,255,0.12); color: #eee4e6; font-size: 10px; }
.portal-login-capabilities span:first-child { padding-left: 0; }
.portal-login-capabilities span:last-child { border-right: 0; }
.portal-login-capabilities b { color: #69d6c5; font-size: 9px; }
.portal-login-live { position: relative; z-index: 1; display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 8px; width: 100%; padding-top: 20px; color: #a99599; font-size: 9px; text-transform: uppercase; }
.portal-login-live i { width: 7px; height: 7px; border-radius: 50%; background: #58d09b; box-shadow: 0 0 0 4px rgba(88,208,155,0.13); }
.portal-login-live strong { color: #8de5bc; font-size: 9px; }

.portal-login-panel { position: relative; display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 58px 60px; background: rgba(255,255,255,0.97); }
.portal-login-shine { position: absolute; top: 0; left: 0; right: 0; height: 5px; background: linear-gradient(90deg, #d73345 0 22%, #e6b941 22% 45%, #39ac9a 45% 70%, #5866d6 70%); }
.portal-login-panel header > span { color: #b52e3d; font-size: 10px; font-weight: 900; }
.portal-login-panel h2 { margin: 13px 0 7px; color: var(--green-950); font-family: Georgia, "Times New Roman", serif; font-size: 34px; font-weight: 600; }
.portal-login-panel header p { margin: 0 0 31px; color: var(--muted); font-size: 12px; }
.portal-login-panel form { display: grid; gap: 18px; }
.portal-login-panel label > span { color: #463a3d; font-size: 11px; }
.portal-login-panel input { min-height: 48px; border-color: #d7ced0; background: #fbfafb; }
.portal-login-panel input:focus { background: #fff; }
.portal-login-submit { display: grid; gap: 2px; width: 100%; min-height: 51px; margin-top: 2px; background: #801f2b; border-color: #801f2b; color: #fff; }
.portal-login-submit small { color: #e7c6cb; font-size: 8px; font-weight: 700; text-transform: uppercase; }
.portal-login-submit:hover { background: #5f111a; border-color: #5f111a; }
.portal-login-submit:disabled { background: #d8d1d2; border-color: #d8d1d2; color: #7f7476; opacity: 1; }
.portal-login-submit:disabled small { color: #94898b; }

.portal-human-check { display: grid; gap: 8px; }
.portal-human-check-head { display: flex; justify-content: space-between; align-items: center; color: #5c5053; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.portal-human-check-head strong { color: #9a777c; font-size: 8px; }
.portal-human-track { position: relative; height: 48px; border: 1px solid #d5ccce; border-radius: 6px; background: #f3f0f1; outline: none; overflow: hidden; touch-action: none; user-select: none; }
.portal-human-track:focus { border-color: #8d2b37; box-shadow: 0 0 0 3px rgba(133,40,50,0.12); }
.portal-human-progress { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #fde99d, #a8e3d8); opacity: 0.82; }
.portal-human-label { position: absolute; inset: 0; display: grid; place-items: center; color: #74686b; font-size: 10px; pointer-events: none; }
.portal-human-handle { position: absolute; top: 3px; left: 3px; display: grid; place-items: center; width: 40px !important; min-width: 40px; height: 40px; min-height: 40px; margin: 0 !important; padding: 0; border: 1px solid #7e2530; border-radius: 5px; background: #852832 !important; color: #fff !important; box-shadow: 0 4px 12px rgba(71,16,24,0.2); pointer-events: none; will-change: transform; }
.portal-human-check.complete .portal-human-track { border-color: #68b99b; background: #edf8f3; }
.portal-human-check.complete .portal-human-handle { border-color: #1c7657; background: #248262 !important; }
.portal-human-check.complete .portal-human-check-head strong { color: #1f7658; }
.portal-login-assurance { display: flex; justify-content: center; gap: 17px; margin-top: 24px; color: #8a7e80; font-size: 8px; text-transform: uppercase; }
.portal-login-assurance span { position: relative; }
.portal-login-assurance span + span::before { content: ""; position: absolute; top: 4px; left: -9px; width: 2px; height: 2px; background: #bd9b4f; }
.portal-login-footer { position: relative; z-index: 1; display: flex; justify-content: center; gap: 9px; padding: 0 20px 22px; color: var(--muted); font-size: 9px; text-align: center; }
.portal-login-footer span + span::before { content: "·"; margin-right: 9px; }

@keyframes login-title-shine { 0%,100% { background-position: 0 50%; } 50% { background-position: 100% 50%; } }
@keyframes login-title-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .portal-login-prism { animation: none; } }

.portal-layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }

.portal-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 22px 16px;
  background: #1f080b;
  color: var(--white);
  overflow-y: auto;
}

.portal-brand { display: flex; align-items: center; gap: 11px; padding: 0 7px 20px; color: var(--white); }
.portal-brand:hover { color: var(--white); }
.portal-brand img { width: 42px; height: 42px; border: 1px solid rgba(255,255,255,0.13); border-radius: 3px; object-fit: cover; }
.portal-brand span { display: grid; gap: 3px; min-width: 0; }
.portal-brand strong { font-family: Georgia, "Times New Roman", serif; font-size: 16px; font-weight: 600; }
.portal-brand small { color: #d8c27f; font-size: 9px; text-transform: uppercase; }

.portal-merchant { display: grid; gap: 5px; margin: 0 2px 18px; padding: 14px 12px; border: 1px solid rgba(255,255,255,0.15); border-radius: 5px; background: rgba(255,255,255,0.06); }
.portal-merchant span, .portal-merchant small { color: #c6aeb2; font-size: 10px; }
.portal-merchant strong { overflow-wrap: anywhere; font-size: 13px; }

.portal-sidebar nav { display: grid; gap: 4px; }
.portal-sidebar nav a { display: grid; gap: 2px; padding: 11px 12px; border-left: 3px solid transparent; border-radius: 4px; color: #eadfe1; }
.portal-sidebar nav a:hover { background: rgba(255,255,255,0.07); color: var(--white); }
.portal-sidebar nav a.active { border-left-color: var(--gold-500); background: #5a1820; color: var(--white); }
.portal-sidebar nav strong { font-size: 13px; }
.portal-sidebar nav span { color: #bba5a9; font-size: 9px; text-transform: uppercase; }
.portal-sidebar nav a.active span { color: #e7cd88; }
.portal-sidebar-foot { display: grid; gap: 5px; margin-top: auto; padding: 18px 9px 0; color: #cdb9bc; font-size: 9px; text-transform: uppercase; }
.portal-sidebar-foot small { color: #9f858a; font-size: 9px; }

.portal-workspace { min-width: 0; }
.portal-topbar { display: flex; justify-content: space-between; align-items: center; min-height: 68px; padding: 10px 28px; border-bottom: 1px solid var(--line); background: var(--white); }
.portal-topbar > div { display: grid; gap: 3px; }
.portal-topbar strong { color: var(--green-950); font-size: 13px; }
.portal-topbar span { color: var(--muted); font-size: 10px; }
.portal-account { grid-template-columns: auto auto; align-items: center; gap: 14px !important; text-align: right; }
.portal-account button { min-height: 34px; padding: 6px 12px; border-color: var(--line); background: var(--white); color: var(--ink); }
.portal-account button:hover { border-color: var(--green-800); color: var(--green-800); }

.portal-main { width: min(1480px, 100%); margin: 0 auto; padding: 26px 30px 56px; }
.portal-page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.portal-page-head h1 { margin: 0; color: var(--green-950); font-family: Georgia, "Times New Roman", serif; font-size: 27px; font-weight: 600; }
.portal-page-head p { max-width: 780px; margin: 7px 0 0; color: var(--muted); line-height: 1.5; }
.portal-secure-mark { flex: none; padding: 7px 10px; border: 1px solid #dfc57f; border-radius: 4px; background: var(--gold-100); color: #72520e; font-size: 9px; font-weight: 800; }

.merchant-content { min-width: 0; }
.merchant-content .dinpay-environment, .merchant-content .dinpay-channel-balances { display: none !important; }
.stack { display: grid; gap: 16px; }

.portal-alert, .error, .success {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: 5px;
  line-height: 1.5;
}
.portal-alert-error, .error { border-color: #e3aaa5; background: var(--danger-soft); color: #7e2925; }
.portal-alert-success, .success { border-color: #a9d2bf; background: var(--success-soft); color: #12513d; }
.error-text { color: var(--danger) !important; }

.portal-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.portal-metrics article { min-height: 112px; padding: 17px; border: 1px solid var(--line); border-top: 3px solid var(--green-800); border-radius: 5px; background: var(--white); }
.portal-metrics span, .portal-metrics small { display: block; color: var(--muted); font-size: 10px; }
.portal-metrics strong { display: block; margin: 9px 0 6px; color: var(--green-950); font-size: 26px; }

.portal-section, .panel { border: 1px solid var(--line); border-radius: 6px; background: var(--white); box-shadow: 0 3px 12px rgba(48,12,18,0.04); overflow: hidden; }
.portal-section + .portal-section { margin-top: 16px; }
.portal-section > header, .panel-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; min-height: 68px; padding: 16px var(--portal-panel-gutter); border-bottom: 1px solid var(--line); background: #fcfbfb; }
.portal-section > header > div, .panel-head > div { display: grid; gap: 3px; }
.portal-section h2, .panel-head h2 { margin: 0; color: var(--green-950); font-size: 15px; }
.portal-section header span, .panel-head p { margin: 0; color: var(--muted); font-size: 10px; }
.portal-section header > a { font-size: 11px; font-weight: 700; }
.portal-section-actions { display: flex !important; grid-auto-flow: column; align-items: center; gap: 14px !important; }
.portal-section-actions a { font-size: 11px; font-weight: 700; }
.panel-body { padding: var(--portal-panel-gutter); }

/* Some Clearing views render forms directly under a panel. Keep their content
   aligned with panel headers rather than letting labels touch the card edge. */
.merchant-content .panel > .address-form,
.merchant-content .panel > .filter-form,
.merchant-content .panel > .inline-form {
  padding: var(--portal-panel-gutter);
}
.merchant-content .panel > .filter-form,
.merchant-content .panel > .inline-form { border-bottom: 1px solid var(--line); }
.merchant-content .panel > .address-form { gap: 20px; }
.merchant-content .panel > .address-form .dinpay-form-section { margin-top: 2px; padding: 14px 0 10px; border-bottom-color: #d9ced0; color: #6f1924 !important; font-size: 11px !important; font-weight: 800; }
.merchant-content .panel > .address-form .dinpay-form-section:first-child { margin-top: -2px; padding-top: 0; }
.merchant-content .panel > .address-form .dinpay-form-actions { padding-top: 12px; border-top: 1px solid #eee7e8; }

.portal-review-boundary { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 16px; margin-bottom: 16px; padding: 14px 17px; border-left: 3px solid #d6a43b; background: #fff8e7; }
.portal-review-boundary strong { color: #5d3e08; }
.portal-review-boundary p { margin: 0; color: #776642; line-height: 1.55; }
.portal-review-boundary span { color: #8f6714; font-size: 9px; font-weight: 800; }
.portal-batch-actions { display:flex; justify-content:flex-end; padding:16px 18px; border-top:1px solid #eceff3; }
.portal-batch-actions button,.portal-security-form button { min-height:40px; padding:0 16px; border:0; background:#7a1e2b; color:#fff; font-weight:800; cursor:pointer; }
.portal-security-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.portal-security-form { display:grid; gap:14px; padding:18px; }
.portal-security-form label { display:grid; gap:6px; color:#565d68; font-size:12px; font-weight:700; }
.portal-security-form input { min-height:42px; padding:0 12px; border:1px solid #cfd5dc; background:#fff; }
.portal-security-form button { justify-self:start; }
.portal-security-form details code { display:block; margin-top:8px; padding:10px; overflow-wrap:anywhere; background:#f4f6f8; }
.portal-security-status { display:grid; gap:5px; padding:20px 18px 12px; }
.portal-security-status span { color:#747b85; font-size:12px; }
.portal-totp-qr { width:190px; height:190px; object-fit:contain; border:1px solid #e1e4e8; }
.portal-batch-confirm { border-top:1px solid #eceff3; }
.portal-batch-confirm > div { display:flex; align-items:center; justify-content:flex-end; gap:16px; }
.portal-text-link { color:#6f1924; font-weight:800; }

.wallet-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 16px; }
.wallet-card { display: grid; min-height: 142px; padding: 15px; border: 1px solid #ddd4d6; border-radius: 5px; background: var(--white); }
.wallet-card header, .wallet-card footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.wallet-card header strong { color: var(--green-900); }
.wallet-card > span { align-self: end; margin-top: 14px; color: var(--muted); font-size: 10px; }
.wallet-card > b { margin-top: 4px; font-size: 22px; }
.wallet-card footer { align-self: end; margin-top: 12px; padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }

.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 13px; border-bottom: 1px solid var(--line); background: #f8f5f6; color: #695b5e; font-size: 10px; text-align: left; white-space: nowrap; }
td { padding: 13px; border-bottom: 1px solid #eee8e9; vertical-align: top; line-height: 1.4; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfafa; }
td a strong { color: var(--green-800); }
.subtext { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.cell-main { min-width: 150px; }
.cell-main strong { display: block; }
.empty { padding: 26px !important; color: var(--muted); text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }

.status-badge, .badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f7f3f4;
  color: #625457;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}
.status-completed { border-color: #9dcab5; background: var(--success-soft); color: var(--success); }
.status-failed { border-color: #e0aaa5; background: var(--danger-soft); color: var(--danger); }
.status-active { border-color: #a8c4d3; background: #edf6fa; color: #285f78; }
.status-pending { border-color: #dfc985; background: var(--warning-soft); color: var(--warning); }
.badge.hipayx { border-color: #a8c4d3; background: #edf6fa; color: #285f78; }

.money-direction { font-weight: 800; white-space: nowrap; }
.money-direction.credit { color: var(--success); }
.money-direction.debit { color: var(--danger); }

.compact-filter, .filter-form, .inline-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.compact-filter input, .compact-filter select, .filter-form input, .filter-form select, .inline-form input, .inline-form select { width: auto; min-width: 120px; min-height: 36px; padding: 7px 9px; }
.compact-filter button, .filter-form button, .inline-form button { min-height: 36px; padding: 7px 12px; }

.address-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.merchant-content .merchant-remittance-form,
.merchant-content .merchant-review-form { padding: var(--portal-panel-gutter); column-gap: 22px; row-gap: 19px; }
.merchant-content .merchant-remittance-form .dinpay-form-section,
.merchant-content .merchant-review-form .dinpay-form-section { margin-top: 4px; padding: 12px 2px 8px; border-bottom-color: #d9ced0; color: #6f1924 !important; font-size: 11px !important; font-weight: 800; }
.merchant-content .merchant-remittance-form .dinpay-form-section:first-child,
.merchant-content .merchant-review-form .dinpay-form-section:first-child { margin-top: 0; padding-top: 2px; }
.merchant-content .merchant-remittance-form label,
.merchant-content .merchant-review-form label { padding: 0 2px; }
.merchant-content .merchant-remittance-form .dinpay-form-actions,
.merchant-content .merchant-review-form .dinpay-form-actions { padding-top: 8px; border-top: 1px solid #eee7e8; }
.merchant-content .dinpay-fx-converter-card,
.merchant-content .dinpay-fx-leg { border-radius: 8px !important; }
.merchant-content .payment-channel-selector,
.merchant-content .payment-channel-badge { display: none !important; }
.address-form .wide { grid-column: 1 / -1; }
.dinpay-form-section { grid-column: 1 / -1; padding: 9px 0 4px; border-bottom: 1px solid var(--line); color: var(--green-800) !important; font-size: 10px !important; }
.dinpay-form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: end; gap: 10px; }
.dinpay-form-actions label { min-width: 230px; }
.dinpay-field-label { display: inline-flex; align-items: center; gap: 6px; }
.dinpay-required::after { content: "*"; color: var(--danger); }
.dinpay-optional { color: var(--muted); font-size: 9px; font-weight: 500; }
.dinpay-field-note, .dinpay-swift-text-note { color: var(--muted); font-size: 10px; line-height: 1.5; }
.dinpay-swift-text-note { grid-column: 1 / -1; }
.dinpay-inline-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.dinpay-inline-action button { min-width: 110px; }
.dinpay-bank-result { grid-column: 1 / -1; padding: 12px; border-left: 3px solid var(--gold-500); background: var(--gold-100); }
.dinpay-bank-result strong, .dinpay-bank-result span { display: block; }
.dinpay-bank-result span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.dinpay-field-hidden, [hidden] { display: none !important; }
.dinpay-advanced { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 5px; padding: 12px; }
.dinpay-advanced summary { cursor: pointer; color: var(--green-800); font-weight: 700; }
.dinpay-advanced-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; padding-top: 14px; }
.dinpay-country-combobox { position: relative; }
.dinpay-country-list { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; max-height: 280px; border: 1px solid var(--line); border-radius: 5px; background: var(--white); box-shadow: var(--shadow); overflow-y: auto; }
.dinpay-country-option { display: block; width: 100%; min-height: 40px; border: 0; border-bottom: 1px solid #edf1ef; border-radius: 0; background: var(--white); color: var(--ink); text-align: left; }
.dinpay-country-option:hover, .dinpay-country-option.active { background: var(--green-100); color: var(--green-950); }
.dinpay-file-input { padding: 7px; }

.dinpay-row-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-width: 150px; }
.dinpay-profile-copy { display: flex; align-items: center; gap: 6px; }
.dinpay-profile-copy select { width: 190px; min-height: 32px; padding: 5px 7px; font-size: 10px; }
.dinpay-profile-copy button { min-height: 32px; padding: 5px 9px; font-size: 10px; }
.dinpay-inline-sync { display: flex; align-items: center; gap: 7px; }
.dinpay-inline-sync button, .nav-link { min-height: 32px; padding: 6px 9px; border: 1px solid #d1c4c6; border-radius: 4px; background: var(--white); color: var(--green-800); font-size: 10px; font-weight: 700; }
.dinpay-inline-sync button:hover, .nav-link:hover { border-color: var(--green-800); background: var(--green-100); color: var(--green-950); }
.payment-channel-selector { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; grid-column: 1 / -1; }
.payment-channel-selector label { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 12px; border: 1px solid var(--line); border-radius: 5px; }
.payment-channel-selector input { width: 18px; min-height: 18px; }

.kv { display: grid; grid-template-columns: 180px minmax(0,1fr); }
.kv > div { min-width: 0; padding: 11px 13px; border-bottom: 1px solid #e8eeeb; overflow-wrap: anywhere; }
.kv > div:nth-child(odd) { color: var(--muted); font-size: 11px; }
.dinpay-timeline { margin: 0; padding: 0; list-style: none; }
.dinpay-timeline li { display: grid; grid-template-columns: 170px minmax(0,1fr); gap: 14px; padding: 12px 17px; border-bottom: 1px solid var(--line); }
.dinpay-timeline time { color: var(--muted); font-size: 10px; }
.dinpay-timeline strong, .dinpay-timeline span { display: block; }
.dinpay-timeline span { margin-top: 4px; color: var(--muted); font-size: 10px; }

.remittance-receipt { border: 1px solid var(--line); border-radius: 6px; background: var(--white); overflow: hidden; }
.remittance-receipt-head, .remittance-receipt-summary { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 20px; }
.remittance-receipt-head { background: #26080c; color: var(--white); }
.remittance-receipt-brand { display: flex; align-items: center; gap: 12px; }
.remittance-receipt-brand img { width: 48px; height: 48px; border: 1px solid rgba(255,255,255,0.14); border-radius: 3px; object-fit: cover; }
.remittance-receipt-brand strong, .remittance-receipt-brand span { display: block; }
.remittance-receipt-brand span { margin-top: 4px; color: #d4bec2; font-size: 10px; }
.remittance-receipt-channel img { max-width: 100px; max-height: 38px; object-fit: contain; }
.remittance-receipt-summary { border-bottom: 1px solid var(--line); }
.remittance-receipt-summary h2 { margin: 0; font-size: 20px; }
.remittance-receipt-summary p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.remittance-receipt-amount { text-align: right; }
.remittance-receipt-amount strong { display: block; margin-bottom: 7px; font-size: 22px; }
.remittance-receipt-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; padding: 18px; }
.remittance-receipt-section { border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.remittance-receipt-section h3 { margin: 0; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--soft); font-size: 12px; }
.remittance-receipt-row { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 10px; padding: 9px 12px; border-bottom: 1px solid #edf1ef; }
.remittance-receipt-row span { color: var(--muted); font-size: 10px; }
.remittance-receipt-wide { grid-column: 1 / -1; }
.remittance-receipt-note { margin: 0; padding: 0 18px 18px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.receipt-toolbar { display: flex; justify-content: flex-end; margin-bottom: 10px; }

.portal-recovery-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 30px 18px;
  background:
    linear-gradient(135deg, rgba(224, 69, 82, 0.10), transparent 34%),
    linear-gradient(315deg, rgba(53, 172, 156, 0.10), transparent 38%),
    #f5f2f3;
}
.portal-recovery-shell { width: min(620px, 100%); border: 1px solid #ddd3d5; border-radius: 8px; background: #fff; box-shadow: 0 24px 64px rgba(47, 17, 25, 0.16); overflow: hidden; }
.portal-recovery-shell > header { display: flex; align-items: center; gap: 13px; padding: 22px 28px; background: #24070b; color: #fff; }
.portal-recovery-shell > header img { width: 48px; height: 48px; border: 1px solid rgba(255,255,255,0.24); border-radius: 6px; object-fit: cover; }
.portal-recovery-shell > header strong, .portal-recovery-shell > header span { display: block; }
.portal-recovery-shell > header strong { font-family: Georgia, "Times New Roman", serif; font-size: 20px; }
.portal-recovery-shell > header span { margin-top: 3px; color: #dfc56e; font-size: 9px; text-transform: uppercase; }
.portal-recovery-panel { padding: 30px 34px 34px; }
.portal-recovery-panel h1 { margin: 10px 0 24px; font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-weight: 600; }
.portal-recovery-context { margin-bottom: 22px; padding: 16px 18px; border: 1px solid var(--line); border-left: 4px solid var(--gold-500); border-radius: 6px; background: #fbf9fa; }
.portal-recovery-context span, .portal-recovery-context strong, .portal-recovery-context p, .portal-recovery-context small { display: block; }
.portal-recovery-context span { color: var(--gold-600); font-size: 9px; font-weight: 900; }
.portal-recovery-context strong { margin-top: 5px; font-size: 16px; }
.portal-recovery-context p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.portal-recovery-context small { margin-top: 9px; color: #8a5a08; font-size: 9px; }
.portal-recovery-loading, .portal-recovery-complete { padding: 24px; border: 1px solid var(--line); border-radius: 6px; text-align: center; }
.portal-recovery-loading strong, .portal-recovery-complete strong { display: block; font-size: 17px; }
.portal-recovery-loading p, .portal-recovery-complete p { margin: 9px 0 20px; color: var(--muted); line-height: 1.7; }
.portal-recovery-shell > footer { padding: 15px 28px; border-top: 1px solid var(--line); background: #faf8f9; color: var(--muted); font-size: 9px; text-align: center; }

@media (max-width: 1120px) {
  .portal-metrics, .wallet-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .portal-login-main { width: min(980px, calc(100% - 36px)); grid-template-columns: minmax(380px,1fr) minmax(370px,0.9fr); }
  .portal-login-brand { padding: 34px; }
  .portal-login-panel { padding: 48px 42px; }
}

@media (max-width: 820px) {
  .portal-security-grid { grid-template-columns:1fr; }
  .portal-login-main { grid-template-columns: 1fr; width: min(560px, calc(100% - 28px)); min-height: 0; margin: 18px auto; }
  .portal-login-brand { min-height: 390px; padding: 28px; }
  .portal-login-lockup img { width: 48px; height: 48px; margin: 0; }
  .portal-login-lockup strong { font-size: 19px; }
  .portal-login-story { padding: 38px 0 28px; }
  .portal-login-prism { margin: 14px 0 16px; font-size: 36px; }
  .portal-login-panel { padding: 34px 30px; }
  .portal-login-footer { flex-wrap: wrap; padding-bottom: 18px; }
  .portal-layout { display: block; }
  .portal-sidebar { position: static; width: 100%; height: auto; padding: 14px; }
  .portal-brand { padding-bottom: 13px; }
  .portal-merchant, .portal-sidebar-foot { display: none; }
  .portal-sidebar nav { display: flex; gap: 5px; padding-bottom: 2px; overflow-x: auto; }
  .portal-sidebar nav a { flex: 0 0 auto; min-width: 112px; border-left: 0; border-bottom: 3px solid transparent; }
  .portal-sidebar nav a.active { border-left: 0; border-bottom-color: var(--gold-500); }
  .portal-topbar { padding: 9px 15px; }
  .portal-main { padding: 22px 20px 44px; }
  .portal-section > header, .panel-head { min-height: 64px; padding: 15px 20px; }
  .panel-body { padding: 20px; }
  .merchant-content .panel > .address-form,
  .merchant-content .panel > .filter-form,
  .merchant-content .panel > .inline-form { padding: 20px; }
  .merchant-content .panel > .address-form { gap: 18px; }
  .merchant-content .merchant-remittance-form,
  .merchant-content .merchant-review-form { padding: 20px; row-gap: 18px; }
  .portal-page-head { align-items: flex-start; }
  .portal-page-head h1 { font-size: 24px; }
  .portal-secure-mark { display: none; }
  .address-form, .payment-channel-selector, .dinpay-advanced-grid, .remittance-receipt-grid { grid-template-columns: 1fr; }
  .address-form .wide, .remittance-receipt-wide { grid-column: 1; }
  .dinpay-form-actions { align-items: stretch; flex-direction: column; }
  .dinpay-form-actions label { min-width: 0; }
  .kv { grid-template-columns: 1fr; }
  .kv > div:nth-child(odd) { padding-bottom: 3px; border-bottom: 0; }
  .kv > div:nth-child(even) { padding-top: 3px; }
  .dinpay-timeline li { grid-template-columns: 1fr; gap: 4px; }
  .portal-review-boundary { grid-template-columns: 1fr; gap: 7px; }
}

@media (max-width: 560px) {
  .portal-recovery-body { padding: 12px; }
  .portal-recovery-panel { padding: 25px 21px 28px; }
  .portal-recovery-shell > header { padding: 19px 21px; }
  .portal-login-main { width: calc(100% - 20px); margin: 10px auto; }
  .portal-login-brand { min-height: 340px; padding: 24px 22px; }
  .portal-login-prism { font-size: 31px; }
  .portal-login-story p { font-size: 12px; }
  .portal-login-capabilities span { padding: 12px 7px; font-size: 9px; }
  .portal-login-capabilities span:first-child { padding-left: 0; }
  .portal-login-panel { padding: 28px 22px; }
  .portal-login-panel h2 { font-size: 29px; }
  .portal-login-assurance { gap: 11px; }
  .portal-topbar > div:first-child { display: none; }
  .portal-topbar { justify-content: flex-end; }
  .portal-main { padding: 20px 16px 38px; }
  .portal-section > header, .panel-head { padding: 15px 18px; }
  .panel-body { padding: 18px; }
  .merchant-content .panel > .address-form,
  .merchant-content .panel > .filter-form,
  .merchant-content .panel > .inline-form { padding: 18px; }
  .merchant-content .merchant-remittance-form,
  .merchant-content .merchant-review-form { padding: 18px; }
  .portal-page-head { display: block; }
  .portal-metrics, .wallet-grid { grid-template-columns: 1fr; }
  .portal-section > header, .panel-head { align-items: flex-start; flex-direction: column; }
  .portal-section-actions { display: flex !important; width: 100%; justify-content: space-between; }
  .compact-filter, .filter-form, .inline-form { width: 100%; align-items: stretch; flex-direction: column; }
  .compact-filter input, .compact-filter select, .filter-form input, .filter-form select, .inline-form input, .inline-form select { width: 100%; }
  .dinpay-inline-action { grid-template-columns: 1fr; }
  .remittance-receipt-head, .remittance-receipt-summary { align-items: flex-start; flex-direction: column; }
  .remittance-receipt-amount { text-align: left; }
  .remittance-receipt-row { grid-template-columns: 1fr; gap: 3px; }
}
