:root {
    --ui-ink: #12233f;
    --ui-ink-soft: #5f6f81;
    --ui-ink-faint: #7d8896;
    --ui-bg-top: #f6efe2;
    --ui-bg-bottom: #e4ebf4;
    --ui-panel: rgba(255, 252, 247, 0.92);
    --ui-panel-strong: #fffdfa;
    --ui-border: rgba(18, 35, 63, 0.12);
    --ui-border-strong: rgba(18, 35, 63, 0.2);
    --ui-primary: #17324f;
    --ui-primary-2: #244d6e;
    --ui-accent: #ba8d47;
    --ui-accent-soft: #efe2cc;
    --ui-success: #1d7a59;
    --ui-success-bg: #e6f4ee;
    --ui-warning: #8b6420;
    --ui-warning-bg: #fff5dd;
    --ui-danger: #9a3f3f;
    --ui-danger-bg: #fbe9e9;
    --ui-shadow: 0 24px 70px rgba(18, 35, 63, 0.12);
    --ui-radius-xl: 30px;
    --ui-radius-lg: 24px;
    --ui-radius-md: 18px;
    --ui-radius-sm: 12px;
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(18, 35, 63, 0.25) transparent;
}

body {
    min-height: 100vh;
    position: relative;
    color: var(--ui-ink);
    background:
        radial-gradient(circle at top left, rgba(186, 141, 71, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(36, 77, 110, 0.16), transparent 25%),
        linear-gradient(180deg, var(--ui-bg-top), var(--ui-bg-bottom)) !important;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: auto;
    pointer-events: none;
    z-index: 0;
    border-radius: 999px;
    filter: blur(20px);
}

body::before {
    top: -40px;
    left: -60px;
    width: 220px;
    height: 220px;
    background: rgba(186, 141, 71, 0.1);
}

body::after {
    right: -80px;
    bottom: -80px;
    width: 260px;
    height: 260px;
    background: rgba(36, 77, 110, 0.1);
}

body > * {
    position: relative;
    z-index: 1;
}

h1,
h2,
h3,
h4 {
    color: var(--ui-ink) !important;
}

h1,
h2,
.hero h1,
.panel h2,
.action h3,
.account-popup h2 {
    font-family: Georgia, "Times New Roman", serif !important;
    letter-spacing: -0.02em;
}

p,
small,
.subtitle,
.method-description,
.muted-text,
.service-note,
.tx-sub,
.hero-copy p,
.head p {
    color: var(--ui-ink-soft) !important;
}

a {
    transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

a:hover {
    opacity: 0.95;
}

.navbar {
    padding: 22px 28px !important;
    background: linear-gradient(135deg, var(--ui-primary), var(--ui-primary-2)) !important;
    color: #fffaf5 !important;
    border-bottom: 1px solid rgba(255, 250, 245, 0.12);
    box-shadow: 0 14px 30px rgba(18, 35, 63, 0.16);
}

.navbar h1,
.navbar div,
.navbar span,
.navbar a {
    color: #fffaf5 !important;
}

body > .container {
    width: min(100%, 540px);
    margin: 48px auto;
    padding: 0 20px;
}

body > .container > .container {
    margin: 0;
    padding: 0;
}

body > .container:not(:has(.sidebar)) {
    background: var(--ui-panel);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-xl);
    box-shadow: var(--ui-shadow);
    backdrop-filter: blur(8px);
    padding: 34px 30px;
}

body > .navbar + .container {
    width: min(1280px, calc(100% - 32px));
    max-width: none;
    margin: 26px auto 40px !important;
    padding: 0;
}

.container {
    color: var(--ui-ink);
}

.container .card,
.hero,
.panel {
    background: var(--ui-panel) !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: var(--ui-radius-lg) !important;
    box-shadow: var(--ui-shadow) !important;
    backdrop-filter: blur(8px);
}

.card {
    padding: 28px !important;
}

.sidebar {
    background: rgba(255, 252, 247, 0.9) !important;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow);
    margin-right: 24px;
    padding: 18px 0 !important;
}

.container:has(.sidebar) {
    display: grid !important;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    min-height: auto !important;
}

.main-content {
    padding: 0 !important;
}

.sidebar-menu {
    padding: 0 12px;
}

.sidebar-menu a {
    border-left: none !important;
    border-radius: 14px;
    margin: 4px 0;
    padding: 14px 16px !important;
    color: var(--ui-ink) !important;
    font-weight: 600;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: linear-gradient(135deg, rgba(23, 50, 79, 0.1), rgba(186, 141, 71, 0.14)) !important;
    color: var(--ui-primary) !important;
}

.subtitle {
    margin-bottom: 26px !important;
}

.alert {
    border-radius: var(--ui-radius-sm) !important;
    border: 1px solid transparent;
    padding: 14px 16px !important;
    margin-bottom: 18px !important;
}

.alert-success,
.alert.ok,
.flash.ok {
    background: var(--ui-success-bg) !important;
    color: var(--ui-success) !important;
    border-color: rgba(29, 122, 89, 0.16) !important;
}

.alert-error,
.flash.bad {
    background: var(--ui-danger-bg) !important;
    color: var(--ui-danger) !important;
    border-color: rgba(154, 63, 63, 0.14) !important;
}

.balance-info,
.readiness-box,
.otp-preview,
.service-note,
.method-section,
.meter,
.account-popup-note {
    border-radius: var(--ui-radius-md) !important;
}

.balance-info,
.otp-preview,
.readiness-box,
.method-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(239, 226, 204, 0.46)) !important;
    border: 1px solid var(--ui-border) !important;
    border-left-width: 1px !important;
}

.form-group label,
label {
    color: var(--ui-ink) !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 13px 14px !important;
    border-radius: 14px !important;
    border: 1px solid var(--ui-border-strong) !important;
    background: rgba(255, 255, 255, 0.96) !important;
    color: var(--ui-ink) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

input:focus,
select:focus,
textarea:focus {
    outline: none !important;
    border-color: rgba(36, 77, 110, 0.5) !important;
    box-shadow: 0 0 0 4px rgba(36, 77, 110, 0.1) !important;
}

button,
.btn-primary,
.btn-secondary,
.btn-approve,
.btn-reject,
.save-btn,
.logout,
.hero-btn,
.popup-btn,
.amount-btn {
    border-radius: 999px !important;
    font-weight: 700 !important;
}

button,
.btn-primary,
.save-btn,
.btn-approve,
.popup-btn.primary {
    background: linear-gradient(135deg, var(--ui-primary), var(--ui-primary-2)) !important;
    color: #fffaf5 !important;
    border: none !important;
    box-shadow: 0 14px 24px rgba(18, 35, 63, 0.18);
}

button:hover,
.btn-primary:hover,
.save-btn:hover,
.btn-approve:hover,
.popup-btn.primary:hover,
.hero-btn.primary:hover,
.logout:hover {
    transform: translateY(-2px);
}

.btn-secondary,
.popup-btn.secondary,
.hero-btn.secondary,
.amount-btn {
    background: rgba(255, 255, 255, 0.94) !important;
    color: var(--ui-primary) !important;
    border: 1px solid var(--ui-border) !important;
    box-shadow: 0 10px 20px rgba(18, 35, 63, 0.08);
}

.btn-reject {
    background: linear-gradient(135deg, #8b3f3f, #b55f5f) !important;
    color: #fff !important;
}

button[disabled],
.btn-disabled,
input[disabled],
select[disabled] {
    cursor: not-allowed !important;
    opacity: 0.62 !important;
    box-shadow: none !important;
}

.action-buttons,
.links,
.pagination,
.suggested-amounts,
.config-status,
.account-popup-actions {
    gap: 12px !important;
}

.filters {
    flex-wrap: wrap;
    margin-bottom: 22px !important;
}

table,
.transaction-table {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid var(--ui-border);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
}

th,
.transaction-table th {
    background: linear-gradient(180deg, rgba(18, 35, 63, 0.05), rgba(18, 35, 63, 0.02)) !important;
    color: var(--ui-ink) !important;
    font-weight: 700 !important;
    border-bottom: 1px solid var(--ui-border) !important;
}

td,
.transaction-table td {
    color: var(--ui-ink);
    border-bottom: 1px solid rgba(18, 35, 63, 0.08) !important;
}

tr:hover,
.transaction-table tr:hover {
    background: rgba(23, 50, 79, 0.03) !important;
}

.badge,
.status-badge,
.type-badge,
.transaction-type,
.method-code,
.type,
.badge.ok,
.badge.warn,
.badge.bad,
.badge.neutral {
    border-radius: 999px !important;
    padding: 6px 10px !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em;
}

.badge-active,
.status-success,
.type-add,
.badge.ok,
.type.add {
    background: var(--ui-success-bg) !important;
    color: var(--ui-success) !important;
}

.badge-inactive,
.status-failed,
.status-rejected,
.type-withdraw,
.badge.bad,
.type.withdraw {
    background: var(--ui-danger-bg) !important;
    color: var(--ui-danger) !important;
}

.status-pending,
.badge.warn,
.badge-merchant {
    background: var(--ui-warning-bg) !important;
    color: var(--ui-warning) !important;
}

.badge-user,
.badge.neutral {
    background: rgba(23, 50, 79, 0.08) !important;
    color: var(--ui-primary) !important;
}

.pagination a,
.pagination span {
    border-radius: 999px !important;
    border: 1px solid var(--ui-border) !important;
    background: rgba(255, 255, 255, 0.9) !important;
    color: var(--ui-primary) !important;
}

.pagination .active {
    background: linear-gradient(135deg, var(--ui-primary), var(--ui-primary-2)) !important;
    color: #fffaf5 !important;
}

.back-link a,
.link,
.links a,
.login-link a,
.signup-link a,
.resend-link button,
.back-link a,
.sidebar-menu a,
.config-header p a {
    color: var(--ui-primary) !important;
    font-weight: 700;
}

.method-card,
.tx,
.stat,
.mini,
.balance-card,
.meta,
.account-popup-stat,
.processing-card {
    background: rgba(255, 255, 255, 0.94) !important;
    border: 1px solid var(--ui-border) !important;
    box-shadow: 0 14px 30px rgba(18, 35, 63, 0.08);
}

.hero {
    background: linear-gradient(135deg, var(--ui-primary), #284e70 65%, #466a87) !important;
    color: #fffaf5 !important;
}

.hero p,
.hero .status-pill,
.hero .brand,
.hero .eyebrow,
.hero .meta-text {
    color: rgba(255, 250, 245, 0.8) !important;
}

.hero .meta,
.hero .balance-card,
.hero .mini {
    color: var(--ui-ink) !important;
}

.hero .meta span,
.hero .balance-card span,
.hero .mini span,
.hero .balance-note {
    color: var(--ui-ink-soft) !important;
}

.hero .meta strong,
.hero .balance,
.hero .mini strong {
    color: var(--ui-ink) !important;
}

.panel,
.card,
.account-popup {
    background: var(--ui-panel) !important;
}

.service {
    border-bottom: 1px solid var(--ui-border) !important;
}

.otp-preview-code {
    color: var(--ui-primary) !important;
}

.config-box,
.readiness-box,
.otp-preview {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.toggle-switch input {
    border: 1px solid rgba(18, 35, 63, 0.12);
    box-shadow: inset 0 2px 6px rgba(18, 35, 63, 0.1);
}

.toggle-switch input:checked {
    background: linear-gradient(135deg, var(--ui-primary), var(--ui-accent)) !important;
}

.empty,
.no-transactions {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px dashed var(--ui-border) !important;
    border-radius: var(--ui-radius-md);
}

.readiness-box.ready strong {
    color: var(--ui-success) !important;
}

.readiness-box.pending strong {
    color: var(--ui-warning) !important;
}

.processing-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
}

.processing-card {
    width: min(100%, 560px);
    padding: 36px 34px;
    text-align: center;
    border-radius: var(--ui-radius-lg);
}

.processing-card h1 {
    margin-bottom: 14px;
}

.processing-card p {
    margin-bottom: 10px;
}

.processing-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    margin-bottom: 20px;
    border-radius: 999px;
    background: rgba(23, 50, 79, 0.08);
    color: var(--ui-primary);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.processing-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--ui-accent);
    box-shadow: 0 0 0 10px rgba(186, 141, 71, 0.16);
    animation: processing-pulse 1.8s ease-in-out infinite;
}

@keyframes processing-pulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.25);
        opacity: 0.72;
    }
}

.dashboard-page .family-shell {
    padding-bottom: 110px;
}

.dashboard-page .topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.family-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.family-tile {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(239, 226, 204, 0.52));
    border: 1px solid var(--ui-border);
    border-radius: 22px;
    box-shadow: 0 16px 34px rgba(18, 35, 63, 0.08);
    padding: 18px 18px 16px;
}

.family-tile span,
.mobile-dock-item small {
    display: block;
    font-size: 0.73rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ui-ink-faint);
}

.family-tile strong {
    display: block;
    margin-top: 8px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.45rem;
    line-height: 1.1;
    color: var(--ui-ink);
}

.family-tile small {
    display: block;
    margin-top: 8px;
    line-height: 1.5;
    color: var(--ui-ink-soft);
}

.mobile-dock {
    display: none;
}

.mobile-menu-toggle {
    display: none;
}

.mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 48;
    padding: 18px;
    background: rgba(18, 35, 63, 0.4);
    backdrop-filter: blur(10px);
}

.mobile-menu-backdrop[hidden] {
    display: none;
}

.mobile-menu-panel {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    background: linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(245, 234, 214, 0.98));
    border: 1px solid rgba(18, 35, 63, 0.1);
    border-radius: 30px;
    box-shadow: 0 32px 70px rgba(18, 35, 63, 0.24);
    padding: 22px 18px 18px;
    animation: mobile-menu-rise 0.22s ease-out both;
}

.mobile-menu-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: rgba(18, 35, 63, 0.08) !important;
    color: var(--ui-primary) !important;
    border: 1px solid rgba(18, 35, 63, 0.1) !important;
    box-shadow: none !important;
}

.mobile-menu-kicker {
    font-size: 0.74rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ui-accent);
    margin-bottom: 10px;
}

.mobile-menu-copy {
    margin-top: 10px;
    margin-bottom: 18px;
    color: var(--ui-ink-soft) !important;
}

.mobile-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.mobile-menu-link {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 92px;
    padding: 16px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(18, 35, 63, 0.1);
    box-shadow: 0 14px 30px rgba(18, 35, 63, 0.08);
    color: var(--ui-ink) !important;
    text-align: left;
}

.mobile-menu-link span {
    display: block;
    font-size: 1rem;
    font-weight: 700;
}

.mobile-menu-link small {
    display: block;
    margin-top: 10px;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--ui-ink-soft);
}

.mobile-menu-link.active {
    background: linear-gradient(135deg, var(--ui-primary), #325a7c);
    color: #fffaf5 !important;
}

.mobile-menu-link.active small {
    color: rgba(255, 250, 245, 0.78);
}

.mobile-menu-link.accent {
    background: linear-gradient(135deg, rgba(186, 141, 71, 0.18), rgba(255, 255, 255, 0.95));
}

.mobile-menu-link.danger {
    background: linear-gradient(135deg, rgba(154, 63, 63, 0.1), rgba(255, 255, 255, 0.94));
}

.mobile-menu-link.danger span {
    color: var(--ui-danger);
}

.mobile-menu-link.disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.mobile-menu-button {
    width: 100%;
    border: 1px solid rgba(18, 35, 63, 0.1) !important;
    box-shadow: 0 14px 30px rgba(18, 35, 63, 0.08) !important;
    background: rgba(255, 255, 255, 0.9) !important;
    color: var(--ui-ink) !important;
    text-align: left;
}

@keyframes mobile-menu-rise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 58px;
    padding: 10px 12px;
    border-radius: 18px;
    color: var(--ui-primary) !important;
    text-align: center;
    font-weight: 700;
}

.mobile-dock-item.active {
    background: linear-gradient(135deg, var(--ui-primary), var(--ui-primary-2));
    color: #fffaf5 !important;
    box-shadow: 0 14px 24px rgba(18, 35, 63, 0.18);
}

.mobile-dock-item.active small {
    color: rgba(255, 250, 245, 0.78);
}

.mobile-dock-item.disabled {
    opacity: 0.56;
    cursor: not-allowed;
}

.history-page .history-shell {
    display: grid;
    gap: 24px;
}

.history-page .history-header,
.history-page .history-actions,
.history-page .history-list-head,
.history-page .history-chip-row,
.history-page .history-card-top,
.history-page .history-meta-row {
    display: flex;
    gap: 14px;
}

.history-page .history-header,
.history-page .history-list-head,
.history-page .history-card-top {
    justify-content: space-between;
    align-items: flex-start;
}

.history-page .history-actions,
.history-page .history-chip-row,
.history-page .history-meta-row {
    flex-wrap: wrap;
}

.history-page .history-actions {
    justify-content: flex-end;
}

.history-page .history-intro {
    max-width: 58ch;
    margin-top: 10px;
    color: var(--ui-ink-soft);
    line-height: 1.7;
}

.history-page .history-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.history-page .history-summary-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 226, 204, 0.52));
    border: 1px solid var(--ui-border);
    border-radius: 22px;
    box-shadow: 0 16px 34px rgba(18, 35, 63, 0.08);
    padding: 20px 18px;
}

.history-page .history-summary-card span,
.history-page .history-meta-pill span {
    display: block;
    font-size: 0.73rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ui-ink-faint);
}

.history-page .history-summary-card strong {
    display: block;
    margin-top: 8px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.55rem;
    line-height: 1.1;
    color: var(--ui-ink);
}

.history-page .history-summary-card small {
    display: block;
    margin-top: 8px;
    line-height: 1.55;
    color: var(--ui-ink-soft);
}

.history-page .history-filter-form {
    align-items: end;
}

.history-page .history-filter-group {
    flex: 1 1 200px;
    min-width: 180px;
}

.history-page .history-list {
    display: grid;
    gap: 14px;
}

.history-page .history-card {
    padding: 22px !important;
}

.history-page .history-card-main {
    display: grid;
    gap: 10px;
}

.history-page .history-card-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--ui-ink);
}

.history-page .history-card-side {
    display: grid;
    justify-items: end;
    gap: 10px;
}

.history-page .history-card-amount {
    font-size: 1.12rem;
    font-weight: 700;
}

.history-page .history-card-amount.add {
    color: var(--ui-success);
}

.history-page .history-card-amount.withdraw {
    color: var(--ui-danger);
}

.history-page .history-meta-pill {
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(23, 50, 79, 0.04);
    border: 1px solid var(--ui-border);
}

.history-page .history-meta-pill strong {
    display: block;
    margin-top: 5px;
    color: var(--ui-ink);
}

.history-page .history-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(23, 50, 79, 0.08);
    color: var(--ui-primary);
    font-weight: 700;
}

.history-page .history-empty {
    padding: 34px;
    text-align: center;
}

.history-page .history-action-disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid var(--ui-border);
    color: var(--ui-ink-soft);
    font-weight: 700;
}

@media (max-width: 1040px) {
    .container:has(.sidebar) {
        grid-template-columns: 1fr !important;
    }

    .sidebar {
        margin-right: 0;
    }
}

@media (max-width: 760px) {
    body > .container,
    body > .navbar + .container {
        width: min(calc(100% - 20px), 1280px);
        margin: 16px auto 28px !important;
    }

    body > .container:not(:has(.sidebar)) {
        padding: 24px 18px;
    }

    .navbar {
        padding: 18px 18px !important;
    }

    .card,
    .panel,
    .hero,
    .account-popup {
        padding: 22px !important;
        border-radius: 22px !important;
    }

    .filters,
    .action-buttons,
    .links,
    .config-status,
    .method-top,
    .config-header {
        flex-direction: column;
        align-items: stretch !important;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: flex-start !important;
    }

    .history-page .history-header,
    .history-page .history-list-head,
    .history-page .history-card-top {
        flex-direction: column;
        align-items: stretch;
    }

    .history-page .history-actions {
        justify-content: stretch;
    }

    .history-page .history-summary {
        grid-template-columns: 1fr 1fr;
    }

    .history-page .history-card-side {
        justify-items: start;
    }

    .dashboard-page .family-shell {
        width: min(calc(100% - 18px), 1220px);
        margin: 10px auto 100px !important;
        padding-bottom: 96px;
    }

    .dashboard-page .hero {
        padding: 20px !important;
        border-radius: 28px !important;
    }

    .dashboard-page .topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        align-items: center;
    }

    .dashboard-page .brand {
        letter-spacing: 0.16em;
    }

    .dashboard-page .topbar-actions {
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .dashboard-page .status-pill {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .dashboard-page .desktop-logout {
        display: none !important;
    }

    .dashboard-page .mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 48px;
        padding: 12px 18px !important;
        background: rgba(255, 250, 245, 0.12) !important;
        color: #fffaf5 !important;
        border: 1px solid rgba(255, 250, 245, 0.18) !important;
        box-shadow: none !important;
    }

    .dashboard-page .logout {
        min-height: 48px;
        padding: 12px 16px !important;
    }

    .dashboard-page .hero-grid {
        gap: 18px;
        margin-top: 18px;
    }

    .dashboard-page .hero h1 {
        font-size: clamp(2rem, 10vw, 2.75rem);
        line-height: 0.98;
        margin-bottom: 10px;
    }

    .dashboard-page .hero-copy p,
    .dashboard-page .head p,
    .dashboard-page .service-note,
    .dashboard-page .tx-sub,
    .dashboard-page .account-popup-copy,
    .dashboard-page .account-popup-note {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .dashboard-page .meta-row,
    .family-strip {
        grid-template-columns: 1fr;
        display: grid;
        gap: 12px;
    }

    .dashboard-page .meta,
    .dashboard-page .balance-card,
    .dashboard-page .mini,
    .family-tile,
    .dashboard-page .stat,
    .dashboard-page .tx,
    .dashboard-page .account-popup-stat {
        border-radius: 20px !important;
    }

    .dashboard-page .hero-actions,
    .dashboard-page .actions,
    .dashboard-page .stats,
    .dashboard-page .mini-stats,
    .dashboard-page .account-popup-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        width: 100%;
    }

    .dashboard-page .hero-btn,
    .dashboard-page .popup-btn,
    .dashboard-page .action {
        width: 100%;
        min-height: 56px;
    }

    .dashboard-page .action {
        padding: 18px !important;
        min-height: 0;
    }

    .dashboard-page .dashboard-main {
        order: 1;
    }

    .dashboard-page .dashboard-history {
        order: 2;
    }

    .dashboard-page .dashboard-insights {
        order: 3;
    }

    .dashboard-page .grid {
        gap: 18px;
    }

    .dashboard-page .tx-row {
        gap: 14px;
    }

    .dashboard-page .amount {
        font-size: 1.05rem;
    }

    .dashboard-page .links {
        display: grid !important;
        grid-template-columns: 1fr;
    }

    .dashboard-page .mobile-dock {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 10px;
        z-index: 45;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
        padding: 10px;
        background: rgba(255, 252, 247, 0.92);
        border: 1px solid rgba(18, 35, 63, 0.1);
        border-radius: 24px;
        box-shadow: 0 22px 46px rgba(18, 35, 63, 0.18);
        backdrop-filter: blur(14px);
    }

    .dashboard-page .mobile-menu-grid {
        grid-template-columns: 1fr 1fr;
    }

    .history-page .history-summary {
        grid-template-columns: 1fr;
    }

    .history-page .history-card,
    .history-page .history-summary-card {
        border-radius: 20px !important;
    }
}

@media (max-width: 420px) {
    .dashboard-page .hero,
    .dashboard-page .panel,
    .dashboard-page .account-popup {
        padding: 18px !important;
        border-radius: 22px !important;
    }

    .dashboard-page .balance {
        font-size: 2.2rem;
    }

    .dashboard-page .mobile-dock-item {
        min-height: 54px;
        padding: 10px 8px;
        font-size: 0.9rem;
    }

    .dashboard-page .mobile-dock-item small {
        font-size: 0.62rem;
        letter-spacing: 0.08em;
    }

    .dashboard-page .mobile-menu-panel {
        left: 10px;
        right: 10px;
        bottom: 10px;
        padding: 20px 14px 14px;
        border-radius: 24px;
    }

    .dashboard-page .mobile-menu-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-page .mobile-menu-link {
        min-height: 84px;
        padding: 14px;
    }
}

.family-page {
    min-height: 100vh;
    padding: 18px;
}

.family-auth-shell,
.family-flow-shell {
    width: min(1180px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(320px, 0.86fr);
    gap: 24px;
    align-items: stretch;
}

.family-auth-shell {
    min-height: calc(100vh - 36px);
}

.family-auth-hero,
.family-flow-hero {
    position: relative;
    overflow: hidden;
    padding: 28px;
    border-radius: 30px;
    color: #fffaf5;
    background: linear-gradient(135deg, var(--ui-primary), #284e70 62%, #547b95);
    box-shadow: var(--ui-shadow);
}

.family-auth-hero::before,
.family-flow-hero::before,
.family-auth-hero::after,
.family-flow-hero::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.family-auth-hero::before,
.family-flow-hero::before {
    width: 260px;
    height: 260px;
    top: -80px;
    right: -40px;
    background: radial-gradient(circle, rgba(255,255,255,.16), transparent 68%);
}

.family-auth-hero::after,
.family-flow-hero::after {
    width: 320px;
    height: 320px;
    left: -120px;
    bottom: -180px;
    background: radial-gradient(circle, rgba(186,141,71,.24), transparent 72%);
}

.family-auth-hero > *,
.family-flow-hero > * {
    position: relative;
    z-index: 1;
}

.family-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.12);
    font-size: .74rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(255,250,245,.84);
}

.family-auth-hero h1,
.family-flow-hero h1 {
    margin: 18px 0 14px;
    font-size: clamp(2.5rem, 5vw, 4.6rem);
    line-height: .95;
    color: #fffaf5 !important;
}

.family-auth-hero p,
.family-flow-hero p,
.family-feature-list li {
    color: rgba(255,250,245,.82) !important;
}

.family-feature-list {
    list-style: none;
    display: grid;
    gap: 12px;
    margin: 26px 0 0;
    padding: 0;
}

.family-feature-list li {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.1);
}

.family-auth-card,
.family-flow-card {
    padding: 30px;
    border-radius: 30px;
    background: var(--ui-panel);
    border: 1px solid var(--ui-border);
    box-shadow: var(--ui-shadow);
    backdrop-filter: blur(8px);
}

.family-auth-copy,
.family-flow-copy {
    margin-bottom: 24px;
}

.family-form {
    display: grid;
    gap: 16px;
}

.family-form-actions {
    display: grid;
    gap: 12px;
    margin-top: 8px;
}

.family-form-links,
.family-inline-links,
.family-back-link {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 18px;
}

.family-amount-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.family-info-card,
.family-method-card {
    padding: 18px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(239,226,204,.44));
    border: 1px solid var(--ui-border);
}

.family-method-card {
    display: none;
}

.family-method-card.active {
    display: block;
}

.family-otp-code {
    display: block;
    font-size: clamp(2rem, 8vw, 3rem);
    letter-spacing: .22em;
    text-align: center;
    font-weight: 700;
    color: var(--ui-primary);
}

@media (max-width: 900px) {
    .family-auth-shell,
    .family-flow-shell {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .family-page {
        padding: 14px;
    }

    .family-auth-hero,
    .family-flow-hero,
    .family-auth-card,
    .family-flow-card {
        padding: 22px;
        border-radius: 24px;
    }

    .family-amount-grid {
        grid-template-columns: 1fr;
    }
}
