:root {
    --bg: #f5f7fb;
    --text: #172033;
    --muted: #6d7587;
    --line: #dfe5ef;
    --card: #ffffff;
    --ink: #172033;
    --blue: #2264e5;
    --green: #13a070;
    --gold: #c98216;
    --red: #d63d4f;
    --shadow: 0 18px 48px rgba(31, 45, 71, .12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    width: min(100%, 520px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 18px 16px 96px;
}

.report-shell {
    width: min(100%, 920px);
    padding: 18px 18px 32px;
}

.splash,
.auth-screen {
    min-height: calc(100vh - 36px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-screen {
    padding: 18px 0;
}

.auth-hero {
    display: grid;
    justify-items: center;
    text-align: center;
    margin-bottom: 22px;
}

.brand-mark {
    width: 104px;
    height: 104px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    overflow: hidden;
    background: #fff;
    color: #fff;
    font-weight: 900;
    box-shadow: var(--shadow);
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.brand-mark span {
    display: none;
}

.auth-screen h1,
.splash h1,
.mobile-header h1 {
    margin: 14px 0 6px;
    font-size: 30px;
    line-height: 1.05;
    letter-spacing: 0;
}

.auth-hero h1 {
    font-size: 34px;
}

.auth-hero p {
    max-width: 340px;
}

.auth-screen p,
.splash p,
.mobile-header p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.panel-form {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.auth-screen .panel-form {
    margin-top: 0;
    padding: 18px;
    border: 1px solid rgba(223, 229, 239, .95);
    border-radius: 18px;
    background: rgba(255, 255, 255, .94);
    box-shadow: var(--shadow);
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 14px;
    background: #fff;
    color: var(--text);
    font: inherit;
    transition: border-color .18s ease, box-shadow .18s ease;
}

input:focus {
    outline: none;
    border-color: rgba(34, 100, 229, .7);
    box-shadow: 0 0 0 4px rgba(34, 100, 229, .12);
}

input[type="file"] {
    padding: 12px;
    height: auto;
}

.primary-btn {
    min-height: 50px;
    border: 0;
    border-radius: 8px;
    background: var(--blue);
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 26px rgba(34, 100, 229, .24);
    transition: transform .18s ease, box-shadow .18s ease;
}

.primary-btn:active {
    transform: translateY(1px);
    box-shadow: 0 8px 18px rgba(34, 100, 229, .22);
}

.link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0 16px;
}

.form-link {
    display: inline-flex;
    justify-content: center;
    color: var(--blue);
    font-size: 14px;
    font-weight: 800;
}

.auth-footnote {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.alert {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #e8f3ff;
    color: #174c94;
    font-size: 14px;
    font-weight: 700;
}

.alert.danger {
    background: #ffe9ed;
    color: #9b1d31;
}

.mobile-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
}

.mobile-header.compact {
    align-items: flex-start;
}

.eyebrow {
    color: var(--blue);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.avatar {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow);
    font-weight: 900;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.metric,
.section {
    background: var(--card);
    border: 1px solid rgba(223, 229, 239, .9);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(31, 45, 71, .08);
}

.metric {
    padding: 14px;
    min-height: 112px;
}

.metric span,
.metric small,
.list-card small,
.progress-card small,
.note-card small {
    color: var(--muted);
    font-size: 12px;
}

.metric strong {
    display: block;
    margin: 10px 0 4px;
    font-size: 23px;
}

.metric.finance {
    border-color: rgba(19, 160, 112, .25);
}

.section {
    padding: 14px;
    margin: 12px 0;
}

.last-section {
    margin-bottom: 28px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-title h2 {
    margin: 0;
    font-size: 16px;
}

.section-title span,
.section-title a {
    color: var(--blue);
    font-size: 12px;
    font-weight: 900;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chips span,
.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eef3fb;
    color: #33415d;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.list-card,
.progress-card,
.note-card {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.list-card:first-of-type,
.progress-card:first-of-type,
.note-card:first-of-type {
    border-top: 0;
}

.list-card strong,
.progress-card strong,
.note-card strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.note-card {
    display: block;
}

.note-card p {
    margin: 6px 0 8px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.bar {
    height: 8px;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e9edf4;
}

.bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--green);
}

.progress-card {
    display: block;
}

.done {
    color: var(--green);
    text-decoration: line-through;
}

.empty {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 12px;
    z-index: 10;
    width: min(calc(100% - 24px), 496px);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    transform: translateX(-50%);
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, .94);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.bottom-nav a {
    display: grid;
    place-items: center;
    gap: 2px;
    min-height: 48px;
    border-radius: 14px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.bottom-nav span {
    font-size: 17px;
}

.bottom-nav a.active {
    background: var(--ink);
    color: #fff;
}

.statement-document {
    color: var(--text);
}

.statement-toolbar {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.print-btn {
    min-height: 44px;
    box-shadow: none;
}

.statement-header {
    display: flex;
    gap: 14px;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.statement-header .brand-mark {
    width: 68px;
    height: 68px;
    flex: 0 0 68px;
    border-radius: 14px;
    box-shadow: none;
    border: 1px solid var(--line);
}

.statement-header h2 {
    margin: 4px 0;
    font-size: 22px;
    line-height: 1.1;
}

.statement-header p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.statement-meta,
.statement-totals {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.statement-meta div,
.statement-totals div {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f9fbff;
}

.statement-meta span,
.statement-totals span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.statement-meta strong,
.statement-totals strong {
    display: block;
    font-size: 14px;
    line-height: 1.35;
}

.statement-totals {
    grid-template-columns: repeat(3, 1fr);
}

.danger-text {
    color: var(--red);
}

.success-text {
    color: var(--green);
}

.statement-table-wrap {
    width: 100%;
    margin-top: 14px;
    overflow-x: auto;
}

.statement-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-size: 12px;
}

.statement-table th,
.statement-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.statement-table th {
    background: #eef3fb;
    color: #33415d;
    font-size: 11px;
    text-transform: uppercase;
}

.report-actions {
    display: grid;
    gap: 12px;
}

.report-switcher a {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eef3fb;
    color: #33415d;
    font-size: 12px;
    font-weight: 800;
}

.report-switcher a.active {
    background: var(--ink);
    color: #fff;
}

.report-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

.report-toolbar.single {
    grid-template-columns: 1fr;
}

.report-print-btn {
    border: 0;
    cursor: pointer;
}

.report-page .report-card-document {
    background: #fff;
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
    padding: 20px 26px;
}

.report-card-header {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 16px;
    align-items: start;
    margin-bottom: 10px;
}

.report-card-header .brand-mark {
    width: 132px;
    height: 98px;
    border-radius: 0;
    box-shadow: none;
    border: 0;
}

.report-card-contact {
    color: #374151;
    font-size: 12px;
    line-height: 1.35;
    text-align: right;
}

.report-card-title {
    margin: 14px 0 14px;
    color: #111827;
    font-size: 21px;
    font-weight: 900;
    letter-spacing: 0;
    text-align: center;
    text-transform: uppercase;
}

.report-card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 22px;
    margin-bottom: 14px;
    font-size: 14px;
}

.report-card-table {
    min-width: 0;
    table-layout: fixed;
}

.report-card-table th,
.report-card-table td {
    border: 1px solid #111827;
    padding: 7px 8px;
    vertical-align: middle;
    word-break: normal;
}

.report-card-table th {
    background: #f2f2f2;
    color: #111827;
    text-align: center;
}

.report-card-table td:not(:first-child) {
    text-align: center;
}

.report-card-table th:first-child,
.report-card-table td:first-child {
    width: 28%;
}

.report-card-table th:last-child,
.report-card-table td:last-child {
    width: 12%;
}

.report-card-section-title {
    margin: 14px 0 7px;
    font-size: 16px;
    font-weight: 900;
    text-align: center;
}

.report-card-footer,
.report-card-comments,
.report-card-stamp {
    margin-top: 14px;
    font-size: 13px;
}

.report-card-comments p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.report-card-stamp {
    font-weight: 900;
}

@media (min-width: 720px) {
    .app-shell {
        padding-top: 28px;
    }
}

@media print {
    body {
        background: #fff;
    }

    .app-shell {
        width: 100%;
        max-width: none;
        min-height: 0;
        padding: 0;
    }

    .no-print,
    .bottom-nav {
        display: none !important;
    }

    .section,
    .statement-document {
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
    }

    .statement-table-wrap {
        overflow: visible;
    }

    .statement-table {
        min-width: 0;
        font-size: 11px;
    }

    .report-actions,
    .mobile-header,
    .bottom-nav {
        display: none !important;
    }

    .report-card-document {
        max-width: none;
        padding: 0;
    }

    .report-card-header {
        display: grid;
        grid-template-columns: 90px 1fr;
        gap: 10px;
        margin-bottom: 8px;
    }

    .report-card-header .brand-mark {
        width: 78px;
        height: 78px;
    }

    .report-card-contact {
        font-size: 8.5px;
        line-height: 1.25;
    }

    .report-card-title {
        margin: 8px 0 9px;
        font-size: 15px;
    }

    .report-card-details {
        gap: 3px 12px;
        margin-bottom: 8px;
        font-size: 10px;
    }

    .report-card-table {
        min-width: 0;
    }

    .report-card-table th,
    .report-card-table td {
        padding: 3.8px 5px;
    }

    .report-card-section-title {
        margin: 8px 0 4px;
        font-size: 11px;
    }

    .report-card-footer,
    .report-card-comments,
    .report-card-stamp {
        margin-top: 7px;
        font-size: 9.5px;
    }

    @page {
        size: A4 portrait;
        margin: 7mm;
    }
}
