.nav-actions,
.head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-actions form,
.head-actions form { margin: 0; }
.account-nav { display: flex; align-items: center; gap: 4px; padding: 5px; background: #f4f6f2; border: 1px solid var(--line); border-radius: 13px; }
.user-name { display: flex; align-items: center; gap: 9px; color: var(--ink); line-height: 1.2; text-decoration: none; padding: 3px 8px 3px 3px; border-radius: 9px; transition: background .15s ease; }
.user-name:hover { background: #fff; }
.user-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--green); color: #fff; font-size: 13px; font-weight: 700; box-shadow: 0 2px 5px rgba(28,107,72,.18); }
.user-copy { display: grid; font-size: 12px; }
.user-name small { color: var(--muted); font-size: 10px; margin-top: 2px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.nav-divider { width: 1px; height: 24px; background: var(--line); margin: 0 2px; }
.logout,.admin-link { display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: 600 12px inherit; cursor: pointer; padding: 9px 10px; text-decoration: none; transition: background .15s ease,color .15s ease; }
.logout:hover { background: #fbe8e6; color: var(--red); }
.admin-link:hover { background: #e4eee8; color: var(--green); }
.nav-icon { font-size: 15px; line-height: 1; }
.new-loan-button { white-space: nowrap; }
.auth-shell { min-height: calc(100vh - 190px); display: grid; place-items: center; }
.auth-card { width: min(440px, 100%); padding: 34px; }
.auth-card h1 { font-size: 30px; letter-spacing: -1px; margin: 8px 0; }
.auth-card .muted { margin-bottom: 26px; }
.auth-mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--green); color: #fff; font-weight: 700; margin-bottom: 24px; }
.auth-card .stack { margin-top: 20px; }
.account-shell { max-width: 620px; margin: 0 auto; }
.admin-layout { display: grid; grid-template-columns: minmax(300px, .85fr) minmax(420px, 1.15fr); gap: 22px; align-items: start; }
.admin-person { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.admin-person:first-of-type { border-top: 0; }
.admin-person strong, .admin-person small { display: block; }
.admin-person small { color: var(--muted); margin-top: 3px; }
.admin-person span { color: var(--muted); font-size: 12px; }
.forgot-link { color: var(--green); text-align: center; font-size: 13px; font-weight: 600; text-decoration: none; }
.info-note { background: #edf5f0; border-radius: 10px; color: var(--green-dark); font-size: 13px; line-height: 1.5; padding: 13px; margin: 0; }
.provider-heading,.provider-transaction,.tx-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sandbox-badge { padding: 5px 8px; border-radius: 20px; background: #fff1d8; color: var(--amber); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.sandbox-badge.production { background: #fbe8e6; color: var(--red); }
.provider-copy { font-size: 13px; margin: 10px 0 18px; }
.provider-actions { display: grid; gap: 14px; }
.provider-actions form:first-child .button { width: 100%; }
.provider-history { margin-top: 20px; border-top: 1px solid var(--line); }
.provider-transaction { padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 12px; align-items: flex-start; }
.provider-transaction small { display: block; color: var(--muted); margin-top: 4px; }
.sync-button { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--green); font: 700 19px/1 inherit; cursor: pointer; padding: 0; transition: background .15s,border-color .15s; }
.sync-button:hover { background: #edf5f0; border-color: #b8d5c6; }
.sync-button:disabled { cursor: wait; opacity: .65; }
.sync-button.is-syncing span { animation: sync-spin .7s linear infinite; }
.receipt-link { color: var(--green); font-size: 11px; font-weight: 700; text-decoration: none; }
.receipt-link:hover { text-decoration: underline; }
@keyframes sync-spin { to { transform: rotate(360deg); } }

.confirm-modal { width: min(440px,calc(100% - 32px)); border: 0; border-radius: 18px; padding: 30px; color: var(--ink); box-shadow: 0 24px 70px rgba(17,35,27,.24); text-align: center; }
.confirm-modal::backdrop { background: rgba(12,24,18,.58); backdrop-filter: blur(3px); }
.confirm-modal[open] { animation: modal-in .18s ease-out; }
.confirm-modal .confirm-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 17px; border-radius: 50%; background: #fff1d8; color: var(--amber); font-size: 24px; font-weight: 800; }
.confirm-modal h2 { margin: 4px 0 12px; font-size: 26px; }
.confirm-modal .muted { line-height: 1.6; margin: 0; }
.confirm-modal .muted strong { color: var(--ink); }
.contact-validation { display: flex; align-items: flex-start; gap: 11px; margin-top: 20px; padding: 13px; border-radius: 11px; background: #f3f5f2; text-align: left; }
.contact-validation .validation-dot { flex: 0 0 auto; width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; background: var(--amber); }
.contact-validation strong,.contact-validation small { display: block; }
.contact-validation strong { font-size: 12px; }
.contact-validation small { color: var(--muted); font-size: 10px; margin-top: 4px; line-height: 1.4; }
.contact-validation.is-loading .validation-dot { animation: validation-pulse .8s ease-in-out infinite alternate; }
.contact-validation.is-valid { background: #e8f4ed; }.contact-validation.is-valid .validation-dot { background: var(--green); }
.contact-validation.is-invalid { background: #fbe8e6; }.contact-validation.is-invalid .validation-dot { background: var(--red); }
.pin-entry { margin-top: 16px; text-align: left; }.pin-entry input { text-align: center; font-size: 20px; letter-spacing: 8px; }
.pin-warning { margin: 16px 0 0; padding: 11px; border-radius: 9px; background: #fff1d8; color: var(--amber); font-size: 11px; }.pin-warning a { color: inherit; font-weight: 700; }
.confirm-actions .button:disabled { cursor: not-allowed; opacity: .5; }
@keyframes validation-pulse { to { opacity: .3; transform: scale(.75); } }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.receipt-page { background: #f3eee9; color: #25352d; }
.receipt-shell { min-height: 100vh; display: grid; justify-items: center; align-content: center; gap: 16px; padding: 32px 16px; }
.receipt-actions { width: min(720px,100%); display: flex; justify-content: flex-end; gap: 9px; }
.receipt-card { position: relative; width: min(720px,100%); min-height: 880px; background: #fffdfb; border: 1px solid #eadfd8; border-radius: 24px; box-shadow: 0 24px 70px rgba(76,54,42,.13); overflow: hidden; isolation: isolate; }
.receipt-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 8px; background: linear-gradient(90deg,#1c6b48 0 58%,#d98b65 58%); }
.receipt-bloom { position: absolute; border-radius: 50%; z-index: -1; filter: blur(1px); }
.bloom-one { width: 240px; height: 240px; right: -105px; top: 115px; background: #f7e5dc; }
.bloom-two { width: 170px; height: 170px; left: -95px; bottom: 95px; background: #e4f0e8; }
.receipt-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 42px 52px 30px; }
.receipt-brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.receipt-brand>span { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: var(--green); color: #fff; font: 700 16px Georgia,serif; }
.receipt-brand strong,.receipt-brand small { display: block; }
.receipt-brand strong { font: 700 20px Georgia,serif; }
.receipt-brand small { color: #89938d; font-size: 9px; margin-top: 4px; }
.receipt-title { display: grid; text-align: right; color: #a77760; }
.receipt-title small { font-size: 8px; letter-spacing: 3px; }
.receipt-title strong { font: 500 26px/1.1 Georgia,serif; letter-spacing: 2px; }
.receipt-hero { padding: 46px 52px 40px; text-align: center; }
.receipt-check { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 20px; border: 1px solid #bcdac8; border-radius: 50%; background: #e8f4ed; color: var(--green); font-size: 28px; font-weight: 800; box-shadow: 0 0 0 8px rgba(232,244,237,.65); }
.receipt-kicker { color: #77837c; font-size: 12px; letter-spacing: .4px; margin: 0 0 8px; }
.receipt-hero h1 { margin: 0 0 13px; color: #21352a; font: 600 48px/1.15 Georgia,serif; letter-spacing: -1px; }
.receipt-hero h1 small { color: #9a7563; font: 700 12px/1 inherit; letter-spacing: 1.5px; }
.receipt-success { display: inline-block; padding: 6px 13px; border-radius: 20px; background: #e6f3eb; color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
.receipt-summary { display: grid; grid-template-columns: 1fr 1fr; margin: 0 52px; border: solid #eadfd8; border-width: 1px 0; }
.receipt-summary>div { padding: 22px 0; }
.receipt-summary>div+div { padding-left: 32px; border-left: 1px solid #eadfd8; }
.receipt-summary span,.receipt-reference span,.receipt-signoff span { display: block; color: #9a8f88; font-size: 9px; letter-spacing: .8px; text-transform: uppercase; margin-bottom: 7px; }
.receipt-summary strong,.receipt-summary small { display: block; }
.receipt-summary strong { font: 600 15px Georgia,serif; }
.receipt-summary small { color: #7d8982; font-size: 10px; margin-top: 5px; }
.receipt-reference { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 36px; padding: 30px 52px; }
.receipt-reference strong { display: block; font-size: 11px; overflow-wrap: anywhere; }
.receipt-signoff { display: flex; align-items: end; justify-content: space-between; margin: 8px 52px 0; padding: 24px 0; border-top: 1px dashed #d9cbc3; }
.receipt-signoff strong { font: 600 14px Georgia,serif; }
.signature-mark { color: #b8785c; font: italic 28px "Brush Script MT","Segoe Script",cursive; transform: rotate(-5deg); }
@media(max-width:600px){.receipt-card{min-height:0}.receipt-header,.receipt-hero{padding-left:26px;padding-right:26px}.receipt-summary,.receipt-signoff{margin-left:26px;margin-right:26px}.receipt-reference{padding-left:26px;padding-right:26px}.receipt-summary{grid-template-columns:1fr}.receipt-summary>div+div{padding-left:0;border-left:0;border-top:1px solid #eadfd8}.receipt-reference{grid-template-columns:1fr}.receipt-title{display:none}.receipt-hero h1{font-size:38px}}
@page { size: A4; margin: 12mm; }
@media print { * { print-color-adjust: exact!important; -webkit-print-color-adjust: exact!important; }.receipt-page { background: #fff; }.receipt-shell { display: block; padding: 0; }.receipt-actions { display: none; }.receipt-card { width: 100%; min-height: 270mm; border: 0; border-radius: 0; box-shadow: none; } }

.dashboard-metrics article { position: relative; }
.saved-client-preview { padding: 15px; border: 1px solid #cfe0d4; border-radius: 11px; background: #edf5f0; }
.saved-client-preview span,.saved-client-preview strong,.saved-client-preview small { display: block; }
.saved-client-preview span { color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.saved-client-preview strong { margin-top: 5px; }.saved-client-preview small { color: var(--muted); margin-top: 4px; }
.client-picker { position: relative; margin-top: 7px; }
.client-picker>input[type="search"] { padding-left: 42px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%2368756e' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") no-repeat 14px center; }
.client-options { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 7px); max-height: 330px; overflow-y: auto; padding: 7px; border: 1px solid #d8e0d9; border-radius: 13px; background: #fff; box-shadow: 0 18px 45px rgba(23,35,29,.16); }
.client-option { width: 100%; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 11px; border: 0; border-radius: 9px; padding: 10px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.client-options[hidden],.client-option[hidden],.client-empty[hidden] { display: none; }
.client-option:hover,.client-option:focus { background: #edf5f0; outline: 0; }
.client-option-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: #e5efe9; color: var(--green); font-size: 13px; font-weight: 800; }
.client-option strong,.client-option small { display: block; }.client-option strong { font-size: 13px; }.client-option small { color: var(--muted); margin-top: 4px; font-size: 10px; font-weight: 400; }
.client-option em { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #e2f4e9; color: var(--green); font-size: 10px; font-style: normal; }
.create-client-option { border-bottom: 1px solid #edf0ec; border-radius: 9px 9px 0 0; margin-bottom: 5px; }
.create-client-option .client-option-avatar { background: var(--green); color: #fff; font-size: 20px; font-weight: 400; }
.client-empty { color: var(--muted); padding: 18px; margin: 0; text-align: center; font-size: 11px; }
.pin-layout { max-width: 680px; }.pin-fields { margin: 20px 0; }.pin-fields input { text-align: center; font-size: 20px; letter-spacing: 8px; }
.dashboard-metrics small { display: block; color: var(--muted); font-size: 11px; margin-top: 9px; }
.trend-panel { margin-bottom: 26px; }
.trend-panel .panel-head { align-items: center; }
.trend-panel .eyebrow { margin: 0 0 5px; }
.chart-legend { display: flex; gap: 16px; color: var(--muted); font-size: 11px; }
.chart-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.disbursed-key::before { background: var(--amber); }
.collected-key::before { background: var(--green); }
.trend-chart { padding: 24px 30px 20px; }
.line-chart svg { display: block; width: 100%; height: 230px; overflow: visible; }
.chart-grid line { stroke: #e7ebe6; stroke-width: 1; }
.chart-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.disbursed-line { stroke: var(--amber); }
.collected-line { stroke: var(--green); }
.chart-point { stroke: #fff; stroke-width: 3; cursor: help; transition: r .15s; }
.chart-point:hover { r: 7; }
.disbursed-point { fill: var(--amber); }
.collected-point { fill: var(--green); }
.chart-months { display: grid; grid-template-columns: repeat(6,1fr); color: var(--muted); text-align: center; font-size: 11px; padding: 0 1px; }
.loans-panel { margin-top: 0; }

@media (max-width: 650px) {
  .user-copy,.admin-link span:last-child,.logout span:last-child { display: none; }
  .user-name { padding-right: 3px; }
  .account-nav { gap: 1px; }
  .nav-actions { gap: 7px; }
  .new-loan-button { padding: 10px 12px; }
  .head-actions { align-items: flex-start; margin-top: 18px; flex-wrap: wrap; }
  .dashboard-hero .button { margin-top: 20px; }
  .chart-legend { display: grid; gap: 5px; }
  .trend-chart { padding: 20px 12px 16px; }
  .line-chart svg { height: 190px; }
}

@media (max-width: 850px) { .admin-layout { grid-template-columns: 1fr; } }

@media (max-width: 440px) { .brand { font-size: 0; } .brand span { margin-right: 0; } .new-loan-button span { display: none; } }
