/* ══════════════════════════════════════════════════════════════════════
   DBS TimeManager Theme — Print Stylesheet
   ══════════════════════════════════════════════════════════════════════ */

@media print {
    /* ── Hide non-essential elements ─────────────────────────────────── */
    .tm-topbar,
    .tm-sidebar,
    .tm-footer,
    .tm-mobile-nav,
    .tm-mobile-nav-overlay,
    .tm-breadcrumb-bar,
    .tm-toast-container,
    .tm-timer-widget,
    .tm-timer-controls,
    .tm-export-btns,
    .tm-approval-section button,
    .tm-date-nav,
    .tm-custom-range,
    .tm-report-tabs,
    .btn,
    button,
    .nav-tabs,
    .tm-skip-link,
    #tmTimerStart,
    #tmTimerStop,
    #tmAddEntry,
    .tm-edit-btn,
    .tm-save-btn,
    .tm-cancel-btn,
    .tm-delete-btn,
    .dropdown-menu,
    input[type="hidden"] {
        display: none !important;
    }

    /* ── Reset layout ────────────────────────────────────────────────── */
    body.tm-app {
        background: #fff;
        color: #000;
        font-size: 11pt;
        line-height: 1.4;
        margin: 0;
        padding: 0;
    }

    .tm-main, .tm-main-full {
        margin: 0;
        padding: 0;
        max-width: 100%;
    }

    .tm-layout-wrap {
        display: block;
        margin: 0;
    }

    .tm-content-area {
        padding: 0;
    }

    /* ── Show all report panes ───────────────────────────────────────── */
    .tm-report-pane {
        display: block !important;
        page-break-before: always;
    }

    .tm-report-pane:first-of-type {
        page-break-before: auto;
    }

    /* ── Print header ────────────────────────────────────────────────── */
    body.tm-app::before {
        content: 'DBS Web Designs \2014  TimeManager';
        display: block;
        font-size: 14pt;
        font-weight: 700;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid #000;
        margin-bottom: 1rem;
    }

    /* ── Tables ──────────────────────────────────────────────────────── */
    .table {
        width: 100%;
        border-collapse: collapse;
        font-size: 9pt;
    }

    .table th,
    .table td {
        border: 1px solid #ccc;
        padding: 4px 6px;
        color: #000;
    }

    .table thead th {
        background: #f0f0f0;
        font-weight: 700;
        color: #000;
        text-transform: uppercase;
        font-size: 8pt;
    }

    .tm-totals-row td,
    .tm-grandtotal-row td {
        font-weight: 700;
        background: #f0f0f0;
    }

    /* ── Cards ────────────────────────────────────────────────────────── */
    .tm-app-card,
    .card,
    .tm-card {
        border: 1px solid #ccc;
        box-shadow: none;
        page-break-inside: avoid;
        margin-bottom: 0.5rem;
    }

    .tm-app-card-header,
    .card-header {
        background: #f0f0f0;
        font-weight: 700;
        border-bottom: 1px solid #ccc;
    }

    /* ── Badges ───────────────────────────────────────────────────────── */
    .badge {
        border: 1px solid #999;
        background: transparent !important;
        color: #000 !important;
        padding: 1px 4px;
    }

    /* ── Progress bars ───────────────────────────────────────────────── */
    .progress {
        border: 1px solid #ccc;
        height: 12px;
    }

    .progress-bar {
        background: #999 !important;
    }

    /* ── Links ────────────────────────────────────────────────────────── */
    a {
        color: #000;
        text-decoration: none;
    }

    /* ── Page breaks ─────────────────────────────────────────────────── */
    h5.tm-section-header {
        page-break-after: avoid;
    }

    .tm-project-rpt-group {
        page-break-inside: avoid;
    }

    /* ── Compact spacing ─────────────────────────────────────────────── */
    .mb-3, .mb-4 { margin-bottom: 0.5rem !important; }
    .mt-3, .mt-4 { margin-top: 0.5rem !important; }
    .p-3 { padding: 0.5rem !important; }

    /* ── Alerts ───────────────────────────────────────────────────────── */
    .alert {
        border: 1px solid #ccc;
        background: transparent;
        color: #000;
        padding: 4px 8px;
    }

    /* ── Forms — hide inputs on print ────────────────────────────────── */
    form,
    .form-control,
    .form-select,
    .input-group,
    .tm-project-filters,
    .tm-sidebar-widget,
    .tm-widget-controls,
    select,
    textarea {
        display: none !important;
    }

    /* ── Page margins ────────────────────────────────────────────────── */
    @page {
        margin: 1.5cm 1cm;
    }

    /* ── Increase table font to 10pt for readability ─────────────────── */
    .table {
        font-size: 10pt;
    }

    .table thead th {
        font-size: 9pt;
    }

    /* ── Ensure tables don't overflow the page ───────────────────────── */
    .table-responsive,
    .tm-table-responsive {
        overflow: visible !important;
    }
}
