/* Report History: Save toolbar, History grid, Run detail, Settings panel */

/* --- Save toolbar (mounted on every report page) ---
   The mount is the page header's .aw-header-action. It stacks the Save row over the
   auto-save note, hugs the right edge, and stays compact so it never competes with the title.
   The title block is told to flex so a long subtitle cannot push the toolbar to a new line. */
.aw-container-header:has(> #awReportSaveMount) .aw-title-info {
    flex: 1 1 0;
    min-width: 0;
}

#awReportSaveMount.aw-header-action {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    flex: 0 0 auto;
}

.aw-report-save-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.aw-report-save-toolbar .btn-aw {
    min-height: 28px;
    padding: 0 10px;
    font-size: 0.78rem;
    border-radius: 5px;
}

.aw-report-save-toolbar .btn-aw i {
    font-size: 0.75rem;
}

.aw-report-capture-badge {
    font-size: 0.72rem;
    font-weight: 500;
    color: #5c6b76;
    background: #F8FAFB;
    border: 1px solid #E1E8EB;
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
}

.aw-report-capture-badge--toolarge,
.aw-report-capture-badge--timeout,
.aw-report-capture-badge--storageunavailable {
    color: #8a5a00;
    background: #FFF4E0;
    border-color: #f0dcae;
}

.aw-report-autosave-line {
    font-size: 0.7rem;
    color: #8a97a1;
    margin-top: 0;
    line-height: 1.2;
}

.aw-report-autosave-line a {
    margin-left: 0.4rem;
    color: var(--aw-teal-700, #1A4E63);
}

.aw-report-save-toast {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1080;
    background: #1f2a33;
    color: #fff;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.aw-report-save-toast a {
    color: #7fd8d0;
    font-weight: 600;
    text-decoration: none;
}

.aw-report-save-toast-close {
    background: transparent;
    border: 0;
    color: #fff;
    opacity: 0.7;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.aw-report-save-toast-close:hover {
    opacity: 1;
}

/* --- User picker (Save / Share dialogs) --- */
.aw-report-user-picker {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #E1E8EB;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
}

.aw-report-user-picker-row {
    display: block;
    padding: 0.25rem 0;
    font-size: 0.85rem;
    font-weight: 400;
    cursor: pointer;
}

.aw-report-user-picker-row input {
    margin-right: 0.4rem;
}

/* --- History grid --- */
.aw-report-history-kind {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-radius: 4px;
    padding: 0.1rem 0.45rem;
}

.aw-report-history-kind--saved {
    background: #E7F6F2;
    color: #0f6b5b;
}

.aw-report-history-kind--auto {
    background: #F8FAFB;
    color: #5c6b76;
    border: 1px solid #E1E8EB;
}

.aw-report-history-chip {
    display: inline-block;
    background: #F8FAFB;
    border: 1px solid #E1E8EB;
    color: #5c6b76;
    border-radius: 999px;
    padding: 0.05rem 0.5rem;
    font-size: 0.7rem;
    margin: 0.1rem 0.2rem 0.1rem 0;
    white-space: nowrap;
}

/* --- Run detail page --- */
.aw-report-run-detail-dl dt {
    color: #8a97a1;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
}

.aw-report-run-detail-dl dd {
    margin-bottom: 0.75rem;
}

.aw-report-run-nopdf {
    color: #8a97a1;
    font-style: italic;
    padding: 1rem 0;
}

/* --- Settings panel --- */
.aw-report-settings-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
}

.aw-report-settings-row label {
    min-width: 220px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0;
}
