/* Visual contract: FixedAssets.Web.Mvc/wwwroot/css/fixed-assets.css.
   Keep report actions separate from workspace editing commands. */
.report-preview.pdf-preview-dialog {
    --surface: #fafafa;
    box-sizing: border-box;
    width: min(1100px, 95vw);
    height: 90vh;
    max-width: calc(100% - 2em - 6px);
    max-height: calc(100% - 2em - 6px);
    inset: 0;
    margin: auto;
    padding: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    color: var(--text);
    font: 13px/1.7 var(--font-ui);
}

.report-preview.pdf-preview-dialog[open] {
    display: flex;
    flex-direction: column;
}

html[data-theme='dark'] .report-preview.pdf-preview-dialog {
    --surface: #21242c;
    background: var(--surface);
}

html[data-theme='dark'] .report-preview.pdf-preview-dialog > header {
    background: transparent;
}

.report-preview::backdrop {
    background: rgb(0 0 0 / 0.1);
}

.report-preview.pdf-preview-dialog > header {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 36px;
    margin-bottom: 12px;
    padding: 0;
    border: 0;
    background: transparent;
}

.report-preview > header > strong {
    flex: 1;
    width: auto;
    min-width: 100px;
    font-size: inherit;
}

.report-preview .report-controls {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 7px;
}

.report-preview .report-controls .report-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 7px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition:
        background-color 150ms ease,
        box-shadow 150ms ease;
}

.report-preview .report-action i {
    font-size: 16px;
    line-height: 1;
}

.report-preview .report-action span {
    margin: 0;
    color: inherit;
    font-size: inherit;
}

.report-preview .report-controls .report-action > i.bi {
    display: block;
    height: 17px;
}

.report-preview .report-action-print {
    background: #352c70;
    color: #fff;
}

.report-preview .report-action-print:hover:not(:disabled) {
    background: #292258;
}

.report-preview .report-action-download {
    background: #dc3029;
    color: #fff;
}

.report-preview .report-action-download:hover {
    background: #b9231d;
}

.report-preview .report-controls .report-action-close {
    width: 36px;
    padding: 7px;
}

.report-preview .report-action:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.report-preview .report-action:disabled {
    opacity: 0.5;
    cursor: wait;
}

.report-preview .report-page-navigation {
    display: flex;
    align-items: center;
    gap: 5px;
    direction: inherit;
}

.report-preview .report-page-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface);
    color: var(--primary);
    font: inherit;
    cursor: pointer;
}

.report-preview.pdf-preview-dialog .report-page-button > i.bi {
    display: block;
    height: auto;
    flex-shrink: 1;
    font-size: 13px;
    line-height: 1.7;
    vertical-align: baseline;
}

.report-preview.pdf-preview-dialog .report-page-button > i.bi::before {
    display: inline-block;
}

.report-preview .report-page-button:disabled {
    opacity: 0.4;
    cursor: default;
}

.report-preview .report-page-button:hover:not(:disabled) {
    background: var(--surface-soft);
}

.report-preview .report-page-button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.report-preview .report-page-status {
    min-width: 56px;
    text-align: center;
    font-size: 12px;
    color: var(--text);
    direction: ltr;
}

html[data-theme]
    .report-preview
    :is(.report-action, .report-page-button):not(:disabled):is(:hover, :focus-visible) {
    color: var(--action-primary-text);
    background: var(--primary);
    border-color: var(--primary);
    transition: none;
}

html[data-theme] .report-preview :is(.report-action, .report-page-button):focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

html[data-theme] .report-preview :is(.report-action, .report-page-button):disabled {
    color: var(--muted);
    background: var(--surface-soft);
    border: 1px dashed var(--control-border-hover);
    opacity: 1;
    cursor: not-allowed;
}

.report-preview .report-pages {
    flex: 1;
    min-height: 0;
    height: auto;
    overflow: auto;
    padding: 16px;
    background: var(--canvas);
    text-align: center;
}

.report-preview .report-pages canvas {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto 16px;
    background: #fff;
    box-shadow: 0 2px 12px #0002;
}

.report-preview .pdf-preview-status {
    padding: 0 0 12px;
    color: var(--text-secondary);
}

.report-preview [hidden] {
    display: none !important;
}
