body {
    background: #f4f7fb;
    color: #172033;
}

.app-topbar {
    background: linear-gradient(90deg, #0f766e, #2563eb);
}

.navbar-brand {
    font-weight: 700;
}

.app-shell {
    display: flex;
    min-height: calc(100vh - 56px);
}

.app-sidebar {
    background: #102033;
    color: #fff;
}

aside.app-sidebar {
    width: 260px;
    flex: 0 0 260px;
}

.app-content {
    flex: 1;
    min-width: 0;
}

.sidebar-inner {
    padding: 16px;
}

.sidebar-section {
    color: #93c5fd;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin: 16px 0 8px;
    text-transform: uppercase;
}

.sidebar-link {
    display: block;
    color: #eef6ff;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 8px;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.sidebar-link-button {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
}

.card {
    border-radius: 8px;
    border: 1px solid #e4e7ec;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.btn-primary {
    background: #0f766e;
    border-color: #0f766e;
}

.btn-primary:hover {
    background: #115e59;
    border-color: #115e59;
}

.badge-status {
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    font-weight: 600;
}

.table th {
    white-space: nowrap;
}

.statement-preview {
    background: white;
    color: #111;
    max-width: 980px;
    margin: 0 auto;
    padding: 36px;
    border: 1px solid #ddd;
    font-size: 12px;
}

.statement-letterhead-space {
    display: none;
}

.statement-fit-content {
    width: 100%;
}

.statement-header-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.statement-header-table td {
    border: 0;
    padding: 3px 0;
}

.statement-header-table td:first-child {
    width: 100%;
    text-align: left;
}

.statement-table {
    width: 100%;
    border-collapse: collapse;
}

.statement-table th,
.statement-table td {
    border: 1px solid #111;
    padding: 5px 6px;
    vertical-align: middle;
}

.statement-table th {
    background: #fff;
    font-weight: 700;
    text-align: left;
}

.statement-table th:nth-child(2),
.statement-table th:nth-child(3),
.statement-table td:nth-child(2),
.statement-table td:nth-child(3) {
    text-align: center;
}

.statement-table th:nth-child(4),
.statement-table td:nth-child(4) {
    text-align: right;
    white-space: nowrap;
}

.statement-amount-words {
    margin-top: 8px;
    font-weight: 400;
}

.statement-signature {
    margin-top: 90px;
    margin-left: auto;
    width: 340px;
    text-align: left;
}

.statement-signature-space {
    height: 70px;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 0;
    }

    .no-print,
    nav,
    aside.app-sidebar,
    .offcanvas {
        display: none !important;
    }

    html,
    body {
        background: white;
        width: 210mm;
        min-height: 297mm;
        margin: 0 !important;
        padding: 0 !important;
    }

    .app-shell,
    .app-content,
    main.container-fluid {
        display: block !important;
        width: 210mm !important;
        min-height: 297mm !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .statement-preview {
        border: 0;
        padding: 55mm 12mm 30mm;
        max-width: none;
        width: 210mm;
        min-height: 297mm;
        box-sizing: border-box;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 12px;
        line-height: 1.22;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
    }

    .statement-letterhead-space {
        display: none;
        height: 0;
    }

    .statement-preview h2 {
        font-size: 16px;
        font-weight: 800;
        margin: 4px 0 8px !important;
    }

    .statement-header-table {
        margin-bottom: 7px;
        font-size: 12px;
    }

    .statement-header-table td {
        padding: 1px 0;
    }

    .statement-table {
        table-layout: fixed;
    }

    .statement-table th:nth-child(1),
    .statement-table td:nth-child(1) {
        width: 21%;
    }

    .statement-table th:nth-child(2),
    .statement-table td:nth-child(2) {
        width: 12%;
    }

    .statement-table th:nth-child(3),
    .statement-table td:nth-child(3) {
        width: 9%;
    }

    .statement-table th:nth-child(4),
    .statement-table td:nth-child(4) {
        width: 14%;
    }

    .statement-table th:nth-child(5),
    .statement-table td:nth-child(5) {
        width: 44%;
    }

    .statement-table th,
    .statement-table td {
        padding: 4px 4px;
        word-wrap: break-word;
        overflow-wrap: anywhere;
        vertical-align: middle;
    }

    .statement-table th:nth-child(4),
    .statement-table td:nth-child(4) {
        white-space: nowrap;
        overflow-wrap: normal;
        word-wrap: normal;
    }

    .statement-table td.statement-invoice,
    .statement-table td.statement-invoice-long {
        font-size: 10px;
        white-space: nowrap;
        overflow-wrap: normal;
        word-wrap: normal;
    }

    .statement-table td.statement-invoice-long {
        font-size: 9px;
    }

    .statement-comfortable-rows {
        font-size: 12.5px;
        line-height: 1.3;
    }

    .statement-comfortable-rows .statement-table th,
    .statement-comfortable-rows .statement-table td {
        padding: 5.5px 4px;
    }

    .statement-medium-rows {
        font-size: 11px;
        line-height: 1.08;
        justify-content: flex-start;
    }

    .statement-medium-rows .statement-table th,
    .statement-medium-rows .statement-table td {
        padding: 1.5px 2px;
    }

    .statement-many-rows {
        font-size: 10.5px;
        line-height: 1.03;
        justify-content: flex-start;
    }

    .statement-many-rows .statement-preview h2,
    .statement-many-rows h2 {
        font-size: 15px;
        margin: 3px 0 4px !important;
    }

    .statement-many-rows .statement-header-table {
        font-size: 10.5px;
        margin-bottom: 2px;
    }

    .statement-many-rows .statement-table th,
    .statement-many-rows .statement-table td {
        padding: 0.8px 1.5px;
    }

    .statement-many-rows .statement-amount-words {
        margin-top: 7px;
        font-size: 10.5px;
    }

    .statement-many-rows .statement-signature {
        margin-top: 2mm;
        font-size: 10.5px;
    }

    .statement-many-rows .statement-signature-space {
        height: 3mm;
    }

    .statement-amount-words {
        margin-top: 20px;
        font-size: 12px;
    }

    .statement-signature {
        margin-top: 6mm;
        width: 270px;
        font-size: 12px;
    }

    .statement-signature-space {
        height: 7mm;
    }
}
