﻿.report-options-bar {
    display:flex;
    align-items:center;
    gap:16px;
    margin-block:8px 16px;
}

.report-options-bar[hidden] {
    display:none;
}

.workspace-toolbar .report-options-toolbar-trigger {
    order:100;
    margin-inline-start:auto;
    min-height:30px;
    padding:4px 9px;
    font-size:12px;
}

html[dir="ltr"] .workspace-toolbar .report-options-toolbar-trigger {
    order:-1;
    margin-inline-start:0;
    margin-inline-end:auto;
}

@media screen {
    .report-print-footer, .report-options-empty-card {
        display:none;
    }
}

.report-options-trigger {
    display:inline-flex;
    align-items:center;
    gap:8px;
    white-space:nowrap;
}

.report-options-trigger svg,.report-options-close svg {
    width:20px;
    height:20px;
}

.report-options-summary {
    color:var(--muted);
    font-size:12px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    min-width:0;
}

.report-options-dialog {
    width:min(1000px,calc(100vw - 32px));
    max-height:calc(100dvh - 48px);
    padding:0;
    border:1px solid var(--border,#d8dbe3);
    border-radius:8px;
    background:var(--surface,#fff);
    color:var(--text,#1f2937);
    box-shadow:0 24px 70px #0004;
    overflow:auto;
}

.report-options-dialog::backdrop {
    background:#0008;
}

.report-options-dialog[open]:has(.multi-select-filter) {
    display:flex;
    flex-direction:column;
    height:min(760px,calc(100dvh - 48px));
    overflow:hidden;
}

.report-options-dialog:has(.multi-select-filter) > .report-options-body {
    flex:1;
    min-height:0;
    overflow:auto;
}

.report-options-dialog:has(.multi-select-filter) > header,
.report-options-dialog:has(.multi-select-filter) > footer {
    flex-shrink:0;
}

/* Native popovers stay above the modal without moving adjacent form fields. */
.report-options-body .multi-select-panel.report-options-floating-panel {
    position:fixed;
    inset:auto;
    margin:0;
    box-sizing:border-box;
    overflow:auto;
    background:var(--surface,#fff);
    color:var(--text,#1f2937);
    border:1px solid var(--line,#c8d7e2);
    border-radius:8px;
    box-shadow:0 12px 28px #0003;
}

dialog.lookup-modal.report-party-dialog {
    width:100vw;
    max-width:none;
    height:100dvh;
    max-height:none;
    margin:0;
    border:0;
    background:transparent !important;
    color:var(--text,#1f2937);
}
.report-party-dialog::backdrop { background:#0a1e2d59; }
.report-party-dialog .lookup-modal-panel {
    background:var(--surface,#fff);
    color:var(--text,#1f2937);
    border-color:var(--line,#c8d7e2);
}

.report-options-dialog > header {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    padding:22px 24px 14px;
}

.report-options-dialog h2 {
    font-size:16px;
    margin:0;
    line-height:1.6;
}

.report-options-close {
    display:grid;
    place-items:center;
    border:0;
    background:transparent;
    color:var(--muted);
    padding:4px;
    border-radius:5px;
}

.report-options-close:hover {
    color:#dc3545;
    background:#dc354515;
}

.report-options-dialog button:focus-visible {
    outline:2px solid var(--primary,#393078);
    outline-offset:3px;
}

.report-options-body {
    padding:0 24px;
}

.report-options-body > form {
    margin:0;
    padding:18px;
    border:1px solid var(--border,#d8dbe3);
    border-radius:4px;
    box-shadow:none;
    background:transparent;
}

.report-options-body form.filter-grid,.report-options-body .inventory-report-filters,.report-options-body .report-filter-grid {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:16px;
}

.report-options-body .report-filter-head,.report-options-body .filter-card-head,.report-options-body .inventory-report-actions,.report-options-body .filter-actions,.report-options-body .report-filter-actions {
    display:none;
}

.report-options-body label {
    font-size:12px;
}

.report-options-body input:not([type=checkbox]):not([type=radio]),.report-options-body select,.report-options-body .search-select-trigger {
    width:100%;
    min-width:0;
    font-size:13px;
    min-height:36px;
}

.report-options-body .inventory-report-field,.report-options-body .report-filter-grid > * {
    min-width:0;
}

.report-options-body .inventory-report-movements,.report-options-body .report-filter-switches {
    border:1px solid var(--border,#d8dbe3);
    padding:14px;
    border-radius:4px;
    margin-block-start:18px;
    display:flex;
    flex-wrap:wrap;
    gap:14px 24px;
}

.report-options-dialog > footer {
    display:flex;
    justify-content:flex-end;
    gap:8px;
    padding:22px 24px;
    position:sticky;
    bottom:0;
    background:var(--surface,#fff);
    align-items:center;
    flex-wrap:wrap;
    border-block-start:1px solid var(--border,#d8dbe3);
    z-index:1;
}

.report-options-dialog > footer .btn {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    min-height:38px;
    padding:8px 14px;
    font-size:13px;
    line-height:1.4;
    text-decoration:none;
    white-space:nowrap;
    border-radius:5px;
}

.report-options-body .report-filter-switches {
    grid-column:1 / -1;
}

.report-options-body input[type="checkbox"]:not(.multi-select-panel input) {
    appearance:none;
    position:relative;
    width:34px;
    height:18px;
    flex-shrink:0;
    border:1px solid var(--border,#cbd5e1);
    border-radius:18px;
    background:var(--border,#cbd5e1);
    vertical-align:middle;
}

.report-options-body input[type="checkbox"]:not(.multi-select-panel input)::before {
    content:"";
    position:absolute;
    width:12px;
    height:12px;
    top:2px;
    inset-inline-start:2px;
    border-radius:50%;
    background:#fff;
}

.report-options-body input[type="checkbox"]:not(.multi-select-panel input):checked {
    background:var(--primary,#393078);
}

.report-options-body input[type="checkbox"]:not(.multi-select-panel input):checked::before {
    inset-inline-start:18px;
}

.report-options-body input[type="checkbox"]:focus-visible {
    outline:2px solid var(--primary,#393078);
    outline-offset:3px;
}

@media(max-width:720px) {
    .report-options-dialog {
        width:calc(100vw - 16px);
        max-height:calc(100dvh - 16px);
    }

    .report-options-body form.filter-grid,.report-options-body .inventory-report-filters,.report-options-body .report-filter-grid {
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:12px;
    }

    .report-options-body {
        padding-inline:12px;
    }

    .report-options-body > form {
        padding:12px;
    }

    .report-options-dialog > header,.report-options-dialog > footer {
        padding:16px 12px;
    }

}

@media(max-width:420px) {
    .report-options-body form.filter-grid,.report-options-body .inventory-report-filters,.report-options-body .report-filter-grid {
        grid-template-columns:minmax(0,1fr);
    }

    .report-options-body .span-2 {
        grid-column:1;
    }

}

