.np-document-viewer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 12rem;
    max-height: min(72vh, 48rem);
}

.np-document-viewer__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--muted-foreground, #9ca3af);
}

.np-document-viewer__canvas-wrap,
.np-document-viewer__image-wrap {
    flex: 1 1 auto;
    overflow: auto;
    border: 1px solid var(--border, #2d3748);
    border-radius: 0.5rem;
    background: color-mix(in srgb, var(--background, #111827) 92%, #000 8%);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0.5rem;
    position: relative;
}

.np-document-viewer__canvas-wrap > .bb-spinner,
.np-document-viewer__canvas-wrap > [class*='spinner'] {
    position: absolute;
    inset: 0;
    margin: auto;
    z-index: 1;
    pointer-events: none;
}

.np-document-viewer__canvas-wrap canvas {
    max-width: 100%;
    height: auto;
}

.np-document-viewer__embed-hint {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--muted-foreground, #9ca3af);
}

.np-document-viewer__frame {
    width: 100%;
    min-height: min(72vh, 48rem);
    flex: 1 1 auto;
    border: 1px solid var(--border, #2d3748);
    border-radius: 0.5rem;
    background: #fff;
}

.np-document-viewer__image-wrap img {
    max-width: 100%;
    max-height: min(68vh, 44rem);
    object-fit: contain;
}

.np-document-viewer__empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--muted-foreground, #9ca3af);
    font-size: 0.875rem;
}

/* Belge önizleme — BbDialogProvider ile çift katman oluşmaması için özel modal */
.np-doc-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0.5rem;
    background: rgba(11, 18, 59, 0.45);
    backdrop-filter: blur(2px);
}

.np-doc-modal {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: min(64rem, 100%);
    max-height: min(95vh, 52rem);
    padding: 1rem 1.25rem 1.25rem;
    border-radius: 1rem;
    border: 1px solid var(--border, #dbe7e3);
    background: var(--background, #fff);
    box-shadow: 0 26px 56px -30px rgba(11, 18, 59, 0.45);
    overflow: hidden;
}

.np-doc-modal--compact {
    width: min(52rem, 100%);
    max-height: 96vh;
    padding: 0.5rem 0.625rem 0.5rem;
    gap: 0.25rem;
}

.np-doc-modal__sr-title {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.np-doc-modal__head {
    flex: none;
}

.np-doc-modal__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--foreground, #1c2541);
}

.np-doc-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.np-doc-modal__body--flush {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.np-doc-modal__download-error {
    margin: 0 0 0.35rem;
    font-size: 0.8125rem;
}

.np-doc-modal__loading {
    display: flex;
    min-height: 12rem;
    align-items: center;
    justify-content: center;
}

.np-document-viewer--dialog {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    gap: 0.35rem;
}

.np-document-viewer__toolbar--header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.15rem 0.1rem 0.4rem;
    border-bottom: 1px solid var(--border, #dbe7e3);
}

.np-document-viewer__doc-title {
    grid-column: 1;
    justify-self: start;
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--foreground, #1c2541);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.np-document-viewer__toolbar-center {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.65rem 1rem;
}

.np-document-viewer__toolbar-group {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
}

.np-document-viewer__toolbar-actions {
    grid-column: 3;
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
}

.np-document-viewer__scale,
.np-document-viewer__page {
    min-width: 2.75rem;
    text-align: center;
}

.np-document-viewer__canvas-wrap--tight {
    border: none;
    border-radius: 0.25rem;
    padding: 0;
    background: #d1d5db;
}

.dark .np-doc-modal {
    background: var(--card, #0b132b);
    border-color: var(--border, #3a506b);
    box-shadow: 0 26px 56px -20px rgba(0, 0, 0, 0.65);
}

.dark .np-doc-modal-backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.dark .np-document-viewer__toolbar--header {
    border-bottom-color: var(--border, #3a506b);
}

.dark .np-document-viewer__doc-title {
    color: var(--foreground, #f4f9fa);
}

.dark .np-document-viewer__toolbar,
.dark .np-document-viewer__scale,
.dark .np-document-viewer__page {
    color: var(--muted-foreground, #dbe7e3);
}

.dark .np-document-viewer__canvas-wrap,
.dark .np-document-viewer__canvas-wrap--tight {
    background: color-mix(in srgb, var(--muted, #1c2541) 85%, #000);
}
