/* ================================================================
   REPORT — Editor de relatório ambiental com overlay full-screen
   Estilos do editor contenteditable, toolbar, scene anchors,
   overlay full-screen/split-screen, TOC sidebar, read mode.

   Extraido de constellation.css + novos estilos para a remodelagem
   do modulo de relatorio (2026-02-19).
   ================================================================ */

/* ----------------------------------------------------------------
   EMBEDDED MODE (tab Report no HUD Constellation)
   Container e expansao do HUD quando Report ativo
   ---------------------------------------------------------------- */

.report-editor-container {
    height: 100%;
    overflow-y: auto;
    background: var(--bottom-bg);
    display: flex;
    flex-direction: column;
}

/* Scrollbar visivel no embedded mode */
.report-editor-container::-webkit-scrollbar {
    width: 6px;
}
.report-editor-container::-webkit-scrollbar-track {
    background: transparent;
}
.report-editor-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}
.report-editor-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
}
.report-editor-container {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* Report mode: expande painel via custom property (sem !important hack) */
/* Altura controlada por --bottom-panel-height em switchConstellationTab() */

/* Resize handle no topo do HUD expandido */
.report-resize-handle {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    cursor: ns-resize;
    z-index: 20;
    background: transparent;
}
.report-resize-handle:hover,
.report-resize-handle:active {
    background: color-mix(in srgb, var(--bottom-accent) 30%, transparent);
}

/* ----------------------------------------------------------------
   TOOLBAR — Barra de ferramentas de formatacao
   ---------------------------------------------------------------- */

.report-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 8px;
    background: var(--overlay-medium);
    border-bottom: 1px solid var(--bottom-border);
    flex-shrink: 0;
}

.report-toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    padding: 0 6px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm, 4px);
    color: var(--bottom-text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    gap: 4px;
}
.report-toolbar-btn:hover {
    background: var(--bottom-hover);
    color: var(--bottom-text);
}
.report-toolbar-btn.active {
    background: color-mix(in srgb, var(--bottom-accent) 15%, transparent);
    color: var(--bottom-accent);
    border-color: color-mix(in srgb, var(--bottom-accent) 30%, transparent);
}

.report-toolbar-separator {
    width: 1px;
    height: 16px;
    background: var(--bottom-border);
    margin: 0 4px;
}

/* ----------------------------------------------------------------
   CONTENTEDITABLE — Area editavel do relatorio
   ---------------------------------------------------------------- */

.report-editor-content {
    flex: 1;
    padding: 12px 16px;
    color: var(--bottom-text);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 13px;
    line-height: 1.6;
    overflow-y: auto;
    outline: none;
    min-height: 0;
}

/* Scrollbar visivel em tema escuro — sem isso, Windows overlay scrollbar fica invisivel */
.report-editor-content::-webkit-scrollbar {
    width: 8px;
}
.report-editor-content::-webkit-scrollbar-track {
    background: transparent;
}
.report-editor-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-md);
}
.report-editor-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
.report-editor-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.report-editor-content:empty::before {
    content: attr(data-placeholder);
    color: var(--bottom-text-faint);
    font-style: italic;
}
.report-editor-content h1,
.report-editor-content h2,
.report-editor-content h3 {
    color: var(--bottom-text);
    margin: 12px 0 6px;
}
.report-editor-content h1 {
    font-size: 18px;
    font-weight: 700;
}
.report-editor-content h2 {
    font-size: 15px;
    font-weight: 600;
}
.report-editor-content h3 {
    font-size: 13px;
    font-weight: 600;
}
.report-editor-content p {
    margin: 0 0 8px;
}
.report-editor-content ul,
.report-editor-content ol {
    padding-left: 24px;
    margin: 4px 0;
}
.report-editor-content li {
    margin: 2px 0;
}
.report-editor-content b,
.report-editor-content strong {
    color: var(--bottom-text);
    font-weight: 700;
}

/* Blockquote — citacao com barra lateral */
.report-editor-content blockquote {
    border-left: 3px solid var(--bottom-accent);
    margin: 8px 0;
    padding: 6px 12px;
    color: var(--bottom-text-muted);
    font-style: italic;
    background: color-mix(in srgb, var(--bottom-accent) 5%, transparent);
}

/* Horizontal rule */
.report-editor-content hr {
    border: none;
    border-top: 1px solid var(--bottom-border);
    margin: 16px 0;
}

/* Simple table */
.report-editor-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 8px 0;
    font-size: 12px;
}
.report-editor-content th,
.report-editor-content td {
    border: 1px solid var(--bottom-border);
    padding: 4px 8px;
    text-align: left;
}
.report-editor-content th {
    background: var(--overlay-medium);
    font-weight: 600;
}

/* ----------------------------------------------------------------
   SCENE ANCHOR — Marcador inline de cena 3D
   ---------------------------------------------------------------- */

.report-scene-anchor {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: color-mix(in srgb, var(--bottom-accent) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--bottom-accent) 30%, transparent);
    border-radius: 12px;
    color: var(--bottom-accent);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    vertical-align: middle;
    transition: all 0.15s ease;
}
.report-scene-anchor:hover {
    background: color-mix(in srgb, var(--bottom-accent) 25%, transparent);
    border-color: color-mix(in srgb, var(--bottom-accent) 50%, transparent);
}
.report-scene-anchor--active {
    background: color-mix(in srgb, var(--bottom-accent) 30%, transparent);
    box-shadow: 0 0 6px color-mix(in srgb, var(--bottom-accent) 30%, transparent);
}
.report-scene-anchor--orphan {
    background: rgba(239, 83, 80, 0.15);
    border-color: rgba(239, 83, 80, 0.3);
    color: #ef5350;
}

/* Scene thumbnail tooltip — preview da camera ao hover */
.report-scene-tooltip {
    position: fixed;
    width: 220px;
    padding: 4px;
    background: var(--bottom-bg-solid);
    border: 1px solid var(--bottom-border);
    border-radius: var(--radius-md, 8px);
    box-shadow: var(--shadow-xl);
    z-index: 60;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
}
.report-scene-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}
.report-scene-tooltip img {
    width: 100%;
    border-radius: var(--radius-sm, 4px);
    display: block;
}
.report-scene-tooltip-label {
    padding: 4px 6px 2px;
    font-size: 10px;
    color: var(--bottom-text-muted);
    text-align: center;
}

/* ----------------------------------------------------------------
   SCENE PICKER — Dropdown para selecionar cena
   ---------------------------------------------------------------- */

.report-scene-picker {
    position: absolute;
    background: var(--bottom-bg-solid);
    border: 1px solid var(--bottom-border);
    border-radius: var(--radius-md, 8px);
    padding: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    min-width: 180px;
    box-shadow: var(--shadow-xl);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.report-scene-picker-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    color: var(--bottom-text);
    font-size: 12px;
    border-radius: var(--radius-sm, 4px);
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}
.report-scene-picker-item:hover {
    background: var(--bottom-hover);
}
.report-scene-picker-empty {
    padding: 8px 10px;
    color: var(--bottom-text-faint);
    font-size: 11px;
    font-style: italic;
}

/* ----------------------------------------------------------------
   OVERLAY — Full-screen document editor
   Painel full-viewport para edicao focada do relatorio
   ---------------------------------------------------------------- */

.report-overlay {
    position: absolute;
    inset: 0;
    z-index: 18;
    background: var(--bottom-bg);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(12px);
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
    pointer-events: none;
}
.report-overlay.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Header bar — titulo, botoes de modo, fechar */
.report-overlay-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--overlay-medium);
    border-bottom: 1px solid var(--bottom-border);
    flex-shrink: 0;
    height: 44px;
}

.report-overlay-back {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm, 4px);
    color: var(--bottom-text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.report-overlay-back:hover {
    background: var(--bottom-hover);
    color: var(--bottom-text);
}

.report-overlay-title {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 1px solid transparent;
    color: var(--bottom-text);
    font-size: 14px;
    font-weight: 600;
    padding: 2px 8px;
    outline: none;
    transition: border-color 0.15s ease;
}
.report-overlay-title:focus {
    border-bottom-color: var(--bottom-accent);
}
.report-overlay-title::placeholder {
    color: var(--bottom-text-faint);
}

.report-overlay-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.report-overlay-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 10px;
    height: 28px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm, 4px);
    color: var(--bottom-text-muted);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.report-overlay-btn:hover {
    background: var(--bottom-hover);
    color: var(--bottom-text);
}
.report-overlay-btn.active {
    background: color-mix(in srgb, var(--bottom-accent) 15%, transparent);
    color: var(--bottom-accent);
    border-color: color-mix(in srgb, var(--bottom-accent) 30%, transparent);
}

/* ----------------------------------------------------------------
   OVERLAY BODY — Area com TOC sidebar + documento
   ---------------------------------------------------------------- */

.report-overlay-body {
    display: flex;
    flex: 1;
    min-height: 0; /* Permite flex-shrink abaixo do conteudo */
    overflow: hidden;
}

/* Document wrapper — area scrollavel do editor no overlay */
.report-document {
    flex: 1;
    overflow-y: auto; /* Scroll principal no overlay */
    min-height: 0;
}

/* Scrollbar visivel no overlay */
.report-document::-webkit-scrollbar {
    width: 8px;
}
.report-document::-webkit-scrollbar-track {
    background: transparent;
}
.report-document::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-md);
}
.report-document::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
.report-document {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

/* Quando em overlay mode, editor fica mais espaçoso */
.report-document .report-editor-content {
    padding: 40px 24px;
    max-width: 760px;
    margin: 0 auto;
    width: 100%;
    font-size: 14px;
    line-height: 1.7;
    overflow-y: visible; /* Scroll delegado ao .report-document pai */
    flex: none; /* Nao comprimir — conteudo determina altura */
}
.report-document .report-editor-content h1 {
    font-size: 22px;
    margin: 20px 0 10px;
}
.report-document .report-editor-content h2 {
    font-size: 17px;
    margin: 16px 0 8px;
}
.report-document .report-editor-content h3 {
    font-size: 14px;
    margin: 12px 0 6px;
}

/* Scroll progress bar */
.report-progress {
    height: 3px;
    background: var(--bottom-border);
    flex-shrink: 0;
}
.report-progress-bar {
    height: 100%;
    background: var(--bottom-accent);
    width: 0%;
    transition: width 0.1s ease;
}

/* ----------------------------------------------------------------
   TABLE OF CONTENTS — Sidebar auto-gerada dos headings
   ---------------------------------------------------------------- */

.report-toc {
    width: 200px;
    flex-shrink: 0;
    border-right: 1px solid var(--bottom-border);
    padding: 16px 0;
    overflow-y: auto;
    transition:
        width 0.2s ease,
        padding 0.2s ease;
}
.report-toc.collapsed {
    width: 0;
    padding: 0;
    overflow: hidden;
    border-right: none;
}

.report-toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px 8px;
    border-bottom: 1px solid var(--bottom-border);
    margin-bottom: 8px;
}
.report-toc-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--bottom-text-faint);
}
.report-toc-toggle {
    background: transparent;
    border: none;
    color: var(--bottom-text-faint);
    cursor: pointer;
    padding: 2px;
    font-size: 12px;
}
.report-toc-toggle:hover {
    color: var(--bottom-text);
}

.report-toc-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 4px 12px;
    background: transparent;
    border: none;
    border-left: 2px solid transparent;
    color: var(--bottom-text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.12s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.report-toc-item:hover {
    color: var(--bottom-text);
    background: color-mix(in srgb, var(--bottom-hover) 50%, transparent);
}
.report-toc-item.active {
    color: var(--bottom-accent);
    border-left-color: var(--bottom-accent);
}
.report-toc-item[data-level='2'] {
    padding-left: 24px;
}
.report-toc-item[data-level='3'] {
    padding-left: 36px;
}

/* ----------------------------------------------------------------
   SPLIT SCREEN — 3D viewport + Report lado a lado
   ---------------------------------------------------------------- */

.report-overlay.report-split-mode {
    left: 70%; /* Report ocupa 30% direito da tela */
}

.report-split-divider {
    position: absolute;
    left: -3px;
    top: 0;
    bottom: 0;
    width: 6px;
    cursor: col-resize;
    z-index: 19;
    background: transparent;
    display: none;
}
.report-split-mode .report-split-divider {
    display: block;
}
.report-split-divider:hover,
.report-split-divider:active {
    background: color-mix(in srgb, var(--bottom-accent) 30%, transparent);
}

/* ----------------------------------------------------------------
   READ MODE — Modo leitura (sem edicao)
   ---------------------------------------------------------------- */

.report-read-mode .report-editor-toolbar {
    display: none;
}
.report-read-mode .report-editor-content {
    cursor: default;
}
.report-read-mode .report-resize-handle {
    display: none;
}

/* Expand button no report tab da constellation */
.report-expand-btn {
    position: absolute;
    top: 4px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm, 4px);
    color: var(--bottom-text-faint);
    font-size: 14px;
    cursor: pointer;
    z-index: 5;
    transition: all 0.15s ease;
}
.report-expand-btn:hover {
    background: var(--bottom-hover);
    color: var(--bottom-text);
    border-color: var(--bottom-border);
}

/* ================================================================
   EXPORT OPTIONS DIALOG
   Modal de opções de exportação (formato PDF/DOCX + seções)
   ================================================================ */

.report-export-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-dialog, 9000);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.report-export-dialog {
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 12px;
    width: 420px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
}

.report-export-header {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    color: var(--text-primary, #1a1a1a);
}

.report-export-group-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary, #666);
    margin-bottom: 0.5rem;
}

.report-export-format-group {
    margin-bottom: 1.2rem;
}

.report-export-radio {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem;
    border-radius: var(--radius-xl);
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s;
}
.report-export-radio:hover {
    background: var(--bg-secondary, #f5f5f5);
}
.report-export-radio input[type='radio'] {
    accent-color: var(--accent-color, #3b6bff);
}
.report-export-radio-icon {
    font-size: 1.1rem;
}

.report-export-section-group {
    margin-bottom: 1.2rem;
}

.report-export-toggle-all {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

.report-export-link-btn {
    background: none;
    border: none;
    color: var(--accent-color, #3b6bff);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}
.report-export-link-btn:hover {
    opacity: 0.8;
}

.report-export-section-list {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.report-export-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 0.82rem;
    transition: background 0.15s;
}
.report-export-checkbox:hover {
    background: var(--bg-secondary, #f5f5f5);
}
.report-export-checkbox input[type='checkbox'] {
    accent-color: var(--accent-color, #3b6bff);
}

.report-export-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #eee);
}

.report-export-btn {
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-xl);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
}

.report-export-btn-cancel {
    background: var(--bg-secondary, #f0f0f0);
    color: var(--text-secondary, #666);
    border-color: var(--border-color, #ddd);
}
.report-export-btn-cancel:hover {
    background: var(--bg-tertiary, #e0e0e0);
}

.report-export-btn-export {
    background: var(--accent-color, #3b6bff);
    color: #fff;
}
.report-export-btn-export:hover {
    opacity: 0.9;
}

/* ----------------------------------------------------------------
   METRIC ANCHORS — chips inline para metricas no editor
   ---------------------------------------------------------------- */

.report-metric-anchor {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: color-mix(in srgb, var(--success-accent, #4caf50) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--success-accent, #4caf50) 30%, transparent);
    border-radius: 12px;
    color: var(--success-accent, #4caf50);
    font-size: 11px;
    font-weight: 500;
    cursor: default;
    -webkit-user-select: none;
    user-select: none;
    vertical-align: middle;
    transition: all 0.15s ease;
}
.report-metric-anchor:hover {
    background: color-mix(in srgb, var(--success-accent, #4caf50) 25%, transparent);
    border-color: color-mix(in srgb, var(--success-accent, #4caf50) 50%, transparent);
}

/* Metric Picker Dropdown */
.report-metric-picker {
    background: var(--panel-bg, #1e1e2e);
    border: 1px solid var(--border-color, #333);
    border-radius: var(--radius-xl);
    padding: 4px;
    min-width: 220px;
    max-height: 320px;
    overflow-y: auto;
    z-index: var(--z-dialog, 9000);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.report-metric-picker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 10px;
    border: none;
    background: transparent;
    color: var(--primary-text, #e0e0e0);
    font-size: 12px;
    text-align: left;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.1s ease;
}
.report-metric-picker-item:hover {
    background: color-mix(in srgb, var(--bottom-accent) 20%, transparent);
}
.report-metric-picker-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
    color: var(--success-accent, #4caf50);
}

/* Export dialog anchor info banner */
.report-export-anchor-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: color-mix(in srgb, var(--success-accent, #4caf50) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--success-accent, #4caf50) 30%, transparent);
    border-radius: var(--radius-lg);
    color: var(--primary-text, #e0e0e0);
    font-size: 11px;
    margin-bottom: 8px;
}

/* ================================================================
   REPORT TREE VIEW — Lista de relatorios por pastas
   Painel inferior da tab Report no HUD Constellation
   ================================================================ */

.report-tree {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding: 0;
}

/* Scrollbar do tree */
.report-tree::-webkit-scrollbar {
    width: 6px;
}
.report-tree::-webkit-scrollbar-track {
    background: transparent;
}
.report-tree::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}
.report-tree::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
}
.report-tree {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* Toolbar — botoes Novo Relatorio + Nova Pasta */
.report-tree-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--bottom-border);
    flex-shrink: 0;
}

.report-tree-toolbar-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    height: 24px;
    background: transparent;
    border: 1px solid var(--bottom-border);
    border-radius: var(--radius-sm, 4px);
    color: var(--bottom-text-muted);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.report-tree-toolbar-btn:hover {
    background: var(--bottom-hover);
    color: var(--bottom-text);
    border-color: var(--bottom-text-muted);
}

/* Tree body — area scrollavel com pastas e relatorios */
.report-tree-body {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
    min-height: 0;
}

/* ----------------------------------------------------------------
   FOLDER — Pasta na arvore
   ---------------------------------------------------------------- */

.report-tree-folder {
    display: flex;
    flex-direction: column;
}

.report-tree-folder-header {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: background 0.1s ease;
    -webkit-user-select: none;
    user-select: none;
}
.report-tree-folder-header:hover {
    background: var(--bottom-hover);
}

.report-tree-folder-icon {
    width: 12px;
    font-size: var(--text-xs, 10px);
    color: var(--bottom-text-faint);
    transition: transform 0.15s ease;
    text-align: center;
    flex-shrink: 0;
}
.report-tree-folder-icon.expanded {
    transform: rotate(90deg);
}

.report-tree-folder-name {
    flex: 1;
    font-size: 11px;
    font-weight: 600;
    color: var(--bottom-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-tree-folder-name-input {
    flex: 1;
    font-size: 11px;
    font-weight: 600;
    color: var(--bottom-text);
    background: var(--bottom-bg);
    border: 1px solid var(--bottom-accent);
    border-radius: 3px;
    padding: 0 4px;
    outline: none;
}

.report-tree-folder-count {
    font-size: 10px;
    color: var(--bottom-text-faint);
    flex-shrink: 0;
}

.report-tree-folder-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.1s ease;
}
.report-tree-folder-header:hover .report-tree-folder-actions {
    opacity: 1;
}

.report-tree-folder-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: transparent;
    border: none;
    border-radius: 3px;
    color: var(--bottom-text-faint);
    font-size: 10px;
    cursor: pointer;
    padding: 0;
}
.report-tree-folder-action-btn:hover {
    background: var(--bottom-hover);
    color: var(--bottom-text);
}

/* Children container — indentacao por nivel */
.report-tree-children {
    padding-left: 16px;
}
.report-tree-children.collapsed {
    display: none;
}

/* Pasta vazia placeholder */
.report-tree-empty {
    padding: 4px 8px;
    font-size: 10px;
    color: var(--bottom-text-faint);
    font-style: italic;
}

/* ----------------------------------------------------------------
   REPORT ITEM — Relatorio dentro de pasta
   ---------------------------------------------------------------- */

.report-tree-item {
    display: flex;
    flex-direction: column;
    padding: 5px 8px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: background 0.1s ease;
    border-left: 3px solid transparent;
    margin: 1px 0;
}
.report-tree-item:hover {
    background: var(--bottom-hover);
}
.report-tree-item.active {
    border-left-color: var(--bottom-accent);
    background: color-mix(in srgb, var(--bottom-accent) 8%, transparent);
}

.report-tree-item-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.report-tree-item-title {
    flex: 1;
    font-size: 12px;
    font-weight: 600;
    color: var(--bottom-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-tree-item-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.1s ease;
    flex-shrink: 0;
}
.report-tree-item:hover .report-tree-item-actions {
    opacity: 1;
}

.report-tree-item-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: transparent;
    border: none;
    border-radius: 3px;
    color: var(--bottom-text-faint);
    font-size: 10px;
    cursor: pointer;
    padding: 0;
}
.report-tree-item-action-btn:hover {
    background: var(--bottom-hover);
    color: var(--bottom-text);
}

.report-tree-item-meta {
    font-size: 10px;
    color: var(--bottom-text-faint);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-tree-item-preview {
    font-size: 11px;
    color: var(--bottom-text-muted);
    margin-top: 2px;
    max-height: 28px;
    overflow: hidden;
    line-height: 1.3;
}

/* ----------------------------------------------------------------
   CONTEXT MENU — Menu de contexto (right-click)
   ---------------------------------------------------------------- */

.report-tree-context-menu {
    position: fixed;
    background: var(--bottom-bg-solid, #1a1a2e);
    border: 1px solid var(--bottom-border);
    border-radius: var(--radius-lg);
    padding: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: var(--z-dialog, 9000);
    min-width: 140px;
}

.report-tree-context-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 5px 10px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--bottom-text);
    font-size: 11px;
    cursor: pointer;
    text-align: left;
    transition: background 0.1s ease;
}
.report-tree-context-menu-item:hover {
    background: var(--bottom-hover);
}
.report-tree-context-menu-item.danger {
    color: #ef5350;
}
.report-tree-context-menu-item.danger:hover {
    background: rgba(239, 83, 80, 0.1);
}
.report-tree-context-menu-separator {
    height: 1px;
    background: var(--bottom-border);
    margin: 3px 4px;
}

/* ================================================================
   ABNT PANEL (C5c — SPEC_REPORT_SCRIPTS_LIBRARY)
   ================================================================ */

.abnt-panel {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 380px;
    max-height: calc(100vh - 100px);
    background: var(--panel-bg, #1a1a1a);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 250;
    display: flex;
    flex-direction: column;
    font-family: var(--font-family, sans-serif);
    color: var(--text-primary, #e8eaed);
    overflow: hidden;
}

.abnt-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--panel-bg-secondary, rgba(255, 255, 255, 0.04));
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.abnt-panel-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-primary, #e8eaed);
}

.abnt-panel-close {
    background: transparent;
    border: none;
    color: var(--text-secondary, #9ca3af);
    font-size: 22px;
    cursor: pointer;
    padding: 0 6px;
    line-height: 1;
}

.abnt-panel-close:hover {
    color: var(--text-primary, #e8eaed);
}

.abnt-panel-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 8px;
    background: var(--panel-bg-secondary, rgba(255, 255, 255, 0.03));
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.abnt-filter-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 4px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-primary, #e8eaed);
    transition: background 0.15s;
}

.abnt-filter-btn:hover {
    background: var(--panel-bg-hover, rgba(255, 255, 255, 0.08));
}

.abnt-filter-btn.active {
    background: var(--panel-bg-hover, rgba(255, 255, 255, 0.1));
    border-color: var(--border-color, rgba(255, 255, 255, 0.2));
}

.abnt-filter-btn.error {
    border-left: 3px solid #f93e3e;
}

.abnt-filter-btn.warning {
    border-left: 3px solid #f59e0b;
}

.abnt-filter-btn.info {
    border-left: 3px solid #49cc90;
}

.abnt-filter-value {
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
}

.abnt-filter-label {
    font-size: 10px;
    color: var(--text-secondary, #9ca3af);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 3px;
}

.abnt-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.abnt-empty {
    padding: 24px 12px;
    text-align: center;
    color: var(--text-secondary, #9ca3af);
    font-size: 12px;
}

.abnt-group {
    margin-bottom: 10px;
}

.abnt-group-header {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-secondary, #9ca3af);
    padding: 4px 6px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.abnt-group-count {
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10px;
}

.abnt-finding {
    padding: 8px 10px;
    margin-bottom: 4px;
    background: var(--panel-bg-secondary, rgba(255, 255, 255, 0.04));
    border-radius: 4px;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: background 0.15s;
}

.abnt-finding:hover {
    background: var(--panel-bg-hover, rgba(255, 255, 255, 0.08));
}

.abnt-finding-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.abnt-finding-original {
    font-family: var(--font-mono, monospace);
    font-size: 12px;
    color: var(--text-primary, #e8eaed);
    word-break: break-all;
}

.abnt-finding-status {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.4px;
    flex-shrink: 0;
}

.abnt-finding-status-error {
    background: rgba(249, 62, 62, 0.15);
    color: #f93e3e;
}

.abnt-finding-status-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.abnt-finding-status-info {
    background: rgba(73, 204, 144, 0.15);
    color: #49cc90;
}

.abnt-finding-meta {
    font-size: 10px;
    color: var(--text-secondary, #9ca3af);
    margin-top: 4px;
    display: flex;
    gap: 10px;
}

.abnt-finding-location {
    font-family: var(--font-mono, monospace);
}

.abnt-finding-normalized {
    color: #4a9eff;
}

.abnt-finding-apply {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 4px 8px;
    background: rgba(74, 158, 255, 0.12);
    border: 1px solid rgba(74, 158, 255, 0.3);
    color: #4a9eff;
    font-size: 11px;
    border-radius: 3px;
    cursor: pointer;
    text-align: left;
}

.abnt-finding-apply:hover {
    background: rgba(74, 158, 255, 0.2);
}

.abnt-finding-apply code {
    font-family: var(--font-mono, monospace);
    color: #e8eaed;
    background: rgba(0, 0, 0, 0.3);
    padding: 0 4px;
    border-radius: 2px;
}

.abnt-editor-flash {
    animation: abnt-editor-flash-anim 0.6s ease-out;
}

.doc-compliance-message {
    margin-top: 6px;
    color: var(--text-primary, #e8eaed);
    font-size: 11px;
    line-height: 1.35;
}

.doc-compliance-highlight {
    border-radius: 2px;
    padding: 0 1px;
    text-decoration-line: underline;
    text-decoration-style: wavy;
    text-underline-offset: 2px;
}

.doc-compliance-highlight--error {
    background: rgba(249, 62, 62, 0.12);
    text-decoration-color: #f93e3e;
}

.doc-compliance-highlight--warning {
    background: rgba(245, 158, 11, 0.14);
    text-decoration-color: #f59e0b;
}

.doc-compliance-highlight--info {
    background: rgba(73, 204, 144, 0.12);
    text-decoration-color: #49cc90;
}

.doc-compliance-highlight--active {
    outline: 2px solid #4a9eff;
    outline-offset: 2px;
}

@keyframes abnt-editor-flash-anim {
    0% {
        background-color: rgba(74, 158, 255, 0.2);
    }
    100% {
        background-color: transparent;
    }
}

/* ================================================================
   TRANSLATE MODAL (C5a — SPEC_REPORT_SCRIPTS_LIBRARY)
   ================================================================ */

.translate-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.translate-modal {
    background: var(--panel-bg, #1a1a1a);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
    width: 520px;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    color: var(--text-primary, #e8eaed);
    font-family: var(--font-family, sans-serif);
    overflow: hidden;
}

.translate-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--panel-bg-secondary, rgba(255, 255, 255, 0.04));
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.translate-modal-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.translate-modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary, #9ca3af);
    font-size: 24px;
    cursor: pointer;
    padding: 0 8px;
    line-height: 1;
}

.translate-modal-close:hover {
    color: var(--text-primary, #e8eaed);
}

.translate-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.translate-source {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary, #9ca3af);
    padding-bottom: 14px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
    margin-bottom: 14px;
}

.translate-source-value {
    color: var(--text-primary, #e8eaed);
    font-weight: 600;
}

.translate-target-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary, #9ca3af);
    margin-bottom: 8px;
}

.translate-lang-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 18px;
}

.translate-lang-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--panel-bg-secondary, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 6px;
    color: var(--text-primary, #e8eaed);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.translate-lang-btn:hover {
    background: var(--panel-bg-hover, rgba(255, 255, 255, 0.08));
    border-color: rgba(74, 158, 255, 0.4);
}

.translate-lang-btn.active {
    background: rgba(74, 158, 255, 0.12);
    border-color: #4a9eff;
    color: #4a9eff;
}

.translate-lang-flag {
    font-size: 20px;
    line-height: 1;
}

.translate-lang-label {
    font-size: 12px;
    font-weight: 500;
}

.translate-estimate {
    background: var(--panel-bg-secondary, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 6px;
    padding: 14px;
    margin-bottom: 14px;
}

.translate-estimate-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary, #9ca3af);
    margin-bottom: 10px;
    font-weight: 600;
}

.translate-estimate-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.translate-estimate-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.translate-estimate-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #e8eaed);
    line-height: 1;
}

.translate-estimate-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-secondary, #9ca3af);
    margin-top: 4px;
}

.translate-cost {
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary, #9ca3af);
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.translate-cost strong {
    color: #49cc90;
    font-weight: 600;
}

.translate-cache-hit {
    text-align: center;
    font-size: 12px;
    color: #49cc90;
    padding: 10px;
    background: rgba(73, 204, 144, 0.08);
    border-radius: 4px;
    border: 1px solid rgba(73, 204, 144, 0.3);
}

.translate-notice {
    font-size: 11px;
    color: var(--text-secondary, #9ca3af);
    font-style: italic;
    padding: 8px 12px;
    background: rgba(74, 158, 255, 0.05);
    border-left: 3px solid rgba(74, 158, 255, 0.4);
    border-radius: 3px;
}

.translate-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    background: var(--panel-bg-secondary, rgba(255, 255, 255, 0.03));
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

/* ================================================================
   AI REPORT MODAL (C5b — SPEC_REPORT_SCRIPTS_LIBRARY)
   ================================================================ */

.ai-report-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.ai-report-modal {
    background: var(--panel-bg, #1a1a1a);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
    width: 680px;
    max-width: 95vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    color: var(--text-primary, #e8eaed);
    font-family: var(--font-family, sans-serif);
    overflow: hidden;
}

.ai-report-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: var(--panel-bg-secondary, rgba(255, 255, 255, 0.04));
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.ai-report-modal-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-report-modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary, #9ca3af);
    font-size: 24px;
    cursor: pointer;
    padding: 0 8px;
    line-height: 1;
}

.ai-report-modal-close:hover {
    color: var(--text-primary, #e8eaed);
}

.ai-report-modal-body {
    padding: 18px 20px;
    overflow-y: auto;
    flex: 1;
}

.ai-report-context {
    display: flex;
    gap: 8px;
    font-size: 11px;
    padding: 8px 12px;
    background: rgba(74, 158, 255, 0.08);
    border-left: 3px solid #4a9eff;
    border-radius: 3px;
    margin-bottom: 16px;
}

.ai-report-context-label {
    color: var(--text-secondary, #9ca3af);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ai-report-context-value {
    color: var(--text-primary, #e8eaed);
    font-weight: 600;
}

.ai-report-section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary, #9ca3af);
    margin-bottom: 8px;
    font-weight: 600;
}

.ai-report-template-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.ai-report-template-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 14px;
    background: var(--panel-bg-secondary, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 6px;
    color: var(--text-primary, #e8eaed);
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    font-family: inherit;
    position: relative;
}

.ai-report-template-card:hover {
    background: var(--panel-bg-hover, rgba(255, 255, 255, 0.08));
    border-color: rgba(74, 158, 255, 0.4);
}

.ai-report-template-card.active {
    background: rgba(74, 158, 255, 0.12);
    border-color: #4a9eff;
}

.ai-report-template-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #e8eaed);
    margin-bottom: 4px;
}

.ai-report-template-card.active .ai-report-template-name {
    color: #4a9eff;
}

.ai-report-template-desc {
    font-size: 11px;
    color: var(--text-secondary, #9ca3af);
    line-height: 1.4;
}

.ai-report-custom-badge {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 9px;
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ai-report-tone-selector {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}

.ai-report-tone-btn {
    flex: 1;
    padding: 8px 14px;
    background: var(--panel-bg-secondary, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 4px;
    color: var(--text-primary, #e8eaed);
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}

.ai-report-tone-btn:hover {
    background: var(--panel-bg-hover, rgba(255, 255, 255, 0.08));
}

.ai-report-tone-btn.active {
    background: rgba(74, 158, 255, 0.12);
    border-color: #4a9eff;
    color: #4a9eff;
}

.ai-report-rate-limit {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 3px;
    font-size: 11px;
    color: var(--text-secondary, #9ca3af);
    margin-bottom: 14px;
}

.ai-report-rate-limit strong {
    color: var(--text-primary, #e8eaed);
    font-weight: 600;
}

.ai-report-rate-limit-icon {
    font-size: 14px;
}

.ai-report-rate-limit-blocked {
    color: #f93e3e;
    font-weight: 600;
}

.ai-report-preview-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary, #9ca3af);
    margin-bottom: 6px;
    font-weight: 600;
}

.ai-report-preview {
    min-height: 120px;
    max-height: 260px;
    overflow-y: auto;
    padding: 12px 14px;
    background: var(--panel-bg-secondary, rgba(255, 255, 255, 0.04));
    border: 1px dashed var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-primary, #e8eaed);
    margin-bottom: 10px;
}

.ai-report-preview-empty {
    text-align: center;
    color: var(--text-secondary, #9ca3af);
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-report-preview p {
    margin: 0 0 8px 0;
}

.ai-report-preview ul {
    margin: 0 0 8px 16px;
    padding: 0;
}

.ai-report-loading {
    text-align: center;
    color: var(--text-secondary, #9ca3af);
    padding: 30px 0;
}

.ai-report-error {
    text-align: center;
    color: #f93e3e;
    padding: 20px 0;
}

.ai-report-feedback {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--panel-bg-secondary, rgba(255, 255, 255, 0.03));
    border-radius: 4px;
    margin-bottom: 10px;
}

.ai-report-feedback-label {
    font-size: 11px;
    color: var(--text-secondary, #9ca3af);
}

.ai-report-thumbs-btn {
    background: transparent;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    color: var(--text-secondary, #9ca3af);
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
}

.ai-report-thumbs-btn:hover {
    background: var(--panel-bg-hover, rgba(255, 255, 255, 0.08));
    color: var(--text-primary, #e8eaed);
}

.ai-report-thumbs-btn.active {
    background: rgba(73, 204, 144, 0.15);
    border-color: #49cc90;
    color: #49cc90;
}

.ai-report-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    background: var(--panel-bg-secondary, rgba(255, 255, 255, 0.03));
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.ai-report-modal-footer .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ai-generated-marker {
    background: rgba(74, 158, 255, 0.08);
    border-left: 3px solid #4a9eff;
    padding: 8px 12px;
    margin: 8px 0;
    font-size: 11px;
    color: #4a9eff;
    font-style: italic;
}

/* ================================================================
   AI PROGRESS OVERLAY (generic for all LLM-backed operations)
   ================================================================ */

.ai-progress-overlay {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 340px;
    max-width: calc(100vw - 40px);
    z-index: 9500;
    font-family: var(--font-family, sans-serif);
    pointer-events: auto;
    animation: ai-progress-slide-in 0.25s ease-out;
}

@keyframes ai-progress-slide-in {
    from {
        transform: translateX(16px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.ai-progress-card {
    background: var(--panel-bg, #1a1a1a);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
    border-left: 3px solid #4a9eff;
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    padding: 14px 16px;
    color: var(--text-primary, #e8eaed);
}

.ai-progress-card.ai-progress-error {
    border-left-color: #f93e3e;
    background: rgba(249, 62, 62, 0.06);
}

.ai-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 8px;
}

.ai-progress-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-primary, #e8eaed);
    line-height: 1.2;
}

.ai-progress-dismiss {
    background: transparent;
    border: none;
    color: var(--text-secondary, #9ca3af);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
}

.ai-progress-dismiss:hover {
    color: var(--text-primary, #e8eaed);
}

.ai-progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.ai-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4a9eff 0%, #6bb6ff 100%);
    transition: width 0.3s ease-out;
    border-radius: 3px;
}

.ai-progress-card.ai-progress-error .ai-progress-bar {
    background: linear-gradient(90deg, #f93e3e 0%, #ff6b6b 100%);
}

.ai-progress-bar.indeterminate {
    animation: ai-progress-indeterminate 1.4s linear infinite;
    background: linear-gradient(90deg, rgba(74, 158, 255, 0.1) 0%, #4a9eff 50%, rgba(74, 158, 255, 0.1) 100%);
    background-size: 200% 100%;
}

@keyframes ai-progress-indeterminate {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.ai-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-secondary, #9ca3af);
    gap: 8px;
}

.ai-progress-phase {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-progress-counter {
    font-family: var(--font-mono, monospace);
    font-variant-numeric: tabular-nums;
    color: var(--text-primary, #e8eaed);
    font-weight: 600;
    flex-shrink: 0;
}

.ai-progress-counter.ai-progress-pulse {
    animation: ai-progress-pulse 1.2s ease-in-out infinite;
}

@keyframes ai-progress-pulse {
    0%,
    100% {
        opacity: 0.4;
    }
    50% {
        opacity: 1;
    }
}

.ai-progress-detail {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    font-size: 10px;
    color: var(--text-secondary, #9ca3af);
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
