/* Wallet widget, deposit and Nokos pages. Uses the design tokens from app.css. */
/* Navbar: keep every item on one line and prevent overflow on desktop widths. */
.nav-shell { width: min(1280px, calc(100% - 32px)); gap: 16px; }
.nav-links { flex-wrap: nowrap; gap: 6px; min-width: 0; white-space: nowrap; }
.nav-links > a, .nav-links .link-button, .nav-links .cart-link, .account-name { white-space: nowrap; flex-shrink: 0; }
.nav-links > a:not(.cart-link):not(.nav-join) { padding: 8px 10px; border-radius: 8px; }
.nav-links > .wallet-widget { margin: 0 6px; }
.nav-links .account-name { margin: 0 4px; }
@media (max-width: 1100px) { .nav-links .account-name { display: none; } }
@media (max-width: 980px) { .nav-links { font-size: .86rem; } .nav-links > a:not(.cart-link):not(.nav-join) { padding: 8px 7px; } }

/* Wallet pill: balance | divider | Top Up */
.wallet-widget { display: inline-flex; flex-shrink: 0; align-items: stretch; overflow: hidden; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: 0 1px 2px rgb(16 24 40 / .06); white-space: nowrap; }
.nav-links > .wallet-widget > a { display: inline-flex; align-items: center; padding: 7px 14px; text-decoration: none; font-weight: 750; line-height: 1.2; white-space: nowrap; }
.wallet-widget__balance { color: var(--ink); font-variant-numeric: tabular-nums; }
.wallet-widget__topup { border-left: 1px solid var(--line); background: var(--brand-soft); color: var(--brand-dark); }
.nav-links > .wallet-widget > a.wallet-widget__topup:hover { background: var(--brand); color: #fff; }
.nav-links > .wallet-widget > a:focus-visible { outline-offset: -3px; }
@media (max-width: 580px) { .nav-links > .wallet-widget { margin: 0 2px; } .nav-links > .wallet-widget > a { padding: 6px 9px; } }

.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.nokos-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; padding: 18px 22px; }
.nokos-balance { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: .9rem; }
.nokos-balance strong { color: var(--ink); font-size: 1.25rem; }
.nokos-search { display: flex; flex: 1 1 320px; gap: 10px; max-width: 520px; }
.nokos-search input, .deposit-custom input { flex: 1; min-height: 46px; padding: 10px 14px; border: 1px solid #dbe1e9; border-radius: 10px; font: inherit; }

.nokos-list, .nokos-history, .nokos-order, .deposit-form, .deposit-balance { margin-bottom: 20px; padding: 8px 22px; }
.nokos-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; }
.nokos-row[hidden] { display: none; }
.nokos-row + .nokos-row, .nokos-history__row + .nokos-history__row { border-top: 1px solid #edf0f3; }
.nokos-row__info { flex: 1; min-width: 0; }
.nokos-row__info h2 { margin: 0; font-size: 1rem; }
.nokos-row__info p { margin: 2px 0 0; color: var(--muted); font-size: .8rem; }
.nokos-row__price { min-width: 96px; text-align: right; color: var(--ink); }
.nokos-empty { padding: 20px 0; color: var(--muted); text-align: center; }

.nokos-history h2, .deposit-form h2 { margin: 14px 0 6px; font-size: 1rem; }
.nokos-history__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; color: inherit; text-decoration: none; }
.nokos-history__row small { display: block; color: var(--muted); font-size: .76rem; }

.nokos-order { padding: 14px 22px 22px; }
.nokos-copy { display: inline-flex; align-items: center; gap: 12px; }
.nokos-otp { display: grid; justify-items: center; gap: 6px; margin: 18px 0; padding: 22px; border: 1px dashed #cfc9ff; border-radius: 14px; background: var(--brand-soft); text-align: center; }
.nokos-otp span { color: var(--muted); font-size: .85rem; }
.nokos-otp__code { color: var(--brand-dark); font-size: 1.9rem; letter-spacing: .12em; }
#nokos-cancel-form { display: grid; justify-items: start; gap: 8px; margin-top: 12px; }
#nokos-cancel-form[hidden] { display: none; }

.deposit-balance { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; color: var(--muted); }
.deposit-balance strong { color: var(--ink); font-size: 1.5rem; }
.deposit-presets { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 18px; }
.deposit-custom { display: grid; gap: 8px; padding-bottom: 14px; }
.deposit-custom label { color: var(--muted); font-size: .85rem; }
.deposit-qris { margin-bottom: 20px; }

.wallet-credit { color: var(--success); }
.wallet-debit { color: var(--danger); }
.status--received, .status--paid { background: #e5f7ee; color: var(--success); }
.status--waiting, .status--reserved, .status--pending { background: #fff4de; color: #9a6400; }
.status--refunded, .status--cancelled, .status--expired { background: #f0f2f5; color: #667085; }

@media (max-width: 720px) {
    .nokos-row { flex-wrap: wrap; }
    .nokos-row__price { text-align: left; }
}

/* Wallet payment on order page */
.wallet-pay { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: 16px 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--brand-soft); }
.wallet-pay p { margin: 2px 0; }
.wallet-pay__balance strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.wallet-pay__short { color: var(--danger); font-size: .85rem; }

/* Nokos catalogue: grid of app cards */
.nokos-group { margin-bottom: 26px; }
.nokos-group[hidden], .nokos-card[hidden] { display: none; }
.nokos-group__title { margin: 0 0 12px; font-size: 1.05rem; }
.nokos-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.nokos-card { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgb(16 24 40 / .05); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.nokos-card:hover { border-color: var(--brand); box-shadow: 0 8px 22px rgb(98 85 232 / .16); transform: translateY(-2px); }
.nokos-card__head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nokos-card__title { min-width: 0; }
.nokos-card__title h3 { margin: 0 0 4px; overflow: hidden; font-size: .95rem; text-overflow: ellipsis; white-space: nowrap; }
.nokos-logo { position: relative; display: grid; flex: 0 0 44px; width: 44px; height: 44px; place-items: center; overflow: hidden; border-radius: 12px; background: var(--brand-soft); color: var(--brand-dark); font-size: .9rem; font-weight: 800; }
.nokos-logo--c1 { background: #e6faef; color: #158a52; }
.nokos-logo--c2 { background: #e7f2ff; color: #1260c4; }
.nokos-logo--c3 { background: #faecff; color: #96309f; }
.nokos-logo--c4 { background: #fff3e3; color: #b2650b; }
.nokos-logo--c5 { background: #ffe9ec; color: #c0283c; }
.nokos-logo__fallback { position: absolute; inset: 0; display: grid; place-items: center; }
.nokos-logo__img { position: relative; width: 28px; height: 28px; border-radius: 6px; background: #fff; object-fit: contain; }
.nokos-logo__img[hidden] { display: none; }
.nokos-stock { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #e6faef; color: #158a52; font-size: .72rem; font-weight: 700; }
.nokos-stock--low { background: #fff3e3; color: #b2650b; }
.nokos-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nokos-card__foot form { margin: 0; }
.nokos-card__price { color: var(--ink); font-size: 1rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nokos-card__foot .button { min-height: 38px; padding: 8px 16px; white-space: nowrap; }
@media (max-width: 1100px) { .nokos-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .nokos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .nokos-card { padding: 12px; } .nokos-card__head { flex-direction: column; align-items: flex-start; } .nokos-card__foot { flex-wrap: wrap; } }

/* Nokos hub: tabs, two-column layout, service list, sticky checkout */
.content-heading:has(.nokos-balance) { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.nk-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.nk-tab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-weight: 700; text-decoration: none; white-space: nowrap; transition: background .18s ease, color .18s ease, border-color .18s ease; }
.nk-tab:hover { border-color: var(--brand); color: var(--brand); }
.nk-tab.is-active { border-color: var(--brand); background: var(--brand); color: #fff; }
.nk-tab__badge { display: inline-grid; min-width: 20px; height: 20px; padding: 0 6px; place-items: center; border-radius: 999px; background: #ef4444; color: #fff; font-size: .72rem; font-weight: 800; }
.nk-layout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px; align-items: start; }
.nk-filters { display: grid; gap: 10px; margin-bottom: 12px; }
.nk-search input, .nk-selects select, .nk-checkout select, .nk-qty input { width: 100%; min-height: 44px; padding: 9px 14px; border: 1px solid #dbe1e9; border-radius: 10px; background: #fff; color: var(--ink); font: inherit; }
.nk-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nk-list { display: grid; gap: 8px; max-height: 640px; padding: 2px 4px 2px 2px; overflow-y: auto; }
.nk-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.nk-item[hidden] { display: none; }
.nk-item:hover { border-color: #b9b3f7; }
.nk-item.is-selected { border-color: #2563eb; box-shadow: 0 0 0 2px rgb(37 99 235 / .18); }
.nk-item__radio { position: absolute; opacity: 0; pointer-events: none; }
.nk-item__radio:focus-visible ~ .nk-item__check { outline: 3px solid rgb(37 99 235 / .35); outline-offset: 2px; }
.nk-item__body { display: grid; flex: 1; gap: 2px; min-width: 0; }
.nk-item__body strong { overflow: hidden; font-size: .93rem; text-overflow: ellipsis; white-space: nowrap; }
.nk-item__body em { color: var(--muted); font-style: normal; font-weight: 600; }
.nk-item__body small, .nk-selected small { display: flex; align-items: center; gap: 6px; color: #8a94a6; font-size: .76rem; }
.nk-flag { display: inline-block; flex: none; width: 16px; height: 11px; border-radius: 2px; background: linear-gradient(#e11d2e 50%, #fff 50%); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .12); }
.nk-item__price { color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nk-item__check { display: grid; flex: none; width: 22px; height: 22px; place-items: center; border: 2px solid #cbd2dc; border-radius: 50%; color: transparent; font-size: .8rem; font-weight: 800; }
.nk-item.is-selected .nk-item__check { border-color: #2563eb; background: #2563eb; color: #fff; }
.nk-checkout { position: sticky; top: 92px; padding: 20px; }
.nk-checkout h2 { margin: 0 0 12px; font-size: 1.05rem; }
.nk-checkout__empty { margin: 0; padding: 22px 0; color: var(--muted); text-align: center; }
.nk-selected { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 12px; border-radius: 12px; background: var(--brand-soft); }
.nk-selected strong { display: block; margin-bottom: 2px; }
.nk-field { display: block; margin: 12px 0 6px; font-size: .82rem; font-weight: 700; }
.nk-field small { color: var(--muted); font-weight: 600; }
.nk-qty { display: flex; align-items: stretch; gap: 8px; }
.nk-qty button { flex: none; width: 44px; border: 1px solid #dbe1e9; border-radius: 10px; background: #fff; color: var(--ink); font-size: 1.2rem; font-weight: 700; cursor: pointer; }
.nk-qty button:hover { border-color: #2563eb; color: #2563eb; }
.nk-qty input { text-align: center; font-weight: 800; appearance: textfield; -moz-appearance: textfield; }
.nk-qty input::-webkit-outer-spin-button, .nk-qty input::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }
.nk-sum { margin: 16px 0; padding: 12px 0 0; border-top: 1px dashed var(--line); }
.nk-sum div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; color: var(--muted); font-size: .88rem; }
.nk-sum dt, .nk-sum dd { margin: 0; }
.nk-sum dd { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.nk-sum__total { margin: 4px 0; padding: 10px 0 !important; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.nk-sum__total dt, .nk-sum__total dd { color: var(--ink); font-size: 1.05rem; font-weight: 800; }
.nk-buy { display: block; width: 100%; padding: 14px; border: 0; border-radius: 12px; background: #2563eb; color: #fff; font: inherit; font-size: 1rem; font-weight: 800; text-align: center; text-decoration: none; cursor: pointer; box-shadow: 0 8px 18px rgb(37 99 235 / .28); transition: background .15s ease, transform .15s ease; }
.nk-buy:hover { background: #1d4ed8; transform: translateY(-1px); }
.nk-buy[hidden] { display: none; }
.nk-buy--topup { background: var(--brand); box-shadow: 0 8px 18px rgb(98 85 232 / .28); }
.nk-buy--topup:hover { background: var(--brand-dark); }
.nk-note { margin: 12px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.nk-warn { padding: 12px; border-radius: 10px; background: #fff3e3; color: #b2650b; font-size: .85rem; }
.nk-orders { padding: 8px 18px; }
.nk-order { display: flex; align-items: center; gap: 12px; padding: 14px 0; color: inherit; text-decoration: none; }
.nk-order + .nk-order { border-top: 1px solid #edf0f3; }
.nk-order__body { display: grid; flex: 1; gap: 2px; min-width: 0; }
.nk-order__body small, .nk-order__side small { color: var(--muted); font-size: .78rem; }
.nk-order__otp b { color: var(--brand-dark); letter-spacing: .08em; }
.nk-order__side { display: grid; justify-items: end; gap: 4px; }
@media (max-width: 900px) {
    .nk-layout { grid-template-columns: minmax(0, 1fr); }
    .nk-checkout { position: static; }
    .nk-list { max-height: 520px; }
}
@media (max-width: 480px) { .nk-selects { grid-template-columns: 1fr; } .nk-item { padding: 10px 12px; } .nk-item__body em { display: none; } }

/* Multi-country + real logos (no initials) */
.nokos-logo { background: #eef0f6 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236255e8' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='7' y='2.5' width='10' height='19' rx='2.4'/%3E%3Cpath d='M10.5 18.5h3'/%3E%3Cpath d='M9.8 7.5h4.4a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-2.2l-1.6 1.4v-1.4h-.6a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1z' fill='%23dcd8ff'/%3E%3C/svg%3E") center / 60% no-repeat; }
.nokos-logo__img { position: absolute; inset: 0; width: 100%; height: 100%; padding: 7px; border-radius: 12px; background: #fff; object-fit: contain; }
.nokos-logo__img[hidden] { display: none; }
.nk-flag-img { display: inline-block; flex: none; width: 18px; height: 12px; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px rgb(0 0 0 / .12); }
.nk-filters .nk-search-input { width: 100%; min-height: 44px; padding: 9px 14px; border: 1px solid #dbe1e9; border-radius: 10px; background: #fff; color: var(--ink); font: inherit; }
.nk-selects select:disabled { opacity: 1; }

/* ---- Nokos active order cards ---- */
.nk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.nk-grid--single { grid-template-columns: minmax(0, 1fr); max-width: 720px; }
.nk-card { display: flex; flex-direction: column; gap: 14px; padding: 16px; border: 1px solid #e3e7ee; border-radius: 16px; background: #fff; box-shadow: 0 6px 18px rgba(20, 24, 40, .05); }
.nk-card.is-finished { opacity: .72; }
.nk-card__head { display: flex; align-items: center; gap: 12px; }
.nk-card__title { flex: 1; min-width: 0; }
.nk-card__title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nk-card__title small { color: #6b7280; }
.nk-card__body { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.nk-cell { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 12px; background: #f6f7fb; min-width: 0; }
.nk-cell > span { color: #6b7280; font-size: .75rem; }
.nk-cell strong { overflow-wrap: anywhere; font-size: .95rem; }
.nk-otp { font-family: ui-monospace, Consolas, monospace; font-size: 1.3rem; letter-spacing: .12em; color: #6b7280; }
.nk-otp.has-code { color: #158a52; }
.nk-timer { font-family: ui-monospace, Consolas, monospace; font-size: 1.2rem; }
.nk-copy { align-self: flex-start; padding: 3px 10px; border: 1px solid #d5d9e3; border-radius: 8px; background: #fff; color: var(--brand-dark, #4a3fd1); font: inherit; font-size: .75rem; cursor: pointer; }
.nk-copy[hidden] { display: none; }
.nk-card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nk-card__price { margin-right: auto; color: #6b7280; font-size: .85rem; }
.nk-cancel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nk-cancel[hidden] { display: none; }
.nk-card__note { flex-basis: 100%; color: #6b7280; font-size: .78rem; }
.nk-btn { padding: 8px 14px; border: 1px solid #2563eb; border-radius: 10px; background: #2563eb; color: #fff; font: inherit; font-size: .85rem; cursor: pointer; }
.nk-btn--ghost { background: #fff; color: #2563eb; }
.nk-btn--danger { border-color: #d6314a; background: #fff; color: #d6314a; }
.nk-btn:disabled { opacity: .45; cursor: not-allowed; }
.nk-card .status--waiting, .nk-card .status--reserved { background: #e3eeff; color: #1d4fd8; }
@media (max-width: 760px) {
    .nk-grid { grid-template-columns: minmax(0, 1fr); }
    .nk-card__body { grid-template-columns: minmax(0, 1fr); }
}
/* Mobile navbar: keep only logo, wallet/top-up and cart (guests keep Masuk). */
@media (max-width: 640px) {
    .nav-links > .nav-secondary, .nav-links .nav-secondary, .nav-links > .nav-join { display: none !important; }
    .nav-shell { gap: 8px; }
    .nav-links { gap: 6px; min-width: 0; }
    .brand > span:last-child { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Mobile account menu (hamburger). Hidden on larger screens, where the full links are shown. */
.nav-menu { display: none; position: relative; flex-shrink: 0; }
.nav-menu__panel[hidden] { display: none; }
@media (max-width: 640px) {
    .nav-menu { display: block; }
    .nav-menu__btn { display: grid; width: 38px; height: 38px; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 999px; background: #fff; box-shadow: 0 2px 8px rgb(40 53 78 / .06); color: var(--ink); font-size: 1.1rem; line-height: 1; }
    .nav-menu__btn:hover, .nav-menu.is-open .nav-menu__btn { border-color: #c9c3fb; background: var(--brand-soft); color: var(--brand-dark); }
    .nav-menu__btn:focus-visible { outline: 3px solid rgb(98 85 232 / .27); outline-offset: 2px; }
    .nav-menu__panel { position: absolute; z-index: 40; top: calc(100% + 10px); right: 0; width: min(240px, calc(100vw - 28px)); padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 18px 40px rgb(30 25 90 / .2); }
    .nav-menu__panel::before { position: absolute; top: -6px; right: 14px; width: 12px; height: 12px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: #fff; content: ''; transform: rotate(45deg); }
    .nav-menu__who { display: grid; gap: 1px; margin: 0 0 6px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); }
    .nav-menu__who small { color: var(--muted); font-size: .72rem; }
    .nav-menu__who strong { overflow: hidden; color: var(--ink); font-size: .92rem; text-overflow: ellipsis; white-space: nowrap; }
    .nav-menu__panel a, .nav-menu__logout { display: flex; width: 100%; min-height: 42px; align-items: center; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; font-size: .9rem; font-weight: 650; text-align: left; text-decoration: none; cursor: pointer; }
    .nav-menu__panel a:hover, .nav-menu__panel a:focus-visible { background: var(--brand-soft); color: var(--brand-dark); outline: 0; }
    .nav-menu__logout { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; color: var(--danger); }
    .nav-menu__logout:hover, .nav-menu__logout:focus-visible { background: #fff0f1; outline: 0; }
    .nav-menu__panel form { margin: 0; }
}