/* IMS.Client – Money Theme */

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
}

/* ── App bar ── */
.mud-appbar {
    background: linear-gradient(135deg, #1B5E20 0%, #2E7D32 60%, #388E3C 100%) !important;
    border-bottom: 2px solid #C8A200 !important;
}

/* ── Drawer header ── */
.mud-drawer-header {
    padding: 0 !important;
}

/* ── Nav links ── */
.mud-nav-link {
    border-left: 3px solid transparent;
    font-size: .875rem;
}

    .mud-nav-link:hover {
        border-left-color: rgba(200,162,0,.5) !important;
    }

    .mud-nav-link.active {
        border-left: 3px solid #C8A200 !important;
        background-color: rgba(200,162,0,.08) !important;
        font-weight: 600;
    }

/* ── Currency display ── */
.money {
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

/* ── Clickable rows ── */
.cursor-pointer {
    cursor: pointer;
}

/* ── Balance colors ── */
.balance-positive {
    color: #2E7D32;
    font-weight: 600;
}

.balance-negative {
    color: #C62828;
    font-weight: 600;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-thumb {
    background: #C8E6C9;
    border-radius: 4px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #81C784;
    }

/* ── Error boundary ── */
#blazor-error-ui {
    background: #1B5E20;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    color: white;
    display: none;
    left: 0;
    padding: .6rem 1.25rem .7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

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

/* ── Collector bottom navigation (small screens only) ── */
/* The bar itself is hidden above the sm breakpoint (d-flex d-sm-none on its
   MudPaper), but its fixed-position footprint still needs to be reserved
   below it so the last row of page content isn't hidden underneath the bar. */
@media (max-width: 599.98px) {
    .collector-bottom-nav-content {
        padding-bottom: 68px;
    }
}

/* ── Printing (report pages) ──────────────────────────────────────────────
   Report pages (Profit & Loss, Subscriber Progress, Receivables, Monthly
   Collection) wrap the printable table in <div id="print-area"> and call
   window.print() on the whole document. With no print stylesheet at all,
   that printed the entire app — app bar, drawer, filter controls — at
   physical paper width, so any report with more than a handful of columns
   (multi-company / multi-month breakdowns) got its right-hand columns
   clipped off the page. This isolates #print-area (hides everything else),
   defaults to landscape for the wider tables, and lets cells wrap instead
   of forcing table width past the printable area. */
.no-print {
    /* Elements explicitly marked no-print (e.g. Auto/Manual/Penalty
       breakdown columns in ReceivablesReportPage) are hidden on screen
       too in some layouts, but this class's only real job is the
       @media print rule below — kept as a harmless no-op on screen. */
}

@media print {
    @page {
        size: landscape;
        margin: 10mm;
    }

    body * {
        visibility: hidden;
    }

    #print-area, #print-area * {
        visibility: visible;
    }

    #print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

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

    /* Force the table to fit the printable width instead of overflowing it —
       MudTable's default nowrap cells are exactly what was clipping columns
       off the right edge of the page. */
    #print-area table {
        width: 100% !important;
        table-layout: auto;
    }

    #print-area th, #print-area td {
        white-space: normal !important;
        word-break: break-word;
        font-size: 10px;
        padding: 4px 6px !important;
    }
}
