:root {
    --bg: #F1F3F7;
    --surface: #ffffff;
    --surface-soft: #F5F7FA;
    --text: #1F2937;
    --muted: #6B7280;
    --line: #e4e8ec;
    --primary: #1F2D4D;
    --primary-2: #2B416A;
    --danger: #a33b3b;
    --success: #236a4a;
    --shadow: 0 14px 34px rgba(21, 31, 38, .08);
    --radius: 18px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
code { padding: .15rem .38rem; border-radius: 6px; background: #edf1f3; font-size: .9em; }

.topbar { height: 74px; padding: 0 26px; display: flex; align-items: center; justify-content: space-between; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand, .auth-card-heading { display: flex; align-items: center; gap: 12px; }
.brand strong, .auth-card-heading strong { display: block; }
.brand small, .auth-card-heading small { display: block; color: var(--muted); margin-top: 2px; }
.brand-mark, .auth-logo { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; color: #fff; background: linear-gradient(145deg, var(--primary), var(--primary-2)); font-weight: 800; box-shadow: 0 9px 18px rgba(31,45,77,.2); }
.topbar-actions, .user-chip { display: flex; align-items: center; gap: 12px; }
.user-chip { padding: 6px 10px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--primary); font-weight: 700; }
.user-chip-text strong, .user-chip-text small { display: block; line-height: 1.15; }
.user-chip-text small { color: var(--muted); font-size: .72rem; margin-top: 3px; text-transform: uppercase; }
.workspace { min-height: calc(100vh - 74px); display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.sidebar { padding: 22px 14px; border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; justify-content: space-between; }
.nav-item { display: flex; gap: 11px; align-items: center; padding: 11px 13px; margin-bottom: 4px; border-radius: 11px; color: #414b54; font-weight: 650; }
.nav-item:hover { background: #EEF2F8; color: var(--primary); }
.nav-label { margin: 24px 13px 8px; color: #8a929a; font-size: .72rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.sidebar-foot { padding: 12px; color: #9aa1a8; font-size: .76rem; }
.main-content { padding: 34px; min-width: 0; }
.mobile-menu { display: none; margin-bottom: 14px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 12px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.page-head h1 { margin: 3px 0 8px; font-size: clamp(1.8rem, 3vw, 2.7rem); letter-spacing: -.04em; }
.page-head p { margin: 0; color: var(--muted); max-width: 680px; line-height: 1.6; }
.eyebrow { color: var(--primary-2) !important; font-size: .76rem; font-weight: 850; letter-spacing: .13em; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 15px; border: 1px solid transparent; border-radius: 11px; font-weight: 750; transition: .16s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #fff; background: var(--primary); box-shadow: 0 8px 18px rgba(31,45,77,.16); }
.btn-primary:hover { background: var(--primary-2); }
.btn-secondary { background: #fff; border-color: var(--line); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-icon { width: 42px; padding: 0; }
.btn-block { width: 100%; }
.btn-small { min-height: 34px; padding: 6px 11px; font-size: .86rem; }

.app-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.app-card { min-height: 170px; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 5px 16px rgba(21,31,38,.035); display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: start; transition: .18s ease; }
.app-card:hover { transform: translateY(-3px); border-color: #C8D0DE; box-shadow: var(--shadow); }
.app-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 15px; background: #EDF1F7; color: var(--primary); font-size: 1.35rem; font-weight: 800; }
.app-card h2 { margin: 4px 0 8px; font-size: 1.08rem; }
.app-card p { margin: 0; color: var(--muted); line-height: 1.5; font-size: .91rem; }
.app-arrow { color: #839089; font-size: 1.2rem; }

.alert { padding: 12px 14px; margin-bottom: 18px; border-radius: 11px; border: 1px solid; line-height: 1.45; }
.alert-success { color: var(--success); background: #edf8f2; border-color: #cce8d9; }
.alert-error { color: var(--danger); background: #fff2f1; border-color: #efcfcb; }
.empty-state { padding: 55px 25px; text-align: center; border: 1px dashed #cfd6db; border-radius: var(--radius); background: rgba(255,255,255,.65); }
.empty-state h1 { margin: 8px 0 0; font-size: 3rem; }
.empty-state h2 { margin: 8px 0; }
.empty-state p { color: var(--muted); margin: 0 auto 20px; max-width: 600px; line-height: 1.6; }
.empty-icon { width: 58px; height: 58px; margin: auto; display: grid; place-items: center; border-radius: 18px; background: #EDF1F7; color: var(--primary); font-size: 1.6rem; font-weight: 850; }

.table-card, .form-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 5px 16px rgba(21,31,38,.035); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 18px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; background: var(--surface-soft); }
td strong, td small { display: block; }
td small { margin-top: 4px; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
.text-right { text-align: right; }
.badge, .status { display: inline-flex; padding: 4px 9px; border-radius: 999px; background: #edf1f3; font-size: .76rem; font-weight: 800; }
.status-active { color: var(--success); background: #e8f6ee; }
.status-disabled { color: #7d5555; background: #f5eaea; }

.form-card { padding: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: block; }
.field-full { grid-column: 1 / -1; }
.field > span, .toggle-field > span { display: block; margin-bottom: 8px; font-size: .88rem; font-weight: 750; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #d7dde1; border-radius: 11px; background: #fff; padding: 11px 12px; color: var(--text); outline: 0; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #71809D; box-shadow: 0 0 0 3px rgba(31,45,77,.11); }
.toggle-field { display: flex; align-items: center; gap: 10px; padding-top: 31px; }
.toggle-field span { margin: 0; }
.permission-box { margin-top: 23px; padding: 20px; border-radius: 14px; background: var(--surface-soft); border: 1px solid var(--line); }
.permission-box h2 { margin: 0 0 6px; font-size: 1rem; }
.permission-box p { margin: 0 0 14px; color: var(--muted); font-size: .88rem; }
.check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.check-card { display: flex; gap: 9px; align-items: center; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.form-actions { margin-top: 23px; display: flex; justify-content: flex-end; }

.auth-body { background: var(--background, #F1F3F7); }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-panel { padding: clamp(32px, 6vw, 88px); }
.auth-intro { color: #fff; background: radial-gradient(circle at 18% 8%, rgba(255,255,255,.12) 0, transparent 34%), linear-gradient(145deg, var(--primary), #111B31); display: flex; flex-direction: column; justify-content: space-between; }
.auth-logo { width: 58px; height: 58px; margin-bottom: 42px; background: rgba(255,255,255,.14); box-shadow: none; }
.auth-intro .eyebrow { color: #D8DFEB !important; }
.auth-intro h1 { margin: 12px 0 20px; font-size: clamp(2.3rem, 5vw, 4.8rem); letter-spacing: -.055em; line-height: 1.03; }
.auth-intro p { max-width: 640px; color: #E3E8F0; line-height: 1.75; font-size: 1.02rem; }
.auth-intro small { color: #C4CDDB; }
.auth-form-panel { display: grid; place-items: center; }
.auth-card { width: min(420px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.auth-card-heading { margin-bottom: 28px; }
.auth-card .field { margin-bottom: 17px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 67px; }
.password-toggle { position: absolute; right: 7px; top: 7px; border: 0; padding: 5px 7px; color: var(--primary); background: transparent; font-weight: 750; }
.form-note { margin: 15px 0 0; text-align: center; color: var(--muted); font-size: .78rem; }
.installer-wrap { min-height: 100vh; padding: 32px 16px; display: grid; place-items: center; }
.installer-card { width: min(760px, 100%); padding: 28px; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.installer-card h2 { margin: 28px 0 15px; font-size: 1rem; }

@media (max-width: 1050px) {
    .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-intro { min-height: 360px; }
}
@media (max-width: 760px) {
    .topbar { height: 66px; padding: 0 14px; }
    .brand small, .user-chip-text { display: none; }
    .workspace { display: block; min-height: calc(100vh - 66px); }
    .sidebar { display: none; position: fixed; top: 66px; left: 0; bottom: 0; width: min(280px, 85vw); z-index: 30; box-shadow: var(--shadow); }
    .sidebar.is-open { display: flex; }
    .mobile-menu { display: inline-flex; }
    .main-content { padding: 20px 14px 36px; }
    .page-head { flex-direction: column; }
    .app-grid, .check-grid, .form-grid { grid-template-columns: 1fr; }
    .field-full { grid-column: auto; }
    .app-card { min-height: 145px; }
    th, td { padding: 13px 14px; white-space: nowrap; }
    .auth-panel { padding: 32px 20px; }
    .auth-intro { min-height: 300px; }
    .auth-intro h1 { font-size: 2.55rem; }
    .auth-card { padding: 23px; }
}

/* Brand logo support */
.brand-mark-image { overflow: hidden; padding: 5px; background: #fff; }
.brand-mark-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.auth-logo.brand-mark-image { width: 132px; height: 132px; margin-bottom: 34px; padding: 0; border-radius: 0; background: transparent; box-shadow: none; }
.auth-card-heading .brand-mark-image { flex: 0 0 42px; }

/* Branding settings */
.branding-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.branding-main { display: grid; gap: 18px; min-width: 0; }
.settings-section { padding: 22px; }
.section-heading { display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: start; margin-bottom: 20px; }
.section-heading h2 { margin: 1px 0 5px; font-size: 1.05rem; }
.section-heading p { margin: 0; color: var(--muted); line-height: 1.5; font-size: .88rem; }
.section-number { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--primary); font-weight: 800; }
.upload-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.upload-card { min-width: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface-soft); }
.upload-preview { min-height: 180px; padding: 20px; display: grid; place-items: center; background: #fff; border-bottom: 1px solid var(--line); color: var(--muted); }
.upload-preview.preview-dark { background: var(--primary); color: #fff; }
.upload-preview img { display: block; width: 100%; height: 140px; object-fit: contain; }
.upload-card-body { display: grid; gap: 8px; padding: 14px; }
.upload-card-body strong, .upload-card-body small { display: block; }
.upload-card-body small { min-height: 35px; color: var(--muted); line-height: 1.45; }
.upload-card-body input[type=file] { width: 100%; font-size: .82rem; }
.remove-file { display: inline-flex; align-items: center; gap: 7px; color: var(--danger); font-size: .8rem; }
.field-help { margin: 13px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.color-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.color-field { display: grid; gap: 8px; }
.color-field > span { font-size: .86rem; font-weight: 750; }
.color-control { display: grid; grid-template-columns: 48px 1fr; gap: 8px; }
.color-control input[type=color] { width: 48px; height: 43px; padding: 3px; border: 1px solid #D7DDE1; border-radius: 10px; background: #fff; }
.color-control input[type=text] { min-width: 0; border: 1px solid #D7DDE1; border-radius: 10px; padding: 10px 11px; text-transform: uppercase; }
.sticky-actions { position: sticky; bottom: 12px; padding: 12px; margin-top: 0; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); box-shadow: var(--shadow); }
.branding-preview-wrap { position: sticky; top: 96px; }
.branding-preview { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.preview-header { min-height: 66px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; background: var(--surface); }
.preview-header .preview-logo { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: var(--primary); font-weight: 800; }
.preview-header .preview-logo.brand-mark-image { padding: 5px; background: #fff; }
.preview-header strong, .preview-header small { display: block; }
.preview-header small { margin-top: 2px; color: var(--muted); font-size: .72rem; }
.preview-hero { min-height: 250px; padding: 28px 22px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; color: #fff; background: radial-gradient(circle at 18% 8%, rgba(255,255,255,.13), transparent 37%), linear-gradient(145deg, var(--primary), #111B31); }
.preview-hero .preview-hero-logo { width: 94px; height: 94px; margin-bottom: auto; display: grid; place-items: center; color: #fff; font-weight: 800; }
.preview-hero .preview-hero-logo.brand-mark-image { padding: 0; background: transparent; }
.preview-hero p { margin: 20px 0 6px; color: #E3E8F0; font-size: .72rem; letter-spacing: .09em; }
.preview-hero h3 { margin: 0; font-size: 1.45rem; }
.preview-content { padding: 16px; background: var(--background, var(--bg)); }
.preview-card { padding: 14px; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.preview-card span { grid-row: 1 / 3; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--primary); background: var(--surface-soft); }
.preview-card small { color: var(--muted); }
.preview-content button { width: 100%; margin-top: 12px; padding: 11px; border: 0; border-radius: 11px; color: #fff; background: var(--primary); font-weight: 750; }
.preview-note { margin: 10px 4px 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }

@media (max-width: 1120px) {
    .branding-layout { grid-template-columns: 1fr; }
    .branding-preview-wrap { position: static; }
    .branding-preview { max-width: 520px; }
}
@media (max-width: 760px) {
    .auth-logo.brand-mark-image { width: 104px; height: 104px; margin-bottom: 24px; }
    .upload-grid, .color-grid { grid-template-columns: 1fr; }
    .upload-preview { min-height: 150px; }
    .upload-preview img { height: 115px; }
    .settings-section { padding: 17px; }
}

/* Payment Page module administration */
.page-head-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.module-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.module-admin-card { min-width: 0; padding: 21px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow); }
.module-admin-card-head { display: flex; align-items: center; justify-content: space-between; }
.module-admin-card h2 { margin: 18px 0 5px; color: var(--primary); font-size: 1.12rem; }
.module-admin-card > p { margin: 0; color: var(--muted); }
.module-admin-meta { margin-top: 18px; padding-top: 14px; display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.module-admin-actions { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 7px; }
.payment-asset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.payment-asset-grid .upload-preview { min-height: 135px; }
.payment-asset-grid .upload-preview img { height: 105px; }
.payment-asset-grid .payment-bg-preview img { width: 100%; object-fit: cover; border-radius: 8px; }
.payment-admin-preview .preview-hero { min-height: 280px; }
.payment-preview-link { margin-top: 12px; }
.public-link-card { margin-bottom: 16px; padding: 15px 17px; display: flex; justify-content: space-between; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.public-link-card strong, .public-link-card code { display: block; }
.public-link-card code { margin-top: 4px; color: var(--muted); overflow-wrap: anywhere; }
.admin-bank-cell { display: flex; align-items: center; gap: 10px; }
.admin-bank-cell i.bank { width: 34px; height: 34px; flex: 0 0 34px; }
.admin-bank-cell span, .admin-bank-cell strong, .admin-bank-cell small { display: block; }
.admin-bank-cell small { color: var(--muted); }
.inline-image-preview { margin-bottom: 10px; padding: 12px; display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.inline-image-preview img { width: 100px; height: 100px; object-fit: contain; background: #fff; border-radius: 9px; }
.field-inline-help { display: block; margin-top: 7px; color: var(--muted); font-size: .78rem; }
.split-actions { justify-content: space-between; }
.btn-danger { color: #fff; background: var(--danger); }
.empty-state.compact { padding: 24px; }
.empty-state.compact h2 { font-size: 1rem; }

@media (max-width: 1100px) {
    .module-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .payment-asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .module-card-grid, .payment-asset-grid { grid-template-columns: 1fr; }
    .public-link-card { align-items: flex-start; flex-direction: column; }
    .split-actions { gap: 10px; }
}


/* Bank icon selector: human-readable dropdown with an immediate visual hint. */
.bank-icon-picker .bank-icon-hint { display: flex; align-items: center; gap: 12px; margin-top: 9px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.bank-icon-picker .bank-icon-hint i.bank { width: 42px; height: 42px; flex: 0 0 42px; }
.bank-icon-picker .bank-icon-hint span, .bank-icon-picker .bank-icon-hint strong, .bank-icon-picker .bank-icon-hint code { display: block; }
.bank-icon-picker .bank-icon-hint strong { color: var(--text); font-size: .88rem; line-height: 1.35; }
.bank-icon-picker .bank-icon-hint code { margin-top: 3px; color: var(--muted); font-size: .76rem; }
