@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #f4f5fb;
    --panel: #ffffff;
    --line: #e6e9f2;
    --text: #263548;
    --muted: #7a8494;
    --accent: #ff4b34;
    --accent-strong: #f33c27;
    --violet: #4f46e5;
    --violet-soft: rgba(79, 70, 229, 0.08);
    --blue: #4f46e5;
    font-family: "Be Vietnam Pro", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    background:
        radial-gradient(circle at top right, rgba(255, 75, 52, .10), transparent 32rem),
        linear-gradient(180deg, #f7f8fc 0%, var(--bg) 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    font: inherit;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 230px;
    background: var(--panel);
    border-right: 1px solid var(--line);
    padding: 20px 14px;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 10px 20px;
}

.brand-logo {
    display: block;
    max-width: 42%;
    width: 170px;
    height: auto;
    object-fit: contain;
}

.nav-group {
    margin: 20px 12px 10px;
    color: #a1a8b3;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.nav-link {
    width: 100%;
    border: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin: 6px 0;
    padding: 8px 14px;
    border-radius: 8px;
    color: #405064;
    background: transparent;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    position: relative;
}

.nav-link.active {
    color: var(--violet);
    background: var(--violet-soft);
    box-shadow: none;
}

.nav-link.active::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 99px;
    background: var(--violet);
}

.nav-link span {
    display: grid;
    min-width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 6px;
    color: #667085;
    background: transparent;
    border: 1px solid #d7dcef;
    font-size: 11px;
    font-weight: 800;
}

.nav-link .nav-icon svg {
    width: 14px;
    height: 14px;
    display: block;
}

.nav-icon-image {
    width: 14px;
    height: 14px;
    object-fit: contain;
    display: block;
}

.nav-link.active span {
    color: var(--violet);
    background: rgba(79, 70, 229, 0.04);
    border-color: rgba(79, 70, 229, 0.45);
}

.nav-button {
    font: inherit;
}

.page {
    margin-left: 230px;
    padding: 12px 28px 48px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1240px;
    min-height: 58px;
    margin: 0 auto 24px;
    padding: 0 24px;
    background: var(--panel);
    border-radius: 4px;
    box-shadow: 0 8px 28px rgba(31, 41, 55, .08);
}

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

.account-name {
    color: #182231;
    font-weight: 800;
}

.role-pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    color: #147a3f;
    background: #e8f8ee;
    font-weight: 800;
}

.balance-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    color: #536174;
    background: #f4f6fb;
    border: 1px solid var(--line);
    font-weight: 800;
}

.balance-pill strong {
    color: #1f2937;
}

.breadcrumb {
    display: flex;
    gap: 12px;
    align-items: center;
    color: #566275;
    font-size: 13px;
    font-weight: 500;
}

.outline-button,
.primary-button,
.buy-box button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 16px;
    border: 1px solid var(--violet);
    border-radius: 6px;
    color: var(--violet);
    background: #fff;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

.primary-button,
.buy-box button {
    color: #fff;
    border-color: var(--accent);
    background: var(--accent);
}

.primary-button.small,
.outline-button.small {
    min-height: 32px;
    padding: 0 12px;
}

.primary-button.wide,
.outline-button.wide {
    width: 100%;
}

.google-login-btn {
    margin-top: 10px;
    gap: 8px;
}

.google-icon {
    width: 16px;
    height: 16px;
    display: block;
    flex: 0 0 16px;
}

.section-heading,
.admin-header,
.search-bar,
.category-row,
.product-grid,
.admin-grid,
.product-form,
.alert,
nav[role="navigation"] {
    max-width: 1240px;
    margin-left: auto;
    margin-right: auto;
}

.section-heading h1,
.admin-header h1 {
    margin: 0 0 10px;
    font-size: 26px;
}

.section-heading p,
.admin-header p,
.muted {
    margin: 0;
    color: var(--muted);
    font-weight: 600;
}

.search-bar {
    display: flex;
    align-items: center;
    height: 40px;
    max-width: 460px;
    margin-top: 22px;
    border: 1px solid #d9def0;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}

.search-bar span {
    display: grid;
    width: 42px;
    height: 100%;
    place-items: center;
    color: #7a86a0;
    border-right: 1px solid #e3e8f6;
}

.search-bar input {
    width: 100%;
    height: 100%;
    border: 0;
    outline: 0;
    padding: 0 16px;
}

.category-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
    font-size: 14px;
    font-weight: 700;
}

.chip {
    flex: 0 0 auto;
    padding: 8px 18px;
    border: 1px solid var(--accent);
    border-radius: 999px;
    color: var(--accent);
    background: #fff;
}

.chip.active {
    color: #fff;
    background: var(--accent);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.product-card {
    position: relative;
    min-width: 0;
    padding: 12px;
    background: var(--panel);
    border: 1px solid #eceff6;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    border-color: #dfe4f2;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.product-badge,
.tags span {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border: 1px solid #8fc6ea;
    border-radius: 4px;
    color: var(--blue);
    font-size: 11px;
    font-weight: 800;
}

.product-media {
    display: grid;
    height: 250px;
    place-items: center;
    overflow: hidden;
    padding: 10px;
    position: relative;
}

.product-media img {
    max-width: 100%;
    max-height: 220px;
    object-fit: contain;
}

.placeholder-logo {
    display: grid;
    gap: 12px;
    justify-items: center;
    color: #050505;
    font-size: 38px;
    font-weight: 900;
}

.placeholder-logo span {
    display: grid;
    width: 94px;
    height: 94px;
    place-items: center;
    color: #fff;
    background: #050505;
    border-radius: 22px;
}

.product-card h2 {
    min-height: 46px;
    margin: 8px 0 12px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tags span:first-child {
    color: var(--accent);
    border-color: #ffb3a8;
}

.tags span:nth-child(2) {
    color: #20b64f;
    border-color: #89e3a5;
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 10px 0;
}

.price-row del {
    color: var(--accent);
    font-size: 13px;
}

.price-row strong {
    color: var(--accent-strong);
    font-size: 20px;
}

.buy-box summary {
    display: grid;
    min-height: 34px;
    place-items: center;
    border-radius: 4px;
    color: #fff;
    background: var(--accent);
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.card-action {
    display: grid;
    width: 100%;
    min-height: 30px;
    place-items: center;
    border: 0;
    border-radius: 6px;
    color: #fff;
    background: var(--accent);
    font-weight: 700;
    font-size: 12.5px;
    cursor: pointer;
}

.buy-modal {
    width: min(460px, calc(100vw - 32px));
    border: 0;
    border-radius: 8px;
    padding: 0;
    color: #354357;
    background: #fff;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .32);
}

.buy-modal::backdrop {
    background: rgba(31, 41, 55, .56);
    backdrop-filter: blur(1px);
}

.buy-modal > form[method="dialog"] {
    margin: 0;
}

.modal-close {
    position: absolute;
    top: -14px;
    right: -14px;
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: #738094;
    background: #fff;
    box-shadow: 0 8px 18px rgba(31, 41, 55, .18);
    cursor: pointer;
    font-weight: 900;
}

.buy-modal-form {
    display: grid;
    gap: 16px;
    padding: 24px;
}

.buy-modal-form h2 {
    margin: 0;
    font-size: 18px;
}

.buy-modal-form p {
    margin: 0;
    color: #58677b;
    line-height: 1.6;
    font-weight: 700;
}

.buy-modal-form b {
    color: var(--violet);
}

.buy-guide-box {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid #cfe6d9;
    border-radius: 10px;
    color: #244435;
    background: #f3fbf6;
    line-height: 1.55;
    font-size: 13px;
}

.buy-guide-box strong {
    color: #12633d;
    font-size: 13px;
}

.buy-guide-box div {
    white-space: normal;
}

.buy-modal-form label {
    display: grid;
    gap: 8px;
    color: #445267;
    font-size: 13px;
    font-weight: 900;
}

.coupon-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 88px;
}

.coupon-line input {
    min-width: 0;
    border: 1px solid #cfd6e3;
    border-right: 0;
    border-radius: 4px 0 0 4px;
    padding: 10px 12px;
    outline-color: var(--violet);
}

.coupon-line button {
    border: 1px solid var(--violet);
    border-radius: 0 4px 4px 0;
    color: var(--violet);
    background: #fff;
    cursor: pointer;
    font-weight: 900;
}

.buy-modal-form small {
    color: #7b8797;
    font-weight: 700;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 2px;
}

.ghost-button {
    min-height: 36px;
    padding: 0 14px;
    border: 0;
    color: #7a8494;
    background: transparent;
    cursor: pointer;
    font-weight: 900;
}

.buy-box form {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.buy-box input,
.product-form input,
.product-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 10px 12px;
    outline-color: var(--violet);
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 24px;
    align-items: stretch;
    max-width: 1040px;
    margin: 40px auto 0;
}

.wallet-grid,
.wallet-history {
    max-width: 1240px;
    margin-left: auto;
    margin-right: auto;
}

.wallet-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px;
    align-items: start;
    margin-top: 14px;
}

.wallet-main {
    display: grid;
    gap: 14px;
}

.info-strip {
    padding: 14px 16px;
    border-radius: 6px;
    color: #05708b;
    background: #cdf5ff;
    font-weight: 800;
}

.topup-card,
.bank-card,
.wallet-side {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 8px 22px rgba(31, 41, 55, .06);
}

.method-tabs {
    display: inline-flex;
    width: fit-content;
    overflow: hidden;
    border: 1px solid var(--violet);
    border-radius: 5px;
    margin-bottom: 16px;
}

.method-tabs label {
    display: block;
}

.method-tabs input {
    position: absolute;
    opacity: 0;
}

.method-tabs span {
    display: grid;
    min-width: 106px;
    min-height: 36px;
    place-items: center;
    color: var(--violet);
    background: #fff;
    font-weight: 900;
    cursor: pointer;
}

.method-tabs input:checked + span {
    color: #fff;
    background: var(--violet);
}

.topup-card label {
    display: grid;
    gap: 8px;
    color: #46566b;
    font-weight: 800;
}

.topup-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 12px;
}

.topup-line input {
    width: 100%;
    border: 1px solid #bfc7d5;
    border-radius: 5px;
    padding: 10px 12px;
}

.topup-card small {
    color: var(--muted);
}

.sub-title {
    margin: 4px 0 0;
    font-size: 18px;
}

.bank-card {
    display: grid;
    grid-template-columns: minmax(220px, 320px) 260px;
    gap: 20px;
    width: fit-content;
    max-width: 100%;
}

.bank-meta {
    display: grid;
    align-content: center;
    gap: 8px;
    color: #536174;
    font-weight: 700;
}

.bank-meta strong {
    color: #344155;
}

.accent-text {
    color: #ff2f75;
    font-weight: 900;
}

.qr-image-box {
    display: grid;
    width: 250px;
    max-width: 100%;
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.qr-image-box img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wallet-side {
    display: grid;
    gap: 14px;
}

.wallet-side span {
    color: var(--muted);
    font-weight: 800;
}

.wallet-side strong {
    color: var(--accent);
    font-size: 34px;
}

.wallet-history {
    margin-top: 18px;
}

.api-doc {
    display: grid;
    gap: 16px;
    max-width: 1040px;
    margin: 0 auto;
}

.api-hero,
.api-key-card,
.api-section {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(31, 41, 55, .06);
}

.api-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 22px;
}

.api-hero h1 {
    margin: 0 0 8px;
    font-size: 28px;
}

.api-hero p,
.api-section p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.api-key-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    border-color: #bfe8f3;
    background: #effcff;
}

.api-key-card span {
    color: #05677f;
    font-weight: 900;
}

.api-key-card code {
    display: block;
    overflow-x: auto;
    padding: 12px;
    border-radius: 6px;
    color: #123047;
    background: #fff;
    border: 1px solid #ccecf5;
    font-size: 14px;
}

.api-key-card small {
    color: #6a788b;
    font-weight: 700;
}

.api-section {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.api-section h2 {
    margin: 0;
    color: #233044;
    font-size: 20px;
}

.api-section code,
.api-doc code {
    font-family: Consolas, "Liberation Mono", monospace;
}

.api-section pre {
    overflow-x: auto;
    margin: 0;
    padding: 16px;
    border-radius: 7px;
    color: #e7edf6;
    background: #182132;
    line-height: 1.55;
}

.doc-table {
    border: 1px solid var(--line);
    border-radius: 7px;
    overflow: hidden;
}

.doc-table th,
.doc-table td {
    white-space: normal;
}

.status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 900;
}

.status.success {
    color: #1b9a48;
    background: #ddf8d6;
}

.status.neutral {
    color: #5b6474;
    background: #eef1f6;
}

.auth-copy {
    min-height: 480px;
    padding: 48px;
    border-radius: 8px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(255, 75, 52, .92), rgba(104, 104, 255, .92)),
        linear-gradient(45deg, #ff4b34, #6868ff);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-shadow: 0 24px 60px rgba(31, 41, 55, .16);
}

.auth-copy h1 {
    margin: 14px 0;
    max-width: 560px;
    font-size: 44px;
    line-height: 1.05;
}

.auth-copy p {
    max-width: 560px;
    margin: 0;
    color: rgba(255, 255, 255, .86);
    font-size: 17px;
    font-weight: 650;
}

.eyebrow {
    width: fit-content;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, .36);
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.auth-card {
    display: grid;
    align-content: center;
    gap: 14px;
    min-height: 480px;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(31, 41, 55, .08);
}

.auth-card h2 {
    margin: 0 0 8px;
    font-size: 26px;
}

.auth-card label {
    display: grid;
    gap: 7px;
    color: #46566b;
    font-weight: 800;
}

.auth-card input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px 14px;
    outline-color: var(--violet);
}

.auth-note {
    margin: 0;
    color: var(--muted);
    text-align: center;
    font-weight: 700;
}

.auth-note a {
    color: var(--violet);
    font-weight: 900;
}

.demo-box {
    display: grid;
    gap: 5px;
    margin-top: 6px;
    padding: 12px;
    border: 1px solid #ffe0dc;
    border-radius: 6px;
    color: #714037;
    background: #fff7f5;
    font-size: 13px;
    font-weight: 750;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 16px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    max-width: 1240px;
    margin: 0 auto 16px;
}

.metric-card {
    display: grid;
    gap: 8px;
    min-height: 132px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(31, 41, 55, .06);
}

.metric-card span,
.metric-card small {
    color: var(--muted);
    font-weight: 800;
}

.metric-card strong {
    color: #182231;
    font-size: 27px;
}

.metric-card.danger {
    border-color: #ffb6ad;
    background: #fff3f1;
}

.metric-card.danger strong {
    color: #c12918;
}

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

.admin-toolbox {
    margin-bottom: 16px;
}

.inline-form,
.table-form {
    display: flex;
    align-items: end;
    gap: 10px;
}

.inline-form label {
    display: grid;
    gap: 6px;
    color: #46566b;
    font-weight: 800;
}

.inline-form input,
.table-form input {
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 7px 10px;
    outline-color: var(--violet);
}

.table-form input {
    width: 150px;
}

.finance-grid {
    margin-top: 16px;
}

.settings-panel {
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
}

.panel,
.product-form {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.panel h2 {
    margin: 0 0 14px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

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

.mini-product img,
.mini-product span {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    background: #111;
    object-fit: cover;
}

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

.actions a,
.actions button,
.image-tile button {
    border: 0;
    color: var(--accent);
    background: transparent;
    cursor: pointer;
    font-weight: 800;
}

.order-item {
    display: grid;
    gap: 4px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.order-item span,
.order-item small {
    color: var(--muted);
}

.product-form {
    display: grid;
    gap: 14px;
}

.product-form label {
    display: grid;
    gap: 7px;
    color: #46566b;
    font-weight: 800;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.check-line {
    display: flex !important;
    grid-template-columns: none;
    align-items: center;
}

.check-line input {
    width: auto;
}

.image-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.image-tile {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px;
}

.image-tile img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
}

.alert {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 6px;
    font-weight: 700;
}

.alert.success {
    color: #15723c;
    background: #e8f8ee;
    border: 1px solid #b8ebc9;
}

.alert.error {
    color: #9f2414;
    background: #fff1ef;
    border: 1px solid #ffc4bb;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 32px;
    background: #fff;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-weight: 800;
    text-align: center;
}

nav[role="navigation"] {
    margin-top: 18px;
}

nav[role="navigation"] svg {
    width: 16px;
    height: 16px;
    display: block;
}

nav[role="navigation"] > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

nav[role="navigation"] .hidden.sm\:flex-1.sm\:flex.sm\:items-center.sm\:justify-between {
    width: 100%;
}

nav[role="navigation"] .relative.inline-flex.items-center {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: #5d6b7d;
    font-size: 14px;
    line-height: 1;
}

nav[role="navigation"] span.relative.inline-flex.items-center {
    background: #f3f6fb;
}

nav[role="navigation"] a.relative.inline-flex.items-center:hover {
    background: #f8faff;
    color: #243447;
}

.topup-modern {
    display: grid;
    gap: 16px;
}

.topup-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: linear-gradient(135deg, #f2f8ff 0%, #f8fbff 100%);
}

.topup-hero h2 {
    margin: 0 0 4px;
    font-size: 18px;
}

.topup-hero p {
    margin: 0;
    color: var(--muted);
}

.badge-soft {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    color: #155ea6;
    background: #e6f1ff;
}

.modern-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.modern-tabs {
    margin-bottom: 12px;
}

.field-label {
    display: block;
    margin-bottom: 8px;
    color: #46566b;
    font-weight: 800;
}

.modern-line input {
    border-radius: 10px 0 0 10px;
}

.modern-line .primary-button {
    border-radius: 0 10px 10px 0;
}

.modern-side {
    border-radius: 10px;
}

.form-error {
    margin-top: 8px;
    color: #b42318;
    font-weight: 700;
}

.topup-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 1000;
}

.topup-modal.is-open {
    display: grid;
    place-items: center;
    padding: 50px 12px 16px;
}

.topup-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(14, 20, 30, 0.55);
}

.topup-modal__content {
    position: relative;
    z-index: 1;
    width: min(840px, calc(100% - 24px));
    max-height: calc(100vh - 66px);
    overflow: auto;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 24px 56px rgba(4, 11, 24, 0.28);
}

.topup-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    width: 32px;
    height: 32px;
    border: 1px solid #d6ddeb;
    border-radius: 8px;
    background: #fff;
    font-size: 24px;
    line-height: 1;
    color: #58667a;
    cursor: pointer;
}

.topup-modal__hint {
    margin-top: 4px;
    margin-bottom: 14px;
    color: var(--muted);
}

.modal-bank-card {
    margin-bottom: 14px;
    justify-content: center;
    align-items: center;
}

.topup-status {
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 800;
}

.topup-status.pending {
    color: #8a6300;
    background: #fff7dc;
    border: 1px solid #ffe39d;
}

.topup-status.success {
    color: #15723c;
    background: #e8f8ee;
    border: 1px solid #b8ebc9;
}

@media (max-width: 1100px) {
    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .auth-shell {
        grid-template-columns: 1fr;
    }

    .wallet-grid {
        grid-template-columns: 1fr;
    }

    .auth-copy,
    .auth-card {
        min-height: auto;
    }
}

@media (max-width: 760px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .sidebar {
        display: none;
    }

    .page {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        margin-left: 0;
        padding: 12px 12px calc(84px + env(safe-area-inset-bottom));
        overflow-x: hidden;
    }

    .product-grid,
    .image-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-row,
    .admin-header {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .topbar,
    .account-box {
        flex-wrap: wrap;
        gap: 10px;
    }

    .auth-copy {
        padding: 28px;
    }

    .auth-copy h1 {
        font-size: 34px;
    }

    .topup-line,
    .bank-card {
        grid-template-columns: 1fr;
    }

    .topup-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .modern-line input,
    .modern-line .primary-button {
        border-radius: 10px;
    }

    .topup-modal.is-open {
        padding: 50px 10px 12px;
        align-items: start;
    }

    .topup-modal__content {
        width: min(100%, 640px);
        max-height: calc(100vh - 64px);
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .header-actions,
    .inline-form,
    .table-form {
        align-items: stretch;
        flex-direction: column;
    }

    .table-form input {
        width: 100%;
    }

    .api-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .qr-box {
        width: 100%;
        max-width: 280px;
    }
}

/* ===== CRM Admin Products Upgrade ===== */
.page {
    width: calc(100% - 230px);
    max-width: none;
    box-sizing: border-box;
    padding: 0 24px 40px;
    overflow-x: clip;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 70;
    max-width: none;
    margin: 0 0 18px;
    border-radius: 0;
}

.sidebar {
    z-index: 80;
    overflow-y: auto;
}

.crm-shell { display: grid; gap: 16px; }
.crm-stats { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.crm-toolbar { display: grid; gap: 12px; }
.crm-grid { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
.crm-main-panel,
.crm-side-panel { width: 100%; }
.crm-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 12px; }
.crm-filters { display: flex; gap: 10px; }
.crm-filters input,
.crm-filters select {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    background: #fff;
}

#products-table th[data-sort] { cursor: pointer; user-select: none; }
#products-table th[data-sort]:hover { color: var(--violet); }

.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-actions a,
.quick-actions button {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f9fafc;
    font-size: 13px;
    font-weight: 700;
}
.quick-actions button { cursor: pointer; }
.status.danger { color: #c62828; background: #ffe7e7; }
.status.warning { color: #9a6700; background: #fff4d6; }

@media (max-width: 1100px) {
    .crm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .crm-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .page {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    .crm-stats, .crm-grid { grid-template-columns: 1fr; }
    .crm-head, .crm-filters { flex-wrap: wrap; }
}

@media (max-width: 520px) {
    .product-grid,
    .image-list {
        grid-template-columns: 1fr;
    }
}

/* ===== CRM topup refinements ===== */
.breadcrumb { font-size: 13px; font-weight: 500; }
.page { padding-top: 10px; }
.topup-heading { margin-top: 8px; }
.topup-heading h1 { font-size: 34px; font-weight: 700; }
.topup-subtext { max-width: 920px; font-size: 13px; color: #6b778b; }
.wallet-grid--single { grid-template-columns: minmax(0, 1fr); }

.crm-topup-form { padding: 14px 16px; }
.payment-method-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.field-label {
    margin: 0;
    color: #4b5b71;
    font-size: 13px;
    font-weight: 600;
}

.method-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #5b6678;
    font-size: 13px;
    font-weight: 600;
}

.payment-method-row--single {
    gap: 12px;
}

.method-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid #d9def0;
    background: #f8faff;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
}

.topup-line--crm {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) 188px;
    align-items: center;
    gap: 10px;
}

.topup-line--crm input {
    min-height: 40px;
    border: 1px solid #cfd6e3;
    border-radius: 6px;
}

#create-topup-btn {
    min-height: 40px;
    border-radius: 6px;
    background: #4f6ef7;
    border-color: #4f6ef7;
}

.help-text { color: #7b8797; font-size: 12px; }

.enterprise-table {
    width: 100%;
    max-width: none;
    padding: 0;
    border: 0;
    background: transparent;
}

.history-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 8px 0 10px;
}

.history-toolbar { display: flex; gap: 10px; align-items: center; }
.history-toolbar label { display: inline-flex; align-items: center; gap: 8px; color: #667085; font-size: 13px; }
.history-toolbar select,
.history-toolbar input { min-height: 34px; border: 1px solid #d9def0; border-radius: 6px; padding: 0 10px; }
.history-toolbar input { min-width: 280px; }

.table-enterprise { width: 100%; background: #fff; }
.table-enterprise th,
.table-enterprise td { border-bottom: 1px solid #edf1f7; }
.table-enterprise thead th { border-top: 1px solid #edf1f7; color: #768197; font-weight: 700; }

.tx-code {
    color: #334155;
    font-weight: 600;
    font-family: Consolas, "Liberation Mono", monospace;
}

.status.pending {
    color: #9a6700;
    background: #fff7dc;
    border: 1px solid #ffe39d;
}

.status.success {
    color: #15723c;
    background: #e8f8ee;
    border: 1px solid #b8ebc9;
}

.history-pagination { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 10px; }
#deposit-page-indicator { color: #667085; font-size: 13px; }
.wallet-history nav[role="navigation"] { margin-top: 10px; }

@media (max-width: 760px) {
    .topup-line--crm {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .history-head,
    .history-toolbar,
    .payment-method-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .history-toolbar input { min-width: 100%; }
}

/* ===== Topup mobile deep optimization ===== */
.topup-info-box {
    padding: 10px 12px;
    border-radius: 8px;
    color: #0ea5cf;
    background: #d6f4fb;
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 8px;
}

.mobile-like-tabs {
    margin-bottom: 10px;
}

.topup-line--mobile-like {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.topup-line--mobile-like input {
    min-height: 40px;
    border: 1px solid #cfd6e3;
    border-radius: 8px;
    padding: 0 12px;
}

.topup-line--mobile-like #create-topup-btn {
    min-height: 40px;
    border-radius: 8px;
    background: #6366f1;
    border-color: #6366f1;
    box-shadow: 0 6px 12px rgba(99, 102, 241, .2);
}

@media (max-width: 760px) {
    .wallet-grid,
    .wallet-grid--single,
    .wallet-main,
    .topup-modern,
    .crm-topup-form,
    .wallet-history,
    .history-head,
    .history-toolbar,
    .table-wrap {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .wallet-grid,
    .wallet-grid--single,
    .wallet-main,
    .topup-modern {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .topup-heading h1 {
        font-size: 18px;
        line-height: 1.3;
        margin-bottom: 4px;
    }

    .crm-topup-form {
        padding: 10px;
        overflow: hidden;
    }

    .mobile-like-tabs {
        width: 100%;
        max-width: 100%;
        display: flex;
        border: 1px solid #6a6ef6;
        border-radius: 8px;
        overflow: hidden;
    }

    .mobile-like-tabs label {
        flex: 1;
        min-width: 0;
        display: block;
    }

    .mobile-like-tabs span {
        min-width: 0;
        width: 100%;
        min-height: 34px;
        font-size: 13px;
        font-weight: 600;
        color: #5a62f2;
        background: #fff;
        padding: 0 8px;
        box-sizing: border-box;
    }

    .mobile-like-tabs input:checked + span {
        color: #fff;
        background: #6366f1;
    }

    .topup-line--crm .field-label {
        margin-bottom: 2px;
    }

    .topup-line--crm input {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 38px;
        padding: 0 10px;
        font-size: 15px;
        box-sizing: border-box;
    }

    #create-topup-btn {
        min-height: 38px;
        width: 100%;
        padding: 0 10px;
        font-size: 13px;
    }

    .help-text {
        display: block;
        margin-top: 2px;
        font-size: 12px;
        line-height: 1.45;
    }

    .history-head {
        margin: 6px 0 8px;
    }

    .history-head h2 {
        margin: 0;
        font-size: 16px;
    }

    .history-toolbar {
        width: 100%;
        gap: 8px;
    }

    .history-toolbar label {
        width: 100%;
        font-size: 12px;
    }

    .history-toolbar select,
    .history-toolbar input {
        min-height: 38px;
        font-size: 14px;
    }

    .history-pagination {
        justify-content: space-between;
    }

    .history-pagination .outline-button.small {
        min-height: 34px;
        padding: 0 12px;
    }

    .topup-modal.is-open {
        display: flex;
        align-items: flex-end;
        justify-content: center;
        padding: 0;
    }

    .topup-modal__overlay {
        background: rgba(14, 20, 30, 0.58);
    }

    .topup-modal__content {
        width: 100%;
        margin: 0;
        border-radius: 14px 14px 0 0;
        padding: 14px 12px 12px;
        max-height: 82vh;
        overflow: auto;
    }

    .topup-modal__close {
        top: 8px;
        right: 8px;
        width: 34px;
        height: 34px;
        border: 1px solid #dfe4f1;
        border-radius: 8px;
        background: #fff;
        font-size: 24px;
        display: grid;
        place-items: center;
        z-index: 2;
    }

    .bank-card,
    .modal-bank-card {
        grid-template-columns: 1fr;
        width: 100%;
        padding: 12px;
        gap: 10px;
    }

    .bank-meta {
        gap: 6px;
        font-size: 13px;
    }

    .qr-image-box {
        width: 100%;
        max-width: 260px;
        margin: 0 auto;
    }

    .topup-status {
        font-size: 13px;
        line-height: 1.45;
    }
}
/* ===== Finance CRM UI ===== */
.finance-head {
    margin-bottom: 12px;
}

.finance-stats {
    max-width: none;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 12px;
}

.flat-card,
.flat-panel {
    box-shadow: none !important;
    border-radius: 10px;
}

.finance-panel {
    max-width: none;
    margin-bottom: 14px;
}

.finance-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.finance-section-head small {
    color: var(--muted);
}

.amount-col {
    text-align: right;
    white-space: nowrap;
}

.compact-form {
    display: grid;
    grid-template-columns: 180px 1fr auto auto;
    gap: 8px;
    align-items: center;
}

.finance-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.finance-tab {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    min-height: 36px;
    padding: 0 14px;
    font-weight: 700;
    cursor: pointer;
}

.finance-tab.is-active {
    border-color: var(--violet);
    color: var(--violet);
    background: #f5f3ff;
}

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

.tx-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.tx-toolbar input,
.tx-toolbar select {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 10px;
}

.tx-toolbar input {
    flex: 1;
}

@media (max-width: 980px) {
    .finance-stats {
        grid-template-columns: 1fr;
    }

    .compact-form {
        grid-template-columns: 1fr;
    }

    .tx-toolbar {
        flex-direction: column;
    }
}

/* ===== Home dashboard (match reference #2) ===== */
.home-dashboard {
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    gap: 10px;
}

.home-welcome {
    padding: 16px 18px;
    border: 1px solid #e7eaf2;
    border-radius: 6px;
    box-shadow: none;
}

.home-welcome h1 {
    margin: 0 0 6px;
    font-size: 34px;
    line-height: 1.24;
    letter-spacing: -0.01em;
    color: #253245;
    font-weight: 800;
}

.home-welcome p {
    margin: 0;
    color: #6f7b8d;
    font-size: 14px;
    line-height: 1.55;
    font-weight: 500;
}

.home-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.home-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.home-metric {
    min-height: 84px;
    padding: 12px 14px;
    border: 1px solid #e7eaf2;
    border-radius: 6px;
    box-shadow: none;
    display: grid;
    align-content: start;
    gap: 6px;
}

.home-metric span {
    color: #7f8898;
    font-size: 12px;
    font-weight: 600;
}

.home-metric strong {
    color: #2f3d57;
    font-size: 31px;
    line-height: 1.12;
    letter-spacing: -0.01em;
    font-weight: 700;
}

.home-table {
    border: 1px solid #e7eaf2;
    border-radius: 6px;
    box-shadow: none;
    padding: 0;
    overflow: hidden;
}

.home-table-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #edf1f7;
}

.home-table-head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #344155;
    letter-spacing: -0.005em;
}

.home-table-tabs {
    display: inline-flex;
    gap: 6px;
}

.home-table-tabs button {
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid #dfe4f1;
    border-radius: 6px;
    background: #fff;
    color: #596579;
    font-size: 12px;
    cursor: pointer;
}

.home-table-tabs button.is-active {
    border-color: #cfd6ee;
    background: #f7f8fd;
}

.home-table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid #edf1f7;
    color: #677384;
    font-size: 12px;
}

.home-table-toolbar label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.home-table-toolbar select,
.home-table-toolbar input {
    min-height: 28px;
    border: 1px solid #dfe4f1;
    border-radius: 4px;
    padding: 0 8px;
    font-size: 12px;
}

.home-table table th,
.home-table table td {
    padding: 10px 12px;
}

.home-empty {
    text-align: center;
    color: #7f8898;
}

.home-pagination {
    padding: 10px 12px;
    border-top: 1px solid #edf1f7;
    color: #7f8898;
    font-size: 12px;
    text-align: right;
}

@media (max-width: 760px) {
    .home-metrics {
        grid-template-columns: 1fr;
    }

    .home-table-head,
    .home-table-toolbar,
    .home-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===== Mobile UX optimization (global) ===== */
@media (max-width: 760px) {
    body {
        font-size: 14px;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 100;
        margin: 0 0 12px;
        padding: 8px 10px;
        border-radius: 8px;
    }

    .breadcrumb {
        font-size: 12px;
        gap: 8px;
    }

    .section-heading h1,
    .admin-header h1,
    .guide-head h1,
    .home-welcome h1 {
        font-size: 24px;
        line-height: 1.25;
    }

    .section-heading p,
    .topup-subtext,
    .guide-meta,
    .home-welcome p {
        font-size: 13px;
    }

    .search-bar {
        max-width: 100%;
        height: 42px;
    }

    .category-row {
        gap: 8px;
        margin-top: 12px;
    }

    .chip {
        padding: 7px 14px;
        font-size: 12px;
    }

    .product-card,
    .panel,
    .topup-card,
    .bank-card,
    .wallet-side,
    .auth-card,
    .guide-card,
    .home-metric {
        border-radius: 10px;
    }

    .product-media {
        height: 190px;
        padding: 8px;
        position: relative;
    }

    .product-media img {
        max-height: 170px;
    }

    .product-card h2 {
        min-height: 40px;
        font-size: 15px;
        margin: 6px 0 10px;
    }

    .price-row strong {
        font-size: 18px;
    }

    .card-action,
    .primary-button,
    .outline-button,
    .buy-box button {
        min-height: 40px;
    }

    .topup-line--crm {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    #create-topup-btn,
    .topup-line input {
        width: 100%;
    }

    .history-toolbar {
        width: 100%;
    }

    .history-toolbar label {
        width: 100%;
        display: grid;
        gap: 6px;
    }

    .history-toolbar input,
    .history-toolbar select {
        width: 100%;
        min-width: 0;
    }

    .table-wrap {
        -webkit-overflow-scrolling: touch;
    }

    table th,
    table td {
        padding: 10px 8px;
        font-size: 12px;
    }

    .wallet-side strong,
    .home-metric strong {
        font-size: 28px;
    }

    .auth-shell {
        margin-top: 12px;
        gap: 12px;
    }

    .auth-card {
        min-height: auto;
        padding: 18px;
    }

    .auth-copy {
        display: none;
    }

    .guide-grid {
        grid-template-columns: 1fr;
    }

    .home-table-toolbar {
        align-items: stretch;
    }

    .home-table-toolbar label {
        width: 100%;
        justify-content: space-between;
    }

    .home-table-toolbar input,
    .home-table-toolbar select {
        width: 100%;
    }
}

.mobile-bottom-nav {
    display: none;
}

@media (max-width: 760px) {
    .mobile-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 120;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: start;
        min-height: 68px;
        padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
        border-top: 1px solid #e9edf6;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(12px);
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.12);
    }

    .mobile-bottom-nav__item {
        display: grid;
        justify-items: center;
        align-content: start;
        gap: 4px;
        min-width: 0;
        color: #7f8898;
        font-size: 10px;
        line-height: 1.2;
        font-weight: 700;
        text-align: center;
        padding: 2px 0;
    }

    .mobile-bottom-nav__icon {
        display: grid;
        width: 24px;
        height: 24px;
        place-items: center;
        border-radius: 999px;
    }

    .mobile-bottom-nav__icon svg {
        width: 19px;
        height: 19px;
        display: block;
    }

    .mobile-bottom-nav__item.active {
        color: #1d4ed8;
    }

    .mobile-bottom-nav__item.active .mobile-bottom-nav__icon {
        background: #eef4ff;
    }
}

.guide-shell {
    max-width: 1240px;
    margin: 0 auto;
}

.guide-head {
    margin-bottom: 14px;
}

.guide-head h1 {
    margin: 0;
    color: #2f3d57;
    font-size: 34px;
    font-weight: 800;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.guide-card {
    min-height: 130px;
    padding: 16px 14px;
    border: 1px solid #e7eaf2;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
    display: grid;
    align-content: start;
    gap: 8px;
}

.guide-card h2 {
    margin: 0;
    min-height: 56px;
    color: #4a52c6;
    font-size: 29px;
    font-weight: 700;
    line-height: 1.28;
}

.guide-meta {
    margin: 0;
    color: #8a93a3;
    font-size: 14px;
}

.guide-content {
    padding: 22px;
}

.guide-card {
    min-height: 150px;
}

.guide-card h2 {
    min-height: auto;
    margin-bottom: 8px;
    color: #3746b8;
    font-size: 16px;
}

.guide-card .guide-meta {
    margin-bottom: 14px;
}

.guide-content h2,
.guide-content h3,
.guide-content h4 {
    margin-top: 16px;
    margin-bottom: 10px;
}

.guide-content ul {
    margin-top: 0;
}

.guide-video {
    position: relative;
    width: 100%;
    max-width: 740px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
}

.guide-video iframe {
    width: 100%;
    min-height: 400px;
    border: 0;
    display: block;
}

.guide-warning {
    color: #c62626;
    font-weight: 700;
}

.guide-image {
    width: 100%;
    max-width: 520px;
    border-radius: 6px;
    border: 1px solid var(--line);
    display: block;
    margin: 8px 0 14px;
}

.guide-support-box {
    margin-top: 22px;
    padding: 18px;
    border-radius: 8px;
    background: #d9dde4;
    text-align: center;
}

.guide-support-box p {
    margin: 0 0 8px;
    color: #6b7280;
    font-size: 14px;
}

.guide-highlight-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.25);
    font-weight: 800;
}

.guide-highlight-link:hover {
    background: linear-gradient(135deg, #38bdf8, #1d4ed8);
    transform: translateY(-1px);
}

/* ===== User-facing mobile-first polish ===== */
@media (max-width: 760px) {
    :root {
        --mobile-gutter: 12px;
    }

    html {
        -webkit-text-size-adjust: 100%;
    }

    body {
        min-width: 0;
        background: #f6f7fb;
    }

    img,
    video,
    iframe,
    table,
    pre,
    code {
        max-width: 100%;
    }

    input,
    select,
    textarea,
    button {
        font-size: 16px;
    }

    .page {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 8px var(--mobile-gutter) calc(92px + env(safe-area-inset-bottom)) !important;
        overflow-x: hidden !important;
    }

    .section-heading,
    .admin-header,
    .search-bar,
    .product-grid,
    .admin-grid,
    .product-form,
    .alert,
    nav[role="navigation"],
    .wallet-grid,
    .wallet-history,
    .api-doc,
    .home-dashboard,
    .guide-shell {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .topbar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        min-height: 0;
        padding: 10px;
        border: 1px solid #edf0f7;
        border-radius: 12px;
        box-shadow: 0 6px 18px rgba(15, 23, 42, .06);
    }

    .breadcrumb {
        width: 100%;
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .account-box {
        display: grid;
        grid-template-columns: 1fr auto;
        width: 100%;
        gap: 8px;
        align-items: center;
    }

    .balance-pill {
        justify-content: center;
        width: 100%;
        min-width: 0;
        padding: 0 10px;
        overflow: hidden;
        white-space: nowrap;
    }

    .balance-pill strong,
    .account-name {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .account-name {
        display: none;
    }

    .role-pill {
        justify-content: center;
        min-height: 34px;
        padding: 0 10px;
        font-size: 12px;
    }

    .section-heading,
    .admin-header,
    .guide-head {
        margin-bottom: 12px;
    }

    .section-heading h1,
    .admin-header h1,
    .guide-head h1,
    .home-welcome h1 {
        font-size: 22px !important;
        line-height: 1.22 !important;
        letter-spacing: -0.01em;
        word-break: break-word;
    }

    .section-heading p,
    .admin-header p,
    .guide-meta,
    .home-welcome p {
        font-size: 13px;
        line-height: 1.5;
    }

    .search-bar {
        height: 44px;
        margin-top: 12px;
        border-radius: 12px;
    }

    .search-bar span {
        width: 38px;
    }

    .search-bar input {
        min-width: 0;
        padding: 0 12px;
    }

    .product-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
        margin-top: 12px;
    }

    .product-card {
        display: grid;
        grid-template-columns: 118px minmax(0, 1fr);
        gap: 10px 12px;
        align-items: start;
        padding: 10px;
        border-radius: 14px;
        box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
    }

    .product-card:hover {
        transform: none;
    }

    .product-media {
        grid-row: span 5;
        width: 118px;
        height: 118px;
        padding: 6px;
        border: 1px solid #eef1f7;
        border-radius: 12px;
        background: #fff;
    }

    .product-media img {
        max-height: 104px;
    }

    .placeholder-logo span {
        width: 58px;
        height: 58px;
        border-radius: 16px;
    }

    .placeholder-logo {
        font-size: 22px;
    }

    .placeholder-logo strong {
        font-size: 10px;
    }

    .product-card h2 {
        min-height: 0;
        margin: 0;
        font-size: 14px;
        line-height: 1.35;
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }

    .tags {
        gap: 5px;
    }

    .tags span {
        min-height: 20px;
        padding: 0 7px;
        font-size: 10px;
    }

    .price-row {
        margin: 0;
        flex-wrap: wrap;
        gap: 3px 8px;
    }

    .price-row strong {
        font-size: 17px;
        line-height: 1.2;
    }

    .card-action {
        min-height: 38px;
        border-radius: 10px;
        font-size: 13px;
    }

    .buy-modal {
        width: 100vw;
        max-width: 100vw;
        max-height: 88dvh;
        margin: auto 0 0;
        border-radius: 18px 18px 0 0;
        overflow: auto;
    }

    .buy-modal-form {
        gap: 12px;
        padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
    }

    .modal-close {
        top: 8px;
        right: 8px;
        width: 34px;
        height: 34px;
        border-radius: 10px;
        box-shadow: none;
    }

    .coupon-line {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .coupon-line input,
    .coupon-line button {
        width: 100%;
        min-height: 40px;
        border: 1px solid #cfd6e3;
        border-radius: 10px;
    }

    .modal-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .modal-actions .ghost-button,
    .modal-actions .primary-button {
        width: 100%;
        min-height: 42px;
        border-radius: 10px;
    }

    .panel,
    .topup-card,
    .wallet-side,
    .api-hero,
    .api-key-card,
    .api-section,
    .home-welcome,
    .home-metric,
    .home-table,
    .guide-card,
    .guide-content {
        padding: 12px;
        border-radius: 14px;
        box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
    }

    .home-dashboard,
    .wallet-main,
    .topup-modern,
    .api-doc,
    .guide-shell {
        gap: 12px;
    }

    .home-metrics,
    .guide-grid,
    .wallet-grid,
    .auth-shell,
    .metric-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .home-actions,
    .header-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        gap: 8px;
    }

    .home-actions .primary-button,
    .home-actions .outline-button,
    .admin-header .primary-button,
    .admin-header .outline-button,
    .header-actions .primary-button,
    .header-actions .outline-button {
        width: 100%;
        min-height: 42px;
    }

    .home-metric {
        min-height: 78px;
    }

    .home-metric strong,
    .wallet-side strong {
        font-size: 25px;
        word-break: break-word;
    }

    .home-table-head,
    .home-table-toolbar,
    .history-head,
    .history-toolbar,
    .api-hero,
    .finance-section-head {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 8px;
    }

    .home-table-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .home-table-tabs button {
        min-height: 34px;
    }

    .home-table-toolbar label,
    .history-toolbar label {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        gap: 5px;
    }

    .home-table-toolbar input,
    .home-table-toolbar select,
    .history-toolbar input,
    .history-toolbar select,
    .tx-toolbar input,
    .tx-toolbar select {
        width: 100%;
        min-width: 0;
        min-height: 40px;
    }

    .table-wrap {
        overflow-x: visible !important;
    }

    table:not(.desktop-table) {
        display: block;
        width: 100%;
    }

    table:not(.desktop-table) thead {
        display: none;
    }

    table:not(.desktop-table) tbody,
    table:not(.desktop-table) tr,
    table:not(.desktop-table) td {
        display: block;
        width: 100%;
    }

    table:not(.desktop-table) tr {
        margin: 0 0 10px;
        padding: 10px;
        border: 1px solid #edf1f7;
        border-radius: 12px;
        background: #fff;
    }

    table:not(.desktop-table) td {
        display: grid;
        grid-template-columns: minmax(96px, 38%) minmax(0, 1fr);
        gap: 8px;
        padding: 7px 0;
        border: 0;
        white-space: normal;
        overflow-wrap: anywhere;
        font-size: 13px;
    }

    table:not(.desktop-table) td::before {
        content: attr(data-label);
        color: #7a8494;
        font-size: 12px;
        font-weight: 800;
    }

    table:not(.desktop-table) td[colspan] {
        display: block;
        text-align: center;
    }

    table:not(.desktop-table) td[colspan]::before {
        content: none;
    }

    td code,
    .tx-code,
    .api-key-card code,
    .api-section pre {
        white-space: pre-wrap;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .topup-line,
    .topup-line--crm,
    .topup-line--mobile-like,
    .bank-card,
    .modal-bank-card {
        grid-template-columns: 1fr !important;
        width: 100%;
    }

    .topup-info-box {
        font-size: 12.5px;
    }

    .topup-modal__content {
        width: 100%;
        max-width: 100%;
    }

    .qr-image-box {
        width: min(260px, 100%);
    }

    .guide-content {
        font-size: 14px;
        line-height: 1.65;
    }

    .guide-content h2 {
        font-size: 19px;
    }

    .guide-content h3 {
        font-size: 17px;
    }

    .guide-content h4 {
        font-size: 15px;
    }

    .guide-content ul {
        padding-left: 20px;
    }

    .guide-video iframe {
        min-height: 210px;
    }

    .guide-image {
        max-width: 100%;
        height: auto;
    }

    nav[role="navigation"] > div {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        text-align: center;
    }

    .mobile-bottom-nav {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        min-height: 68px;
        padding-left: 4px;
        padding-right: 4px;
    }

    .mobile-bottom-nav__item {
        font-size: 10px;
        line-height: 1.15;
    }

    .mobile-bottom-nav__icon,
    .mobile-bottom-nav__icon svg {
        width: 19px;
        height: 19px;
    }
}

@media (max-width: 380px) {
    .product-card {
        grid-template-columns: 96px minmax(0, 1fr);
    }

    .product-media {
        width: 96px;
        height: 104px;
    }

    .product-media img {
        max-height: 88px;
    }

    table:not(.desktop-table) td {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}
