[x-cloak] {
    display: none !important;
}

:root {
    --gl-font-sans: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --gl-font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

html,
body,
button,
input,
select,
textarea,
.fi-body,
.fi-sidebar,
.fi-main,
.fi-modal,
.fi-dropdown,
.fi-ta,
.fi-fo {
    font-family: var(--gl-font-sans);
}

.font-mono,
.font-mono-num {
    font-family: var(--gl-font-mono) !important;
    font-variant-numeric: tabular-nums;
}

.gl-report-table-wrap {
    max-width: 100%;
    outline: none;
    -webkit-overflow-scrolling: touch;
}

.gl-report-table-wrap:focus-visible {
    box-shadow: 0 0 0 2px rgb(99 102 241 / 0.5);
    border-radius: 0.5rem;
}

.gl-report-table-wrap table {
    min-width: max-content;
}

/* Compact table for multi-column reports (e.g. trial balance: 8 cols) */
.gl-report-table-wrap table.gl-table-compact {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
}

.gl-table-compact th,
.gl-table-compact td {
    padding: 0.375rem 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gl-table-compact .gl-tc-code {
    width: 7%;
}

.gl-table-compact .gl-tc-name {
    width: 25%;
}

.gl-table-compact .gl-tc-money {
    width: 11.3%;
}

/* Sticky first column with solid background */
.gl-report-table-wrap th[scope="col"]:first-child,
.gl-report-table-wrap td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background-color: inherit;
}

/* Scroll shadow on scrollable wrapper */
.gl-scroll-container {
    position: relative;
}

.gl-scroll-container .gl-scroll-shadow-right {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 2rem;
    pointer-events: none;
    background: linear-gradient(to left, rgb(0 0 0 / 0.06), transparent);
    z-index: 3;
    opacity: 0;
    transition: opacity 0.2s;
}

.gl-scroll-container .gl-scroll-shadow-left {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2rem;
    pointer-events: none;
    background: linear-gradient(to right, rgb(0 0 0 / 0.06), transparent);
    z-index: 3;
    opacity: 0;
    transition: opacity 0.2s;
}

.dark .gl-scroll-container .gl-scroll-shadow-right {
    background: linear-gradient(to left, rgb(0 0 0 / 0.2), transparent);
}

.dark .gl-scroll-container .gl-scroll-shadow-left {
    background: linear-gradient(to right, rgb(0 0 0 / 0.2), transparent);
}

.gl-col-code {
    min-width: 6rem;
    width: 12%;
}

.gl-col-money {
    min-width: 9rem;
    width: 16%;
}

.gl-col-money-wide {
    min-width: 10rem;
    width: 20%;
}

.gl-col-name {
    min-width: 16rem;
}

.gl-col-note {
    min-width: 12rem;
}

.gl-col-journal {
    min-width: 8rem;
}

/* Mobile: reduce column min-widths and font for tighter tables */
@media (max-width: 639px) {
    .gl-col-code {
        min-width: 5rem;
    }
    .gl-col-money {
        min-width: 7rem;
    }
    .gl-col-money-wide {
        min-width: 8rem;
    }
    .gl-col-name {
        min-width: 10rem;
    }
    .gl-col-note {
        min-width: 8rem;
    }
    .gl-col-journal {
        min-width: 6rem;
    }

    .gl-report-table-wrap table {
        font-size: 0.75rem;
    }

    .gl-report-table-wrap th,
    .gl-report-table-wrap td {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Compact table: on mobile, allow horizontal scroll with sensible min-width */
    .gl-report-table-wrap table.gl-table-compact {
        table-layout: auto;
        min-width: 700px;
    }

    .gl-table-compact th,
    .gl-table-compact td {
        padding: 0.25rem 0.375rem;
        font-size: 0.6875rem;
    }
}

.gl-report-row-muted {
    background-color: rgb(249 250 251 / 0.5);
}

.dark .gl-report-row-muted {
    background-color: rgb(31 41 55 / 0.3);
}

.gl-report-row-header {
    background-color: rgb(249 250 251 / 0.5);
}

.dark .gl-report-row-header {
    background-color: rgb(31 41 55 / 0.5);
}

.gl-report-footer-muted {
    background-color: rgb(249 250 251 / 0.5);
}

.dark .gl-report-footer-muted {
    background-color: rgb(31 41 55 / 0.3);
}

.gl-report-total-row {
    background-color: #f3f4f6;
}

.dark .gl-report-total-row {
    background-color: rgb(55 65 81 / 0.5);
}

.gl-report-tint-blue {
    background-color: rgb(239 246 255 / 0.7);
}

.dark .gl-report-tint-blue {
    background-color: rgb(30 58 138 / 0.1);
}

.gl-report-tint-amber {
    background-color: rgb(255 251 235 / 0.7);
}

.dark .gl-report-tint-amber {
    background-color: rgb(120 53 15 / 0.1);
}

.gl-report-tint-purple {
    background-color: rgb(250 245 255 / 0.7);
}

.dark .gl-report-tint-purple {
    background-color: rgb(88 28 135 / 0.1);
}

.gl-report-hover-primary:hover {
    background-color: rgb(238 242 255 / 0.7);
}

.dark .gl-report-hover-primary:hover {
    background-color: rgb(49 46 129 / 0.1);
}

.gl-report-hover-blue:hover {
    background-color: rgb(239 246 255 / 0.7);
}

.dark .gl-report-hover-blue:hover {
    background-color: rgb(30 58 138 / 0.1);
}

.gl-report-hover-amber:hover {
    background-color: rgb(255 251 235 / 0.7);
}

.dark .gl-report-hover-amber:hover {
    background-color: rgb(120 53 15 / 0.1);
}

.gl-report-hover-purple:hover {
    background-color: rgb(250 245 255 / 0.7);
}

.dark .gl-report-hover-purple:hover {
    background-color: rgb(88 28 135 / 0.1);
}

.gl-report-hover-emerald:hover {
    background-color: rgb(236 253 245 / 0.7);
}

.dark .gl-report-hover-emerald:hover {
    background-color: rgb(6 78 59 / 0.1);
}

.gl-report-hover-rose:hover {
    background-color: rgb(255 241 242 / 0.7);
}

.dark .gl-report-hover-rose:hover {
    background-color: rgb(136 19 55 / 0.1);
}

.gl-qa-wrapper {
    display: none;
    align-items: center;
    gap: 0.5rem;
    margin-right: 0.5rem;
}

.gl-qa-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgb(0 0 0 / 0.05);
    border-radius: 0.5rem;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}

.gl-qa-btn svg {
    width: 1rem !important;
    height: 1rem !important;
    margin: 0;
}

.gl-qa-label {
    display: none;
}

.gl-qa-indigo { background-color: #eef2ff; color: #4338ca; }
.gl-qa-indigo:hover { background-color: #e0e7ff; }
.dark .gl-qa-indigo { background-color: rgb(79 70 229 / 0.1); color: #818cf8; }

.gl-qa-purple { background-color: #f5f3ff; color: #6d28d9; }
.gl-qa-purple:hover { background-color: #ede9fe; }
.dark .gl-qa-purple { background-color: rgb(124 58 237 / 0.1); color: #a78bfa; }

.gl-qa-teal { background-color: #f0fdfa; color: #0f766e; }
.gl-qa-teal:hover { background-color: #ccfbf1; }
.dark .gl-qa-teal { background-color: rgb(13 148 136 / 0.1); color: #2dd4bf; }

.gl-qa-cyan { background-color: #ecfeff; color: #0e7490; }
.gl-qa-cyan:hover { background-color: #cffafe; }
.dark .gl-qa-cyan { background-color: rgb(6 182 212 / 0.1); color: #22d3ee; }

.gl-account-progress {
    width: 100%;
    height: 0.5rem;
    overflow: hidden;
    border: 0;
    border-radius: 9999px;
    background-color: #f3f4f6;
}

.dark .gl-account-progress {
    background-color: #374151;
}

.gl-account-progress::-webkit-progress-bar {
    background-color: transparent;
}

.gl-account-progress::-webkit-progress-value {
    border-radius: 9999px;
    background-color: #4f46e5;
    transition: width 0.5s ease-out;
}

.gl-account-progress::-moz-progress-bar {
    border-radius: 9999px;
    background-color: #4f46e5;
}

@media (min-width: 1024px) {
    .gl-qa-wrapper {
        display: flex;
    }
}

@media (min-width: 1280px) {
    .gl-qa-label {
        display: inline;
    }
}

/* ─── Accessibility: prefers-reduced-motion ─── */
@media (prefers-reduced-motion: reduce) {
    .gl-scroll-container .gl-scroll-shadow-right,
    .gl-scroll-container .gl-scroll-shadow-left {
        transition: none;
    }

    .gl-qa-btn {
        transition: none;
    }

    .gl-account-progress::-webkit-progress-value {
        transition: none;
    }

    /* Disable Tailwind transition-colors on report rows */
    .gl-report-hover-primary,
    .gl-report-hover-blue,
    .gl-report-hover-amber,
    .gl-report-hover-purple,
    .gl-report-hover-emerald,
    .gl-report-hover-rose {
        transition: none !important;
    }
}

/* ─── Accessibility: focus-visible for interactive elements ─── */
.gl-qa-btn:focus-visible {
    outline: 2px solid rgb(99 102 241);
    outline-offset: 2px;
}

.gl-print-only {
    display: none;
}

.gl-print-logo {
    display: block;
    height: 80px;
    margin: 0 auto 1rem;
}

@media print {
    @page {
        margin: 1cm;
        size: auto;
    }

    /* ── 1. NUCLEAR RESET: Force white background on EVERYTHING ──
       Filament applies grey backgrounds on html, body, .fi-body, .fi-layout,
       .fi-main, .fi-page, thead rows, etc. — all must be wiped. */
    html,
    body,
    html.fi,
    html.dark,
    body.fi-body,
    .fi-layout,
    .fi-main,
    .fi-main-ctn,
    .fi-page,
    .fi-page-content,
    .fi-section,
    .fi-section-content-ctn,
    .fi-section-content {
        background: white !important;
        background-color: white !important;
        color: #000 !important;
    }

    /* Full-width, no margin/padding for print area */
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .fi-main-ctn {
        max-width: none !important;
        padding: 0 !important;
    }

    /* ── 2. HIDE all non-content UI ── */
    aside.fi-sidebar,
    header.fi-header,
    .fi-topbar,
    .fi-header-actions,
    .fi-form-actions,
    .fi-btn,
    .fi-ac-btn,
    .fi-sidebar-close-overlay,
    .fi-layout-sidebar-toggle-btn-ctn,
    button,
    form,
    nav {
        display: none !important;
    }

    /* ── 3. GLOBAL: print-color-adjust + strip shadows ── */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* ── 4. DARK MODE: fully reset for print ── */
    html.dark,
    html.dark body,
    .dark .fi-layout,
    .dark .fi-main,
    .dark .fi-page,
    .dark .fi-page-content {
        background: white !important;
        background-color: white !important;
        color: #000 !important;
    }

    /* ── 5. SCROLL UI: hide shadows, enable overflow ── */
    .gl-scroll-container .gl-scroll-shadow-left,
    .gl-scroll-container .gl-scroll-shadow-right {
        display: none !important;
    }

    .gl-report-table-wrap {
        overflow: visible !important;
    }

    /* ── 6. TABLE: crisp borders, black text, white bg ── */
    .gl-report-table-wrap table {
        min-width: 0 !important;
        width: 100% !important;
        font-size: 9pt !important;
        border: 1px solid #000 !important;
        page-break-inside: auto;
    }

    thead,
    thead tr {
        background-color: #eee !important;
    }

    th {
        background-color: #eee !important;
        color: #000 !important;
        font-weight: 700 !important;
        border: 1px solid #000 !important;
    }

    td {
        border: 1px solid #999 !important;
        color: #000 !important;
        background-color: white !important;
    }

    tbody tr {
        page-break-inside: avoid;
        background-color: white !important;
        color: #000 !important;
    }

    tfoot tr {
        background-color: #eee !important;
        color: #000 !important;
    }

    /* All text inside table cells: inherit black */
    td *, th * {
        color: inherit !important;
    }

    /* ── 7. CUSTOM REPORT CLASSES: strip all tint/grey backgrounds ── */
    .gl-report-row-muted,
    .gl-report-footer-muted,
    .gl-report-row-header,
    .gl-report-tint-blue,
    .gl-report-tint-amber,
    .gl-report-tint-purple,
    .gl-report-hover-primary,
    .gl-report-hover-blue,
    .gl-report-hover-amber,
    .gl-report-hover-purple,
    .gl-report-hover-emerald,
    .gl-report-hover-rose {
        background-color: white !important;
    }

    .gl-report-total-row {
        background-color: #eee !important;
    }

    /* ── 8. TAILWIND OVERRIDES: force black text everywhere ── */
    [class*="text-gray-"],
    [class*="text-emerald-"],
    [class*="text-rose-"],
    [class*="text-blue-"],
    [class*="text-amber-"],
    [class*="text-purple-"],
    [class*="text-red-"],
    [class*="text-primary-"] {
        color: #000 !important;
    }

    /* Force any Tailwind bg-* to white inside content area */
    [class*="bg-gray-"],
    [class*="bg-emerald-"],
    [class*="bg-rose-"],
    [class*="bg-blue-"],
    [class*="bg-amber-"],
    [class*="bg-purple-"],
    [class*="bg-red-"] {
        background-color: white !important;
    }

    /* Preserve only section header tints as very light */
    .fi-page-content > div > div > div [class*="bg-emerald-50"],
    .fi-page-content > div > div > div [class*="bg-rose-50"],
    .fi-page-content > div > div > div [class*="bg-amber-50"],
    .fi-page-content > div > div > div [class*="bg-purple-50"] {
        background-color: #f5f5f5 !important;
    }

    .font-mono {
        color: #000 !important;
    }

    .opacity-50 {
        opacity: 1 !important;
    }

    /* ── 9. REPORT TEXT: all content text black ── */
    .fi-page-content span,
    .fi-page-content div,
    .fi-page-content p,
    .fi-page-content a,
    .fi-page-content h2,
    .fi-page-content h3 {
        color: #000 !important;
    }

    /* ── 10. PRINT-ONLY elements ── */
    .gl-print-only {
        display: block !important;
    }

    /* ── 11. DECORATIONS: strip ring/badge styling ── */
    [class*="ring-"] {
        --tw-ring-shadow: none !important;
        box-shadow: none !important;
    }

    .fi-page-content [class*="rounded-lg"][class*="ring-"] {
        background: none !important;
        padding: 0 !important;
        font-weight: 700 !important;
    }
}
