/* =============================================================================
   Portal Hawk — Print stylesheet (Sprint 6E)
   Para impressão do browser de listas/cards/tabelas. NÃO é o CSS do
   fechamento PDF (Sprint 7 usa WeasyPrint + CSS próprio).
   Referenciado em base.html com media="print" — não afeta tela.
   ============================================================================= */

@media print {
    /* Esconde shell e interatividade */
    .topbar,
    .sidebar,
    .footer,
    .theme-toggle-floating,
    .skip-link,
    .breadcrumb,
    .pagination,
    .section-header .btn,
    .table__actions,
    .form-actions,
    .detail-actions,
    .delete-confirm__actions,
    .empty-state .btn,
    form .btn,
    .btn {
        display: none !important;
    }

    /* Layout plano na página */
    body {
        background: #fff !important;
        color: #000 !important;
        font-family: "Iowan Old Style", Georgia, "Times New Roman", serif !important;
        font-size: 11pt;
        line-height: 1.4;
    }

    body.app-shell,
    body.public-shell {
        display: block !important;
        min-height: auto !important;
        padding: 0 !important;
    }

    main,
    .main {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    h1, h2, h3, h4 {
        font-family: "Iowan Old Style", Georgia, "Times New Roman", serif !important;
        color: #000 !important;
        page-break-after: avoid;
        break-after: avoid;
    }

    h1 { font-size: 20pt; }
    h2 { font-size: 16pt; }
    h3 { font-size: 13pt; }

    p { orphans: 3; widows: 3; }

    /* Cards, tabelas, charts: borda preta simples */
    .card,
    .card--public,
    .table-wrapper,
    .chart-wrap,
    .kpi-card {
        border: 1px solid #000 !important;
        background: #fff !important;
        box-shadow: none !important;
        break-inside: avoid;
        page-break-inside: avoid;
        padding: 8mm !important;
    }

    .table {
        border-collapse: collapse;
    }

    .table th,
    .table td {
        border-bottom: 1px solid #000;
        padding: 4pt 6pt;
    }

    .table thead th {
        background: #f0f0f0 !important;
        font-weight: 700;
    }

    /* Links: mostra URL externa entre parênteses (a11y benefit em impressão) */
    a {
        color: #000 !important;
        text-decoration: underline !important;
    }

    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.85em;
        color: #444;
        word-wrap: break-word;
    }

    /* Esconde ícones decorativos (SVG Lucide) — texto já diz tudo */
    .lucide,
    [data-lucide] {
        display: none !important;
    }

    /* Badges viram texto plano entre colchetes */
    .badge {
        background: transparent !important;
        color: #000 !important;
        border: 1px solid #000 !important;
        padding: 1pt 4pt !important;
    }

    /* Charts não imprimem bem (canvas vira raster); esconder */
    canvas {
        display: none !important;
    }

    /* Quebra de página explícita antes de seções destacadas (futuro) */
    .page-break-before { page-break-before: always; break-before: page; }
}
