.hidden { display: none !important; }
textarea { width: 100%; border: 2px solid #cbd3cf; border-radius: 14px; padding: 14px 16px; background: #fff; color: var(--text); font-size: 1.02rem; font-family: inherit; resize: vertical; }
textarea:focus { outline: 4px solid rgba(23,107,69,.17); border-color: var(--green); }
button:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }
code { font-size: .84em; word-break: break-all; }

.portal-page { min-height: 100vh; display: grid; place-items: center; padding: 36px 18px; background: radial-gradient(circle at 50% 0%, #fff 0, var(--bg) 55%); }
.portal-shell { width: min(900px, 100%); }
.portal-heading { text-align: center; margin-bottom: 30px; }
.portal-heading h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -.05em; margin: 8px 0; }
.portal-heading p { margin: 0; color: var(--muted); }
.portal-kicker { color: var(--green); font-weight: 900; }
.portal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.portal-card { min-height: 290px; padding: 30px; border: 1px solid var(--line); border-radius: 28px; background: #fff; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: flex-start; transition: transform .15s ease, box-shadow .15s ease; }
.portal-card:hover { transform: translateY(-3px); box-shadow: 0 15px 36px rgba(24,42,34,.12); }
.portal-card strong { font-size: 1.7rem; margin: 28px 0 6px; }
.portal-card > span:not(.portal-icon) { color: var(--muted); }
.portal-card b { margin-top: auto; color: var(--green); }
.portal-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; font-weight: 900; font-size: 1.45rem; }
.stock-card .portal-icon { background: var(--blue-soft); color: var(--blue); }
.fund-card .portal-icon { background: var(--green-soft); color: var(--green); }

.fund-page { padding-bottom: 112px; }
.fund-topbar { min-height: 68px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 max(24px, calc((100vw - 980px)/2)); position: sticky; top: 0; z-index: 30; }
.fund-brand { font-size: 1.15rem; font-weight: 900; }
.fund-top-actions { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: .9rem; }
.fund-top-actions a { color: var(--green); font-weight: 800; }
.fund-top-actions form { margin: 0; }
.fund-bottom-nav { width: min(680px, calc(100% - 24px)); min-height: 66px; position: fixed; z-index: 40; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 12px 30px rgba(20,39,30,.16); overflow: hidden; backdrop-filter: blur(14px); }
.fund-bottom-nav a { flex: 1; display: grid; place-items: center; min-width: 0; color: var(--muted); font-weight: 800; }
.fund-bottom-nav a.active { color: var(--green); background: var(--green-soft); }
.fund-mark { background: #155f46; }
.fund-login-card .back-link { display: block; text-align: left; margin-bottom: 18px; }

.fund-hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 22px; }
.fund-hero-row h1, .fund-customer-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0; letter-spacing: -.04em; }
.fund-compact-button { min-height: 50px; padding: 12px 18px; display: grid; place-items: center; }
.fund-stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.fund-stat-card { min-height: 122px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 18px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 4px 14px rgba(24,42,34,.035); }
.fund-stat-card span { color: var(--muted); font-size: .88rem; }
.fund-stat-card strong { font-size: 1.35rem; overflow-wrap: anywhere; }
.fund-stat-card.positive { background: var(--green-soft); }
.fund-stat-card.negative { background: #fff2f0; }
.fund-stat-card.cashback { background: var(--orange-soft); }
.fund-quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.fund-quick-grid a { padding: 22px; min-height: 112px; border-radius: 18px; background: #fff; border: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; }
.fund-quick-grid strong { font-size: 1.15rem; }
.fund-quick-grid span { color: var(--muted); margin-top: 5px; }

.fund-search, .fund-filter-bar { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; margin-bottom: 18px; }
.fund-search .primary-button, .fund-search .secondary-button, .fund-filter-bar .primary-button { min-height: 58px; }
.fund-filter-bar { grid-template-columns: 1fr minmax(130px,200px) auto; }
.fund-customer-list { display: grid; gap: 12px; }
.fund-customer-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.fund-customer-card:hover { border-color: #9ebbad; }
.fund-customer-card > div { display: flex; flex-direction: column; }
.fund-customer-card > div:last-child { text-align: right; }
.fund-customer-card strong { font-size: 1.2rem; }
.fund-customer-card span, .fund-customer-card small { color: var(--muted); }

.fund-customer-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.fund-customer-head p { margin: 8px 0 0; color: var(--muted); }
.fund-balance-card { border-radius: 24px; background: #143f31; color: #fff; padding: 30px; box-shadow: var(--shadow); }
.fund-balance-card > span { opacity: .78; }
.fund-balance-card > strong { display: block; margin: 4px 0 24px; font-size: clamp(2.4rem, 7vw, 4.4rem); line-height: 1.05; letter-spacing: -.04em; }
.fund-summary-inline { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.fund-summary-inline > div { display: flex; flex-direction: column; padding: 12px 14px; background: rgba(255,255,255,.09); border-radius: 14px; }
.fund-summary-inline span { font-size: .8rem; opacity: .72; }
.fund-summary-inline b { margin-top: 2px; }
.fund-action-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 16px 0; }
.fund-action-grid.two { grid-template-columns: 1fr 1fr; }
.fund-action { min-height: 110px; border-radius: 18px; padding: 18px; display: flex; flex-direction: column; justify-content: center; border: 1px solid transparent; }
.fund-action strong { font-size: 1.25rem; }
.fund-action span { margin-top: 3px; font-size: .84rem; }
.fund-action.topup { background: var(--green-soft); color: #0f5d3a; }
.fund-action.consume { background: #fff0ee; color: #8b2929; }
.fund-action.cashback { background: var(--orange-soft); color: #854219; }

.fund-timeline-item { display: grid; grid-template-columns: 48px 1fr; gap: 15px; padding: 20px 0; border-top: 1px solid var(--line); }
.fund-timeline-item:first-of-type { border-top: 0; }
.fund-timeline-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-weight: 900; }
.fund-timeline-icon.topup { background: var(--green-soft); color: var(--green); }
.fund-timeline-icon.consumption { background: var(--red-soft); color: var(--red); }
.fund-timeline-icon.reversal { background: #eceeee; color: #545c58; }
.fund-timeline-icon.cashback { background: var(--orange-soft); color: var(--orange); }
.fund-timeline-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.fund-timeline-title strong { font-size: 1.08rem; }
.fund-timeline-title b { font-size: 1.14rem; }
.fund-timeline-title b.topup { color: var(--green); }
.fund-timeline-title b.consumption { color: var(--red); }
.fund-timeline-title b.cashback { color: var(--orange); }
.fund-meta { color: var(--muted); font-size: .83rem; margin-top: 3px; overflow-wrap: anywhere; }
.fund-description { font-weight: 800; margin-top: 7px; }
.fund-note { margin-top: 6px; color: #47524d; }
.fund-reversal-reason { margin-top: 6px; color: var(--red); font-weight: 700; }
.fund-evidence-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.fund-evidence-links a { color: var(--blue); font-weight: 800; font-size: .85rem; padding: 5px 9px; background: var(--blue-soft); border-radius: 8px; }
.fund-badge { display: inline-block; margin-top: 8px; padding: 4px 9px; border-radius: 999px; font-size: .78rem; font-weight: 800; }
.fund-badge.reversed { background: #eceeee; color: #555; }
.fund-reverse-box { margin-top: 10px; }
.fund-reverse-box summary { cursor: pointer; color: var(--red); font-size: .84rem; font-weight: 800; }
.fund-reverse-box form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 9px; }
.fund-reverse-box input { min-height: 48px; }
.fund-reverse-box .danger-button { min-height: 48px; padding: 8px 14px; }

.fund-proof-box { margin-top: 8px; padding: 18px; border: 2px dashed #bdc9c3; border-radius: 16px; background: #fafcfb; display: flex; flex-direction: column; gap: 10px; }
.fund-proof-box h3 { margin: 0; }
.fund-proof-box p { margin: -5px 0 5px; color: var(--muted); font-size: .88rem; }
.fund-proof-box input[type=file], .stack-form input[type=file] { min-height: 52px; padding: 11px; }

.fund-ledger-list { padding-top: 8px; padding-bottom: 8px; }
.fund-ledger-row { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 16px 4px; border-top: 1px solid var(--line); }
.fund-ledger-row:first-child { border-top: 0; }
.fund-ledger-main, .fund-ledger-value { display: flex; flex-direction: column; }
.fund-ledger-main { min-width: 0; }
.fund-ledger-main span, .fund-ledger-main small, .fund-ledger-value span { color: var(--muted); font-size: .82rem; }
.fund-ledger-main small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 560px; }
.fund-ledger-value { text-align: right; flex: 0 0 auto; }
.fund-ledger-value.topup strong { color: var(--green); }
.fund-ledger-value.consumption strong { color: var(--red); }
.fund-ledger-value.cashback strong { color: var(--orange); }

.fund-inline-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: 14px 0; }
.fund-inline-form.four { grid-template-columns: 1fr 1fr 1fr 150px auto; }
.fund-inline-form .primary-button, .fund-settings-actions .secondary-button { min-height: 58px; }
.fund-settings-list { border-top: 1px solid var(--line); margin-top: 16px; }
.fund-settings-row { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.fund-settings-row > div:first-child { display: flex; flex-direction: column; }
.fund-settings-row span { color: var(--muted); font-size: .84rem; }
.fund-settings-actions { display: flex; align-items: center; gap: 8px; }
.fund-settings-actions form { display: flex; gap: 8px; }
.fund-settings-actions input { min-height: 50px; max-width: 180px; }
.fund-settings-actions .secondary-button { min-height: 50px; padding: 8px 13px; }
.fund-channel-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.fund-channel-tags form { margin: 0; }
.fund-channel-tag { border: 1px solid #a9c8b8; background: var(--green-soft); color: #0d5535; border-radius: 999px; padding: 8px 13px; cursor: pointer; font-weight: 800; }
.fund-channel-tag.disabled { background: #eee; color: #777; border-color: #ddd; }
.fund-audit-list > div { display: flex; flex-direction: column; padding: 11px 0; border-top: 1px solid var(--line); }
.fund-audit-list > div:first-child { border-top: 0; }
.fund-audit-list span { color: var(--muted); font-size: .82rem; }

@media (max-width: 760px) {
  .portal-grid { grid-template-columns: 1fr; }
  .portal-card { min-height: 220px; }
  .fund-topbar { padding: 0 14px; }
  .fund-top-actions > span, .fund-top-actions > a { display: none; }
  .fund-stat-grid { grid-template-columns: 1fr 1fr; }
  .fund-summary-inline { grid-template-columns: 1fr; }
  .fund-action-grid, .fund-action-grid.two { grid-template-columns: 1fr; }
  .fund-search, .fund-filter-bar { grid-template-columns: 1fr; }
  .fund-customer-card { align-items: flex-start; }
  .fund-hero-row, .fund-customer-head { align-items: flex-start; flex-direction: column; }
  .fund-inline-form.four { grid-template-columns: 1fr; }
  .fund-settings-row { align-items: flex-start; flex-direction: column; }
  .fund-settings-actions { width: 100%; flex-wrap: wrap; }
  .fund-settings-actions form:first-child { flex: 1 1 100%; }
  .fund-settings-actions input { max-width: none; flex: 1; }
}

@media (max-width: 460px) {
  .portal-page { padding: 22px 12px; }
  .portal-heading { text-align: left; }
  .portal-card { padding: 24px; }
  .fund-stat-grid { grid-template-columns: 1fr; }
  .fund-quick-grid { grid-template-columns: 1fr; }
  .fund-customer-card { flex-direction: column; gap: 8px; }
  .fund-customer-card > div:last-child { text-align: left; }
  .fund-timeline-item { grid-template-columns: 40px 1fr; gap: 10px; }
  .fund-timeline-icon { width: 38px; height: 38px; }
  .fund-timeline-title { align-items: flex-start; flex-direction: column; gap: 2px; }
  .fund-reverse-box form { grid-template-columns: 1fr; }
  .fund-ledger-row { align-items: flex-start; }
  .fund-ledger-value { min-width: 88px; }
}

/* Hotel ledger v2 */
.debt-text { color: #b42318 !important; }
.fund-balance-card.has-debt { background: #7c2d2d; }
.fund-stat-grid.hotel-stats { grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); }
.fund-stat-card.debt { background: #fff0ee; color: #8b2929; }
.fund-summary-inline.hotel-summary { grid-template-columns: repeat(3,1fr); }
.hotel-form-shell { width: min(860px,100%); }
.hotel-form-section { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.hotel-form-section h2 { margin: 0 0 14px; font-size: 1.1rem; }
.hotel-form-grid { display: grid; gap: 12px; }
.hotel-form-grid.two { grid-template-columns: 1fr 1fr; }
.hotel-form-grid.three { grid-template-columns: repeat(3,1fr); }
.hotel-choice-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.hotel-choice { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; background: #fafcfb; }
.hotel-choice input { min-height: 0; width: auto; margin-top: 4px; }
.hotel-choice span { display: flex; flex-direction: column; gap: 3px; }
.hotel-choice small { color: var(--muted); line-height: 1.35; }
.hotel-stay-list { display: grid; gap: 10px; }
.hotel-stay-card { padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.hotel-stay-card.is-reversed { opacity: .6; background: #f5f5f5; }
.hotel-stay-top { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.hotel-stay-top > div { display: flex; flex-direction: column; }
.hotel-stay-top strong { font-size: 1.05rem; }
.hotel-stay-top span { color: var(--muted); font-size: .84rem; margin-top: 3px; }
.hotel-stay-top b { font-size: 1.15rem; white-space: nowrap; }
.hotel-stay-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; color: var(--muted); font-size: .84rem; }
@media (max-width: 760px) {
  .fund-summary-inline.hotel-summary { grid-template-columns: 1fr 1fr; }
  .hotel-form-grid.two,.hotel-form-grid.three,.hotel-choice-grid { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .fund-summary-inline.hotel-summary { grid-template-columns: 1fr; }
  .hotel-stay-top { flex-direction: column; gap: 6px; }
}
