/**
 * Shared app styles: oojeema PRIME brand, auth pages, typeahead, company logo dropzone.
 */

:root {
    --oojeema-prime: #205088;
    --oojeema-prime-rgb: 32, 80, 136;
    --oojeema-prime-hover: #1a406e;
    --oojeema-prime-soft: #e4eef7;
    --oojeema-prime-ink: #143354;
    /* Companion accents — Ocean Sky (palette A) */
    --oojeema-accent: #3d8ab5;
    --oojeema-accent-rgb: 61, 138, 181;
    --oojeema-accent-soft: #e4eef7;
    --oojeema-accent-border: #a8c9e3;
    --oojeema-positive: #047857;
    --oojeema-positive-soft: #e0f0eb;
    --oojeema-positive-border: #a7d4c4;
    --oojeema-positive-ink: #064e3b;
    --oojeema-warm: #b45309;
    --oojeema-warm-soft: #f7f0d9;
    --oojeema-warm-border: #f0d78c;
    --oojeema-warm-ink: #78350f;
    --oojeema-bg-top: #0f2744;
    --oojeema-bg-bottom: #1a406e;
    --oojeema-font: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;

    /* Spacing — canonical gutters (see docs/design/oojeema-design-canon.md) */
    --oo-inset-sm: 0.85rem;
    --oo-inset-md: 1rem;
    --oo-inset-lg: 1.25rem;
    --oo-inset-xl: 1.35rem;
    --oo-stack-sm: 0.5rem;
    --oo-stack-md: 0.75rem;
    --oo-stack-lg: 1rem;
    --oo-stack-xl: 1.25rem;
    --oo-table-cell-y: 0.5rem;
    --oo-table-cell-x: 0.85rem;
    --oo-table-cell-y-comfort: 0.65rem;
    --oo-table-cell-x-comfort: 1rem;

    --bs-primary: #205088;
    --bs-primary-rgb: 32, 80, 136;
    --bs-link-color: #205088;
    --bs-link-hover-color: #1a406e;
    --bs-body-font-family: var(--oojeema-font);
}

body {
    font-family: var(--oojeema-font);
}

body.auth-page {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(ellipse at 12% 20%, rgba(32, 80, 136, 0.07), transparent 50%),
        linear-gradient(165deg, #f4f7fb 0%, #ffffff 48%, var(--oojeema-prime-soft) 100%);
    font-family: var(--oojeema-font);
    color: var(--oojeema-prime-ink);
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
}

@media (min-width: 992px) {
    .auth-shell {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    }
}

.auth-brand-panel {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 3rem 3.5rem;
    background:
        radial-gradient(ellipse at 70% 80%, rgba(61, 138, 181, 0.12), transparent 55%),
        linear-gradient(160deg, #ffffff 0%, var(--oojeema-prime-soft) 100%);
    border-right: 1px solid rgba(32, 80, 136, 0.08);
    animation: auth-panel-in 0.55s ease-out both;
}

@media (min-width: 992px) {
    .auth-brand-panel {
        display: flex;
    }
}

.auth-brand-panel-inner {
    max-width: 28rem;
}

.auth-headline {
    margin: 1.25rem 0 0;
    color: var(--oojeema-prime-ink);
    font-size: 1.75rem;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-tagline {
    margin: 0.85rem 0 0;
    color: #475569;
    font-size: 1.0625rem;
    line-height: 1.5;
    font-weight: 500;
}

.auth-tagline--mobile {
    color: #475569;
    font-size: 0.95rem;
}

.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem 2.5rem;
    animation: auth-card-in 0.5s ease-out 0.08s both;
}

.auth-form-wrap {
    width: 100%;
    max-width: 26rem;
}

.auth-form-title {
    color: var(--oojeema-prime-ink);
    font-weight: 700;
}

.auth-brand {
    letter-spacing: 0.04em;
    font-weight: 700;
}

.auth-brand-logo {
    display: block;
    height: 44px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.auth-brand-logo--mobile {
    margin: 0 auto 0.5rem;
    height: 36px;
}

.auth-card {
    border: 1px solid rgba(32, 80, 136, 0.1);
    border-radius: 0.75rem;
    box-shadow: 0 12px 36px rgba(20, 51, 84, 0.08);
    background: #fff;
}

.auth-card .btn-primary {
    background-color: var(--oojeema-prime);
    border-color: var(--oojeema-prime);
}

.auth-card .btn-primary:hover,
.auth-card .btn-primary:focus {
    background-color: var(--oojeema-prime-hover);
    border-color: var(--oojeema-prime-hover);
}

.auth-password-field {
    position: relative;
}

.auth-password-field .form-control {
    padding-right: 2.75rem;
}

.auth-password-toggle {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #64748b;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus {
    color: var(--oojeema-prime-ink);
    background: rgba(32, 80, 136, 0.08);
}

.auth-forgot {
    line-height: 1.4;
}

.auth-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.5rem;
    margin-top: 1.25rem;
    color: #64748b;
    font-size: 0.8125rem;
}

.auth-footer-sep {
    opacity: 0.6;
}

.auth-support-link {
    color: var(--oojeema-prime);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-support-link:hover {
    color: var(--oojeema-prime-hover);
}

.auth-footer-name {
    color: var(--oojeema-prime-ink);
    opacity: 0.85;
}

@keyframes auth-panel-in {
    from {
        opacity: 0;
        transform: translateX(-0.75rem);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes auth-card-in {
    from {
        opacity: 0;
        transform: translateY(0.75rem);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-brand-panel,
    .auth-form-panel {
        animation: none;
    }
}

.app-shell {
    min-height: 100vh;
    background: #e5eaf0;
}

/* Typeahead combobox — menu is portaled to body (fixed) */
.oojeema-typeahead-menu {
    position: fixed;
    z-index: 1060;
    margin: 0;
    padding: 0.25rem 0;
    max-height: 14rem;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.oojeema-typeahead-option {
    cursor: pointer;
}

.oojeema-typeahead-option:hover,
.oojeema-typeahead-option.is-active {
    background: var(--oojeema-prime-soft);
    color: var(--oojeema-prime);
}

/**
 * Company logo dropzone — large clickable preview for add / change / remove.
 */
.logo-dropzone {
    position: relative;
    display: block;
    width: 100%;
    max-width: 22rem;
    height: 9.5rem;
    border: 1.5px dashed #b8c2cc;
    border-radius: 0.5rem;
    background: #f7f9fb;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.logo-dropzone:hover,
.logo-dropzone:focus {
    border-color: var(--oojeema-prime);
    background: var(--oojeema-prime-soft);
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--oojeema-prime-rgb), 0.18);
}

.logo-dropzone.is-filled {
    border-style: solid;
    border-color: #dee2e6;
    background: #fff;
    cursor: pointer;
}

.logo-dropzone.is-filled:hover,
.logo-dropzone.is-filled:focus {
    border-color: var(--oojeema-prime);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(var(--oojeema-prime-rgb), 0.18);
}

.logo-dropzone.is-disabled {
    opacity: 0.55;
    pointer-events: none;
    cursor: not-allowed;
}

/* Permission UX: disabled actions stay visible with Access Denied affordance */
button.is-access-disabled,
a.is-access-disabled,
.btn.is-access-disabled,
.dropdown-item.is-access-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.oojeema-access-denied {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 55vh;
    padding: 2rem 1rem;
}

.oojeema-access-denied-card {
    max-width: 28rem;
    width: 100%;
    text-align: center;
    padding: 2rem 1.75rem;
    border-radius: 1rem;
    background: #fff;
    border: 1px solid #e9ecef;
    box-shadow: 0 0.5rem 1.5rem rgba(33, 37, 41, 0.06);
}

.oojeema-access-denied-icon {
    width: 3.25rem;
    height: 3.25rem;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--oojeema-prime-rgb), 0.1);
    color: var(--oojeema-prime);
    font-size: 1.5rem;
}

.oojeema-access-denied-title {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #212529;
}

.oojeema-access-denied-text {
    color: #6c757d;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.logo-dropzone-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    height: 100%;
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
    user-select: none;
}

.logo-dropzone-empty .bi {
    font-size: 1.5rem;
    color: var(--oojeema-prime);
}

.logo-dropzone-filled {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
}

.logo-dropzone-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-dropzone-actions {
    position: absolute;
    inset: auto 0.5rem 0.5rem auto;
    display: flex;
    gap: 0.35rem;
    padding: 0.25rem;
    border-radius: 0.4rem;
    background: rgba(15, 39, 68, 0.72);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.logo-dropzone-actions .btn {
    --bs-btn-padding-y: 0.15rem;
    --bs-btn-padding-x: 0.55rem;
    --bs-btn-font-size: 0.75rem;
    border: 0;
}

.logo-dropzone-actions .btn-light {
    color: #0f2744;
}

.logo-dropzone-actions .btn-outline-light {
    color: #fff;
    background: transparent;
}

.logo-dropzone-actions .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.logo-dropzone.is-filled:hover .logo-dropzone-actions,
.logo-dropzone.is-filled:focus-within .logo-dropzone-actions {
    opacity: 1;
    transform: translateY(0);
}

@media (hover: none) {
    .logo-dropzone-actions {
        opacity: 1;
        transform: none;
    }
}

/**
 * Dashboard — marketing-ready KPI tiles and activity.
 */
.dash-hero {
    margin-bottom: 1.75rem;
}

.dash-hero h1 {
    font-size: 1.65rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    margin: 0 0 0.35rem;
}

.dash-hero p {
    margin: 0;
    color: var(--oojeema-shell-muted, #6b7785);
    font-size: 0.95rem;
}

.dash-message {
    max-width: 38rem;
    padding: 1.25rem 1.35rem;
    background: #fff;
    border: 1px solid var(--oojeema-shell-border, #dde3ea);
    border-radius: 12px;
}

.dash-message h1 {
    margin: 0 0 0.45rem;
    font-size: 1.15rem;
    font-weight: 650;
}

.dash-message p,
.dash-empty {
    color: var(--oojeema-shell-muted, #6b7785);
}

.dash-message p {
    margin: 0 0 0.9rem;
}

.dash-empty {
    margin: 0;
    font-size: 0.88rem;
}

.dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.dash-kpi {
    background: #fff;
    border: 1px solid var(--oojeema-shell-border, #dde3ea);
    border-radius: 12px;
    padding: 1.15rem 1.25rem;
    box-shadow: 0 1px 2px rgba(28, 36, 48, 0.04);
}

.dash-kpi-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--oojeema-shell-muted, #6b7785);
    margin-bottom: 0.45rem;
}

.dash-kpi-value {
    font-size: 1.45rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--oojeema-shell-ink, #1c2430);
    line-height: 1.2;
}

.dash-kpi-hint {
    margin-top: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--oojeema-accent);
}

.dash-kpi-hint.is-positive {
    color: var(--oojeema-positive);
}

.dash-kpi-hint.is-warm {
    color: var(--oojeema-warm);
}

.dash-panels {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
    .dash-panels {
        grid-template-columns: 1fr;
    }
}

.dash-panel {
    background: #fff;
    border: 1px solid var(--oojeema-shell-border, #dde3ea);
    border-radius: 12px;
    padding: 1.25rem 1.35rem;
    box-shadow: 0 1px 2px rgba(28, 36, 48, 0.04);
}

.dash-panel h2 {
    font-size: 0.95rem;
    font-weight: 650;
    margin: 0 0 1rem;
}

.dash-activity {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dash-activity li {
    display: flex;
    gap: 0.85rem;
    padding: 0.75rem 0;
    border-top: 1px solid #eef1f5;
}

.dash-activity li:first-child {
    border-top: 0;
    padding-top: 0;
}

.dash-activity-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    background: var(--oojeema-accent-soft);
    color: var(--oojeema-accent);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 0.95rem;
}

.dash-activity-icon.is-positive {
    background: var(--oojeema-positive-soft);
    color: var(--oojeema-positive);
}

.dash-activity-icon.is-warm {
    background: var(--oojeema-warm-soft);
    color: var(--oojeema-warm);
}

.dash-activity-body {
    min-width: 0;
}

.dash-activity-title {
    font-size: 0.9rem;
    font-weight: 550;
    margin: 0 0 0.15rem;
}

.dash-activity-meta {
    font-size: 0.78rem;
    color: var(--oojeema-shell-muted, #6b7785);
    margin: 0;
}

.dash-quick-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.dash-quick-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--oojeema-shell-border, #dde3ea);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    font-size: 0.9rem;
    font-weight: 550;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.dash-quick-link:hover {
    border-color: #b8cce0;
    background: var(--oojeema-prime-soft);
    color: var(--oojeema-prime);
}

.dash-quick-link i {
    font-size: 1.1rem;
    color: var(--oojeema-prime);
}

/**
 * Setup master forms — section headers match document entry tint (see document-line-sections.css --oo-doc-header-bg).
 */
.setup-master-page {
    --oo-doc-header-bg: #f8fafc;
}

.setup-master-page .oo-doc-card-title {
    display: flex;
    align-items: center;
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--bs-body-color);
}

.setup-master-page .oo-doc-card-title strong {
    font-weight: 600;
}

.setup-master-page .card.border-0.shadow-sm > .card-header.oo-setup-section-header {
    background: var(--oo-doc-header-bg);
    border-bottom: 1px solid var(--bs-border-color, var(--oojeema-shell-border, #dde3ea));
    padding: 1rem 1.25rem 0.85rem;
}

.setup-master-page .oojeema-form-actions {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    width: auto;
    max-width: 100%;
    margin-left: auto;
}

.setup-master-page .oojeema-form-actions .btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
}

/* Muted micro-labels — same tokens as .je-page (field-label-value hierarchy, canon §5.13). */
.setup-master-page .form-label,
.oo-setup-master-modal .form-label {
    font-size: 0.72rem;
    font-weight: 650;
    color: var(--oojeema-shell-muted, #475569);
    margin-bottom: 0.35rem;
    line-height: 1.3;
}

.company-setup-page .card {
    border-radius: 12px;
}

.company-setup-page .card-body {
    padding: var(--oo-inset-lg, 1.25rem);
}

.company-setup-page .oo-doc-card-title {
    display: block;
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--bs-body-color);
}

.company-setup-page .oo-doc-card-title strong {
    font-weight: 600;
}

.company-setup-page .row.g-3 {
    --bs-gutter-y: 1rem;
    --bs-gutter-x: 1rem;
}

.company-setup-page .form-label {
    font-weight: 600;
    font-size: 0.8125rem;
    margin-bottom: 0.35rem;
    color: var(--oojeema-shell-muted, #5c6b7a);
}

.company-setup-page .company-setup-check {
    padding-top: 0.35rem;
}

.company-setup-page .oojeema-form-actions {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
}

.company-setup-page .company-setup-tabs {
    border-bottom: 2px solid var(--oojeema-shell-border, #dde3ea);
    margin-bottom: 1rem;
    gap: 0.15rem;
}

.company-setup-page .company-setup-tabs .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: var(--oojeema-shell-muted, #5c6b7a);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.65rem 0.9rem;
    background: transparent;
}

.company-setup-page .company-setup-tabs .nav-link:hover {
    color: var(--oojeema-prime, #205088);
}

.company-setup-page .company-setup-tabs .nav-link.active {
    color: var(--oojeema-prime, #205088);
    border-bottom-color: var(--oojeema-prime, #205088);
    background: transparent;
}

.company-setup-page .company-setup-band {
    padding-top: 1rem;
    border-top: 1px solid var(--oojeema-shell-border, #dde3ea);
}

.company-setup-page .company-setup-band + .company-setup-band {
    margin-top: 0.25rem;
}

.company-setup-page .company-setup-band__lead {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--oojeema-shell-ink, #1c2430);
    margin: 0 0 0.15rem;
}

.company-setup-page .company-setup-band__sub {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--oojeema-shell-muted, #5c6b7a);
    margin: 0 0 0.5rem;
}

/**
 * Journal entry form — higher-contrast surfaces (proposal-2).
 * Soft tinted headers + stronger borders/text; horizontal hairlines only in grids.
 */
.je-page h1.h3 {
    color: #0f172a;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.je-page a.small.text-muted {
    color: #475569 !important;
    font-weight: 550;
}

.je-page .card-body {
    padding: 1.25rem 1.35rem;
}

.je-page .form-label {
    font-size: 0.72rem;
    font-weight: 650;
    color: var(--oojeema-shell-muted, #475569);
    margin-bottom: 0.35rem;
}

.je-page .form-control,
.je-page .form-select {
    border-color: #cbd5e1;
    color: #0f172a;
    font-weight: 500;
}

.je-page .form-control:focus,
.je-page .form-select:focus {
    border-color: var(--oojeema-prime);
    box-shadow: 0 0 0 2px rgba(32, 80, 136, 0.45);
}

.je-page .form-control:disabled,
.je-page .form-control[readonly] {
    background: #f1f5f9;
    color: #475569;
    font-weight: 500;
}

/* Partner typeahead + quick-add — matched row height (phone primary btn rule excluded via btn-sm) */
.je-partner-combo {
    align-items: stretch;
}

.je-partner-combo .oojeema-typeahead,
.je-partner-combo #f-partner-ta {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
}

.je-partner-combo .oojeema-typeahead .form-control {
    flex: 1 1 auto;
    width: 100%;
    min-height: calc(1.5em + 0.5rem + 2px);
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.je-partner-add-btn {
    width: 2.5rem;
    flex: 0 0 2.5rem;
    padding: 0;
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.je-page .form-control.line-debit.is-side-locked,
.je-page .form-control.line-credit.is-side-locked,
.je-page .form-control.line-debit:disabled,
.je-page .form-control.line-credit:disabled,
.oojeema-line-cards .form-control.line-debit.is-side-locked,
.oojeema-line-cards .form-control.line-credit.is-side-locked,
.oojeema-line-cards .form-control.line-debit:disabled,
.oojeema-line-cards .form-control.line-credit:disabled {
    background: #e2e8f0 !important;
    background-color: #e2e8f0 !important;
    color: #94a3b8 !important;
    -webkit-text-fill-color: #94a3b8;
    border-color: #cbd5e1 !important;
    cursor: not-allowed;
    opacity: 1;
    pointer-events: none;
}

.je-page .je-grid tbody td.is-side-locked,
.oojeema-line-cards tbody td.is-side-locked {
    opacity: 1;
}

/* Tablet / narrow desktop: gray locked DR/CR cells in the grid (line-cards are phone-only) */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .je-page .je-grid tbody td.is-side-locked,
    .je-page .je-grid > :not(caption) > * > *.is-side-locked {
        background: #e8edf3 !important;
        background-color: #e8edf3 !important;
    }

    .je-page .je-grid tbody td.is-side-locked .form-control,
    .je-page .je-grid tbody td.is-side-locked .form-control:disabled {
        background: #dbe3ec !important;
        background-color: #dbe3ec !important;
        color: #64748b !important;
        -webkit-text-fill-color: #64748b;
        border-color: #c5d0dc !important;
        opacity: 1;
    }
}

.je-page .card-header {
    padding: 0.8rem 1.25rem;
    border-bottom: 2px solid #6ba5cf;
    border-radius: 12px 12px 0 0;
    background: #cfe0f0;
    color: var(--oojeema-prime-ink);
    box-shadow: none;
}

.je-page .card-header h2,
.je-page .card-header .h6 {
    color: #0f2740;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.je-page .card-header.je-header-tax {
    background: #bdd4ea;
    border-bottom-color: #3d8ab5;
}

.je-page .card-header.je-header-tax h2,
.je-page .card-header.je-header-tax .h6 {
    color: #0f2740;
}

.je-page .card-header.je-header-wht {
    background: #f0dfa0;
    border-bottom-color: #d4a017;
}

.je-page .card-header.je-header-wht h2,
.je-page .card-header.je-header-wht .h6 {
    color: #5c3d05;
}

.je-page .card-header.je-header-preview {
    background: #b8dfd0;
    border-bottom-color: #059669;
}

.je-page .card-header.je-header-preview h2,
.je-page .card-header.je-header-preview .h6 {
    color: #043d2e;
}

/* Add-row buttons: white chip on tinted headers */
.je-page .card-header .btn-outline-primary {
    --bs-btn-color: #0f2740;
    --bs-btn-border-color: #6ba5cf;
    --bs-btn-hover-bg: #fff;
    --bs-btn-hover-border-color: var(--oojeema-prime);
    --bs-btn-hover-color: var(--oojeema-prime);
    background: #fff;
    font-weight: 650;
    font-size: 0.72rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.je-page .card-header.je-header-tax .btn-outline-primary {
    --bs-btn-border-color: #3d8ab5;
}

.je-page .card-header.je-header-wht .btn-outline-primary {
    --bs-btn-color: #5c3d05;
    --bs-btn-border-color: #d4a017;
    --bs-btn-hover-bg: #fffbeb;
    --bs-btn-hover-border-color: #b45309;
    --bs-btn-hover-color: #5c3d05;
}

.je-page .card-header.je-header-preview .btn-outline-primary {
    --bs-btn-color: #043d2e;
    --bs-btn-border-color: #059669;
}

#wht-card > .card-body.py-2 {
    background: #f5ebb8;
    border-bottom: 1px solid #d4a017;
    padding-top: 0.55rem !important;
    padding-bottom: 0.55rem !important;
}

#wht-card > .card-body.py-2 .text-muted,
#wht-card #wht-card-help {
    color: #5c3d05 !important;
    font-weight: 600;
    font-size: 0.72rem;
}

.je-page .je-nature-toggle,
.je-page #nature-toggle {
    display: inline-flex;
    align-items: center;
    background: #e2e8f0;
    border: 1px solid #94a3b8;
    border-radius: 0.55rem;
    padding: 0.2rem;
    gap: 0.15rem;
}

.je-page #nature-toggle .nature-btn {
    appearance: none;
    border: 0;
    border-radius: 0.4rem;
    margin: 0;
    padding: 0.45rem 0.95rem;
    font: inherit;
    font-weight: 600;
    font-size: 0.82rem;
    line-height: 1.25;
    color: #334155;
    background: transparent;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.je-page #nature-toggle .nature-btn:hover:not(.is-active):not(:disabled) {
    background: rgba(255, 255, 255, 0.55);
    color: #0f172a;
}

.je-page #nature-toggle .nature-btn.is-active {
    background: var(--oojeema-prime);
    color: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
}

.je-page #nature-toggle .nature-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.je-page #nature-toggle .nature-btn.is-active:disabled {
    opacity: 0.9;
    background: var(--oojeema-prime);
    color: #fff;
}

.je-page .je-grid,
.je-page #je-preview-table {
    --je-rule: #e2e8f0;
    --je-rule-strong: #cbd5e1;
    width: 100%;
    margin: 0;
    border: 0;
    border-collapse: collapse;
    vertical-align: middle;
    font-size: 0.82rem;
    color: #0f172a;
}

.je-page .je-grid.table-bordered,
.je-page #je-preview-table.table-bordered {
    border: 0;
}

.je-page .je-grid > :not(caption) > * > *,
.je-page #je-preview-table > :not(caption) > * > * {
    border: 0 !important;
    border-bottom: 1px solid var(--je-rule) !important;
    background-color: transparent;
    padding: 0.65rem 1rem;
    vertical-align: middle;
    box-shadow: none;
}

.je-page .je-grid thead th,
.je-page #je-preview-table thead th {
    border-bottom: 1px solid var(--je-rule-strong) !important;
    background: #fff !important;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
}

.je-page .je-grid tbody tr:hover > * {
    background: #f8fafc;
}

.je-page .je-grid tbody tr:last-child > *,
.je-page .je-grid tfoot tr:first-child > * {
    border-bottom-color: var(--je-rule-strong) !important;
}

.je-page .je-grid tfoot th,
.je-page .je-grid tfoot td,
.je-page #je-preview-table tfoot th,
.je-page #je-preview-table tfoot td {
    background: #f1f5f9 !important;
    font-weight: 650;
    color: #334155;
    border-bottom: 0 !important;
    border-top: 1px solid #cbd5e1 !important;
}

.je-page .je-grid tfoot tr:last-child > *,
.je-page #je-preview-table tfoot tr:last-child > *,
.je-page .je-grid tbody:last-child tr:last-child > *,
.je-page #je-preview-table tbody:last-child tr:last-child > * {
    border-bottom: 0 !important;
}

.je-page .je-grid .form-control,
.je-page .je-grid .form-select {
    border-color: #cbd5e1;
    background-color: #fff;
    font-weight: 500;
    color: #0f172a;
}

.je-page .je-grid .form-control:focus,
.je-page .je-grid .form-select:focus {
    border-color: var(--oojeema-prime);
    box-shadow: 0 0 0 2px rgba(32, 80, 136, 0.35);
}

.je-page .je-grid .btn-link {
    text-decoration: none;
    padding: 0.25rem 0.4rem;
    color: #64748b;
}

.je-page .je-grid .btn-link:hover {
    color: #dc2626;
}

/**
 * General Ledger / books reports — legacy Oojeema row colors and header styling.
 */
.gl-taxpayer-header {
    font-size: 0.875rem;
}

.gl-report-table thead th {
    white-space: nowrap;
    vertical-align: middle;
}

.gl-report-table td {
    vertical-align: middle;
}

.gl-account-header td {
    background: #f5f5f5;
    border-top: 1px solid #dee2e6;
}

.gl-row-alt td {
    background: #e3f2fd;
}

.gl-row-subtotal td {
    background: #cdf6fd;
}

.gl-row-balance td {
    background: #fdf0cb;
}

.gl-row-grand td {
    background: #f2dddc;
}

.gl-report-table a {
    color: var(--oojeema-prime);
    text-decoration: none;
    font-weight: 600;
}

.gl-report-table a:hover {
    text-decoration: underline;
}

/**
 * Books report page layout — generous spacing for feature / marketing screenshots.
 * Used by General Journal (and reusable by other books reports).
 */
.books-report {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0.25rem 0.5rem 2.5rem;
}

.books-report--wide {
    max-width: 90rem;
}

.books-report__header {
    margin-bottom: 1.75rem;
}

.books-report__crumb {
    margin-bottom: 0.65rem;
    font-size: 0.8125rem;
}

.books-report__crumb a {
    color: var(--oojeema-shell-muted, #334155);
}

.books-report__crumb a:hover {
    color: var(--oojeema-prime);
}

.books-report__title {
    margin: 0 0 0.4rem;
    font-size: clamp(1.65rem, 1.4rem + 0.8vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--oojeema-prime-ink);
    line-height: 1.2;
}

.books-report__lede {
    max-width: 36rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--oojeema-shell-muted, #334155);
}

.books-report__panel {
    background: var(--oojeema-shell-surface, #fff);
    border: 1px solid rgba(182, 194, 208, 0.65);
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px rgba(15, 39, 68, 0.04), 0 12px 28px rgba(15, 39, 68, 0.06);
    overflow: hidden;
}

/* Statement matrices scroll inside .statement-table-scroll; keep panel from
   becoming the sticky containing block (overflow:hidden breaks sticky left). */
.statement-report .books-report__panel {
    overflow: visible;
}

.books-report__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem 1.25rem;
    padding: 1.25rem 1.75rem 1.25rem;
    border-bottom: 1px solid rgba(182, 194, 208, 0.55);
    background: linear-gradient(180deg, #fbfdff 0%, #ffffff 100%);
}

.books-report__toolbar.books-report__toolbar--stacked {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding-top: 1.1rem;
    padding-bottom: 1.1rem;
}

.books-report__toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
}

.books-report__toolbar-row + .books-report__toolbar-row {
    margin-top: 0;
}

.books-report__toolbar-row + .books-report__toolbar-row .books-report__field {
    gap: 0;
}

.books-report__toolbar-exports {
    display: inline-flex;
    gap: 0.5rem;
    padding-right: 0.5rem;
}

.books-report__export-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.375rem;
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--oojeema-accent-border);
    background: var(--oojeema-accent-soft);
    color: var(--oojeema-prime-ink);
    font-size: 0.8125rem;
    font-weight: 600;
}

.books-report__export-btn:hover,
.books-report__export-btn:focus {
    background: #d7e6f3;
    border-color: var(--oojeema-accent);
    color: var(--oojeema-prime);
}

.books-report__export-btn .bi {
    font-size: 1.05rem;
    line-height: 1;
}

.books-report__filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.85rem 1rem;
    flex: 1 1 auto;
}

.books-report__field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 9.5rem;
}

.books-report__field--status {
    min-width: 8.5rem;
}

.books-report__field--grow {
    flex: 1 1 14rem;
    min-width: 12rem;
}

.books-report__field--typeahead {
    flex: 1 1 16rem;
    min-width: 15rem;
    max-width: 22rem;
}

.books-report__field--search {
    flex: 1 1 18rem;
    min-width: 16rem;
}

.books-report__typeahead-host {
    width: 100%;
}

.books-report__typeahead-host .form-control {
    min-height: 2.375rem;
    font-size: 0.875rem;
}

.books-report__field--check {
    min-width: 12.5rem;
    margin-left: 0.25rem;
    padding-right: 0.5rem;
}

.books-report__check {
    display: inline-flex;
    align-items: center;
    align-self: flex-end;
    gap: 0.5rem;
    min-height: 2.375rem;
    margin: 0 0 0 1.15rem;
    padding: 0 0.5rem 0 0;
    font-size: 0.875rem;
    white-space: nowrap;
}

.books-report__check .form-check-input {
    float: none;
    margin: 0;
    flex: 0 0 auto;
}

.books-report__check .form-check-label {
    margin: 0;
    padding: 0;
    line-height: 1.25;
}

.books-report__field--action {
    min-width: auto;
}

.books-report__field .form-label {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--oojeema-shell-muted, #334155);
}

.books-report__field-spacer {
    visibility: hidden;
    user-select: none;
}

.books-report__field .form-control,
.books-report__field .form-select {
    min-height: 2.375rem;
    font-size: 0.875rem;
}

.books-report__field--action .btn {
    min-height: 2.375rem;
    padding-left: 1.15rem;
    padding-right: 1.15rem;
    font-weight: 600;
}

.books-report__taxpayer {
    display: grid;
    gap: 0.55rem;
    padding: 1.15rem 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(182, 194, 208, 0.45);
    background: #f8fafc;
}

.books-report__taxpayer-row {
    display: grid;
    grid-template-columns: minmax(9.5rem, 11.5rem) minmax(0, 1fr);
    gap: 0.75rem 1.25rem;
    align-items: baseline;
    font-size: 0.875rem;
    line-height: 1.45;
}

.books-report__taxpayer-label {
    color: var(--oojeema-shell-muted, #334155);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.books-report__taxpayer-row strong {
    font-weight: 600;
    color: var(--oojeema-shell-ink, #0f172a);
    word-break: break-word;
}

.books-report__table-wrap {
    padding: 0;
}

.books-report__table {
    --bs-table-bg: transparent;
    margin: 0;
}

.books-report__table thead th {
    padding: 0.85rem 1.15rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--oojeema-prime-ink);
    background: #eef3f8;
    border-bottom: 1px solid rgba(182, 194, 208, 0.75);
}

.books-report__table tbody td {
    padding: 0.8rem 1.15rem;
    font-size: 0.875rem;
    border-color: rgba(182, 194, 208, 0.4);
}

.books-report__table tbody tr:first-child td {
    border-top: 0;
}

.books-report__empty {
    padding: 2.75rem 1.5rem !important;
    text-align: center;
    color: var(--oojeema-shell-muted, #334155);
    font-size: 0.9375rem;
}

.books-report__table .gl-row-subtotal td {
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
    border-top: 1px solid rgba(61, 138, 181, 0.35);
}

.books-report__table .gl-account-header td {
    padding-top: 0.95rem;
    padding-bottom: 0.95rem;
    font-size: 0.9375rem;
    background: #eef3f8;
    border-top: 1px solid rgba(182, 194, 208, 0.7);
}

.books-report__table .gl-row-begin td {
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
    color: var(--oojeema-shell-muted, #334155);
}

.books-report__table .gl-row-balance td,
.books-report__table .gl-row-grand td {
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

.books-report__pager {
    padding: 0.85rem 1.35rem 1rem;
    border-top: 1px solid rgba(182, 194, 208, 0.55);
    background: #fcfdff;
}

.books-report__filter-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.55rem;
    padding: 0.75rem 1.35rem;
    border-bottom: 1px solid rgba(182, 194, 208, 0.45);
    background: #f8fafc;
}

.books-report__filter-summary-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--oojeema-shell-muted, #334155);
    margin-right: 0.15rem;
}

.books-report__filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(61, 138, 181, 0.35);
    background: #fff;
    font-size: 0.8125rem;
    color: var(--oojeema-prime-ink, #0f172a);
}

.books-report__filter-chip-key {
    font-weight: 600;
    color: var(--oojeema-shell-muted, #334155);
}

.books-report__filter-chip--muted {
    border-style: dashed;
    color: var(--oojeema-shell-muted, #334155);
}

.books-report__dim-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.85rem 1rem;
    padding: 0.85rem 1.35rem;
    border-bottom: 1px solid rgba(182, 194, 208, 0.45);
    background: #fcfdff;
}

.books-report__pager .listing-page-size {
    min-width: 4.25rem;
}

.books-report__col-search {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--oojeema-prime);
    font: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
}

.books-report__col-search:hover,
.books-report__col-search.is-active {
    color: var(--oojeema-prime-hover);
    text-decoration: underline;
}

@media (max-width: 767.98px) {
    .books-report {
        padding: 0 0 2rem;
    }

    .books-report__toolbar {
        padding: 1.1rem 1.15rem 1.1rem;
    }

    .books-report__field--typeahead,
    .books-report__field--search {
        max-width: none;
        flex: 1 1 100%;
        min-width: 100%;
    }

    .books-report__taxpayer {
        padding: 1rem 1.1rem;
    }

    .books-report__taxpayer-row {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }

    .books-report__table thead th,
    .books-report__table tbody td {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    .books-report__pager {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* —— Compact financial-report workspace —— */

.compact-report .books-report__header {
    margin-bottom: 0.75rem;
}

.compact-report .books-report__crumb {
    margin-bottom: 0.2rem;
}

.compact-report .books-report__title {
    margin-bottom: 0.15rem;
    font-size: clamp(1.4rem, 1.25rem + 0.45vw, 1.65rem);
}

.compact-report .books-report__lede {
    max-width: none;
    font-size: 0.8125rem;
    line-height: 1.35;
}

.compact-report .books-report__toolbar.books-report__toolbar--stacked {
    gap: 0.55rem;
    padding: 0.85rem 1.25rem;
}

.compact-report .books-report__toolbar-row {
    gap: 0.45rem;
}

.compact-report__primary-row {
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

/* Native date inputs need room for MM/DD/YYYY + calendar affordance. */
.compact-report .compact-report__date {
    flex: 0 0 10rem;
    min-width: 10rem;
}

.compact-report .compact-report__date .form-control[type="date"] {
    width: 100%;
    min-width: 0;
}

.compact-report .books-report__field--status {
    flex: 0 0 6.5rem;
    min-width: 6.5rem;
}

.compact-report .books-report__field .form-label {
    font-size: 0.6875rem;
}

.compact-report .books-report__field .form-control,
.compact-report .books-report__field .form-select,
.compact-report .books-report__typeahead-host .form-control {
    min-height: 2rem;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    font-size: 0.8125rem;
}

.compact-report .books-report__check {
    gap: 0.35rem;
    min-height: 2rem;
    margin: 0;
    padding: 0;
    font-size: 0.75rem;
}

.compact-report__unassigned-host {
    display: flex;
    align-self: flex-end;
}

.compact-report__unassigned-host:empty {
    display: none;
}

.compact-report .books-report__toolbar-exports {
    gap: 0.3rem;
    margin-left: auto;
    padding-right: 0;
}

.compact-report .books-report__export-btn {
    min-height: 2rem;
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
}

.compact-report .books-report__field--typeahead {
    flex: 1 1 12rem;
    min-width: 11rem;
    max-width: none;
}

.compact-report .books-report__field--search {
    flex: 2 1 18rem;
    min-width: 14rem;
}

.gl-report .gl-filter-account {
    flex: 1 1 14rem;
    min-width: 12rem;
    max-width: 20rem;
}

.report-update-status {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.3rem;
    min-height: 2rem;
    color: var(--oojeema-shell-muted, #334155);
    font-size: 0.75rem;
    white-space: nowrap;
}

.report-update-status:empty {
    display: none;
}

.report-update-status .spinner-border {
    width: 0.75rem;
    height: 0.75rem;
    border-width: 0.12em;
}

.report-update-status.is-updated {
    color: var(--oojeema-positive, #047857);
}

.report-update-status.is-error {
    color: #8a1f1f;
}

.compact-report .books-report__dim-toolbar {
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding: 0.55rem 1rem 0.65rem;
}

.compact-report .books-report__dim-toolbar .books-report__field {
    flex: 1 1 0;
    min-width: 0;
    max-width: 12rem;
}

.compact-taxpayer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 0.45rem 2rem;
    padding: 0.85rem 1.25rem;
    font-size: 0.8125rem;
    border-bottom: 1px solid rgba(182, 194, 208, 0.45);
    background: #f8fafc;
}

.books-report__panel > .compact-taxpayer {
    border-top: 0;
}

.compact-taxpayer__item {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 0.65rem;
    line-height: 1.35;
}

.compact-taxpayer__item strong {
    overflow-wrap: anywhere;
}

.compact-taxpayer__address {
    grid-column: 1 / -1;
}

@media (max-width: 767.98px) {
    .compact-report .books-report__header {
        padding: 0 0.25rem;
    }

    .compact-report .books-report__toolbar.books-report__toolbar--stacked {
        padding: 0.75rem;
    }

    .compact-report__primary-row,
    .compact-report .books-report__dim-toolbar {
        flex-wrap: wrap;
    }

    .compact-report .compact-report__date,
    .compact-report .books-report__field--status {
        flex: 1 1 28%;
    }

    .compact-report .books-report__toolbar-exports {
        margin-left: 0;
    }

    .compact-report .books-report__dim-toolbar .books-report__field {
        flex: 1 1 calc(50% - 0.5rem);
        max-width: none;
    }

    .report-update-status {
        margin-left: auto;
    }

    .compact-taxpayer {
        grid-template-columns: 1fr;
        gap: 0.35rem;
        padding: 0.65rem 0.75rem;
    }

    .compact-taxpayer__address {
        grid-column: auto;
    }
}

/* —— Trial Balance drill-down + accounting amounts —— */

.tabular-nums {
    font-variant-numeric: tabular-nums;
}

.tb-drilldown {
    --bs-offcanvas-width: min(72rem, calc(100vw - 2rem));
    width: var(--bs-offcanvas-width);
    max-width: none;
}

.tb-drilldown__header {
    padding: 1rem 1.25rem;
}

.tb-drilldown__body {
    padding: 1.25rem;
    overflow: auto;
}

.tb-drilldown__summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.tb-drilldown__metric {
    border: 1px solid var(--oojeema-shell-border, #d7dee8);
    border-radius: 0.5rem;
    padding: 0.75rem 0.9rem;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-height: 4.25rem;
}

.tb-drilldown__metric-label {
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #5b6b7c;
}

.tb-drilldown__metric strong {
    font-size: 1.05rem;
    color: #1c2430;
}

.tb-drilldown__table th,
.tb-drilldown__table td {
    padding: 0.55rem 0.65rem;
    vertical-align: middle;
}

.tb-drilldown__table thead th {
    white-space: nowrap;
    background: #f3f6fa;
}

.tb-drilldown__footer {
    background: #fff;
    position: sticky;
    bottom: 0;
}

.tb-drilldown__footer .btn {
    min-width: 11rem;
}

.tb-panel-gl__context {
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--oojeema-shell-border, #d7dee8);
    border-radius: 0.5rem;
    background: #f8fafc;
}

.tb-panel-gl__eyebrow {
    color: #35465a;
    font-size: 0.75rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tb-panel-gl__balance-row td {
    background: #f3f6fa;
    border-top-width: 1px;
}

.tb-panel-gl__subtotal-row td {
    background: #fbfcfe;
    border-top: 2px solid #aeb9c7;
}

.tb-panel-gl__table tbody tr:last-child td {
    border-bottom: 2px solid #6d7d8f;
}

.tb-drilldown__footer #gl-drilldown-full {
    min-width: auto;
}

/* —— GL review mode (from Trial Balance) —— */

.gl-review-context {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--oojeema-shell-border, #d7dee8);
    background: #f7f9fc;
}

.gl-review-context__eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5b6b7c;
    font-weight: 600;
}

.gl-review-context__account {
    color: #1c2430;
    font-weight: 650;
}

.gl-review-context__period {
    color: #445466;
}

.gl-review-context__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
}

.gl-filter-panel.is-collapsed {
    display: none;
}

.gl-report--review .books-report__lede {
    max-width: 42rem;
}

@media (max-width: 767.98px) {
    .gl-review-context {
        padding: 0.9rem 1rem;
    }

    .gl-review-context__actions {
        width: 100%;
    }

    .tb-drilldown__footer #gl-drilldown-full {
        width: 100%;
        margin-left: 0 !important;
        text-align: left;
    }
}

.books-report__table .is-negative,
.tb-drilldown__table .is-negative,
.account-detail-report .is-negative,
.modal .is-negative,
.statement-matrix .is-negative {
    color: #8a1f1f;
}

/* —— Management IS / BS —— */

.statement-kpi-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    margin-bottom: 0.85rem;
}

.statement-kpi {
    min-width: 7.5rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--oojeema-shell-border, #d7dee8);
    border-radius: 0.4rem;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.statement-kpi__label {
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #5b6b7c;
    font-weight: 600;
}

.statement-kpi__value {
    font-size: 0.95rem;
    font-weight: 650;
    color: #1c2430;
    font-variant-numeric: tabular-nums;
}

/* Calm focused result summary (replaces five-tile KPI walls). */
.statement-result-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.65rem 1.25rem;
    margin-bottom: 0.95rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--oojeema-shell-border, #d7dee8);
    border-radius: 0.45rem;
    background: #f8fafc;
}

.statement-result-summary__primary {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 10rem;
}

.statement-result-summary__label {
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5b6b7c;
    font-weight: 700;
}

.statement-result-summary__value {
    font-size: 1.35rem;
    font-weight: 750;
    color: #1c2430;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.statement-result-summary__value.is-negative {
    color: #8a1f1f;
}

.statement-result-summary__secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    font-size: 0.8125rem;
    color: #5b6b7c;
}

.statement-result-summary__secondary strong {
    color: #1c2430;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.statement-result-summary.is-warning {
    border-color: #f0c4c4;
    background: #fdf8f8;
}

.statement-result-summary.is-warning .statement-result-summary__label,
.statement-result-summary.is-warning .statement-result-summary__value {
    color: #9b1c1c;
}

/* Books reports (TB / GL / GJ): entry-grouped journal + status pills */
.books-entry-header td {
    padding: 0;
    background: #f3f6f9;
    border-top: 1px solid var(--oojeema-shell-border, #d7dee8);
}

.books-entry-header__btn {
    display: grid;
    grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr) auto auto;
    gap: 0.55rem 1rem;
    align-items: center;
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 0;
    background: transparent;
    text-align: left;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.books-entry-header__btn:hover,
.books-entry-header__btn:focus-visible {
    background: #e9eef4;
    outline: none;
}

.books-entry-header__meta {
    font-size: 0.8125rem;
    color: #5b6b7c;
}

.books-entry-header__desc {
    font-size: 0.875rem;
    color: #1c2430;
    min-width: 0;
}

.books-entry-header__amounts {
    font-size: 0.875rem;
    color: #1c2430;
    white-space: nowrap;
}

.books-entry-line td {
    border-top-color: rgba(182, 194, 208, 0.35);
}

.books-entry-line__indent {
    width: 1.25rem;
    background: linear-gradient(90deg, #f3f6f9 0, #f3f6f9 0.55rem, transparent 0.55rem);
}

.books-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(91, 107, 124, 0.28);
    background: #fff;
    font-size: 0.7rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #5b6b7c;
    white-space: nowrap;
}

.books-status-pill--posted {
    border-color: rgba(31, 107, 74, 0.35);
    background: #e8f5ef;
    color: #1f6b4a;
}

.books-status-pill--reversed {
    border-color: rgba(155, 28, 28, 0.3);
    background: #fdf2f2;
    color: #9b1c1c;
}

.books-status-pill--reversing {
    border-color: rgba(146, 104, 12, 0.35);
    background: #fff8e8;
    color: #8a6410;
}

.tb-report .statement-period-chrome,
.gl-report .statement-period-chrome,
.gj-report .statement-period-chrome {
    flex: 1 1 18rem;
    min-width: 0;
}

.statement-balance-check {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.9rem;
    margin-top: 1rem;
    padding: 0.8rem 0.95rem;
    border: 1px solid var(--oojeema-shell-border, #d7dee8);
    border-radius: 0.45rem;
    background: #f8fafc;
    font-size: 0.875rem;
    color: #1c2430;
}

.statement-balance-check.is-ok {
    border-color: #b7decc;
    background: #e8f5ef;
    color: #1f6b4a;
}

.statement-balance-check.is-bad {
    border-color: #f0c4c4;
    background: #fdf2f2;
    color: #9b1c1c;
}

.statement-balance-check strong {
    font-weight: 750;
    color: inherit;
}

.statement-export-note {
    font-size: 0.75rem;
    color: #5b6b7c;
    line-height: 1.4;
}

.statement-table-scroll {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

/*
 * Sticky table cells require separate borders — collapse breaks position:sticky
 * in Chromium/WebKit so the Account column scrolls away with the matrix.
 */
.statement-matrix {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.statement-matrix thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #f3f6fa;
    white-space: nowrap;
}

/* Thin cell rules make wide period matrices easier to track horizontally. */
.statement-matrix th + th,
.statement-matrix td + td {
    border-left: 1px solid #d7dde5;
}

.statement-matrix th.is-highlight,
.statement-matrix td.is-highlight {
    background: #eef5fb;
}

.statement-matrix .statement-row-header td {
    font-weight: 700;
    color: #1c2430;
    background: #fff;
    border-top: 1px solid #c5d0dc;
    padding-top: 0.65rem;
}

.statement-matrix .statement-row-account .statement-account-name {
    padding-left: 1.25rem;
}

.statement-matrix .statement-summary-label {
    padding-left: 1.25rem;
    white-space: nowrap;
}

.statement-matrix .statement-row-subtotal td {
    font-weight: 600;
    border-top: 1px solid #c5d0dc;
    background: #fbfcfe;
}

.statement-matrix .statement-row-total td {
    font-weight: 700;
    border-top: 1px solid #9eb6d0;
    background: #d9e8f7;
    color: #1c2430;
}

.statement-matrix .statement-row-gross td {
    font-weight: 700;
    border-top: 1px solid #d6c98a;
    background: #f7efc2;
    color: #1c2430;
}

.statement-matrix .statement-row-net td {
    font-weight: 700;
    border-top: 2px solid #c48a8a;
    background: #f5d6d6;
    color: #1c2430;
}

.statement-matrix .statement-col-account {
    position: sticky;
    left: 0;
    z-index: 3;
    background-color: #fff;
    background-clip: padding-box;
    box-shadow: 1px 0 0 rgba(182, 194, 208, 0.55);
}

.statement-matrix thead .statement-col-account {
    z-index: 5;
    top: 0;
    left: 0;
    background-color: #f3f6fa;
}

.statement-matrix .statement-col-account {
    min-width: 16rem;
    max-width: 24rem;
    white-space: nowrap;
}

/*
 * Sticky labels need opaque backgrounds matching their row tint.
 * `background: inherit` is transparent for sticky stacking and lets
 * horizontally scrolled amount cells bleed through the Account column.
 */
.statement-matrix .statement-row-account .statement-col-account {
    background-color: #fff;
}

.statement-matrix .statement-row-account--alt td:not(.is-highlight) {
    background-color: #f3f4f6;
}

.statement-matrix .statement-row-subtotal .statement-col-account {
    background-color: #fbfcfe;
}

.statement-matrix .statement-row-total .statement-col-account {
    background-color: #d9e8f7;
}

.statement-matrix .statement-row-gross .statement-col-account {
    background-color: #f7efc2;
}

.statement-matrix .statement-row-net .statement-col-account {
    background-color: #f5d6d6;
}

.statement-matrix .statement-row-header .statement-col-account {
    background-color: #fff;
    font-weight: 700;
}

.statement-matrix .statement-row-header td[aria-hidden="true"] {
    border-top: 1px solid #c5d0dc;
    background: #fff;
    padding: 0;
}

/* Separate period groups with the same subtle rule used by the cell grid. */
.statement-matrix .statement-period-start {
    border-left: 1px solid #d7dde5;
}

/* Amount and common-size % belong to the same period group. */
.statement-matrix .statement-period-percent {
    border-left: 0;
    padding-left: 0.25rem;
}

/* Keep paired amount/% cells compact without tightening period boundaries. */
.statement-matrix .statement-period-amount {
    padding-right: 0.25rem;
}

/* Scrolled amount cells must stay under sticky labels. */
.statement-matrix tbody td:not(.statement-col-account) {
    position: relative;
    z-index: 0;
}

/* Report drill affordance — selected-checkbox blue (see report-drilldown rule). */
.report-drill-link,
.statement-amount-link,
.tb-drill-link,
a.report-drill-link,
button.report-drill-link {
    color: var(--bs-blue, #0d6efd);
    text-decoration: none;
    font-weight: inherit;
}

.report-drill-link:hover,
.statement-amount-link:hover,
.tb-drill-link:hover,
a.report-drill-link:hover,
button.report-drill-link:hover {
    color: #0a58ca;
    text-decoration: underline;
}

button.report-drill-link {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font: inherit;
}

.statement-report__secondary-row {
    gap: 0.75rem 1rem;
    padding-top: 0.35rem;
}

.statement-toggle .btn.active {
    background: var(--oojeema-prime, #205088);
    border-color: var(--oojeema-prime, #205088);
    color: #fff;
}

/* —— Period chrome / View offcanvas (all viewports; calm synthesis) —— */

.statement-period-chrome {
    display: flex;
    flex: 1 1 100%;
    flex-direction: column;
    gap: 0.45rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

/*
 * Keep the toolbar inside the report card. Statement panels use overflow:visible
 * for sticky matrix columns, so the toolbar must contain its own actions.
 */
.statement-report .books-report__toolbar {
    overflow: hidden;
    box-sizing: border-box;
}

.statement-toolbar-topline,
.statement-toolbar-controls {
    display: flex;
    align-items: flex-end;
    gap: 0.55rem 1rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.statement-toolbar-topline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: center;
    justify-content: stretch;
    column-gap: 0.75rem;
}

.statement-toolbar-controls {
    flex-wrap: wrap;
}

.statement-period-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    min-width: 0;
}

.statement-preset-chip {
    min-height: 2rem;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
}

/*
 * Cascade period pickers. flex: 1 1 20rem is for WIDTH inside a row
 * (.statement-toolbar-controls). Never place this as a direct flex-grow
 * child of column .statement-period-chrome — that turns 20rem into height.
 */
.statement-period-cascade {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: flex-start;
    min-width: 0;
}

.statement-toolbar-controls .statement-period-cascade {
    flex: 1 1 20rem;
}

.statement-period-cascade .books-report__field {
    flex: 1 1 7rem;
    min-width: 6.5rem;
    align-self: flex-start;
}

/*
 * Stable right side of the presets row: CSV + Excel + View.
 * Freshness status overlays to the left so it never shifts or overflows
 * the report panel edge.
 */
.statement-view-actions {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    margin: 0;
    flex: 0 0 auto;
    max-width: 100%;
    padding: 0;
}

.statement-view-actions .report-update-status {
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    min-width: 0;
    flex: none;
    margin-right: 0.55rem;
    pointer-events: none;
}

.statement-export-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.statement-export-actions .btn {
    min-height: 2rem;
    white-space: nowrap;
}

.statement-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    align-self: center;
    min-height: 2rem;
}

.statement-view-btn[aria-expanded="true"],
.statement-view-btn.is-open {
    background: var(--oojeema-prime, #205088);
    border-color: var(--oojeema-prime, #205088);
    color: #fff;
}

/* ISO date field stays available to JS; chrome cascade is the visible control. */
.statement-report .statement-anchor-desktop {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/*
 * View options — dedicated right offcanvas (narrower than drill panels).
 * Sections: Presentation → Scope → Dimensions (feature-gated).
 * Export lives in the primary toolbar, not inside View.
 */
.statement-view-offcanvas {
    --bs-offcanvas-width: min(26.25rem, 100vw);
}

.statement-view-offcanvas .offcanvas-header {
    padding: 1.15rem 1.25rem 0.85rem;
    border-bottom: 1px solid rgba(182, 194, 208, 0.55);
}

.statement-view-offcanvas .offcanvas-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1c2430;
}

.statement-view-offcanvas .offcanvas-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.25rem;
}

.statement-view-section {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.statement-view-section__header {
    display: flex;
    min-height: 1.75rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid rgba(127, 145, 164, 0.45);
}

.statement-view-section__label {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    color: #334e68;
}

.statement-view-section__header .compact-report__unassigned-host {
    align-self: center;
    margin-left: auto;
}

.statement-view-section__header .compact-report__unassigned-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    font-size: 0.8125rem;
    color: #334155;
    white-space: nowrap;
}

.statement-view-section__header .compact-report__unassigned-filter .form-check-input {
    flex: 0 0 auto;
    margin: 0;
}

.statement-view-section--dims:has(#dim-filter-toolbar.d-none),
.statement-view-section--dims:not(:has(#dim-filter-toolbar)) {
    display: none;
}

.statement-view-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    align-items: end;
}

.statement-view-grid .books-report__field {
    min-width: 0;
    flex: none;
}

.statement-view-grid .books-report__field--span-2,
.statement-view-checks {
    grid-column: 1 / -1;
}

.statement-view-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
}

.statement-view-checks .books-report__check,
.statement-view-checks .compact-report__unassigned-host {
    align-self: center;
    min-height: auto;
}

/* Dimensions inside View — compact wrap, not a second primary toolbar. */
.statement-view-offcanvas .books-report__dim-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 0.75rem;
    padding: 0;
    border: 0;
    background: transparent;
}

.statement-view-offcanvas .books-report__dim-toolbar .books-report__field {
    flex: 1 1 8.5rem;
    min-width: 8rem;
    max-width: 12rem;
}

.statement-view-offcanvas .books-report__dim-toolbar .books-report__check {
    flex: 1 1 100%;
    align-self: center;
}

/* Activity From/To pair inside View stays compact. */
.statement-view-offcanvas .compact-report__date {
    flex: none;
    min-width: 0;
}

.statement-viewport-notice {
    color: #8a5a00;
    background: #fff8e8;
    border-bottom: 1px solid #f0dfb0;
    font-size: 0.8125rem;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.statement-compare-mode-field {
    display: none;
}

@media (max-width: 1199.98px) {
    .statement-period-chrome {
        flex: 1 1 100%;
    }

    .statement-primary-row {
        flex-wrap: wrap;
    }

    .statement-result-summary__value {
        font-size: 1.2rem;
    }

    .statement-matrix .statement-col-account {
        min-width: 10rem;
    }
}

@media (max-width: 767.98px) {
    .statement-amount-link {
        display: inline-block;
        min-height: 2.5rem;
        min-width: 2.75rem;
        padding: 0.45rem 0.15rem;
        line-height: 1.2;
    }

    .statement-matrix .statement-col-account {
        min-width: 8.5rem;
        max-width: 11rem;
        white-space: normal;
    }

    .statement-result-summary {
        align-items: flex-start;
    }

    .statement-balance-check {
        flex-direction: column;
        align-items: flex-start;
    }

    .statement-toolbar-topline {
        grid-template-columns: 1fr;
        row-gap: 0.55rem;
    }

    .statement-toolbar-controls {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .statement-period-presets {
        width: 100%;
    }

    .statement-view-actions {
        width: 100%;
        justify-content: flex-end;
        margin-left: 0;
        padding-right: 0;
    }

    .statement-view-actions .report-update-status {
        position: static;
        transform: none;
        margin-right: auto;
        order: -1;
    }

    .statement-view-offcanvas {
        --bs-offcanvas-width: 100vw;
    }

    .statement-view-offcanvas .offcanvas-header,
    .statement-view-offcanvas .offcanvas-body {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .statement-view-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1200px) {
    .statement-primary-row {
        align-items: flex-end;
        gap: 0.75rem 1rem;
    }

    .statement-period-chrome {
        flex: 1 1 100%;
        max-width: none;
    }
}

@media (min-width: 992px) {
    .tb-drilldown__summary {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .tb-drilldown {
        --bs-offcanvas-width: 100vw;
    }

    .tb-drilldown__summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* —— Mobile list cards, line cards, sticky actions (phone < 768px) —— */

.oojeema-list-cards {
    display: none;
    flex-direction: column;
    gap: 0.65rem;
}

.oojeema-list-card {
    background: #fff;
    border: 1px solid var(--oojeema-shell-border, #b6c2d0);
    border-radius: 12px;
    padding: 0.85rem 0.95rem;
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-areas:
        "title amount actions"
        "meta meta meta";
    gap: 0.25rem 0.75rem;
    align-items: start;
    width: 100%;
    text-align: left;
    font: inherit;
    color: inherit;
    box-shadow: 0 1px 2px rgba(28, 36, 48, 0.04);
}

a.oojeema-list-card {
    text-decoration: none;
}

.oojeema-list-card:hover {
    border-color: var(--oojeema-prime, #205088);
}

.oojeema-list-card-title {
    grid-area: title;
    font-weight: 650;
    font-size: 0.95rem;
    min-width: 0;
    align-self: center;
}

.oojeema-list-card-meta {
    grid-area: meta;
    font-size: 0.78rem;
    color: var(--oojeema-shell-muted, #334155);
}

.oojeema-list-card-amount {
    grid-area: amount;
    font-weight: 650;
    font-size: 1rem;
    text-align: right;
    white-space: nowrap;
    align-self: center;
}

.oojeema-list-card-actions {
    grid-area: actions;
    justify-self: end;
    align-self: center;
}

.oojeema-listing-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
}

.oojeema-listing-pager-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.oojeema-listing-pager-size {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.oojeema-listing-pager-size .listing-page-size {
    width: auto;
    min-width: 4.25rem;
}

.oojeema-listing-pager-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.oojeema-listing-pager-page {
    white-space: nowrap;
}

/* Listing filter bar: status pills + funnel on one row; fields expand below */
.oojeema-filters-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    min-width: 0;
}

.oojeema-filters-toolbar-solo {
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.oojeema-status-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
}

.oojeema-status-pills .nav-item {
    flex: 0 0 auto;
}

.oojeema-status-pills .nav-link {
    white-space: nowrap;
}

.oojeema-filters-collapsible .oojeema-filters-body {
    display: block;
}

.oojeema-filters-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem 0.75rem;
}

.oojeema-filters-field {
    flex: 0 1 9rem;
    min-width: 7.5rem;
}

.oojeema-filters-field-grow {
    flex: 1 1 12rem;
    min-width: 10rem;
}

.oojeema-filters-field-action {
    flex: 0 0 auto;
    margin-left: auto;
}

.oojeema-filters-field-check {
    flex: 0 0 auto;
    min-width: auto;
    padding-bottom: 0.35rem;
}

.oojeema-filters-field .form-label {
    margin-bottom: 0.25rem;
}

.oojeema-filters-toggle {
    display: none;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    min-width: 2.25rem;
    padding-left: 0;
    padding-right: 0;
}

.oojeema-filters-toggle .bi {
    font-size: 1rem;
    line-height: 1;
}

@media (min-width: 768px) {
    .oojeema-filters-toolbar-solo {
        display: none;
    }
}

.oojeema-sticky-actions {
    display: none;
}

.oojeema-form-actions {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0.5rem;
    justify-content: flex-end;
    align-items: stretch;
    margin-top: 1rem;
    padding-top: 0.5rem;
}

.oojeema-sticky-actions-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}

.oojeema-toolbar-primary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-left: auto;
}

.oojeema-toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 40px;
}

.oojeema-toolbar-btn i {
    font-size: 1.1rem;
    line-height: 1;
}

.oojeema-toolbar-text-short {
    display: none;
}

.oojeema-sticky-actions-inner .btn,
.oojeema-form-actions .btn {
    flex: 0 1 auto;
    min-height: 40px;
}

.oojeema-sticky-totals {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.8rem;
    color: var(--oojeema-shell-muted, #334155);
    margin-bottom: 0;
}

.oojeema-sticky-totals strong {
    color: var(--oojeema-shell-ink, #0f172a);
    font-size: 0.95rem;
}

@media (max-width: 767.98px) {
    .oojeema-list-cards {
        display: flex;
    }

    .oojeema-list-table {
        display: none !important;
    }

    .oojeema-list-card {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "title actions"
            "amount amount"
            "meta meta";
    }

    .oojeema-list-card-amount {
        text-align: left;
        font-size: 1.05rem;
        margin-top: 0.15rem;
    }

    .oojeema-listing-pager {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .oojeema-listing-pager-controls {
        justify-content: space-between;
        width: 100%;
    }

    .oojeema-listing-pager-nav {
        margin-left: auto;
    }

    .oojeema-filters-toggle {
        display: inline-flex;
        min-height: 36px;
    }

    .oojeema-filters-toolbar {
        margin-bottom: 0;
    }

    .oojeema-filters-collapsible.is-open .oojeema-filters-toolbar {
        margin-bottom: 0.75rem;
    }

    .oojeema-status-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding-bottom: 0.1rem;
    }

    .oojeema-status-pills .nav-link {
        font-size: 0.8rem;
        padding: 0.3rem 0.65rem;
    }

    .oojeema-filters-collapsible:not(.is-open) .oojeema-filters-body {
        display: none;
    }

    .oojeema-filters-collapsible.is-open .oojeema-filters-body {
        display: block;
    }

    /* Keep filter fields in a horizontal strip; avoid skinny stacked columns */
    .oojeema-filters-fields {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.15rem;
    }

    .oojeema-filters-field {
        flex: 0 0 auto;
        min-width: 8.5rem;
        width: 8.5rem;
    }

    .oojeema-filters-field-grow {
        width: 12rem;
        min-width: 12rem;
    }

    .oojeema-filters-field-action {
        margin-left: 0;
    }

    .oojeema-filters-field-check {
        width: auto;
        min-width: auto;
        align-self: center;
        padding-bottom: 0;
    }

    .je-page .je-nature-toggle,
    .je-page #nature-toggle {
        display: flex;
        width: 100%;
    }

    .je-page #nature-toggle .nature-btn {
        flex: 1;
        min-height: 44px;
        padding: 0.55rem 0.35rem;
        font-size: 0.78rem;
    }

    /* Form line tables → stacked cards (keeps <tr> DOM for typeaheads) */
    .oojeema-line-cards .table-responsive {
        overflow: visible !important;
    }

    .oojeema-line-cards table,
    .oojeema-line-cards .table,
    .oojeema-line-cards .je-grid,
    .oojeema-line-cards thead,
    .oojeema-line-cards tbody,
    .oojeema-line-cards tfoot,
    .oojeema-line-cards tr,
    .oojeema-line-cards th,
    .oojeema-line-cards td,
    .je-page .oojeema-line-cards .je-grid,
    .je-page .oojeema-line-cards .je-grid thead,
    .je-page .oojeema-line-cards .je-grid tbody,
    .je-page .oojeema-line-cards .je-grid tr,
    .je-page .oojeema-line-cards .je-grid th,
    .je-page .oojeema-line-cards .je-grid td {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .oojeema-line-cards thead,
    .je-page .oojeema-line-cards .je-grid thead {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }

    .oojeema-line-cards tbody tr,
    .je-page .oojeema-line-cards .je-grid tbody tr {
        background: #f8fafc !important;
        border: 1px solid var(--oojeema-shell-border, #b6c2d0) !important;
        border-radius: 12px !important;
        padding: 0.75rem 0.85rem !important;
        margin-bottom: 0.65rem !important;
        box-shadow: none !important;
    }

    .oojeema-line-cards tbody td,
    .je-page .oojeema-line-cards .je-grid tbody td,
    .je-page .oojeema-line-cards .je-grid > :not(caption) > * > * {
        border: 0 !important;
        border-bottom: 0 !important;
        padding: 0.4rem 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .oojeema-line-cards tbody td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.75rem;
        font-weight: 600;
        letter-spacing: 0.02em;
        color: var(--oojeema-shell-muted, #334155);
        margin-bottom: 0.25rem;
    }

    .oojeema-line-cards tbody td[data-label=""]::before,
    .oojeema-line-cards tbody td:not([data-label])::before {
        display: none;
    }

    .oojeema-line-cards tbody td .form-control,
    .oojeema-line-cards tbody td .form-select {
        width: 100%;
        max-width: 100%;
    }

    /* Locked DR/CR side: gray the whole field block (label + input) on phone cards */
    .oojeema-line-cards tbody td.is-side-locked,
    .je-page .oojeema-line-cards .je-grid tbody td.is-side-locked {
        background: #e2e8f0 !important;
        border-radius: 8px;
        padding: 0.45rem 0.55rem !important;
        margin: 0.1rem 0;
    }

    .oojeema-line-cards tbody td.is-side-locked::before,
    .je-page .oojeema-line-cards .je-grid tbody td.is-side-locked::before {
        color: #64748b;
    }

    .oojeema-line-cards tbody td.is-side-locked .form-control,
    .je-page .oojeema-line-cards .je-grid tbody td.is-side-locked .form-control,
    .oojeema-line-cards tbody td.is-side-locked .form-control:disabled,
    .je-page .oojeema-line-cards .je-grid tbody td.is-side-locked .form-control:disabled {
        background: #dbe3ec !important;
        background-color: #dbe3ec !important;
        color: #64748b !important;
        -webkit-text-fill-color: #64748b;
        border-color: #c5d0dc !important;
        opacity: 1;
    }

    .oojeema-desktop-actions {
        display: none !important;
    }

    /*
     * Phone form actions stay in document flow at the end of the form (not fixed).
     * Save at the bottom encourages reviewing lines before commit; avoids a double footer with tabs.
     */
    .oojeema-form-actions {
        display: flex;
        flex-direction: column;
        position: static;
        left: auto;
        right: auto;
        bottom: auto;
        z-index: auto;
        width: 100%;
        margin: 1.25rem 0 0.5rem;
        padding: 0.85rem 0 0.35rem;
        gap: 0.65rem;
        background: transparent;
        border-top: 1px solid var(--oojeema-shell-border, #b6c2d0);
        box-shadow: none;
        backdrop-filter: none;
    }

    .oojeema-form-actions .oojeema-sticky-totals {
        display: flex;
        margin-bottom: 0;
        padding: 0.35rem 0.15rem;
    }

    .oojeema-form-actions .oojeema-sticky-actions-inner {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        width: 100%;
    }

    .oojeema-form-actions .oojeema-toolbar-primary {
        margin-left: 0;
        flex: 1 1 auto;
        justify-content: flex-end;
    }

    .oojeema-form-actions .oojeema-toolbar-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 0.45rem 0.75rem;
        flex: 0 0 auto;
        width: auto;
    }

    .oojeema-form-actions #btn-back-list,
    .oojeema-form-actions #btn-back-vouchers {
        padding: 0.45rem 0.65rem;
    }

    .oojeema-form-actions .oojeema-toolbar-text-full {
        display: none;
    }

    .oojeema-form-actions .oojeema-toolbar-text-short {
        display: inline;
    }

    .oojeema-form-actions #btn-back-list .oojeema-toolbar-text,
    .oojeema-form-actions #btn-back-vouchers .oojeema-toolbar-text {
        display: none;
    }

    .oojeema-form-actions .oojeema-sticky-actions-inner .btn {
        flex: 0 0 auto;
        width: auto;
    }

    .setup-master-page .oojeema-form-actions {
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
        width: 100%;
    }

    .setup-master-page .oojeema-form-actions .btn {
        flex: 0 0 auto;
        width: auto;
    }

    .oojeema-line-cards tfoot {
        display: none !important;
    }

    .oojeema-sticky-actions {
        display: none;
    }
}

@media (min-width: 768px) {
    .oojeema-form-actions .oojeema-sticky-totals {
        display: none;
    }

    .oojeema-form-actions .oojeema-sticky-actions-inner {
        display: flex;
        justify-content: flex-end;
    }

    .oojeema-form-actions .oojeema-toolbar-btn i {
        display: none;
    }

    .oojeema-form-actions .oojeema-toolbar-text-short {
        display: none;
    }

    .oojeema-form-actions .oojeema-toolbar-text-full {
        display: inline;
    }

    /* Desktop: Back first in reading order feels odd next to Save — keep Back at end */
    .oojeema-form-actions .oojeema-sticky-actions-inner {
        flex-direction: row;
    }

    .oojeema-form-actions #btn-back-list,
    .oojeema-form-actions #btn-back-vouchers {
        order: 9;
        margin-left: 0;
    }

    .oojeema-form-actions .oojeema-toolbar-primary {
        margin-left: 0;
        order: 1;
    }
}


/* Phase B permissions matrix */
.oojeema-perm-module-tabs {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    padding: 0.15rem 0 0.65rem;
    margin-bottom: 0.5rem;
    scrollbar-width: thin;
}

.oojeema-perm-module-tab {
    flex: 0 0 auto;
    border: 1px solid var(--oojeema-shell-border, #dde3ea);
    border-radius: 6px;
    background: #fff;
    color: var(--oojeema-shell-muted, #6b7785);
    padding: 0.45rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.oojeema-perm-module-tab.is-active {
    background: #fdecea;
    border-color: #f0aaa4;
    color: #c62828;
}

.oojeema-perm-module-count {
    display: inline-block;
    min-width: 1.15rem;
    margin-left: 0.25rem;
    padding: 0.05rem 0.25rem;
    border-radius: 999px;
    background: #eef1f4;
    color: #6b7785;
    font-size: 0.65rem;
    text-align: center;
}

.oojeema-perm-module-tab.is-active .oojeema-perm-module-count {
    background: #fff;
    color: #c62828;
}

.oojeema-perm-table th,
.oojeema-perm-table td {
    vertical-align: middle;
}

.oojeema-perm-resource-cell {
    min-width: 11rem;
    font-weight: 500;
}

.oojeema-perm-resource-label {
    border: 0;
    background: transparent;
    padding: 0;
    color: #1c2430;
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 0.2em;
}

.oojeema-perm-resource-label.is-all {
    color: #2e7d32;
}

.oojeema-perm-resource-label.is-mixed {
    color: #b26a00;
}

.oojeema-perm-resource-label.is-readonly {
    text-decoration: none;
    cursor: default;
    color: inherit;
}

.oojeema-role-chip {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #f0f3f6;
    border: 1px solid #dde3ea;
    margin: 0.1rem 0.15rem 0.1rem 0;
}

/* Item master / posting defaults — progressive disclosure helpers */

.oojeema-choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.oojeema-choice {
    position: relative;
    display: flex;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.625rem;
    background: #fff;
    cursor: pointer;
}

.oojeema-choice:has(input:checked) {
    border-color: var(--oojeema-prime, #205088);
    background: var(--oojeema-prime-soft, #eef4fa);
    box-shadow: 0 0 0 1px rgba(32, 80, 136, 0.14);
}

.oojeema-choice input {
    margin-top: 0.2rem;
}

.oojeema-choice.oojeema-choice--disabled {
    opacity: 0.55;
    pointer-events: none;
    cursor: not-allowed;
}

.oojeema-choice-title {
    display: block;
    color: var(--oojeema-shell-ink, #1c2430);
    font-size: 0.9rem;
    font-weight: 700;
}

.oojeema-choice-copy {
    display: block;
    margin-top: 0.15rem;
    color: var(--oojeema-shell-muted, #5b6b7c);
    font-size: 0.78rem;
    line-height: 1.4;
}

.oojeema-account-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0.95rem;
    border: 1px solid var(--oojeema-positive-border, #a7d7b0);
    border-radius: 0.625rem;
    background: var(--oojeema-positive-soft, #edf7ef);
    color: var(--oojeema-positive-ink, #1b5e20);
}

.oojeema-account-status strong {
    font-size: 0.875rem;
}

.oojeema-account-status p {
    margin: 0.1rem 0 0;
    font-size: 0.78rem;
}

.oojeema-account-status.is-warn {
    border-color: #f0c36d;
    background: #fff8e8;
    color: #8a5a00;
}

.oojeema-account-summary {
    margin: 0;
}

.oojeema-account-summary-row {
    display: grid;
    grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1.2fr);
    gap: 1rem;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.oojeema-account-summary-row:last-child {
    border-bottom: 0;
}

.oojeema-account-summary dt,
.oojeema-account-summary dd {
    margin: 0;
}

.oojeema-account-summary dt {
    color: var(--oojeema-shell-muted, #5b6b7c);
    font-size: 0.82rem;
    font-weight: 600;
}

.oojeema-account-value {
    color: var(--oojeema-shell-ink, #1c2430);
    font-size: 0.9rem;
    font-weight: 700;
}

.oojeema-account-code {
    color: var(--oojeema-prime, #205088);
    font-variant-numeric: tabular-nums;
}

.oojeema-account-source {
    display: block;
    margin-top: 0.2rem;
    color: var(--oojeema-shell-muted, #5b6b7c);
    font-size: 0.75rem;
    font-weight: 500;
}

.oojeema-account-form-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(260px, 1fr);
    gap: 1.25rem;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.oojeema-account-form-row:last-child {
    border-bottom: 0;
}

.oojeema-account-label {
    color: var(--oojeema-shell-ink, #1c2430);
    font-size: 0.9rem;
    font-weight: 700;
}

.oojeema-account-help {
    margin: 0.15rem 0 0;
    color: var(--oojeema-shell-muted, #5b6b7c);
    font-size: 0.78rem;
    line-height: 1.4;
}

.oojeema-role-code {
    display: none;
    margin-top: 0.25rem;
    color: #9f1239;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.72rem;
}

body.oojeema-show-role-codes .oojeema-role-code {
    display: block;
}

.oojeema-save-bar {
    position: sticky;
    bottom: 0.75rem;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    padding: 0.8rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(8px);
}

.oojeema-save-bar-copy {
    color: var(--oojeema-shell-muted, #5b6b7c);
    font-size: 0.78rem;
}

.oojeema-advanced-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 0;
    background: #fff;
    color: var(--oojeema-shell-ink, #1c2430);
    text-align: left;
}

.oojeema-advanced-toggle:hover {
    background: #f8fafc;
}

.oojeema-advanced-toggle .bi-chevron-down {
    transition: transform 0.2s ease;
}

.oojeema-advanced-toggle[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

.oojeema-account-health {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--oojeema-positive, #2e7d32);
    font-size: 0.78rem;
    font-weight: 700;
}

.oojeema-account-health.is-warn {
    color: #8a5a00;
}

@media (max-width: 767.98px) {
    .oojeema-choice-grid,
    .oojeema-account-form-row,
    .oojeema-account-summary-row {
        grid-template-columns: 1fr;
    }

    .oojeema-account-status,
    .oojeema-save-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .oojeema-save-bar {
        bottom: calc(var(--oojeema-shell-tab-h, 56px) + 0.5rem);
    }
}

/* —— BIR 2307 certificates workbench: compact single-row filters —— */
.wht-2307-workbench .wht-2307-toolbar {
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 0.55rem 0.75rem;
}

.wht-2307-workbench .wht-2307-field-period {
    flex: 0 0 9.5rem;
    min-width: 9.5rem;
    max-width: 9.5rem;
}

.wht-2307-workbench .wht-2307-field-date {
    flex: 0 0 8.75rem;
    min-width: 8.75rem;
    max-width: 8.75rem;
}

.wht-2307-workbench .wht-2307-field-date .form-control[type="date"] {
    width: 100%;
    min-width: 0;
}

.wht-2307-workbench .wht-2307-field-vendor {
    flex: 1 1 14rem;
    min-width: 12rem;
    max-width: 20rem;
}

.wht-2307-workbench .wht-2307-vendor-ta .oojeema-typeahead,
.wht-2307-workbench .wht-2307-vendor-ta {
    width: 100%;
}

.wht-2307-workbench .wht-2307-field-covered {
    flex: 0 1 auto;
    min-width: 10rem;
    max-width: 16rem;
}

.wht-2307-workbench .wht-2307-covered-range {
    display: block;
    font-size: 0.875rem;
    font-weight: 650;
    color: #1c2430;
    line-height: 2.1;
    white-space: nowrap;
}

.wht-2307-workbench .wht-2307-field-date.is-disabled .form-control {
    background: #f1f5f9;
    color: #64748b;
}

/* Phone tap targets for primary listing actions (TP-UI-03). */
@media (max-width: 767.98px) {
    #shell-content .btn-primary:not(.btn-sm) {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* —— Listing workspace (PRIME liveliness B) —— */

/**
 * Operational listing pages — fluid width with centered cap (canon §5.1).
 * Beats Bootstrap container (~1320px); mitigates ultrawide scan distance.
 */
:root {
    --oojeema-listing-shell-max: 1600px;
    /* Column tier caps — canon §5.2.2 (T3/T4 identity + scan); identical JE + vouchers */
    --oojeema-list-col-actions: 3rem;
    /* Document # — PAY-2026-000064, JE-0000000075, SI-000000240, CD-000000003 */
    --oojeema-list-col-number: 18ch;
    /* formatDisplay() default e.g. Aug 10, 2026 (+ MM/DD/YYYY variants) */
    --oojeema-list-col-meta: 14ch;
    /* Money listing design width: 9,999,999,999.99 (14 chars) — see canon §5.2.2 */
    --oojeema-list-col-money: 10.5rem;
    --oojeema-list-col-status: 3.75rem;
    --oojeema-list-col-reference: 31ch;
    --oojeema-list-col-party: 10rem;
    /* Listing text cols — matches DEFAULT_LIST_CLIP_CHARS (30) + ellipsis in listing.js */
    --oojeema-list-text-col-width: 31ch;
    /* Voucher profile — party/reference caps; Notes flex (canon §5.2.2 Option A lean) */
    --oojeema-list-voucher-party: 11rem;
    --oojeema-list-voucher-reference: 8.5rem;
    --oojeema-list-payment-method: 12rem;
    --oojeema-list-payment-reference: 8.5rem;
}

.oojeema-shell-content--listing {
    width: 100%;
    max-width: var(--oojeema-listing-shell-max);
    margin-inline: auto;
}

.oojeema-listing-workspace {
    overflow: hidden;
}

.oojeema-listing-workspace__header {
    padding: 0.85rem 1rem 1rem;
    background: #fff;
    border-bottom: 2px solid var(--oojeema-shell-border, #b6c2d0);
}

.oojeema-listing-workspace__body {
    background: var(--oojeema-shell-bg, #e5eaf0);
    padding: 0.65rem;
}

.oojeema-listing-workspace__results {
    background: #fff;
    border: 1px solid rgba(182, 194, 208, 0.8);
    border-radius: 0.45rem;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(15, 39, 68, 0.08);
}

.oojeema-listing-workspace__filter-action {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.oojeema-listing-workspace__btn-refresh {
    width: auto;
    min-width: 5.25rem;
    max-width: 100%;
    flex: 0 0 auto;
}

.oojeema-list-cell--clip {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    vertical-align: bottom;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.oojeema-list-cell--clip-wide {
    /* Width comes from .oojeema-list-td--clip-wide column */
}

/* Document listing column profile (JE, vouchers, sales invoices) — canon §5.2.2 */

.oojeema-list-table--doc-profile > .table {
    table-layout: fixed;
    width: 100%;
    min-width: 56rem;
}

.oojeema-list-table--doc-profile > .table tbody td {
    font-size: 0.875rem;
    line-height: 1.4;
}

.oojeema-list-table--doc-profile > .table tbody td.oojeema-list-td--clip,
.oojeema-list-table--doc-profile > .table tbody td.oojeema-list-td--notes,
.oojeema-list-table--doc-profile > .table tbody td.oojeema-list-td--clip-wide,
.oojeema-list-table--doc-profile > .table tbody td.oojeema-list-td--party {
    overflow: hidden;
}

.oojeema-list-table--doc-profile > .table .oojeema-list-notes-wrap {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.4;
}

.oojeema-list-table--doc-profile .oojeema-status-tile {
    /* Compact pill — never stretch to cell width (canon §5.2.2). */
    display: inline-block;
    min-width: 0;
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.15rem 0.35rem;
    font-size: 0.625rem;
    letter-spacing: 0.03em;
    vertical-align: middle;
}

.oojeema-list-table--doc-profile .oojeema-doc-number {
    display: inline-block;
    max-width: 100%;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}

.oojeema-list-table--doc-profile.oojeema-list-table--scrollable {
    position: relative;
}

.oojeema-list-table--doc-profile.oojeema-list-table--scrollable::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1.35rem;
    pointer-events: none;
    background: linear-gradient(to left, rgba(255, 255, 255, 0.96), transparent);
    z-index: 2;
}

.oojeema-list-col--meta {
    display: inline-block;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--oojeema-shell-ink, #0f172a);
    white-space: nowrap;
}

.oojeema-list-col--party {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    line-height: 1.4;
    font-size: 0.875rem;
    word-break: break-word;
    max-width: 100%;
}

.oojeema-list-cell--clip.oojeema-list-cell--tip {
    cursor: default;
}

.oojeema-list-td--actions {
    width: var(--oojeema-list-col-actions);
}

.oojeema-list-td--number {
    width: var(--oojeema-list-col-number);
    max-width: var(--oojeema-list-col-number);
    min-width: var(--oojeema-list-col-number);
    white-space: nowrap;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    overflow: visible;
}

.oojeema-list-td--meta {
    width: var(--oojeema-list-col-meta);
    max-width: var(--oojeema-list-col-meta);
    min-width: var(--oojeema-list-col-meta);
    white-space: nowrap;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.oojeema-list-td--money {
    width: var(--oojeema-list-col-money);
    max-width: var(--oojeema-list-col-money);
    white-space: nowrap;
}

.oojeema-list-td--status {
    width: var(--oojeema-list-col-status);
    max-width: var(--oojeema-list-col-status);
    white-space: nowrap;
}

.oojeema-list-td--clip {
    width: var(--oojeema-list-text-col-width);
    max-width: var(--oojeema-list-text-col-width);
}

.oojeema-list-td--party {
    width: var(--oojeema-list-col-party);
    max-width: var(--oojeema-list-col-party);
    min-width: 0;
}

.oojeema-list-td--notes {
    width: var(--oojeema-list-text-col-width);
    max-width: var(--oojeema-list-text-col-width);
    min-width: 0;
}

.oojeema-list-td--clip-wide {
    min-width: 0;
    /* SI deliver-to — flex remainder via col.oojeema-list-col--clip-wide */
}

.oojeema-list-td--select {
    width: 2.5rem;
}

/* Column tiers — canon §5.2.2: rem caps on T3/T4; T2 reference/party fixed; T1 notes (or SI deliver-to) width:auto */

col.oojeema-list-col--actions {
    width: var(--oojeema-list-col-actions);
}

col.oojeema-list-col--select {
    width: 2.5rem;
}

col.oojeema-list-col--number {
    width: var(--oojeema-list-col-number);
}

col.oojeema-list-col--meta {
    width: var(--oojeema-list-col-meta);
}

col.oojeema-list-col--money {
    width: var(--oojeema-list-col-money);
}

col.oojeema-list-col--status {
    width: var(--oojeema-list-col-status);
}

col.oojeema-list-col--clip {
    width: var(--oojeema-list-text-col-width);
}

col.oojeema-list-col--party {
    width: var(--oojeema-list-col-party);
}

col.oojeema-list-col--notes {
    width: var(--oojeema-list-text-col-width);
}

/* SI deliver-to / other flex primary-read columns */
col.oojeema-list-col--clip-wide {
    width: 100%;
    min-width: 0;
}

.oojeema-list-table--doc-profile > .table tbody td.oojeema-list-td--meta,
.oojeema-list-table--doc-profile > .table tbody td.oojeema-list-td--number,
.oojeema-list-table--doc-profile > .table tbody td.oojeema-list-td--party,
.oojeema-list-table--doc-profile > .table tbody td.oojeema-list-td--clip,
.oojeema-list-table--doc-profile > .table tbody td.oojeema-list-td--notes,
.oojeema-list-table--doc-profile > .table tbody td.oojeema-list-td--clip-wide {
    text-align: left;
}

/* T3/T4 scan columns — compact padding so rem caps match visible width */
.oojeema-list-table--doc-profile > .table thead th.oojeema-list-th--meta,
.oojeema-list-table--doc-profile > .table thead th.oojeema-list-th--number,
.oojeema-list-table--doc-profile > .table thead th.oojeema-list-th--money,
.oojeema-list-table--doc-profile > .table thead th.oojeema-list-th--status,
.oojeema-list-table--doc-profile > .table tbody td.oojeema-list-td--meta,
.oojeema-list-table--doc-profile > .table tbody td.oojeema-list-td--number,
.oojeema-list-table--doc-profile > .table tbody td.oojeema-list-td--money,
.oojeema-list-table--doc-profile > .table tbody td.oojeema-list-td--status {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}

.oojeema-list-table--doc-profile > .table tbody td.oojeema-list-td--money {
    text-align: right;
    overflow: visible;
    padding-right: 0.55rem;
    font-variant-numeric: tabular-nums;
}

/* T3 identity columns — document # and date; ch-based caps + comfortable inset */
.oojeema-list-table--doc-profile > .table thead th.oojeema-list-th--number,
.oojeema-list-table--doc-profile > .table tbody td.oojeema-list-td--number {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    min-width: var(--oojeema-list-col-number);
    overflow: visible;
}

.oojeema-list-table--doc-profile > .table thead th.oojeema-list-th--meta,
.oojeema-list-table--doc-profile > .table tbody td.oojeema-list-td--meta {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    min-width: var(--oojeema-list-col-meta);
}

.oojeema-list-table--doc-profile > .table thead th.oojeema-list-th--money {
    padding-right: 0.55rem;
}

.oojeema-list-table--doc-profile > .table tbody td.oojeema-list-td--status {
    text-align: center;
    overflow: hidden;
    min-width: 0;
}

.oojeema-list-table--doc-profile .oojeema-list-th--money .oojeema-sortable-th__btn {
    width: 100%;
    justify-content: flex-end;
}

.oojeema-list-table--doc-profile .oojeema-list-th--status .oojeema-sortable-th__btn {
    width: 100%;
    justify-content: center;
}

.oojeema-list-money {
    display: block;
    width: 100%;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* —— Profile overrides (JE vs cash voucher) —— */

.oojeema-list-table--voucher-profile {
    --oojeema-list-col-party: var(--oojeema-list-voucher-party);
    --oojeema-list-voucher-reference-width: var(--oojeema-list-voucher-reference);
}

.oojeema-list-table--voucher-profile.oojeema-list-table--doc-profile > .table {
    table-layout: auto;
    min-width: 48rem;
}

.oojeema-list-table--voucher-profile > .table {
    table-layout: auto;
}

.oojeema-list-table--voucher-profile > .table thead th.oojeema-list-th--number,
.oojeema-list-table--voucher-profile > .table tbody td.oojeema-list-td--number {
    width: var(--oojeema-list-col-number);
    max-width: var(--oojeema-list-col-number);
    white-space: nowrap;
}

.oojeema-list-table--voucher-profile > .table thead th.oojeema-list-th--meta,
.oojeema-list-table--voucher-profile > .table tbody td.oojeema-list-td--meta {
    width: var(--oojeema-list-col-meta);
    max-width: var(--oojeema-list-col-meta);
    white-space: nowrap;
}

.oojeema-list-table--voucher-profile > .table thead th.oojeema-list-th--party,
.oojeema-list-table--voucher-profile > .table tbody td.oojeema-list-td--party {
    width: var(--oojeema-list-col-party);
    max-width: var(--oojeema-list-col-party);
    min-width: 0;
    white-space: normal;
    vertical-align: middle;
}

.oojeema-list-table--voucher-profile > .table thead th.oojeema-list-th--clip,
.oojeema-list-table--voucher-profile > .table tbody td.oojeema-list-td--clip {
    width: var(--oojeema-list-voucher-reference-width);
    max-width: var(--oojeema-list-voucher-reference-width);
    white-space: nowrap;
    vertical-align: middle;
}

.oojeema-list-table--voucher-profile > .table thead th.oojeema-list-th--notes,
.oojeema-list-table--voucher-profile > .table tbody td.oojeema-list-td--notes {
    width: 30%;
    min-width: 8rem;
    max-width: none;
    white-space: normal;
    vertical-align: middle;
}

.oojeema-list-table--voucher-profile > .table tbody td.oojeema-list-td--money {
    width: var(--oojeema-list-col-money);
    max-width: var(--oojeema-list-col-money);
    text-align: right;
    padding-right: 0.75rem;
    white-space: nowrap;
}

.oojeema-list-table--voucher-profile > .table thead th.oojeema-list-th--money {
    width: var(--oojeema-list-col-money);
    max-width: var(--oojeema-list-col-money);
    padding-right: 0.75rem;
}

.oojeema-list-table--voucher-profile > .table thead th.oojeema-list-th--status,
.oojeema-list-table--voucher-profile > .table tbody td.oojeema-list-td--status {
    width: var(--oojeema-list-col-status);
    max-width: var(--oojeema-list-col-status);
    text-align: center;
    white-space: nowrap;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
}

.oojeema-list-table--voucher-profile .oojeema-status-tile {
    padding: 0.12rem 0.28rem;
    font-size: 0.5625rem;
    letter-spacing: 0.02em;
}

/**
 * JE listing — apanel journal_voucher pattern: auto layout; Notes flex; T2/T3/T4 rem caps.
 */
.oojeema-list-table--je-profile {
    --oojeema-list-col-party: 14rem;
    --oojeema-list-je-reference: 12rem;
}

.oojeema-list-table--je-profile.oojeema-list-table--doc-profile > .table {
    table-layout: auto;
    min-width: 48rem;
}

.oojeema-list-table--je-profile > .table {
    table-layout: auto;
}

.oojeema-list-table--je-profile > .table thead th.oojeema-list-th--number,
.oojeema-list-table--je-profile > .table tbody td.oojeema-list-td--number {
    width: var(--oojeema-list-col-number);
    max-width: var(--oojeema-list-col-number);
    white-space: nowrap;
}

.oojeema-list-table--je-profile > .table thead th.oojeema-list-th--meta,
.oojeema-list-table--je-profile > .table tbody td.oojeema-list-td--meta {
    width: var(--oojeema-list-col-meta);
    max-width: var(--oojeema-list-col-meta);
    white-space: nowrap;
}

.oojeema-list-table--je-profile > .table thead th.oojeema-list-th--party,
.oojeema-list-table--je-profile > .table tbody td.oojeema-list-td--party {
    width: var(--oojeema-list-col-party);
    max-width: var(--oojeema-list-col-party);
    min-width: 0;
    white-space: normal;
    vertical-align: middle;
}

.oojeema-list-table--je-profile > .table thead th.oojeema-list-th--clip,
.oojeema-list-table--je-profile > .table tbody td.oojeema-list-td--clip {
    width: var(--oojeema-list-je-reference);
    max-width: var(--oojeema-list-je-reference);
    white-space: nowrap;
    vertical-align: middle;
}

.oojeema-list-table--je-profile > .table thead th.oojeema-list-th--notes,
.oojeema-list-table--je-profile > .table tbody td.oojeema-list-td--notes {
    width: 30%;
    min-width: 8rem;
    max-width: none;
    white-space: normal;
    vertical-align: middle;
}

.oojeema-list-table--je-profile > .table tbody td.oojeema-list-td--money {
    width: var(--oojeema-list-col-money);
    max-width: var(--oojeema-list-col-money);
    text-align: right;
    padding-right: 0.75rem;
    white-space: nowrap;
}

.oojeema-list-table--je-profile > .table thead th.oojeema-list-th--money {
    width: var(--oojeema-list-col-money);
    max-width: var(--oojeema-list-col-money);
    padding-right: 0.75rem;
}

.oojeema-list-table--je-profile > .table thead th.oojeema-list-th--status,
.oojeema-list-table--je-profile > .table tbody td.oojeema-list-td--status {
    width: var(--oojeema-list-col-status);
    max-width: var(--oojeema-list-col-status);
    text-align: center;
    white-space: nowrap;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
}

.oojeema-list-table--je-profile .oojeema-status-tile {
    padding: 0.12rem 0.28rem;
    font-size: 0.5625rem;
    letter-spacing: 0.02em;
}

/**
 * Sales invoice listing — Deliver to flex (T1); Bill to capped; dual money cols.
 */
.oojeema-list-table--invoice-profile {
    --oojeema-list-col-party: 14rem;
}

.oojeema-list-table--invoice-profile.oojeema-list-table--doc-profile > .table {
    table-layout: auto;
    min-width: 52rem;
}

.oojeema-list-table--invoice-profile > .table {
    table-layout: auto;
}

.oojeema-list-table--invoice-profile > .table thead th.oojeema-list-th--select,
.oojeema-list-table--invoice-profile > .table tbody td.oojeema-list-td--select {
    width: 2.5rem;
    max-width: 2.5rem;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}

.oojeema-list-table--invoice-profile > .table thead th.oojeema-list-th--number,
.oojeema-list-table--invoice-profile > .table tbody td.oojeema-list-td--number {
    width: var(--oojeema-list-col-number);
    max-width: var(--oojeema-list-col-number);
    white-space: nowrap;
}

.oojeema-list-table--invoice-profile > .table thead th.oojeema-list-th--meta,
.oojeema-list-table--invoice-profile > .table tbody td.oojeema-list-td--meta {
    width: var(--oojeema-list-col-meta);
    max-width: var(--oojeema-list-col-meta);
    white-space: nowrap;
}

.oojeema-list-table--invoice-profile > .table thead th.oojeema-list-th--party,
.oojeema-list-table--invoice-profile > .table tbody td.oojeema-list-td--party {
    width: var(--oojeema-list-col-party);
    max-width: var(--oojeema-list-col-party);
    min-width: 0;
    white-space: normal;
    vertical-align: middle;
}

.oojeema-list-table--invoice-profile > .table thead th.oojeema-list-th--clip-wide,
.oojeema-list-table--invoice-profile > .table tbody td.oojeema-list-td--clip-wide {
    width: 30%;
    min-width: 8rem;
    max-width: none;
    white-space: normal;
    vertical-align: middle;
}

.oojeema-list-table--invoice-profile > .table tbody td.oojeema-list-td--money {
    width: var(--oojeema-list-col-money);
    max-width: var(--oojeema-list-col-money);
    text-align: right;
    padding-right: 0.75rem;
    white-space: nowrap;
}

.oojeema-list-table--invoice-profile > .table thead th.oojeema-list-th--money {
    width: var(--oojeema-list-col-money);
    max-width: var(--oojeema-list-col-money);
    padding-right: 0.75rem;
}

.oojeema-list-table--invoice-profile > .table thead th.oojeema-list-th--status,
.oojeema-list-table--invoice-profile > .table tbody td.oojeema-list-td--status {
    width: var(--oojeema-list-col-status);
    max-width: var(--oojeema-list-col-status);
    text-align: center;
    white-space: nowrap;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
}

.oojeema-list-table--invoice-profile .oojeema-status-tile {
    padding: 0.12rem 0.28rem;
    font-size: 0.5625rem;
    letter-spacing: 0.02em;
}

/**
 * Delivery receipts listing — customer flex, open qty, dual money cols (SI listing rhythm).
 */
.oojeema-list-table--dr-profile {
    --oojeema-list-col-party: 16rem;
    --oojeema-list-dr-open-qty: 4.5rem;
}

.oojeema-list-table--dr-profile.oojeema-list-table--doc-profile > .table {
    table-layout: auto;
    min-width: 52rem;
}

.oojeema-list-table--dr-profile > .table {
    table-layout: auto;
}

.oojeema-list-table--dr-profile > .table thead th.oojeema-list-th--number,
.oojeema-list-table--dr-profile > .table tbody td.oojeema-list-td--number {
    width: var(--oojeema-list-col-number);
    max-width: var(--oojeema-list-col-number);
    white-space: nowrap;
}

.oojeema-list-table--dr-profile > .table thead th.oojeema-list-th--meta,
.oojeema-list-table--dr-profile > .table tbody td.oojeema-list-td--meta {
    width: var(--oojeema-list-col-meta);
    max-width: var(--oojeema-list-col-meta);
    white-space: nowrap;
}

.oojeema-list-table--dr-profile > .table thead th.oojeema-list-th--party,
.oojeema-list-table--dr-profile > .table tbody td.oojeema-list-td--party {
    width: auto;
    min-width: 10rem;
    max-width: none;
    white-space: normal;
    vertical-align: middle;
}

.oojeema-list-table--dr-profile > .table thead th.oojeema-list-th--qty,
.oojeema-list-table--dr-profile > .table tbody td.oojeema-list-td--qty {
    width: var(--oojeema-list-dr-open-qty);
    max-width: var(--oojeema-list-dr-open-qty);
    text-align: right;
    padding-right: 0.75rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.oojeema-list-table--dr-profile > .table tbody td.oojeema-list-td--money {
    width: var(--oojeema-list-col-money);
    max-width: var(--oojeema-list-col-money);
    text-align: right;
    padding-right: 0.75rem;
    white-space: nowrap;
}

.oojeema-list-table--dr-profile > .table thead th.oojeema-list-th--money {
    width: var(--oojeema-list-col-money);
    max-width: var(--oojeema-list-col-money);
    padding-right: 0.75rem;
}

.oojeema-list-table--dr-profile > .table thead th.oojeema-list-th--status,
.oojeema-list-table--dr-profile > .table tbody td.oojeema-list-td--status {
    width: var(--oojeema-list-col-status);
    max-width: var(--oojeema-list-col-status);
    text-align: center;
    white-space: nowrap;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
}

.oojeema-list-table--dr-profile .oojeema-status-tile {
    padding: 0.12rem 0.28rem;
    font-size: 0.5625rem;
    letter-spacing: 0.02em;
}

.oojeema-list-table--dr-profile .oojeema-list-dr-from-si {
    color: var(--bs-secondary-color);
    line-height: 1.3;
}

.oojeema-list-table--dr-profile .oojeema-list-dr-from-si .oojeema-doc-number {
    font-size: 0.8125rem;
}

/**
 * Customer payments listing — party + method + reference caps; Total right-aligned.
 */
.oojeema-list-table--payment-profile {
    --oojeema-list-col-party: 14rem;
    --oojeema-list-payment-method: 12rem;
    --oojeema-list-payment-reference: 8.5rem;
}

.oojeema-list-table--payment-profile.oojeema-list-table--doc-profile > .table {
    table-layout: auto;
    min-width: 48rem;
}

.oojeema-list-table--payment-profile > .table {
    table-layout: auto;
}

.oojeema-list-table--payment-profile > .table thead th.oojeema-list-th--number,
.oojeema-list-table--payment-profile > .table tbody td.oojeema-list-td--number {
    width: var(--oojeema-list-col-number);
    max-width: var(--oojeema-list-col-number);
    white-space: nowrap;
}

.oojeema-list-table--payment-profile > .table thead th.oojeema-list-th--meta,
.oojeema-list-table--payment-profile > .table tbody td.oojeema-list-td--meta {
    width: var(--oojeema-list-col-meta);
    max-width: var(--oojeema-list-col-meta);
    white-space: nowrap;
}

.oojeema-list-table--payment-profile > .table thead th.oojeema-list-th--party,
.oojeema-list-table--payment-profile > .table tbody td.oojeema-list-td--party {
    width: var(--oojeema-list-col-party);
    max-width: var(--oojeema-list-col-party);
    min-width: 0;
    white-space: normal;
    vertical-align: middle;
}

.oojeema-list-table--payment-profile > .table thead th.oojeema-list-th--method,
.oojeema-list-table--payment-profile > .table tbody td.oojeema-list-td--method {
    width: var(--oojeema-list-payment-method);
    max-width: var(--oojeema-list-payment-method);
    min-width: 0;
    overflow: hidden;
    white-space: normal;
    vertical-align: middle;
}

.oojeema-list-method {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    word-break: break-word;
    line-height: 1.3;
}

.oojeema-list-table--payment-profile > .table thead th.oojeema-list-th--clip,
.oojeema-list-table--payment-profile > .table tbody td.oojeema-list-td--clip {
    width: var(--oojeema-list-payment-reference);
    max-width: var(--oojeema-list-payment-reference);
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    vertical-align: middle;
}

.oojeema-list-table--payment-profile > .table tbody td.oojeema-list-td--money {
    width: var(--oojeema-list-col-money);
    max-width: var(--oojeema-list-col-money);
    text-align: right;
    padding-right: 0.75rem;
    white-space: nowrap;
}

.oojeema-list-table--payment-profile > .table thead th.oojeema-list-th--money {
    width: var(--oojeema-list-col-money);
    max-width: var(--oojeema-list-col-money);
    padding-right: 0.75rem;
}

.oojeema-list-table--payment-profile > .table thead th.oojeema-list-th--status,
.oojeema-list-table--payment-profile > .table tbody td.oojeema-list-td--status {
    width: var(--oojeema-list-col-status);
    max-width: var(--oojeema-list-col-status);
    text-align: center;
    white-space: nowrap;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
}

.oojeema-list-table--payment-profile .oojeema-status-tile {
    padding: 0.12rem 0.28rem;
    font-size: 0.5625rem;
    letter-spacing: 0.02em;
}


.oojeema-list-tooltip {
    --bs-tooltip-max-width: 22rem;
    --bs-tooltip-bg: #ffffff;
    --bs-tooltip-color: var(--oojeema-shell-ink, #0f172a);
    --bs-tooltip-padding-x: 0.65rem;
    --bs-tooltip-padding-y: 0.45rem;
    --bs-tooltip-font-size: 0.8125rem;
}

.oojeema-list-tooltip .tooltip-inner {
    text-align: left;
    border: 1px solid var(--oojeema-shell-border, #b6c2d0);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
}

@media (min-width: 768px) {
    .oojeema-listing-workspace__filter-action {
        align-items: flex-end;
    }
}

.oojeema-listing-workspace__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.oojeema-listing-workspace__action-group .btn {
    min-width: 2.35rem;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
}

/*
 * Some workspaces swap toolbar buttons per tab by toggling .d-none (e.g. Setup → Projects
 * shows project vs project-type import/export). Bootstrap rounds the DOM :last-child, which
 * may be hidden, so restore the rounded trailing edge on the last *visible* button.
 * Only the trailing edge needs this: the leading button (New) is never hidden.
 */
.oojeema-listing-workspace__action-group .btn:not(.d-none):not(:has(~ .btn:not(.d-none))) {
    border-top-right-radius: var(--bs-border-radius-sm);
    border-bottom-right-radius: var(--bs-border-radius-sm);
}

.oojeema-listing-workspace__tabs,
.oojeema-workspace-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-bottom: 1px solid var(--oojeema-shell-border, #b6c2d0);
    gap: 0.15rem;
    padding-bottom: 0;
}

.oojeema-listing-workspace__tabs::-webkit-scrollbar,
.oojeema-workspace-tabs::-webkit-scrollbar {
    display: none;
}

@media (min-width: 768px) {
    .oojeema-listing-workspace__tabs,
    .oojeema-workspace-tabs {
        overflow-x: visible;
    }
}

.oojeema-listing-workspace__results .oojeema-listing-workspace__tabs {
    background: #fff;
}

.oojeema-listing-workspace__results .oojeema-listing-workspace__pager {
    border-top: 1px solid rgba(182, 194, 208, 0.65);
}

.oojeema-listing-workspace__tabs .nav-link,
.oojeema-workspace-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    margin-bottom: -1px;
    color: var(--oojeema-accent, #3d8ab5);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.55rem 0.85rem;
    white-space: nowrap;
    background: transparent;
}

.oojeema-listing-workspace__tabs .nav-link:hover,
.oojeema-workspace-tabs .nav-link:hover {
    color: var(--oojeema-prime, #205088);
    border-bottom-color: rgba(32, 80, 136, 0.25);
}

.oojeema-listing-workspace__tabs .nav-link.active,
.oojeema-workspace-tabs .nav-link.active {
    color: var(--oojeema-prime, #205088);
    border-bottom-color: var(--oojeema-prime, #205088);
    background: transparent;
}

.oojeema-list-table--grid .table thead th {
    padding: 0.65rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--oojeema-prime-ink, #143354);
    background: #eef3f8;
    border-color: rgba(182, 194, 208, 0.65);
    vertical-align: middle;
}

.oojeema-list-table--grid .table tbody td {
    padding: 0.55rem 0.75rem;
    border-color: rgba(182, 194, 208, 0.55);
    vertical-align: middle;
}

.oojeema-list-table--grid .table.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-bg-type: #ffffff;
}

.oojeema-list-table--grid .table.table-striped > tbody > tr:nth-of-type(even) > * {
    --bs-table-bg-type: #f8fafc;
}

.oojeema-status-tile {
    display: inline-block;
    min-width: 5.625rem;
    padding: 0.2rem 0.35rem;
    border-radius: 0.2rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: center;
    /* Default fill so unknown modifiers never render white-on-white on striped rows. */
    color: #fff;
    background: #64748b;
    line-height: 1.25;
}

.oojeema-status-tile--draft {
    background: var(--oojeema-warm, #b45309);
}

.oojeema-status-tile--posted {
    background: var(--oojeema-positive, #047857);
}

.oojeema-status-tile--reversed {
    background: #64748b;
}

.oojeema-status-tile--active {
    background: var(--oojeema-positive, #047857);
}

.oojeema-status-tile--inactive {
    background: #64748b;
}

/* AR / OTC document lifecycle (SI list maps sent → posted for display). */

.oojeema-status-tile--partial {
    background: var(--oojeema-accent, #3d8ab5);
}

.oojeema-status-tile--paid {
    background: var(--oojeema-prime, #205088);
}

.oojeema-status-tile--overdue {
    background: #b91c1c;
}

.oojeema-status-tile--cancelled {
    background: #64748b;
}

/* Customer payment statuses. */

.oojeema-status-tile--pending {
    background: var(--oojeema-warm, #b45309);
}

.oojeema-status-tile--cleared {
    background: var(--oojeema-positive, #047857);
}

.oojeema-status-tile--bounced {
    background: #b91c1c;
}

/* Role kind tiles (Setup → Roles): platform template vs this company's own role. */

.oojeema-status-tile--system {
    background: var(--oojeema-prime, #205088);
}

.oojeema-status-tile--custom {
    background: var(--oojeema-accent, #3d8ab5);
}

.oojeema-doc-number,
.oojeema-master-code {
    color: var(--oojeema-prime, #205088);
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    text-decoration: none;
}

.oojeema-doc-number:hover,
.oojeema-master-code:hover {
    color: var(--oojeema-prime-hover, #1a406e);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.oojeema-master-code--plain {
    cursor: default;
    text-decoration: none;
}

.oojeema-master-code--plain:hover {
    text-decoration: none;
}

.oojeema-master-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.oojeema-master-toolbar__search {
    flex: 1 1 12rem;
    max-width: 18rem;
}

.oojeema-master-chips,
.coa-active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    min-height: 1.5rem;
}

.oojeema-master-chip,
.coa-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    background: #eef3f8;
    color: #205088;
    border: 1px solid #c5d6e8;
}

.oojeema-master-chip button,
.coa-filter-chip button {
    border: 0;
    background: transparent;
    padding: 0;
    line-height: 1;
    color: #5a6572;
    cursor: pointer;
}

.oojeema-listing-meta {
    display: inline-block;
    margin-left: 0.15rem;
    vertical-align: middle;
}

.oojeema-listing-workspace .oojeema-listing-pager {
    background: #fff;
    border-top: 1px solid rgba(182, 194, 208, 0.65);
    padding: 0.65rem 1rem;
}

.oojeema-listing-workspace__filter-toggle {
    display: none;
}

.oojeema-listing-workspace .oojeema-list-cards {
    display: none;
}

@media (min-width: 768px) {
    .oojeema-listing-workspace__filters {
        display: block !important;
    }

    .oojeema-listing-workspace__filter-toggle {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .oojeema-listing-workspace__filter-toggle {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
    }

    .oojeema-listing-workspace__filters:not(.show) {
        display: none;
    }

    .oojeema-listing-workspace .oojeema-list-table--grid {
        display: none !important;
    }

    .oojeema-listing-workspace .oojeema-list-cards {
        display: flex;
        flex-direction: column;
        gap: 0.65rem;
        padding: 0.75rem 1rem;
    }
}

/* Sortable listing column headers */

.oojeema-sortable-th {
    white-space: nowrap;
}

.oojeema-sortable-th__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    font: inherit;
    font-weight: 700;
    font-size: inherit;
    letter-spacing: inherit;
    color: inherit;
    cursor: pointer;
}

.oojeema-sortable-th__btn:hover {
    color: var(--oojeema-prime, #205088);
}

.oojeema-sortable-th__btn.is-sorted {
    color: var(--oojeema-prime, #205088);
}

.oojeema-sort-icon {
    font-size: 0.65rem;
    opacity: 0.85;
}

.oojeema-sort-icon--idle {
    opacity: 0.35;
}

.oojeema-sortable-th__btn.is-sorted .oojeema-sort-icon--idle {
    opacity: 0.85;
}

/* Warehouse release pick slip — print mount (OTC Phase B+.2) */
.print-only {
    display: none;
}

@media print {
    body.app-shell {
        background: #fff !important;
    }

    .no-print {
        display: none !important;
    }

    .print-only {
        display: table-cell !important;
    }

    .no-print-col {
        display: none !important;
    }

    #shell-content {
        max-width: none !important;
        padding: 0 !important;
    }

    .wr-sheet {
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
    }
}

.wr-sheet {
    max-width: 820px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #dde3ea;
    border-radius: 0.5rem;
    padding: 1.25rem 1.5rem 1.5rem;
}

.wr-sheet h1 {
    font-size: 1.35rem;
    margin-bottom: 0.15rem;
}

.wr-nonfiscal {
    font-size: 0.8rem;
    color: #555;
    border: 1px solid #ccc;
    padding: 0.25rem 0.5rem;
    display: inline-block;
}

.wr-meta {
    font-size: 0.92rem;
    line-height: 1.45;
}

.wr-meta .label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #666;
}

table.wr-lines th,
table.wr-lines td {
    padding: 0.45rem 0.5rem;
    vertical-align: middle;
}

table.wr-lines th {
    border-bottom: 2px solid #333;
    font-weight: 600;
}

table.wr-lines td.text-end,
table.wr-lines th.text-end {
    text-align: right;
}

.wr-qty-input {
    max-width: 5.5rem;
    margin-left: auto;
}

/* Setup → Sales fulfillment policy cards */
.sf-policy-card {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    border: 1px solid var(--oo-border, #dde3ea);
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    margin-bottom: 0;
}

.sf-policy-card:hover {
    border-color: #9eb6d4;
    background: #f8fbff;
}

.sf-policy-card.is-active {
    border-color: #0d6efd;
    background: #f0f6ff;
    box-shadow: inset 0 0 0 1px rgba(13, 110, 253, 0.15);
}

.sf-policy-card input {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.sf-policy-card strong {
    display: block;
    margin-bottom: 0.15rem;
}
