/* ============================================================
   print.css — PDF viewer & preview shell styles
   Served as: _content/Basis.Shared/print.css
   ============================================================ */

/* ── Preview wrapper (screen only) ────────────────────────── */
/* overflow: auto — scrollbars appear when PDF wider/taller than viewport.
   Centering is handled by margin: 0 auto on the canvas.                  */
.doc-preview-wrap {
    background: var(--neutral-fill-stealth-rest);
    padding: 24px 16px;
    min-height: 100%;
    overflow: auto;
    /* Fill remaining height when inside a fixed-height flex column */
    flex: 1;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--neutral-stroke-rest) transparent;
}

.doc-preview-wrap::-webkit-scrollbar { width: 4px; height: 4px; }
.doc-preview-wrap::-webkit-scrollbar-thumb {
    background: var(--neutral-stroke-rest);
    border-radius: 999px;
}
.doc-preview-wrap::-webkit-scrollbar-thumb:hover {
    background: var(--neutral-foreground-hint);
}

/* ── PDF canvas ─────────────────────────────────────────────── */
.pdf-canvas-page {
    display: block;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 2px 16px rgba(0,0,0,.22);
}

/* ── Zoom strip ─────────────────────────────────────────────── */
.pdf-zoom-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0 12px;
}

/* ── PDF error bar ──────────────────────────────────────────── */
.pdf-error-bar {
    margin: 8px auto 0;
    padding: 10px 14px;
    background: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
    border-radius: 4px;
    font-size: 13px;
    width: 210mm;
    max-width: 100%;
    box-sizing: border-box;
}

/* ── Sticky invoice action bar ──────────────────────────────── */
/* Sits above .doc-preview-wrap. Bleeds over app-content-inner's
   24px padding via negative margin so it spans full content width. */
.inv-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px 6px 8px;
    background: var(--neutral-layer-2, #fff);
    border-bottom: 1px solid var(--neutral-stroke-rest, #d1d1d1);
    box-shadow: 0 1px 6px rgba(0, 0, 0, .08);
    min-height: 48px;
    margin: -24px -24px 0;
}

.inv-bar-identity {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    min-width: 0;
    overflow: hidden;
}

.inv-bar-number {
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    line-height: 1.3;
    color: var(--neutral-foreground-rest);
}

.inv-bar-meta {
    font-size: 12px;
    color: var(--neutral-foreground-hint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.inv-bar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.inv-bar-more {
    position: relative;
}

.inv-bar-overlay {
    position: fixed;
    inset: 0;
    z-index: 49;
}

.inv-bar-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: var(--neutral-layer-floating, #fff);
    border: 1px solid var(--neutral-stroke-rest, #d1d1d1);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .14);
    min-width: 190px;
    z-index: 50;
    padding: 4px 0;
    white-space: nowrap;
}

.inv-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    color: var(--neutral-foreground-rest);
    transition: background 60ms ease;
}

.inv-dropdown-item:hover {
    background: var(--neutral-fill-stealth-hover, #f5f5f5);
}

.inv-dropdown-item.danger {
    color: var(--colorPaletteRedForeground1, #d13438);
}

/* Screen-only block (audit info etc.) — hidden on print */
.inv-screen-only {
    margin-top: 16px;
}

/* Space between action bar and PDF viewer */
.inv-bar + .doc-preview-wrap,
.inv-bar + [id^="pdf-viewer-"] {
    margin-top: 8px;
}

/* ── Narrow screen ──────────────────────────────────────────── */
@media (max-width: 820px) {
    .doc-preview-wrap {
        padding: 8px 0;
    }
}

@media (max-width: 640px) {
    .inv-bar-meta { display: none; }
}

/* ── Print: hide app chrome ─────────────────────────────────── */
@media print {
    .app-header,
    .app-sidebar,
    .app-footer,
    .mobile-overlay,
    .inv-bar,
    .inv-screen-only,
    .page-header {
        display: none !important;
    }

    .app-body-row {
        display: block !important;
    }

    .app-content,
    .app-content-inner {
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    .doc-preview-wrap {
        background: white !important;
        padding: 0 !important;
        display: block !important;
        overflow: visible !important;
    }
}
