:root {
    --bg: #f4f6f8;
    --card: #ffffff;
    --text: #1b2630;
    --muted: #6b7785;
    --line: #e4e9ef;
    --primary: #117c34;
    --primary-soft: #e8f6ed;
    --danger: #c43939;
    --warning: #9a6a00;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

.phone-shell {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    position: relative;
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #ffffffee;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.top-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
}

.top-subtitle {
    margin: 3px 0 0;
    font-size: 12px;
    color: var(--muted);
}

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

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    display: grid;
    place-items: center;
    font-size: 15px;
}

.app-main {
    flex: 1;
    padding: 12px 12px 90px;
}

.login-main {
    padding-bottom: 24px;
}

.alert {
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 12px;
}

.alert-error {
    background: #fdeced;
    color: #90232f;
    border: 1px solid #f7c8ce;
}

.alert-success {
    background: #e7f7ed;
    color: #0e5f29;
    border: 1px solid #bfe7cf;
}

.alert-info {
    background: #eaf0ff;
    color: #2a4f96;
    border: 1px solid #cedbff;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 10px;
}

.section-title {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 800;
}

.muted {
    color: var(--muted);
    font-size: 12px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.metric .label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric .value {
    margin-top: 6px;
    font-size: 18px;
    font-weight: 800;
}

.metric .note {
    margin-top: 4px;
    font-size: 11px;
    color: var(--muted);
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.list-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.list-meta {
    min-width: 0;
}

.list-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
}

.list-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 210px;
}

.amount {
    font-size: 14px;
    font-weight: 700;
}

.badge {
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 9px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-success { background: #e8f6ed; color: #0e5f29; }
.badge-pending { background: #fff3db; color: #8a5b00; }
.badge-danger { background: #fdeced; color: #992935; }
.badge-neutral { background: #edf1f5; color: #506071; }

.form-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
}

.form-group {
    margin-bottom: 11px;
}

.form-group label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #4a5b6d;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid #d8e0ea;
    border-radius: 10px;
    padding: 10px;
    font-size: 14px;
    background: #fff;
    color: var(--text);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 0;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-light {
    background: #eef2f6;
    color: #33475b;
}

.btn-row {
    display: flex;
    gap: 8px;
}

.btn-block {
    width: 100%;
}

.tab-row {
    display: flex;
    gap: 8px;
    overflow: auto;
    padding-bottom: 4px;
    margin-bottom: 10px;
}

.tab-pill {
    border-radius: 999px;
    border: 1px solid var(--line);
    padding: 7px 12px;
    background: #fff;
    font-size: 12px;
    white-space: nowrap;
    font-weight: 600;
    color: #506071;
}

.tab-pill.active {
    background: var(--primary-soft);
    border-color: #b8dfc5;
    color: #0c5d27;
}

.progress-wrap {
    width: 100%;
    height: 8px;
    background: #eaf0ee;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
}

.empty {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    padding: 22px 8px;
}

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

.kv {
    background: #f7fafc;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 9px;
}

.kv .k {
    font-size: 11px;
    color: var(--muted);
}

.kv .v {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 700;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 100%;
    max-width: 460px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    background: #fff;
    border-top: 1px solid var(--line);
    padding: 6px 4px 8px;
    z-index: 20;
}

.bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 11px;
    color: #6c7a89;
    padding: 4px 2px;
    border-radius: 8px;
}

.bottom-nav-link.active {
    color: var(--primary);
    background: var(--primary-soft);
}

.bottom-nav-icon {
    font-size: 14px;
}

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 18px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    padding: 18px;
}

.auth-title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
}

.auth-sub {
    margin: 6px 0 16px;
    color: var(--muted);
    font-size: 13px;
}

.error-card h3 {
    margin: 0 0 6px;
}
