:root {
    --navy: #0b1f33;
    --navy-2: #132f4c;
    --blue: #1d72b8;
    --teal: #18a999;
    --bg: #f4f7fb;
    --card: #ffffff;
    --text: #122033;
    --muted: #65758b;
    --border: #dbe4ef;
    --danger: #b42318;
    --success: #067647;
    --warning: #9a6700;
    --shadow: 0 24px 60px rgba(11, 31, 51, .16);
}

* {
    box-sizing: border-box;
}

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

a {
    color: var(--blue);
    font-weight: 700;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 10%, rgba(24, 169, 153, .28), transparent 32%),
        radial-gradient(circle at 85% 15%, rgba(29, 114, 184, .28), transparent 34%),
        linear-gradient(135deg, #081827 0%, #102b46 50%, #f4f7fb 50%, #eef4fa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 34px;
}

.auth-shell {
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: 1fr 440px;
    gap: 28px;
    align-items: stretch;
}

.register-shell {
    grid-template-columns: .88fr 1.12fr;
    align-items: start;
}

.auth-hero {
    color: #fff;
    padding: 48px;
    border-radius: 28px;
    background: rgba(8, 24, 39, .70);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, .12);
    backdrop-filter: blur(10px);
}

.brand-mark {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--teal), var(--blue));
    color: #fff;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -.04em;
    margin-bottom: 28px;
    box-shadow: 0 18px 34px rgba(0, 0, 0, .22);
}

.brand-mark.small {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    margin: 0;
    font-size: .88rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .16em;
    font-size: .78rem;
    font-weight: 800;
    color: #7ee4d8;
    margin: 0 0 14px;
}

.auth-hero h1 {
    font-size: clamp(2.4rem, 5vw, 4.5rem);
    line-height: .98;
    letter-spacing: -.055em;
    margin: 0;
}

.hero-copy {
    color: rgba(255, 255, 255, .80);
    font-size: 1.12rem;
    line-height: 1.65;
    max-width: 620px;
    margin: 24px 0 0;
}

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

.feature-grid div {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .12);
    font-weight: 750;
}

.auth-card {
    background: var(--card);
    border-radius: 28px;
    padding: 36px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(219, 228, 239, .90);
}

.register-card {
    padding: 32px;
}

.auth-card h2 {
    font-size: 2rem;
    letter-spacing: -.04em;
    margin: 0 0 8px;
}

.muted {
    color: var(--muted);
    margin-top: 0;
    line-height: 1.5;
}

form {
    margin-top: 26px;
}

.form-section {
    padding: 18px 0 20px;
    border-top: 1px solid var(--border);
}

.form-section:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.form-section h3 {
    margin: 0 0 14px;
    font-size: 1rem;
    letter-spacing: -.02em;
}

label {
    display: block;
    font-weight: 800;
    font-size: .92rem;
    margin-bottom: 16px;
}

input,
select {
    width: 100%;
    display: block;
    margin-top: 7px;
    border: 1px solid var(--border);
    border-radius: 14px;
    min-height: 48px;
    padding: 11px 13px;
    font: inherit;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

input:focus,
select:focus {
    border-color: rgba(29, 114, 184, .75);
    box-shadow: 0 0 0 4px rgba(29, 114, 184, .12);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-row.three {
    grid-template-columns: 1.3fr .7fr .8fr;
}

.optional {
    color: var(--muted);
    font-weight: 650;
    font-size: .82rem;
}

.btn-primary {
    width: 100%;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--blue), var(--teal));
    color: #fff;
    min-height: 52px;
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 18px 30px rgba(29, 114, 184, .20);
}

.btn-primary:hover {
    filter: brightness(.98);
}

.auth-switch {
    margin: 22px 0 0;
    color: var(--muted);
    text-align: center;
}

.alert {
    padding: 12px 14px;
    border-radius: 14px;
    font-weight: 750;
    margin: 16px 0;
    border: 1px solid transparent;
}

.alert-error {
    color: var(--danger);
    background: #fff1f0;
    border-color: #ffd6d2;
}

.alert-success {
    color: var(--success);
    background: #ecfdf3;
    border-color: #abefc6;
}

.alert-warning {
    color: var(--warning);
    background: #fffaeb;
    border-color: #fedf89;
}

.field-error {
    color: var(--danger);
    font-size: .82rem;
    margin-top: 6px;
    font-weight: 750;
}

.app-page {
    background: #f4f7fb;
    min-height: 100vh;
}

.topbar {
    height: 74px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 34px;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.topbar-brand strong {
    display: block;
    letter-spacing: -.02em;
}

.topbar-brand span {
    display: block;
    color: var(--muted);
    font-size: .86rem;
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--muted);
    font-weight: 700;
}

.dashboard {
    width: min(1180px, calc(100% - 40px));
    margin: 32px auto;
}

.dashboard-hero {
    border-radius: 26px;
    padding: 38px;
    color: #fff;
    background:
        radial-gradient(circle at 85% 0%, rgba(24, 169, 153, .38), transparent 30%),
        linear-gradient(135deg, var(--navy), var(--navy-2));
    box-shadow: var(--shadow);
}

.dashboard-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.6rem);
    letter-spacing: -.055em;
}

.dashboard-hero p:not(.eyebrow) {
    color: rgba(255, 255, 255, .78);
    max-width: 760px;
    line-height: 1.65;
    font-size: 1.08rem;
}

.setup-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.setup-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 24px;
    box-shadow: 0 12px 30px rgba(11, 31, 51, .07);
}

.setup-card span {
    display: inline-flex;
    width: 38px;
    height: 38px;
    border-radius: 13px;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--teal));
    font-weight: 900;
    margin-bottom: 16px;
}

.setup-card h2 {
    font-size: 1.1rem;
    letter-spacing: -.03em;
    margin: 0 0 10px;
}

.setup-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

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

    .setup-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .auth-page {
        padding: 16px;
    }

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

    .feature-grid,
    .form-row,
    .form-row.three,
    .setup-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 0 18px;
    }

    .topbar nav span {
        display: none;
    }
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.25rem);
    letter-spacing: -.055em;
}

.page-header p:not(.eyebrow) {
    color: var(--muted);
    line-height: 1.6;
    max-width: 720px;
    margin-bottom: 0;
}

.eyebrow.dark {
    color: var(--blue);
}

.btn-link-primary,
.btn-link-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 14px;
    font-weight: 900;
    white-space: nowrap;
    text-decoration: none;
}

.btn-link-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--teal));
    box-shadow: 0 14px 26px rgba(29, 114, 184, .18);
}

.btn-link-primary:hover,
.btn-link-secondary:hover,
.setup-link:hover {
    text-decoration: none;
}

.btn-link-secondary {
    color: var(--navy);
    background: #fff;
    border: 1px solid var(--border);
}

.empty-state,
.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 26px;
    padding: 34px;
    box-shadow: 0 12px 30px rgba(11, 31, 51, .07);
}

.empty-state {
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

.empty-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 16px;
    border-radius: 24px;
    background: #eef7ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.empty-state h2 {
    margin: 0 0 10px;
    font-size: 1.65rem;
    letter-spacing: -.035em;
}

.empty-state p {
    color: var(--muted);
    line-height: 1.65;
    margin: 0 auto 22px;
    max-width: 560px;
}

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

.property-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 12px 30px rgba(11, 31, 51, .07);
}

.property-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.property-card h2 {
    margin: 0;
    font-size: 1.35rem;
    letter-spacing: -.035em;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 11px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 900;
}

.status-active {
    color: var(--success);
    background: #ecfdf3;
}

.status-inactive {
    color: var(--muted);
    background: #f2f4f7;
}

.property-details {
    margin: 0;
    display: grid;
    gap: 14px;
}

.property-details div {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 12px;
}

.property-details dt {
    color: var(--muted);
    font-weight: 850;
}

.property-details dd {
    margin: 0;
    line-height: 1.45;
}

.card-actions {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.dashboard.narrow {
    max-width: 940px;
}

textarea {
    width: 100%;
    display: block;
    margin-top: 7px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 11px 13px;
    font: inherit;
    background: #fff;
    color: var(--text);
    outline: none;
    resize: vertical;
}

textarea:focus {
    border-color: rgba(29, 114, 184, .75);
    box-shadow: 0 0 0 4px rgba(29, 114, 184, .12);
}

.setup-link {
    color: inherit;
}

@media (max-width: 760px) {
    .page-header {
        display: block;
    }

    .page-header .btn-link-primary,
    .page-header .btn-link-secondary {
        margin-top: 18px;
    }

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

    .property-details div {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

.checkbox-label {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f8fafc;
    margin-bottom: 12px;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    min-height: 18px;
    height: 18px;
    margin: 2px 0 0;
    flex: 0 0 auto;
    box-shadow: none;
}

.checkbox-label span {
    line-height: 1.45;
    font-weight: 750;
}

@media (max-width: 980px) {
    .topbar {
        height: auto;
        min-height: 74px;
        gap: 16px;
        flex-wrap: wrap;
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .topbar nav {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

.section-tabs {
    display: inline-flex;
    gap: 6px;
    padding: 6px;
    margin: 0 0 22px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(11, 31, 51, .06);
}

.section-tabs a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 12px;
    color: var(--muted);
    font-weight: 900;
    text-decoration: none;
}

.section-tabs a.active {
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--teal));
    box-shadow: 0 10px 20px rgba(29, 114, 184, .16);
}

.section-tabs a:hover {
    text-decoration: none;
    color: var(--navy);
}

.section-tabs a.active:hover {
    color: #fff;
}

.section-tabs button {
    appearance: none;
    border: 0;
    cursor: pointer;
    font: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 12px;
    color: var(--muted);
    font-weight: 900;
    text-decoration: none;
    background: transparent;
}

.section-tabs button.active {
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--teal));
    box-shadow: 0 10px 20px rgba(29, 114, 184, .16);
}

.section-tabs button:hover {
    color: var(--navy);
}

.section-tabs button.active:hover {
    color: #fff;
}

.tab-panel {
    display: none;
}

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

.subpage-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.subpage-header h2 {
    margin: 0;
    font-size: 1.8rem;
    letter-spacing: -.04em;
}

.subpage-header p {
    color: var(--muted);
    line-height: 1.55;
    margin: 6px 0 0;
    max-width: 760px;
}

@media (max-width: 760px) {
    .subpage-header {
        display: block;
    }

    .subpage-header .btn-link-primary {
        margin-top: 16px;
    }

    .section-tabs {
        display: flex;
        width: 100%;
    }

    .section-tabs button {
        flex: 1;
    }
}

.summary-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 22px;
}

.summary-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 22px;
    box-shadow: 0 12px 30px rgba(11, 31, 51, .07);
}

.summary-card span {
    display: block;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 850;
    margin-bottom: 8px;
}

.summary-card strong {
    display: block;
    font-size: 1.75rem;
    letter-spacing: -.04em;
}

.money-positive {
    color: var(--success);
}

.money-negative {
    color: #b42318;
}

.table-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 26px;
    padding: 24px;
    box-shadow: 0 12px 30px rgba(11, 31, 51, .07);
}

.table-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.table-header h2 {
    margin: 0;
    font-size: 1.55rem;
    letter-spacing: -.035em;
}

.table-header p {
    margin: 5px 0 0;
    color: var(--muted);
}

.responsive-table {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 920px;
}

.data-table th,
.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--muted);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 950;
}

.data-table td {
    line-height: 1.35;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.numeric {
    text-align: right !important;
    white-space: nowrap;
}

.table-subtext {
    display: block;
    color: var(--muted);
    font-size: .88rem;
    margin-top: 3px;
}

.table-actions {
    text-align: right !important;
    white-space: nowrap;
}

.status-neutral {
    color: var(--navy);
    background: #eef7ff;
}

@media (max-width: 760px) {
    .summary-grid.three {
        grid-template-columns: 1fr;
    }

    .table-header {
        display: block;
    }

    .table-header .btn-link-primary {
        margin-top: 16px;
    }
}

.field-help {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: .86rem;
    line-height: 1.4;
}

.soft-hidden {
    display: none;
}

.page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

@media (max-width: 760px) {
    .page-actions {
        justify-content: flex-start;
        margin-top: 16px;
    }
}

.filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    padding: 0 0 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.filter-bar label {
    min-width: 190px;
    margin: 0;
}

.btn-small-primary,
.btn-small-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 15px;
    border-radius: 13px;
    font-weight: 900;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    font: inherit;
}

.btn-small-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--teal));
}

.btn-small-secondary {
    color: var(--navy);
    background: #fff;
    border: 1px solid var(--border);
}

.sort-input {
    width: 86px;
    min-height: 38px;
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 10px;
    text-align: right;
    font-weight: 800;
}

.table-footer-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 18px;
}

@media (max-width: 760px) {
    .filter-bar {
        display: block;
    }

    .filter-bar label,
    .filter-bar .btn-small-primary,
    .filter-bar .btn-small-secondary {
        width: 100%;
        margin-bottom: 12px;
    }

    .table-footer-actions {
        justify-content: flex-start;
    }
}

.property-details dd strong {
    font-size: 1.08rem;
}

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

.transfer-side {
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    background: #f8fafc;
}

.transfer-side h3 {
    margin-top: 0;
}

@media (max-width: 760px) {
    .transfer-columns {
        grid-template-columns: 1fr;
    }
}
