/* Small accent layer on top of Bootstrap 5.3 (light and dark) - not a re-skin. Same shell as Pulse. */

html, body {
    height: 100%;
}

.ledger-boot-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

/* Hidden by default - Blazor's own JS shows it only on an unrecoverable error. */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1050;
    padding: 0.75rem 1.25rem;
    background: #fff3cd;
    color: #664d03;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.3);
}

#blazor-error-ui .reload {
    color: #0d6efd;
    text-decoration: underline;
    cursor: pointer;
    margin-left: 0.5rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.6rem;
}

.navbar-brand {
    font-size: 1.25em;
    text-align: center;
}

/* ---- App shell ---- */
.ledger-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--bs-tertiary-bg);
    border-right: 1px solid var(--bs-border-color);
    overflow-y: auto;
}

.ledger-sidebar .navbar-brand,
.ledger-sidebar .nav-link {
    color: var(--bs-body-color);
}

.ledger-sidebar .nav-link.active {
    background: var(--bs-primary);
    color: #fff;
}

.ledger-sidebar .nav-section {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bs-secondary-color);
    margin: 0.75rem 0 0.25rem 0.5rem;
}

/* Below lg the sidebar slides in over the content instead of squeezing it. */
@media (max-width: 991.98px) {
    .ledger-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1040;
        transform: translateX(-100%);
        transition: transform 0.2s ease-in-out;
    }

    .ledger-sidebar.show {
        transform: translateX(0);
    }

    .ledger-sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1039;
    }
}

/* ---- Misc ---- */
.cursor-pointer {
    cursor: pointer;
}

/* Tables keep their natural width and scroll horizontally inside .table-responsive, like a spreadsheet. */
.table-responsive table {
    white-space: nowrap;
}

/* Amounts: tabular digits, right-aligned. */
.amount {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* ---- Printing: reports print as plain documents (no shell, no filters), with the company header. ---- */
.print-only {
    display: none;
}

@media print {
    /* Class selectors (loaded after Bootstrap) so they beat utilities like .d-flex, which are !important too. */
    .no-print, .toast-container, .btn, #blazor-error-ui {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    main {
        overflow: visible !important;
        padding: 0 !important;
    }

    .d-flex.vh-100 {
        height: auto !important;
        display: block !important;
    }

    .table-responsive {
        overflow: visible !important;
    }

    .table {
        font-size: 9pt;
    }

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

    thead {
        display: table-header-group;
    }

    tr {
        page-break-inside: avoid;
    }
}
