/* =============================================================================
   RumiNest360 — print (Phase 16A)

   Printing a receipt or a bill should put the document on the paper, not a
   screenshot of a web page. The chrome goes, the page takes the full sheet, and
   the cards stop pretending to float.

   Carried forward from site.css and extended for the new shell. The document
   frame itself arrives with the financial pages (16D).
   ========================================================================== */
@media print {
    /* The shell: no navigation, no top bar, no breadcrumb, no footer, no toast,
       and nothing a page marked .no-print. */
    .app-sidebar,
    .app-topbar,
    .app-crumbs,
    .app-footer,
    .app-nav-backdrop,
    .toast-container,
    .no-print,
    nav,
    header:not(.sm-doc-head),
    footer {
        display: none !important;
    }

    /* The content column takes the whole sheet. */
    .app-shell {
        display: block !important;
        min-height: 0 !important;
        background: #fff !important;
    }

    .app-content {
        display: block !important;
        background: #fff !important;
    }

    .app-main,
    main {
        max-width: none !important;
        padding: 0 !important;
    }

    .app-page {
        max-width: none !important;
    }

    body {
        background: #fff !important;
        font-size: 11pt;
    }

    /* A card on paper is a section, not a floating surface. */
    .card {
        border: none !important;
        box-shadow: none !important;
        break-inside: avoid;
    }

    .card > .card-header {
        border-bottom: 1px solid #000 !important;
        background: transparent !important;
    }

    /* Tables must not lose their rules on paper, and a row must not be split
       across two sheets. */
    .table > thead > tr > th {
        background: transparent !important;
        color: #000 !important;
        border-bottom: 1px solid #000 !important;
    }

    .table > tbody > tr,
    .table > tfoot > tr {
        break-inside: avoid;
    }

    .table > tfoot > tr > td,
    .table > tfoot > tr > th {
        background: transparent !important;
        border-top: 1px solid #000 !important;
    }

    /* A status chip printed as a tint prints as nothing on a mono printer. */
    .badge {
        box-shadow: none !important;
        border: 1px solid #555 !important;
        color: #000 !important;
        background: transparent !important;
    }

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

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

    /* ---------------------------------------------------------------------
       A bill or a receipt is the reason this stylesheet exists. On paper the
       frame keeps its letterhead rule and its totals rule — those are what
       make it read as a document — and loses the screen's shadow and tints.
       --------------------------------------------------------------------- */
    .sm-doc {
        border: none !important;
        box-shadow: none !important;
    }

    .sm-doc-head {
        border-bottom: 2px solid #000 !important;
        padding: 0 0 12pt !important;
    }

    .sm-doc-body {
        padding: 12pt 0 0 !important;
    }

    /* The stamp prints: it is the one mark that says at a glance what happened
       to this document, and a filed copy should carry it. */
    .sm-doc-stamp {
        opacity: 1 !important;
        color: #000 !important;
    }

    .sm-doc-amount {
        background: transparent !important;
        border: 1px solid #000 !important;
    }

    .sm-doc-total-row--final {
        border-top: 2px solid #000 !important;
    }

    .sm-doc-total-row--rule {
        border-top: 1px solid #555 !important;
    }

    /* Nothing on paper is a card list; the table is the printable form. */
    .sm-cardlist { display: none !important; }
    .table-responsive.sm-table-wide { display: block !important; }

    /* Chrome that belongs only to the screen. */
    .sm-toolbar,
    .sm-filters,
    .sm-tabs,
    .sm-form-actions,
    .sm-pager,
    .sm-skip-link {
        display: none !important;
    }

    /* A tinted KPI or figure panel prints as grey mush; keep the figures, drop
       the fill. */
    .sm-kpi,
    .sm-stat,
    .sm-hero {
        border: 1px solid #999 !important;
        box-shadow: none !important;
        break-inside: avoid;
    }

    .sm-gauge-track { stroke: #ddd !important; }
    .sm-gauge-value { stroke: #000 !important; }

    /* Phase 21: the brand hero is white on purple on screen, and a printer drops
       the purple — so on paper it is black on white like everything else. */
    .sm-hero--brand,
    .sm-hero--brand .sm-hero-chip,
    .sm-hero--brand .sm-hero-chip-icon {
        background: transparent !important;
        color: #000 !important;
    }

    .sm-hero--brand .sm-hero-title,
    .sm-hero--brand .sm-hero-subtitle,
    .sm-hero--brand .sm-hero-chip-label,
    .sm-hero--brand .sm-hero-chip-value,
    .sm-hero--brand .sm-hero-chip-caption {
        color: #000 !important;
    }

    .sm-hero-art,
    .sm-chart-loading,
    .sm-doc-actions {
        display: none !important;
    }

    /* A bill or receipt beside its actions card: the document takes the sheet, and
       the grid row's negative gutters go with the column that needed them. */
    .sm-doc-layout {
        margin: 0 !important;
    }

    .sm-doc-layout > .sm-doc-layout-main {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}
