/**
 * Joseph Personal Asset Manager
 * Copyright © JosephWang（QQ1471056247）
 */

:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --text: #172033;
    --muted: #6b7280;
    --line: #e5e9f2;
    --primary: #2563eb;
    --primary-soft: #e8f0ff;
    --asset: #0f766e;
    --income: #16a34a;
    --expense: #dc2626;
    --warning: #f59e0b;
    --shadow: 0 16px 40px rgba(31, 41, 55, .08);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    margin: 0;
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px 18px;
    background: #101827;
    color: #e5edf8;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.side-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    line-height: 1.2;
}

.brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #0f766e);
    box-shadow: 0 10px 24px rgba(37, 99, 235, .25);
    font-size: 28px;
}

.brand-mark.small { width: 42px; height: 42px; border-radius: 12px; font-size: 22px; }

.sidebar nav { display: grid; gap: 8px; }
.sidebar nav a,
.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    color: #b9c4d3;
    transition: .2s ease;
}
.sidebar nav a i { font-size: 20px; }
.sidebar nav a.active,
.sidebar nav a:hover,
.sidebar-footer a:hover {
    color: #fff;
    background: rgba(255, 255, 255, .1);
}
.sidebar-footer {
    margin-top: auto;
    color: #93a2b7;
    font-size: 12px;
}

.main-content {
    padding: 28px;
    max-width: 1540px;
    width: 100%;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.topbar h1 { margin: 2px 0 0; font-size: 30px; }
.eyebrow { color: var(--muted); margin: 0; font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn, .avatar {
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(31, 41, 55, .05);
}
.avatar { background: #101827; color: #fff; font-weight: 700; }

.panel, .metric-card, .mini-card, .install-card, .login-card, .account-card, .export-card {
    background: var(--panel);
    border: 1px solid rgba(229, 233, 242, .9);
    box-shadow: var(--shadow);
}

.panel {
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 18px;
}
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.panel-head h2 {
    margin: 0;
    font-size: 18px;
}
.panel-head span { color: var(--muted); font-size: 13px; }

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}
.metric-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-card, .mini-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    padding: 22px;
    min-height: 132px;
}
.metric-card span, .mini-card span { color: var(--muted); font-size: 14px; }
.metric-card strong, .mini-card strong { display: block; margin-top: 12px; font-size: 28px; line-height: 1.1; }
.metric-card i {
    position: absolute;
    right: 18px;
    bottom: 14px;
    font-size: 46px;
    opacity: .13;
}
.metric-card.asset strong { color: var(--asset); }
.metric-card.liability strong, .danger-text { color: var(--expense); }
.metric-card.net strong { color: var(--primary); }
.metric-card.ratio strong { color: var(--warning); }
.mini-card { min-height: 92px; }
.mini-card strong { font-size: 24px; }
.mini-card.income strong { color: var(--income); }
.mini-card.expense strong { color: var(--expense); }

.content-grid.two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.chart-panel canvas {
    width: 100% !important;
    height: 310px !important;
}
.chart-empty-state {
    min-height: 310px;
    display: grid;
    place-items: center;
    gap: 8px;
    color: var(--muted);
    border-radius: 16px;
    background: #f8fafc;
}
.chart-empty-state i {
    font-size: 34px;
    color: #94a3b8;
}
.chart-empty-state span {
    display: block;
    font-size: 14px;
}

.filter-bar, .action-row {
    margin-bottom: 18px;
}
.inline-form {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
}
.inline-form.wide label { min-width: 150px; }
.stack-form { display: grid; gap: 16px; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.form-grid .full, .full { grid-column: 1 / -1; }
label {
    display: grid;
    gap: 7px;
    color: #364152;
    font-size: 14px;
    font-weight: 600;
}
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    border-radius: 14px;
    padding: 12px 13px;
    outline: none;
    min-height: 46px;
}
textarea { resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}
.check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
}
.check-label input { width: 18px; height: 18px; min-height: 0; }

.btn {
    border: 0;
    border-radius: 14px;
    min-height: 44px;
    padding: 11px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    transition: .2s ease;
}
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 12px 24px rgba(37, 99, 235, .2); }
.btn.soft { background: var(--primary-soft); color: var(--primary); }
.btn.ghost { background: #f8fafc; color: #42526b; }
.btn.danger { background: #fee2e2; color: var(--expense); }
.btn.tiny { min-height: 34px; padding: 7px 10px; border-radius: 10px; font-size: 12px; }
.btn.full { width: 100%; }
.btn:hover, .export-card:hover { transform: translateY(-1px); }
.text-link { color: var(--primary); font-weight: 700; font-size: 14px; }

.alert {
    padding: 13px 15px;
    border-radius: 14px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert.success { background: #dcfce7; color: #166534; }
.alert.danger { background: #fee2e2; color: #991b1b; }
.alert.warning { background: #fef3c7; color: #92400e; }
.alert.info { background: #dbeafe; color: #1e40af; }
.muted { color: var(--muted); }

.small-list { display: grid; gap: 10px; }
.list-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    background: #f8fafc;
}
.list-row b { display: block; font-size: 14px; }
.list-row em { display: block; color: var(--muted); font-size: 12px; font-style: normal; margin-top: 3px; }
.list-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--c, #2563eb) 14%, white);
    color: var(--c, #2563eb);
    font-size: 20px;
}
.list-icon.large { width: 48px; height: 48px; border-radius: 16px; font-size: 24px; }

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 700;
}
.badge.expense { background: #fee2e2; color: #991b1b; }
.badge.income { background: #dcfce7; color: #166534; }
.badge.transfer, .badge.debt_payoff { background: #e0f2fe; color: #075985; }
.badge.adjustment { background: #fef3c7; color: #92400e; }

.account-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.account-card {
    border-radius: 18px;
    padding: 16px;
}
.account-card.disabled { opacity: .62; }
.account-card-top { display: flex; gap: 12px; align-items: center; }
.account-card h3 { margin: 0; font-size: 16px; }
.account-card p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.account-amount { margin: 18px 0 12px; }
.account-amount span { color: var(--muted); font-size: 13px; }
.account-amount strong { display: block; font-size: 24px; margin-top: 5px; }
.tag-row { min-height: 26px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
}
.tag.green { background: #dcfce7; color: #166534; }
.tag.gray { background: #e5e7eb; color: #4b5563; }
.card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}
.card-actions form { margin: 0; }

.asset-app-screen {
    width: min(100%, 460px);
    margin: 0 auto 18px;
}

.asset-home-screen,
.asset-flow-panel,
.asset-form-panel {
    padding: 2px 0 18px;
}

.asset-app-head {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    margin: 0 0 14px;
}

.asset-app-head h2 {
    margin: 0;
    color: #111827;
    font-size: 21px;
    line-height: 1.2;
}

.asset-app-head p {
    margin: 5px 0 0;
    color: #8a94a6;
    font-size: 13px;
}

.round-back {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #334155;
    font-size: 24px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .07);
}

.asset-app-list,
.asset-option-list {
    display: block;
    overflow: hidden;
    width: 100%;
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(229, 233, 242, .82);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .055);
}

.asset-option-row {
    display: flex !important;
    width: 100%;
    min-height: 80px;
    align-items: center;
    gap: 13px;
    padding: 15px 16px;
    border-bottom: 1px solid #edf1f7;
    background: #fff;
    grid-template-columns: none !important;
}

.asset-option-row:last-child {
    border-bottom: 0;
}

.asset-option-row:hover,
.asset-option-row:active {
    background: #fafafa;
}

.asset-option-icon,
.provider-avatar {
    position: relative;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    background: var(--c, var(--primary));
    font-size: 22px;
    box-shadow: inset 0 -10px 18px rgba(0, 0, 0, .08);
}

.asset-option-icon i,
.provider-avatar i {
    font-size: 21px;
}

.provider-avatar i {
    position: absolute;
    right: 3px;
    bottom: 1px;
    color: rgba(255, 255, 255, .38);
    font-size: 24px;
}

.provider-avatar b {
    position: relative;
    z-index: 1;
    min-width: 0;
    height: auto;
    padding: 0;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .16);
}

.asset-option-copy,
.asset-account-copy,
.selected-provider-chip span:last-child {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.asset-option-copy b,
.asset-account-copy b,
.selected-provider-chip b {
    overflow: hidden;
    color: #172033;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asset-option-copy em,
.asset-account-copy em,
.selected-provider-chip em {
    overflow: hidden;
    color: #8a94a6;
    font-size: 13px;
    font-style: normal;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asset-option-row > .ri-arrow-right-s-line,
.row-arrow {
    flex: 0 0 auto;
    margin-left: auto;
    color: #c5ccd8;
    font-size: 23px;
}

.asset-overview-card {
    position: relative;
    overflow: hidden;
    display: block;
    margin: 0 0 16px;
    padding: 24px 22px 20px;
    border-radius: 24px;
    color: #fff;
    background: linear-gradient(135deg, #111827 0%, #1d4ed8 52%, #0f766e 100%);
    box-shadow: 0 18px 38px rgba(29, 78, 216, .22);
}

.asset-overview-card::after {
    content: "";
    position: absolute;
    right: -34px;
    top: -52px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
}

.asset-overview-card > span {
    position: relative;
    z-index: 1;
    display: block;
    color: rgba(255, 255, 255, .74);
    font-size: 14px;
    font-weight: 700;
}

.asset-overview-card > strong {
    position: relative;
    z-index: 1;
    display: block;
    margin-top: 8px;
    color: #fff;
    font-size: 38px;
    font-weight: 900;
    line-height: 1.08;
}

.overview-stats {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 18px;
    margin-top: 22px;
}

.overview-stats span {
    display: block;
    color: rgba(255, 255, 255, .72);
    font-size: 13px;
    font-weight: 700;
}

.overview-stats span:last-child {
    grid-column: 1 / -1;
}

.overview-stats b {
    display: inline-block;
    margin-left: 6px;
    color: #fff;
    font-size: 15px;
    font-weight: 900;
}

.asset-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 20px;
}

.asset-add-button,
.asset-secondary-button {
    width: 100%;
    min-height: 50px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 850;
}

.asset-add-button {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 12px 24px rgba(37, 99, 235, .18);
}

.asset-secondary-button {
    color: var(--primary);
    background: var(--primary-soft);
}

.asset-add-button i,
.asset-secondary-button i {
    font-size: 20px;
}

.asset-group-section {
    margin: 0 0 18px;
}

.asset-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 30px;
    padding: 0 2px 8px;
}

.asset-group-title span {
    color: #172033;
    font-size: 15px;
    font-weight: 850;
}

.asset-group-title strong {
    color: #6b7280;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.asset-account-list {
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(229, 233, 242, .82);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .045);
}

.asset-account-row {
    display: flex !important;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    padding: 14px 15px;
    border-bottom: 1px solid #edf1f7;
    background: #fff;
    grid-template-columns: none !important;
}

.asset-account-row:last-child {
    border-bottom: 0;
}

.asset-account-row:hover,
.asset-account-row:active {
    background: #fafafa;
}

.asset-account-row.is-disabled {
    opacity: .55;
}

.asset-account-amount {
    flex: 0 0 auto;
    margin-left: auto;
    color: #111827;
    font-size: 15px;
    font-weight: 900;
    white-space: nowrap;
}

.asset-account-amount.liability {
    color: var(--expense);
}

.asset-row-actions {
    flex: 0 0 auto;
    color: #c5ccd8;
    font-size: 20px;
}

.import-hint {
    display: grid;
    gap: 8px;
    padding: 14px;
    border-radius: 14px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.import-hint strong {
    color: var(--text);
    font-size: 15px;
}

.import-hint span,
.import-hint em {
    display: block;
    font-style: normal;
}

.selected-provider-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 15px;
    border-radius: 18px;
    background: #eef6ff;
    border: 1px solid rgba(37, 99, 235, .18);
}

.asset-step-form {
    display: block;
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(229, 233, 242, .82);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .055);
}

.asset-step-form label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 64px;
    padding: 12px 15px;
    border-bottom: 1px solid #edf1f7;
    color: #172033;
    font-size: 15px;
    font-weight: 750;
}

.asset-step-form label.full {
    grid-column: auto;
}

.asset-step-form label.textarea-row {
    display: grid;
    align-items: start;
    gap: 8px;
}

.asset-step-form input,
.asset-step-form select,
.asset-step-form textarea {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    min-height: 42px;
    border: 0;
    border-radius: 0;
    padding: 8px 0;
    background: transparent;
    text-align: right;
    box-shadow: none;
}

.asset-step-form textarea {
    width: 100%;
    min-height: 80px;
    text-align: left;
    padding-top: 4px;
}

.asset-step-form input:focus,
.asset-step-form select:focus,
.asset-step-form textarea:focus {
    box-shadow: none;
}

.asset-step-form input[readonly] {
    color: #8a94a6;
    background: transparent;
}

.asset-step-form .selected-provider-chip {
    margin: 14px;
}

.asset-step-form .check-label {
    justify-content: flex-start;
}

.asset-step-form .check-label input {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    min-height: 0;
}

.sticky-actions {
    display: grid;
    gap: 10px;
    padding: 18px 15px 16px;
    border-bottom: 0 !important;
    background: #fff;
}

.asset-save-button {
    width: min(100%, 390px);
    min-height: 52px;
    margin: 0 auto;
    border: 0;
    border-radius: 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
    background: var(--primary);
    font-weight: 900;
    box-shadow: 0 12px 24px rgba(37, 99, 235, .18);
}

.asset-save-button i {
    font-size: 20px;
}

.asset-cancel-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    color: #8a94a6;
    font-weight: 750;
}

.empty-asset-state {
    text-align: center;
    padding: 30px 18px 8px;
}

.empty-asset-state i {
    display: inline-flex;
    width: 54px;
    height: 54px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 28px;
}

.empty-asset-state h2 {
    margin: 12px 0 8px;
    font-size: 18px;
}

.empty-asset-state p {
    margin: 0 0 18px;
    color: #8a94a6;
    font-size: 14px;
    line-height: 1.6;
}

.table-wrap { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 840px;
}
.data-table th, .data-table td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}
.data-table th {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    background: #f8fafc;
}
.data-table .amount { font-weight: 800; }
.table-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}
.table-actions a, .table-actions button {
    border: 0;
    background: transparent;
    color: var(--primary);
    padding: 0;
    font-weight: 700;
}
.table-actions button { color: var(--expense); }
.empty { color: var(--muted); text-align: center; padding: 20px; }
.table-empty {
    height: 150px;
}
.table-empty i,
.table-empty span,
.table-empty a {
    display: block;
    margin: 4px auto;
}
.table-empty i {
    font-size: 30px;
    color: #94a3b8;
}
.table-empty a {
    color: var(--primary);
    font-weight: 800;
}

.export-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.export-year-form {
    margin-bottom: 18px;
    padding: 14px;
    border-radius: 16px;
    background: #f8fafc;
}
.export-card {
    border-radius: 18px;
    padding: 22px;
    display: grid;
    gap: 10px;
}
.export-card i { font-size: 34px; color: var(--primary); }
.export-card strong { font-size: 18px; }
.export-card span { color: var(--muted); font-size: 14px; line-height: 1.5; }

.content-footer {
    color: var(--muted);
    font-size: 12px;
    text-align: center;
    padding: 16px 0 80px;
}

.mobile-nav { display: none; }

.login-body, .install-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 22px;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .12), transparent 34%),
        radial-gradient(circle at bottom right, rgba(15, 118, 110, .11), transparent 36%),
        var(--bg);
}
.login-shell, .install-shell { width: min(100%, 980px); }
.login-card, .install-card {
    width: min(100%, 460px);
    margin: auto;
    border-radius: 24px;
    padding: 30px;
}
.install-card { width: min(100%, 780px); }
.login-card h1, .install-card h1 { margin: 18px 0 8px; font-size: 27px; }
.login-card footer, .install-card footer {
    color: var(--muted);
    margin-top: 20px;
    font-size: 12px;
    text-align: center;
}
.install-form { margin-top: 20px; }

@media (min-width: 821px) {
    .asset-main-content .topbar {
        display: flex;
    }

    .asset-app-screen {
        width: min(100%, 1180px);
        margin: 0 auto 22px;
    }

    .asset-home-screen {
        display: grid;
        grid-template-columns: 360px minmax(0, 1fr);
        gap: 20px;
        align-items: start;
    }

    .asset-home-screen .asset-overview-card,
    .asset-home-screen .asset-actions {
        grid-column: 1;
    }

    .asset-groups-grid {
        grid-column: 2;
        grid-row: 1 / span 3;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .asset-flow-panel {
        width: min(100%, 980px);
    }

    .asset-form-panel {
        width: min(100%, 860px);
    }

    .asset-app-head {
        min-height: 64px;
        margin-bottom: 20px;
    }

    .asset-app-head h2 {
        font-size: 26px;
    }

    .asset-app-head p {
        font-size: 14px;
    }

    .asset-app-list,
    .asset-option-list {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .provider-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .asset-option-row {
        min-height: 104px;
        align-items: center;
        padding: 18px;
        border: 1px solid rgba(229, 233, 242, .9);
        border-radius: 18px;
        box-shadow: 0 10px 24px rgba(15, 23, 42, .045);
    }

    .asset-option-row:last-child {
        border: 1px solid rgba(229, 233, 242, .9);
    }

    .asset-option-row:hover,
    .asset-account-row:hover {
        transform: translateY(-1px);
        box-shadow: 0 14px 28px rgba(15, 23, 42, .07);
    }

    .asset-overview-card {
        min-height: 230px;
        padding: 30px;
        border-radius: 24px;
    }

    .asset-overview-card > strong {
        font-size: 44px;
    }

    .overview-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        margin-top: 28px;
    }

    .overview-stats span:last-child {
        grid-column: auto;
    }

    .overview-stats b {
        display: block;
        margin: 6px 0 0;
    }

    .asset-actions {
        margin: 0;
    }

    .asset-add-button {
        width: auto;
        min-width: 168px;
        padding: 0 18px;
    }

    .asset-secondary-button {
        width: auto;
        min-width: 132px;
        padding: 0 16px;
    }

    .asset-group-section {
        margin: 0;
    }

    .asset-account-list {
        min-height: 72px;
    }

    .asset-step-form {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
        overflow: visible;
        padding: 18px;
        border-radius: 20px;
    }

    .asset-step-form .selected-provider-chip,
    .asset-step-form label.full,
    .asset-step-form label.textarea-row,
    .asset-step-form .sticky-actions {
        grid-column: 1 / -1;
    }

    .asset-step-form .selected-provider-chip {
        margin: 0;
    }

    .asset-step-form label {
        display: grid;
        align-items: start;
        min-height: auto;
        padding: 0;
        border-bottom: 0;
        gap: 8px;
    }

    .asset-step-form input,
    .asset-step-form select,
    .asset-step-form textarea {
        width: 100%;
        min-height: 46px;
        border: 1px solid var(--line);
        border-radius: 14px;
        padding: 11px 12px;
        background: #fff;
        text-align: left;
    }

    .asset-step-form input:focus,
    .asset-step-form select:focus,
    .asset-step-form textarea:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
    }

    .asset-step-form input[readonly] {
        background: #f8fafc;
    }

    .asset-step-form input[readonly],
    .asset-step-form select[readonly],
    .asset-step-form textarea[readonly] {
        color: var(--muted);
        background: #f8fafc;
    }

    .asset-step-form .check-label {
        display: flex;
        align-items: center;
        min-height: 46px;
    }

    .sticky-actions {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        padding: 4px 0 0;
        background: transparent;
    }

    .asset-save-button {
        width: auto;
        min-width: 180px;
        margin: 0;
    }

    .asset-cancel-link {
        min-width: 92px;
    }
}

@media (max-width: 1180px) {
    .account-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .asset-home-screen {
        grid-template-columns: 330px minmax(0, 1fr);
    }
    .asset-groups-grid {
        grid-template-columns: 1fr;
    }
    .provider-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .app-shell { display: block; }
    .sidebar { display: none; }
    .main-content { padding: 18px 14px 92px; }
    .asset-main-content .topbar {
        display: none;
    }
    .topbar h1 { font-size: 24px; }
    .metric-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    .metric-card, .mini-card {
        min-height: 116px;
        padding: 17px;
        border-radius: 18px;
    }
    .metric-card strong, .mini-card strong { font-size: 21px; }
    .content-grid.two, .form-grid, .export-grid, .account-card-grid {
        grid-template-columns: 1fr;
    }
    .panel { padding: 16px; border-radius: 18px; }
    .chart-panel canvas { height: 270px !important; }
    .inline-form { display: grid; grid-template-columns: 1fr; align-items: stretch; }
    .list-row { grid-template-columns: auto 1fr; }
    .list-row strong { grid-column: 2; }
    .mobile-nav {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 12px;
        z-index: 20;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        background: rgba(255, 255, 255, .94);
        backdrop-filter: blur(14px);
        border: 1px solid var(--line);
        border-radius: 22px;
        box-shadow: 0 18px 40px rgba(31, 41, 55, .16);
        padding: 8px;
    }
    .mobile-nav a {
        display: grid;
        place-items: center;
        gap: 3px;
        color: var(--muted);
        font-size: 12px;
        min-height: 48px;
        border-radius: 16px;
    }
    .mobile-nav i { font-size: 22px; }
    .mobile-nav a.active { color: var(--primary); background: var(--primary-soft); }
    .install-card, .login-card { padding: 22px; }
}

@media (max-width: 430px) {
    .metric-grid { grid-template-columns: 1fr 1fr; overflow-x: auto; }
    .metric-card strong, .mini-card strong { font-size: 19px; }
    .topbar-actions .icon-btn { display: none; }
    .data-table th, .data-table td { padding: 11px 9px; }
    .asset-overview-card {
        padding: 22px;
        border-radius: 22px;
    }
    .asset-overview-card strong {
        font-size: 31px;
    }
    .overview-stats {
        grid-template-columns: 1fr 1fr;
    }
    .overview-stats span:last-child {
        grid-column: 1 / -1;
    }
    .asset-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
    .asset-account-row {
        min-height: 70px;
        padding: 13px 12px;
    }
    .asset-account-copy {
        min-width: 0;
    }
    .asset-account-copy b,
    .asset-account-copy em,
    .asset-option-copy b,
    .asset-option-copy em {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .asset-account-amount {
        font-size: 14px;
    }
    .asset-flow-panel,
    .asset-form-panel {
        margin-left: 0;
        margin-right: 0;
    }
    .asset-option-row {
        min-height: 72px;
        padding: 13px 12px;
    }
    .asset-option-icon,
    .provider-avatar {
        width: 42px;
        height: 42px;
        font-size: 21px;
    }
    .sticky-actions {
        position: sticky;
        bottom: 82px;
        z-index: 5;
        padding-top: 10px;
        background: linear-gradient(to top, #fff 72%, rgba(255,255,255,0));
    }
}
