/* ═══════════════════════════════════════════════════════════════
   COMPARISON REPORT MODAL
   Overlay, header, content, export popover, share popover.
   Brand primary: #1d4ed8  Secondary blue: #eff6ff  Border: #e2e8f0
   ═══════════════════════════════════════════════════════════════ */

/* ── Overlay ─────────────────────────────────────────────────── */
.report-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    z-index: 1060;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem;
    overflow-y: auto;
}

/* ── Modal shell ─────────────────────────────────────────────── */
.report-modal {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
    width: 100%;
    max-width: 880px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Header ──────────────────────────────────────────────────── */
.report-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.5rem;
    background: #1d4ed8;
    color: #fff;
    border-radius: 12px 12px 0 0;
    gap: 1rem;
}

.report-header h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.report-header small {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.75);
}

.report-icon-box {
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.18);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #fff;
    flex-shrink: 0;
}

/* ── Header action buttons row ───────────────────────────────── */
.rpt-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

/* Share button — outlined white */
.rpt-btn-share {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 7px;
    border: 1.5px solid rgba(255,255,255,0.6);
    background: transparent;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.rpt-btn-share:hover {
    background: rgba(255,255,255,0.15);
    border-color: #fff;
}

/* Export button — solid white fill */
.rpt-btn-export {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 7px;
    border: 1.5px solid #fff;
    background: #fff;
    color: #1d4ed8;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.rpt-btn-export:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e3a8a;
}

/* Close button */
.rpt-btn-close {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    border: 1.5px solid rgba(255,255,255,0.4);
    background: transparent;
    color: #fff;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}
.rpt-btn-close:hover {
    background: rgba(255,255,255,0.2);
}

/* ── Popover base ────────────────────────────────────────────── */
.rpt-popover-wrap {
    position: relative;
}

.rpt-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.14);
    min-width: 230px;
    z-index: 1070;
    overflow: hidden;
    animation: popover-in 0.15s ease;
}

@keyframes popover-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.rpt-popover-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    padding: 10px 14px 6px;
}

.rpt-popover-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 4px 0;
}

/* ── Share popover items ──────────────────────────────────────── */
.rpt-share-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 14px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s;
    font-size: 0.85rem;
    color: #1e293b;
}
.rpt-share-item:hover {
    background: #f8faff;
}

.rpt-share-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}
.rpt-share-icon.teams-icon  { background: #e8f0fe; color: #5059c9; }
.rpt-share-icon.email-icon  { background: #fef3c7; color: #b45309; }
.rpt-share-icon.copy-icon   { background: #f0fdf4; color: #15803d; }

.rpt-share-label { flex: 1; font-weight: 500; font-size: 0.84rem; }
.rpt-share-ext   { font-size: 0.7rem; color: #94a3b8; margin-left: auto; }

/* ── Export popover checkboxes ───────────────────────────────── */
.rpt-check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    border-radius: 0;
    transition: background 0.12s;
    font-size: 0.85rem;
    color: #1e293b;
    margin: 0;
    width: 100%;
}
.rpt-check-row:hover { background: #f8faff; }

.rpt-check {
    width: 15px;
    height: 15px;
    accent-color: #1d4ed8;
    cursor: pointer;
    flex-shrink: 0;
}

.rpt-check-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.rpt-check-icon.html-icon { background: #eff6ff; color: #1d4ed8; }
.rpt-check-icon.csv-icon  { background: #f0fdf4; color: #15803d; }
.rpt-check-icon.json-icon { background: #fefce8; color: #a16207; }

.rpt-check-label {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.rpt-check-label strong { font-size: 0.84rem; font-weight: 600; color: #1e293b; }
.rpt-check-label small  { font-size: 0.72rem; color: #94a3b8; }

.rpt-export-error {
    font-size: 0.78rem;
    color: #dc2626;
    padding: 4px 14px 2px;
}

.rpt-popover-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid #f1f5f9;
    background: #fafafa;
}

.rpt-btn-sm-cancel {
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    transition: background 0.12s;
}
.rpt-btn-sm-cancel:hover { background: #f1f5f9; }

.rpt-btn-sm-download {
    padding: 5px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    background: #1d4ed8;
    color: #fff;
    cursor: pointer;
    transition: background 0.12s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.rpt-btn-sm-download:hover  { background: #1e3a8a; }
.rpt-btn-sm-download:disabled { background: #93c5fd; cursor: not-allowed; }

/* ── Report content area ──────────────────────────────────────── */
.report-content {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.report-meta-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr 1fr;
    gap: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    align-items: center;
}

.meta-item label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 2px;
}
.meta-item span { font-size: 0.85rem; font-weight: 500; color: #1e293b; }

.report-summary-boxes {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.summary-box {
    flex: 1;
    min-width: 110px;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #1d4ed8;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    background: #fff;
}
.summary-box h3  { font-size: 1.5rem; font-weight: 700; margin: 0; color: #1e293b; }
.summary-box label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; font-weight: 600; }

.report-diff-table-container { overflow-x: auto; }

.audit-report-table { font-size: 0.83rem; }
.audit-report-table thead th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
    padding: 8px 10px;
}
.audit-report-table tbody td { padding: 7px 10px; vertical-align: middle; }
.audit-report-table tbody tr:hover { background: #f8fafc; }

.report-table-title { font-size: 0.9rem; font-weight: 600; }

/* badge variants for column status */
.badge-status-added   { background: #dcfce7; color: #15803d; font-size: 0.72rem; padding: 3px 7px; border-radius: 4px; }
.badge-status-removed { background: #fee2e2; color: #b91c1c; font-size: 0.72rem; padding: 3px 7px; border-radius: 4px; }
.badge-status-modified{ background: #fef3c7; color: #b45309; font-size: 0.72rem; padding: 3px 7px; border-radius: 4px; }
.badge-status-match   { background: #dcfce7; color: #15803d; font-size: 0.72rem; padding: 3px 7px; border-radius: 4px; }

/* fade in */
.animate-fade-in { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Popover opening upward (for drawer footer) ──────────────── */
.rpt-popover-up {
    top: auto;
    bottom: calc(100% + 8px);
    right: 0;
}

/* ── Drawer footer action buttons ────────────────────────────── */
.ch-action-share {
    background: #fff !important;
    color: #1d4ed8 !important;
    border: 1.5px solid #1d4ed8 !important;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}
.ch-action-share:hover {
    background: #eff6ff !important;
}

.ch-action-export {
    background: #1d4ed8 !important;
    color: #fff !important;
    border: 1.5px solid #1d4ed8 !important;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}
.ch-action-export:hover {
    background: #1e3a8a !important;
    border-color: #1e3a8a !important;
}
