:root {
    --bg: #04131d;
    --panel: rgba(10, 29, 41, 0.94);
    --panel-2: rgba(14, 39, 54, 0.9);
    --line: rgba(167, 252, 236, 0.1);
    --text: #eafffa;
    --muted: #a4bbc3;
    --green: #2ce3a2;
    --blue: #42b7ff;
    --warn: #ffb84d;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top, rgba(44, 227, 162, 0.18), transparent 32%),
        radial-gradient(circle at 85% 10%, rgba(66, 183, 255, 0.16), transparent 28%),
        linear-gradient(180deg, #05131d 0%, #071a26 48%, #030e15 100%);
}

.app-shell {
    min-height: 100vh;
    padding: 24px 14px;
}

.phone-shell {
    max-width: 460px;
    margin: 0 auto;
    padding: 18px 14px 100px;
}

.topbar,
.section-head,
.hero-panel,
.list-card,
.bottom-nav,
.signature-actions,
.loan-summary,
.top-actions,
.stats-grid {
    display: flex;
}

.topbar,
.section-head,
.hero-panel,
.list-card,
.bottom-nav,
.signature-actions,
.loan-summary {
    justify-content: space-between;
}

.topbar,
.section-head,
.hero-panel,
.list-card,
.signature-actions,
.loan-summary,
.top-actions {
    align-items: center;
}

.content,
.list-wrap,
.audit-list,
.form-grid {
    display: grid;
    gap: 16px;
}

.eyebrow {
    margin: 0;
    font-size: 11px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(201, 255, 244, 0.68);
}

h1, h2, h3, strong {
    font-family: "Poppins", sans-serif;
}

h1 {
    margin: 10px 0 4px;
    font-size: 30px;
}

.subtitle,
.section-head p,
.hero-panel p,
.list-card p,
.audit-card p,
.audit-card small,
.list-card small {
    color: var(--muted);
}

.subtitle {
    margin: 0;
    line-height: 1.6;
}

.top-actions {
    gap: 10px;
}

.icon-btn,
.tab-btn,
.ghost-btn,
.cta-btn,
.bottom-nav button {
    border: 0;
    cursor: pointer;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.panel,
.bottom-nav {
    background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
    border: 1px solid var(--line);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 52px rgba(7, 26, 38, 0.35);
}

.panel {
    border-radius: 28px;
    padding: 18px;
}

.auth-panel {
    margin-top: 18px;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.auth-tabs a {
    flex: 1;
    text-align: center;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 18px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.05);
    font-weight: 700;
}

.auth-tabs a.active {
    background: rgba(44, 227, 162, 0.12);
    color: #d9fff3;
}

.flash {
    margin: 16px 0;
    padding: 14px 16px;
    border-radius: 18px;
    font-weight: 700;
}

.flash.success {
    background: rgba(44, 227, 162, 0.12);
    color: #c8ffe8;
}

.flash.error {
    background: rgba(255, 107, 107, 0.12);
    color: #ffd3d3;
}

.hint-box {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(66, 183, 255, 0.1);
    color: #d6f0ff;
    line-height: 1.6;
}

.hint-box strong {
    color: #ffffff;
}

.inline-form {
    margin-top: -4px;
}

.full-btn {
    width: 100%;
}

.hero-panel {
    gap: 16px;
    align-items: flex-end;
}

.pill,
.badge,
.delta {
    display: inline-flex;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.pill,
.delta,
.badge.ok {
    background: rgba(44, 227, 162, 0.12);
    color: #bffbe4;
}

.badge.warn {
    background: rgba(255, 184, 77, 0.14);
    color: #ffd18a;
}

.hero-panel h2 {
    margin: 12px 0 10px;
    font-size: 22px;
    line-height: 1.35;
}

.cta-btn {
    padding: 12px 18px;
    border-radius: 18px;
    background: linear-gradient(90deg, var(--green), var(--blue));
    color: #03202b;
    font-weight: 800;
    white-space: nowrap;
}

.cta-btn.small {
    padding: 10px 14px;
}

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

.stat-card h3 {
    margin: 10px 0;
    font-size: 22px;
}

.card-label {
    margin: 0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(201, 255, 244, 0.56);
}

.chart-wrap {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    height: 210px;
    margin-top: 12px;
}

.bar-group {
    flex: 1;
    text-align: center;
}

.bar-stack {
    height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.bar {
    width: 26px;
    border-radius: 14px 14px 6px 6px;
    display: block;
}

.bar.income {
    background: linear-gradient(180deg, #44efb4, #14ad7a);
}

.bar.loan {
    background: linear-gradient(180deg, #5bc5ff, #208fdd);
}

.tab-menu {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.tab-btn {
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    font-weight: 700;
    white-space: nowrap;
}

.tab-btn.active {
    background: rgba(44, 227, 162, 0.12);
    color: #d9fff3;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.form-grid {
    grid-template-columns: 1fr 1fr;
    margin-bottom: 16px;
}

.compact-form {
    margin-top: 14px;
}

.form-grid label {
    display: block;
}

.form-grid label span {
    display: block;
    margin-bottom: 8px;
    color: rgba(234, 255, 250, 0.76);
    font-size: 13px;
    font-weight: 700;
}

.form-grid input,
.form-grid textarea,
.form-grid select {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border-radius: 18px;
    padding: 13px 14px;
    font: inherit;
    outline: none;
}

.form-grid textarea {
    min-height: 92px;
    resize: vertical;
}

.form-grid .full {
    grid-column: 1 / -1;
}

.list-wrap.compact {
    margin-top: 14px;
}

.list-card {
    gap: 12px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
}

.list-card strong {
    display: block;
    margin-bottom: 6px;
}

.list-card p,
.audit-card p,
.audit-card small {
    margin: 0;
}

.align-right {
    text-align: right;
}

.loan-summary {
    gap: 12px;
    margin-bottom: 16px;
}

.mini-card {
    flex: 1;
    padding: 14px;
    border-radius: 22px;
    background: rgba(44, 227, 162, 0.12);
}

.mini-card.alt {
    background: rgba(66, 183, 255, 0.13);
}

.mini-card span {
    display: block;
    color: rgba(234, 255, 250, 0.72);
    font-size: 13px;
}

.mini-card strong {
    display: block;
    margin-top: 8px;
    font-size: 20px;
}

#map {
    width: 100%;
    height: 250px;
    border-radius: 22px;
    overflow: hidden;
}

.signature-box {
    margin-top: 14px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.05);
    padding: 14px;
}

#signaturePad {
    width: 100%;
    height: 170px;
    display: block;
    border-radius: 18px;
    background: #fbfdff;
}

.signature-actions {
    gap: 10px;
    margin-top: 12px;
}

.ghost-btn {
    flex: 1;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-weight: 700;
}

.audit-list {
    margin-top: 14px;
}

.audit-card {
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.05);
    padding: 14px;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    width: calc(100% - 28px);
    max-width: 432px;
    padding: 10px 8px;
    border-radius: 26px;
    gap: 6px;
}

.bottom-nav button {
    flex: 1;
    padding: 12px 6px;
    border-radius: 18px;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
}

.bottom-nav button.active {
    background: rgba(44, 227, 162, 0.12);
    color: #dcfff4;
}

@media (max-width: 480px) {
    .phone-shell {
        padding-left: 0;
        padding-right: 0;
    }

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

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

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