﻿/* ================================================================
           REPORT DESIGN TOKENS
           ================================================================ */
:root {
    /* Semantic — positive / negative amounts */
    --rpt-positive: var(--colorPaletteGreenForeground1, #107c10);
    --rpt-negative: var(--colorPaletteRedForeground1, #d13438);
    /* Report-specific: strong horizontal rules under section headers */
    --rpt-section-rule: var(--neutral-stroke-rest);
    --rpt-total-rule: var(--neutral-stroke-rest);
    /* Row separator — lighter than section rule */
    --rpt-row-rule: var(--neutral-stroke-divider-rest);
    /* Typography */
    --rpt-font: 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    --rpt-font-mono: 'Inter', 'Segoe UI Mono', 'Cascadia Code', Consolas, monospace !important;
    /* Amount column min-width */
    --rpt-col-amount: 110px;
}


/* ================================================================
           REPORT PANELS
           ================================================================ */
.rpt-doc {
    padding: 28px 32px 32px;
    background: var(--neutral-fill-layer-rest);
    animation: fadeIn 160ms ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ================================================================
           DOCUMENT HEADER
           ================================================================ */
.rpt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--neutral-stroke-divider-rest);
    flex-wrap: wrap;
}

.rpt-company {
    font-size: 15px;
    font-weight: 700;
    color: var(--neutral-foreground-rest);
    line-height: 1.2;
}

.rpt-report-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--neutral-foreground-hint);
    margin-top: 3px;
}

.rpt-header-right {
    text-align: right;
    flex-shrink: 0;
}

.rpt-period {
    font-size: 12px;
    font-weight: 500;
    color: var(--neutral-foreground-rest);
}

.rpt-generated {
    font-size: 11px;
    color: var(--neutral-foreground-hint);
    margin-top: 3px;
}

/* ================================================================
           SECTION — used in BS, PL, CF
           ================================================================ */
.rpt-section {
    margin-bottom: 20px;
}

.rpt-section-bar {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding-bottom: 6px;
    border-bottom: 1.5px solid var(--rpt-section-rule);
    margin-bottom: 4px;
}

.rpt-section-name {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--neutral-foreground-rest);
}

.rpt-section-totals {
    display: flex;
    gap: 0;
    flex-shrink: 0;
    width: calc(2 * var(--rpt-col-amount));
}

    .rpt-section-totals .rpt-amt {
        font-weight: 600;
    }

/* ================================================================
           AMOUNT COLUMN
           ================================================================ */
.rpt-amt {
    min-width: var(--rpt-col-amount);
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    white-space: nowrap;
    letter-spacing: -0.03em;
}

.rpt-amt-pair {
    display: flex;
    gap: 0;
    width: 100%;
}

/* ================================================================
           COLUMN YEAR HEADER (for comparative)
           ================================================================ */
.rpt-col-header {
    display: flex;
    justify-content: flex-end;
    gap: 0;
    margin-bottom: 6px;
}

    .rpt-col-header .rpt-col-year {
        min-width: var(--rpt-col-amount);
        text-align: right;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--neutral-foreground-hint);
    }

/* ================================================================
           LINE TABLE — account rows
           ================================================================ */
.rpt-lines {
    width: 100%;
    border-collapse: collapse;
}

    .rpt-lines tr {
        border-bottom: 1px solid var(--rpt-row-rule);
    }

        .rpt-lines tr:last-child {
            border-bottom: none;
        }

    .rpt-lines td {
        padding: 5px 0;
        font-size: 13px;
        vertical-align: middle;
    }

        .rpt-lines td.td-code {
            width: 56px;
            font-size: 11px;
            font-family: var(--rpt-font-mono);
            color: var(--neutral-foreground-hint);
            padding-right: 8px;
        }

        .rpt-lines td.td-name {
            color: var(--neutral-foreground-rest);
        }

        .rpt-lines td.td-amounts {
            text-align: right;
            width: calc(2 * var(--rpt-col-amount));
            flex-shrink: 0;
        }

/* ================================================================
           SUBTOTAL, MILESTONE, GRAND-TOTAL ROWS
           ================================================================ */
.rpt-subtotal,
.rpt-milestone,
.rpt-grand-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
}

.rpt-subtotal {
    padding: 7px 0;
    border-top: 1px solid var(--neutral-stroke-rest);
    margin-top: 4px;
}

.rpt-milestone {
    padding: 8px 0;
    border-top: 1.5px solid var(--rpt-section-rule);
    border-bottom: 1.5px solid var(--rpt-section-rule);
    margin: 10px 0 18px;
}

.rpt-grand-total {
    padding: 10px 0;
    border-top: 2px solid var(--rpt-total-rule);
    margin-top: 16px;
}

.rpt-row-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--neutral-foreground-rest);
}

.rpt-milestone .rpt-row-label,
.rpt-grand-total .rpt-row-label {
    font-size: 14px;
}

.rpt-row-amounts {
    display: flex;
    gap: 0;
    flex-shrink: 0;
    width: calc(2 * var(--rpt-col-amount));
}

    .rpt-row-amounts .rpt-amt {
        font-size: 13px;
        font-weight: 600;
    }

.rpt-milestone .rpt-row-amounts .rpt-amt,
.rpt-grand-total .rpt-row-amounts .rpt-amt {
    font-size: 14px;
}

/* ================================================================
           NET PROFIT LINE — inside equity section
           ================================================================ */
.rpt-net-profit-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 5px 0;
    border-bottom: 1px solid var(--neutral-stroke-divider-rest);
}

    .rpt-net-profit-line .rpt-np-label {
        font-size: 12px;
        font-style: italic;
        color: var(--neutral-foreground-hint);
    }

/* ================================================================
           DUAL COLUMN LAYOUT — Balance Sheet
           ================================================================ */
.rpt-dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 48px;
}

.rpt-dual-divider {
    border-left: 1px solid var(--neutral-stroke-divider-rest);
    padding-left: 48px;
}

.rpt-col-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--neutral-foreground-hint);
    margin-bottom: 14px;
}

/* ================================================================
           SEMANTIC AMOUNT COLORS
           ================================================================ */
.rpt-positive {
    color: var(--rpt-positive);
}

.rpt-negative {
    color: var(--rpt-negative);
}

/* ================================================================
           ACCOUNT BADGE — General Ledger
           ================================================================ */
.rpt-account-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: color-mix(in srgb, var(--accent-fill-rest) 10%, transparent);
    color: var(--accent-fill-rest);
    border: 1px solid color-mix(in srgb, var(--accent-fill-rest) 25%, transparent);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* ================================================================
           TYPE BADGE — Trial Balance account type
           ================================================================ */
.rpt-type-badge {
    display: inline-block;
    background: color-mix(in srgb, var(--accent-fill-rest) 10%, transparent);
    color: var(--accent-fill-rest);
    border-radius: 20px;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
}

/* ================================================================
           DATA TABLE — Trial Balance & General Ledger
           ================================================================ */
.rpt-table-wrap {
    overflow-x: auto;
    margin-top: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--neutral-stroke-rest) transparent;
}

    .rpt-table-wrap::-webkit-scrollbar {
        height: 4px;
    }

    .rpt-table-wrap::-webkit-scrollbar-thumb {
        background: var(--neutral-stroke-rest);
        border-radius: 999px;
    }

.rpt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 880px;
}

    .rpt-table thead tr {
        border-bottom: 1px solid var(--neutral-stroke-rest);
    }

    .rpt-table th {
        padding: 8px 10px;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--neutral-foreground-hint);
        text-align: right;
        white-space: nowrap;
        background: var(--neutral-layer-1);
    }

        .rpt-table th.col-left,
        .rpt-table td.col-left {
            text-align: left;
        }

    .rpt-table tbody tr {
        border-bottom: 1px solid var(--neutral-stroke-divider-rest);
        transition: background 80ms ease;
    }

        .rpt-table tbody tr:hover {
            background: color-mix(in srgb, var(--neutral-stroke-divider-rest) 40%, transparent);
        }

    .rpt-table td {
        padding: 7px 10px;
        text-align: right;
        font-variant-numeric: tabular-nums;
        vertical-align: middle;
    }

        .rpt-table td.col-code {
            font-family: var(--rpt-font-mono);
            font-size: 11px;
            color: var(--neutral-foreground-hint);
            text-align: left;
            letter-spacing: -0.03em;
        }

    .rpt-table tfoot tr,
    .rpt-table tr.rpt-total-row {
        border-top: 1.5px solid var(--neutral-stroke-rest);
        background: var(--neutral-layer-floating);
    }

        .rpt-table tfoot td,
        .rpt-table tr.rpt-total-row td {
            font-weight: 600;
            padding: 8px 10px;
            letter-spacing: -0.03em;
        }

    .rpt-table tr.rpt-balance-row td {
        font-weight: 500;
        background: color-mix(in srgb, var(--neutral-stroke-divider-rest) 30%, transparent);
        letter-spacing: -0.03em;
    }

/* ================================================================
           FOOTER NOTE
           ================================================================ */
.rpt-footer-note {
    font-size: 11px;
    color: var(--neutral-foreground-hint);
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--neutral-stroke-divider-rest);
    text-align: right;
}

/* ================================================================
           RESPONSIVE
           ================================================================ */
@media (max-width: 900px) {
    .rpt-doc {
        padding: 18px 16px 24px;
    }

    .rpt-dual {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .rpt-dual-divider {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--neutral-stroke-divider-rest);
        padding-top: 24px;
    }
}

@media (max-width: 640px) {
    .rpt-header {
        flex-direction: column;
    }

    .rpt-header-right {
        text-align: left;
    }

    .rpt-col-amount {
        min-width: 88px;
    }
}

/* ================================================================
           PRINT / PDF COMPATIBILITY
           ================================================================ */
@media print {
    body {
        background: #ffffff !important;
        padding: 0 !important;
    }

    .rpt-page {
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .rpt-tabs {
        display: none !important;
    }

    .rpt-doc {
        display: block !important;
        padding: 16px 20px !important;
        page-break-after: always;
        break-after: page;
        animation: none !important;
    }

        .rpt-doc:last-of-type {
            page-break-after: auto;
            break-after: auto;
        }

    /* Force explicit colors for PDF engines */
    .rpt-positive {
        color: #107c10 !important;
    }

    .rpt-negative {
        color: #d13438 !important;
    }

        .rpt-account-badge {
            background: #e8f1fb !important;
            color: #0078d4 !important;
            border-color: #b3d1ef !important;
        }

        .rpt-type-badge {
            background: #e8f1fb !important;
            color: #0078d4 !important;
        }

        .rpt-table {
            min-width: unset !important;
        }

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

        .rpt-table thead {
            display: table-header-group;
        }

        .rpt-table tbody tr {
            page-break-inside: avoid;
            break-inside: avoid;
        }
    }

/* ================================================================
   MOBILE VIEW TOGGLE (global untuk semua laporan)
   ================================================================ */
.rpt-desktop {
    display: block;
}

.rpt-mobile {
    display: none;
}

@media (max-width: 768px) {
    .rpt-desktop {
        display: none;
    }

    .rpt-mobile {
        display: block;
    }
}

/* Override untuk kolom narasi agar bisa wrap */
.rpt-table td.narration-col {
    white-space: normal !important;
    word-break: break-word;
    min-width: 150px;
}

/* Kolom lain tidak wrap */
.rpt-table td:not(.narration-col),
.rpt-table th:not(.narration-col) {
    white-space: nowrap;
}

/* Optional: tambah margin antar section */
.stockmovement-section {
    margin-bottom: 32px;
}

/* ================================================================
   MOBILE CARD BASE STYLES (global)
   ================================================================ */
.rpt-mobile-card {
    background: var(--neutral-layer-card-container, #ffffff);
    border: 1px solid var(--neutral-stroke-rest, #d2d3dc);
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 12px;
    font-family: var(--rpt-font, 'Segoe UI', Roboto, sans-serif);
    font-size: 12px;
}

.rpt-mobile-header {
    border-bottom: 1px solid var(--neutral-stroke-divider-rest, #e6e7ef);
    padding-bottom: 8px;
    margin-bottom: 10px;
}

/* Grid layout untuk pasangan label-value */
.rpt-mobile-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 12px;
    align-items: baseline;
}

.rpt-mobile-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--neutral-foreground-hint, #66667a);
    letter-spacing: 0.3px;
}

.rpt-mobile-value {
    text-align: right;
    font-family: var(--rpt-font-mono, monospace);
    font-size: 12px;
    font-weight: 500;
    color: var(--neutral-foreground-rest, #1a1a28);
}

/* Elemen tambahan untuk berbagai tipe laporan */
.rpt-mobile-code {
    font-family: var(--rpt-font-mono, monospace);
    font-size: 11px;
    color: var(--neutral-foreground-hint, #66667a);
    margin-right: 6px;
}

.rpt-mobile-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--neutral-foreground-rest, #1a1a28);
}

.rpt-mobile-date {
    font-size: 11px;
    color: var(--neutral-foreground-hint, #66667a);
    margin-top: 2px;
}

.rpt-mobile-number {
    font-family: var(--rpt-font-mono, monospace);
    font-weight: 600;
    font-size: 13px;
    color: var(--accent-fill-rest, #0078d4);
    text-decoration: none;
}

.rpt-mobile-amount {
    font-family: var(--rpt-font-mono, monospace);
    font-size: 14px;
    font-weight: 700;
    color: var(--neutral-foreground-rest, #1a1a28);
}

.rpt-mobile-shortage {
    font-family: var(--rpt-font-mono, monospace);
    font-size: 14px;
    font-weight: 700;
    color: var(--rpt-negative);
}

/* Warna untuk nilai positif/negatif di mobile */
.rpt-mobile-value.rpt-positive,
.rpt-mobile-amount.rpt-positive {
    color: var(--rpt-positive, #107c10);
}

.rpt-mobile-value.rpt-negative,
.rpt-mobile-amount.rpt-negative {
    color: var(--rpt-negative, #d13438);
}

/* Highlight untuk baris kritis (low stock) */
.rpt-mobile-critical {
    background-color: color-mix(in srgb, var(--rpt-negative) 8%, transparent);
}


.filter-container {
    width: 100%;
}

.filter-item {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: flex-end;
}

    .filter-item fluent-date-picker,
    .filter-item fluent-button,
    .filter-item fluent-select,
    .filter-item fluent-combobox,
    .filter-item fluent-search,
    .filter-item fluent-checkbox {
        width: 100%;
    }

@media (max-width: 576px) {
    .filter-item {
        margin-bottom: 0.5rem;
    }
}