:root {
    font-family: Inter, Arial, sans-serif;
    color: #192c43;
    background: #f2f5f8;
    font-size: 15px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
}

header {
    background: #082e50;
    color: white;
    padding: 25px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header a {
    font-weight: 800;
    font-size: 22px;
    color: white;
    text-decoration: none;
}

header a span {
    font-weight: 400;
    color: #a9d5ec;
    font-size: 14px;
}

main {
    max-width: 1150px;
    margin: 35px auto;
    padding: 0 24px;
}

h1 {
    font-size: clamp(28px, 4vw, 40px);
    letter-spacing: -1px;
}

h2 {
    font-size: 23px;
}

p {
    line-height: 1.6;
}

nav,
.tabs {
    display: flex;
    gap: 22px;
    align-items: center;
    margin-bottom: 26px;
}

nav form {
    margin-left: auto;
}

a {
    color: #146687;
}

button {
    border: 0;
    border-radius: 7px;
    background: #0b536b;
    color: white;
    font-weight: bold;
    padding: 13px 20px;
    cursor: pointer;
}

button:hover {
    background: #07364b;
}

.card,
.paper,
.login {
    background: white;
    padding: 28px;
    border: 1px solid #dee5ed;
    border-radius: 12px;
    margin: 20px 0;
}

.login {
    max-width: 460px;
    margin: 80px auto;
}

.eyebrow {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #287e8d;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.stats section {
    padding: 20px 26px;
    background: white;
    border: 1px solid #dce6ee;
    border-radius: 12px;
}

.stats p {
    color: #66788c;
}

.stats h2 {
    font-size: 32px;
    margin: 0;
}

.split,
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.paper {
    padding: 45px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 25px;
    align-items: start;
}

.paper h1 {
    font-size: 27px;
}

.paper > * {
    grid-column: 1 / -1;
    min-width: 0;
}

/* Business information stays in the left column. */

.paper > .split {
    display: contents;
}

.paper > .split > div:first-child {
    grid-column: 1;
    grid-row: 1 / 4;
    min-width: 0;
}

/* Document number and dates stay in the right column. */

.paper > .split > div:last-child {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
}

/* Client information sits below the number and dates. */

.paper > h3:first-of-type {
    grid-column: 2;
    grid-row: 2;
    margin: 24px 0 0;
}

.paper > p:first-of-type {
    grid-column: 2;
    grid-row: 3;
    margin: 10px 0 28px;
    overflow-wrap: anywhere;
}

.totals {
    max-width: 340px;
    margin: 28px 0 30px auto;
}

.paper > .totals {
    width: 100%;
}

.totals b {
    float: right;
}

label {
    display: block;
    margin: 13px 0;
    font-size: 13px;
    font-weight: 600;
}

input,
select,
textarea {
    display: block;
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd6df;
    border-radius: 6px;
    background: white;
    color: #192c43;
    font: inherit;
    margin-top: 7px;
}

textarea {
    min-height: 80px;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

th {
    color: #637387;
    font-size: 12px;
}

td,
th {
    padding: 16px 10px;
    border-bottom: 1px solid #e4e9ef;
    vertical-align: top;
}

td:first-child {
    min-width: 130px;
}

.scroll {
    overflow: auto;
}

.line {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr;
    gap: 15px;
    border-bottom: 1px solid #eee;
}

.badge {
    background: #e3f2ed;
    padding: 7px 12px;
    border-radius: 20px;
    font-size: 12px;
}

.muted,
footer {
    color: #66788c;
    font-size: 13px;
}

footer {
    text-align: center;
    padding: 30px;
}

.error {
    background: #ffeded;
    color: #9e2020;
    padding: 16px;
}

summary {
    font-weight: 700;
    cursor: pointer;
    font-size: 18px;
}

.brand-logo {
    display: block;
    width: 190px;
    height: 90px;
    object-fit: contain;
    object-position: left center;
}

@media (max-width: 650px) {
    header > span {
        display: none;
    }

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

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

    .paper,
    .card {
        padding: 20px;
    }

    .stats h2 {
        font-size: 25px;
    }
}

@media screen and (max-width: 650px) {
    .paper {
        display: block;
    }

    .paper > .split {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .paper > .split > div {
        grid-column: auto;
        grid-row: auto;
    }

    .paper > h3:first-of-type {
        margin-top: 24px;
    }
}

@media print {
    header,
    nav,
    footer,
    form,
    .muted,
    .error {
        display: none !important;
    }

    body {
        background: white;
    }

    main {
        margin: 0;
        padding: 0;
        max-width: none;
    }

    .paper {
        border: 0;
        padding: 0;
    }

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

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

    tr {
        break-inside: avoid;
    }
}