:root {
    --tblr-primary: #2f55d4;
    --tblr-primary-rgb: 47, 85, 212;
    --app-muted: #748197;
    --app-border: #e3e8f1;
    --app-radius: 14px;
}

body {
    background: #f6f8fc;
    font-family: Inter, "Segoe UI", sans-serif;
}

.container-xl {
    max-width: 1320px;
}

.app-header {
    background: var(--tblr-bg-surface);
    border-bottom: 1px solid var(--tblr-border-color);
}

.navbar {
    min-height: 76px;
    box-shadow: none;
    border: 0;
}

.brand {
    gap: 14px;
    margin-right: 32px;
}

.brand img {
    width: 166px;
    height: auto;
}

.brand-divider {
    height: 25px;
    width: 1px;
    background: var(--tblr-border-color);
}

.brand-product {
    font-size: 13px;
    font-weight: 500;
    color: var(--tblr-secondary);
}

.navbar-nav .nav-link {
    gap: 7px;
    font-size: 13px;
    padding: 12px 11px;
}

.navbar-nav .nav-link.active {
    color: var(--tblr-primary);
    font-weight: 600;
}

.navbar-nav .icon {
    width: 18px;
    height: 18px;
}

.private-label {
    font-size: 11px;
    color: var(--tblr-secondary);
    margin-right: 6px;
}

.private-label .icon {
    width: 14px;
    height: 14px;
}

.preference-menu {
    width: 235px;
}

.page-content {
    padding-top: 36px;
    padding-bottom: 38px;
    min-height: calc(100vh - 160px);
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
}

.page-heading h1 {
    font-size: 29px;
    font-weight: 650;
    letter-spacing: -.7px;
    line-height: 1.3;
    margin: 5px 0 7px;
}

.page-heading p {
    color: var(--tblr-secondary);
    margin: 0;
    font-size: 14px;
}

.eyebrow {
    color: var(--tblr-secondary);
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 1.6px;
    text-transform: uppercase;
}

.btn {
    border-radius: 7px;
    font-weight: 550;
    gap: 6px;
    white-space: normal;
}

.btn-primary {
    background: #2f55d4;
    border-color: #2f55d4;
    box-shadow: 0 2px 4px #2f55d414;
}

.btn-primary:hover {
    background: #2546b8;
    border-color: #2546b8;
}

.card {
    border-radius: var(--app-radius);
    box-shadow: 0 2px 5px #1c365605;
    border-color: var(--tblr-border-color);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    min-height: 74px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 14px 24px;
    background: transparent;
}

.metric-card .card-body {
    padding: 21px 24px;
}

.metric-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--tblr-secondary);
    gap: 8px;
}

.metric-icon {
    color: #5b76c8;
    display: flex;
    padding: 7px;
    border-radius: 8px;
    background: #edf2ff;
}

.metric-icon .icon {
    width: 19px;
    height: 19px;
}

.metric-value {
    font-size: 27px;
    font-weight: 650;
    letter-spacing: -.8px;
    line-height: 1.4;
    margin: 9px 0 4px;
    overflow-wrap: anywhere;
}

.metric-card .small {
    font-size: 11px;
}

.chart-area {
    height: 230px;
    width: 100%;
    position: relative;
}

.chart-area svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.chart-area svg text {
    fill: var(--tblr-secondary);
    font-size: 10px;
}

.chart-area svg .grid-line {
    stroke: var(--tblr-border-color);
    stroke-dasharray: 3 5;
}

.chart-area svg .chart-line {
    stroke: #5377e0;
    stroke-width: 2.6;
    fill: none;
}

.chart-area svg .chart-point {
    stroke: #5377e0;
    stroke-width: 2;
    fill: var(--tblr-bg-surface);
    cursor: pointer;
}

.chart-tooltip {
    position: absolute;
    padding: 7px 10px;
    background: var(--tblr-bg-surface);
    border: 1px solid var(--tblr-border-color);
    border-radius: 7px;
    box-shadow: 0 3px 12px #0001;
    font-size: 12px;
    pointer-events: none;
    top: 8px;
    right: 0;
    z-index: 1;
}

.chart-months {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2px;
    margin-left: 42px;
    margin-top: 4px;
    color: var(--tblr-secondary);
    font-size: 10px;
    text-align: center;
}

.chart-total {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 16px;
}

.month-card {
    background: linear-gradient(155deg, var(--tblr-bg-surface) 70%, #ecf1ff);
}

.month-card h2 {
    font-size: 25px;
    font-weight: 600;
}

.workflow-step {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 13px 0;
    font-size: 12px;
}

.workflow-step span {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    background: #edf2ff;
    border-radius: 50%;
    color: #4664b5;
    font-size: 11px;
    font-weight: 600;
}

.review-banner {
    border: 1px solid #eadfbf;
    background: #fffaf0;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 15px 21px;
    margin-bottom: 24px;
}

.review-banner strong {
    font-size: 13px;
    margin-left: 8px;
}

.review-banner .icon {
    color: #b28e38;
    width: 19px;
}

.review-banner p {
    margin: 4px 0 0 31px;
    font-size: 12px;
    color: #7e7154;
}

.table {
    font-size: 13px;
}

.table thead th {
    font-size: 10px;
    letter-spacing: .8px;
    text-transform: uppercase;
    background: var(--tblr-bg-surface-secondary);
    padding-top: 14px;
    padding-bottom: 14px;
}

.table td {
    padding-top: 18px;
    padding-bottom: 18px;
}

.badge {
    font-size: 10px;
    font-weight: 550;
    padding: 5px 8px;
    border-radius: 5px;
    white-space: nowrap;
}

.empty-table {
    padding: 44px !important;
    text-align: center;
    color: var(--tblr-secondary);
}

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--tblr-secondary);
    border-top: 1px solid var(--tblr-border-color);
    padding-top: 19px;
    padding-bottom: 24px;
    font-size: 11px;
}

.filter-tabs {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.filter-tabs a {
    padding: 7px 10px;
    border-radius: 7px;
    font-size: 12px;
    color: var(--tblr-secondary);
    text-decoration: none;
}

.filter-tabs a.active {
    background: #edf2ff;
    color: #2f55d4;
    font-weight: 600;
}

.app-dialog {
    width: 470px;
    max-width: calc(100vw - 32px);
    border: 1px solid var(--tblr-border-color);
    border-radius: 14px;
    background: var(--tblr-bg-surface);
    color: var(--tblr-body-color);
    padding: 28px;
    box-shadow: 0 20px 80px #0003;
}

.app-dialog::backdrop {
    background: #15213b77;
    backdrop-filter: blur(3px);
}

.dialog-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.dialog-heading h2 {
    margin: 0;
    font-size: 20px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--tblr-secondary);
    font-size: 12px;
    margin-bottom: 5px;
}

.back-link .icon {
    width: 15px;
}

.heading-badge {
    vertical-align: middle;
    margin-left: 14px;
}

.invoice-preview {
    width: 100%;
    height: 620px;
    border: 0;
    background: #edf0f5;
    overflow: auto;
    padding: 16px;
}

.invoice-preview canvas {
    display: block;
    margin: 0 auto;
    box-shadow: 0 2px 10px #0001;
}

.pdf-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 8px;
    border-bottom: 1px solid var(--tblr-border-color);
    font-size: 12px;
}

.invoice-total {
    font-size: 33px;
    font-weight: 650;
    letter-spacing: -1px;
    margin: 12px 0 20px;
    overflow-wrap: anywhere;
}

.summary-list {
    margin: 0 0 22px;
}

.summary-list > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 11px 0;
    font-size: 12px;
}

.summary-list dt {
    font-weight: 400;
    color: var(--tblr-secondary);
}

.summary-list dd {
    font-weight: 600;
    margin: 0;
    text-align: right;
    overflow-wrap: anywhere;
    min-width: 0;
}

.email-addresses {
    font-size: 12px;
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 6px;
    margin-bottom: 18px;
}

.email-addresses dt {
    color: var(--tblr-secondary);
    font-weight: 400;
}

.email-addresses dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.email-subject {
    border-top: 1px solid var(--tblr-border-color);
    padding-top: 16px;
    font-size: 13px;
    font-weight: 600;
}

.email-body {
    font-size: 12px;
    white-space: pre-wrap;
    line-height: 1.65;
    margin-top: 12px;
    overflow-wrap: anywhere;
}

.accountant-workflow,
.settings-layout {
    --tblr-gutter-x: 1rem;
}

.accountant-workflow > * {
    min-width: 0;
}

.accountant-workflow textarea {
    font-size: 13px;
    line-height: 1.6;
}

.item-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 140px 36px;
    gap: 12px;
    margin-bottom: 16px;
    align-items: end;
}

.item-row .btn {
    height: 38px;
}

.editor-total {
    background: var(--tblr-bg-surface-secondary);
    border-radius: 8px;
    padding: 15px 18px;
    display: flex;
    justify-content: space-between;
}

.document-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--tblr-border-color);
}

.document-row > div {
    min-width: 0;
}

.document-row a {
    overflow-wrap: anywhere;
}

.document-icon {
    display: flex;
    color: #7182b3;
    background: #edf2ff;
    padding: 10px;
    border-radius: 8px;
    flex-shrink: 0;
}

.upload-form {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr) auto;
    gap: 12px;
}

.activity-list > div {
    display: flex;
    gap: 13px;
    margin-bottom: 18px;
    font-size: 12px;
}

.activity-list > div:last-child {
    margin-bottom: 0;
}

.activity-list > div > div {
    min-width: 0;
}

.activity-dot {
    width: 7px;
    height: 7px;
    background: #7792e9;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.audit-details {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: var(--tblr-bg-surface-secondary);
    padding: 10px;
    margin-top: 8px;
    font-size: 11px;
}

.delivery-row {
    padding: 12px 0;
    border-bottom: 1px solid var(--tblr-border-color);
}

.delivery-row:last-child {
    border: 0;
}

.review-card {
    border-color: #e5cf9c;
}

.preserve-lines {
    white-space: pre-wrap;
}

.login-page {
    max-width: 490px;
    padding-top: 8vh;
}

.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-brand img {
    width: 230px;
    height: auto;
}

.login-card h1 {
    font-size: 28px;
}

.error-card {
    max-width: 650px;
    margin: 60px auto;
}

[data-bs-theme="dark"] body {
    background: #121924;
}

[data-bs-theme="dark"] .brand img, [data-bs-theme="dark"] .login-brand img {
    filter: brightness(0) invert(.9);
}

[data-bs-theme="dark"] .metric-icon, [data-bs-theme="dark"] .document-icon, [data-bs-theme="dark"] .workflow-step span, [data-bs-theme="dark"] .filter-tabs a.active {
    background: #243252;
    color: #9cb2f2;
}

[data-bs-theme="dark"] .month-card {
    background: linear-gradient(155deg, var(--tblr-bg-surface) 70%, #25304a);
}

[data-bs-theme="dark"] .review-banner {
    background: #292619;
    border-color: #54492e;
}

[data-bs-theme="dark"] .review-banner p {
    color: #c9b98d;
}

@media (max-width: 1199px) {
    .brand {
        margin-right: 14px;
        gap: 10px;
    }

    .brand img {
        width: 140px;
    }

    .brand-product, .brand-divider {
        display: none;
    }

    .navbar-nav .nav-link {
        padding-left: 8px;
        padding-right: 8px;
    }

}

@media (max-width: 767px) {
    .navbar {
        min-height: 65px;
        padding: 10px 0;
    }

    .navbar > .container-xl {
        flex-wrap: wrap;
    }

    .brand {
        margin: 0 auto 0 8px;
    }

    .brand img {
        width: 145px;
    }

    .navbar-nav .nav-link {
        padding: 12px 8px;
    }

    #navigation {
        border-top: 1px solid var(--tblr-border-color);
        margin-top: 12px;
        padding-top: 6px;
    }

    .page-content {
        padding-top: 24px;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
        margin-bottom: 22px;
    }

    .page-heading h1 {
        font-size: 25px;
    }

    .page-heading p {
        font-size: 12px;
    }

    .card-body {
        padding: 20px;
    }

    .card-header {
        padding: 18px 20px;
    }

    .metric-value {
        font-size: 28px;
    }

    .review-banner {
        align-items: flex-start;
        padding: 16px;
    }

    .review-banner p {
        margin-left: 0;
    }

    .chart-area {
        height: 195px;
    }

    .chart-months {
        font-size: 8px;
        margin-left: 32px;
    }

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

    .item-row {
        grid-template-columns: minmax(0, 1fr) 105px 32px;
        gap: 8px;
    }

    .item-row label {
        font-size: 11px;
    }

    .invoice-preview {
        height: 440px;
    }

    .app-footer {
        flex-direction: column;
        font-size: 10px;
    }

    .login-page {
        padding-top: 5vh;
    }

}
