/* ═══════════════════════════════════════
   BUG REPORTS — Admin page
   ═══════════════════════════════════════ */

.br-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.br-controls-left,
.br-controls-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.br-count {
    font-size: 13px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ─── Table ─────────────────────────────── */

.br-table-wrap {
    overflow-x: auto;
}

.br-table {
    width: 100%;
    border-collapse: collapse;
}

.br-table th,
.br-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.br-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.br-table td {
    color: var(--text-primary);
}

.br-table tbody tr:hover {
    background: var(--bg-hover);
    cursor: pointer;
}

.br-mono {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.br-desc-cell {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
    font-size: 12px;
}

/* Sortable headers */
.br-sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

.br-sortable:hover {
    color: var(--text-primary);
}

.br-sortable::after {
    content: ' ↕';
    font-size: 10px;
    opacity: 0.3;
}

.br-sortable.br-sort-active::after {
    opacity: 1;
}

.br-sortable.br-sort-asc::after {
    content: ' ↑';
}

/* Badges */
.br-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: var(--blue-dim);
    color: var(--blue);
    margin-right: 3px;
}

.br-badge-none {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

/* Loading/Error rows */
.br-loading,
.br-error {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
}

.br-error {
    color: var(--red);
}

/* ─── Empty state ───────────────────────── */

.br-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.br-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.br-empty p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.br-empty-hint {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
}

/* ─── Modal header action buttons ───────── */

.br-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 1;
    gap: 12px;
    flex-wrap: wrap;
}

.br-modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 8px;
}

.br-action-btn {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: var(--radius);
    border: 1px solid;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.br-action-download {
    background: var(--blue-dim);
    border-color: var(--blue);
    color: var(--blue);
}
.br-action-download:hover {
    background: var(--blue);
    color: #fff;
}
.br-action-download:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.br-action-resolve {
    background: var(--green-dim);
    border-color: var(--green);
    color: var(--green);
}
.br-action-resolve:hover {
    background: var(--green);
    color: #000;
}
.br-action-resolve.br-action-resolved-active {
    background: var(--green);
    color: #000;
}

.br-action-delete {
    background: var(--red-dim);
    border-color: var(--red);
    color: var(--red);
}
.br-action-delete:hover {
    background: var(--red);
    color: #fff;
}
.br-action-delete:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ─── Resolved state ─────────────────────── */

/* Modal body strikethrough overlay when resolved */
.br-modal-resolved .br-detail-description,
.br-modal-resolved .br-detail-section:not(:last-child) {
    opacity: 0.5;
}

.br-modal-resolved .br-modal-body::before {
    content: '✓ RESOLVED';
    position: sticky;
    top: 0;
    display: block;
    text-align: center;
    padding: 8px;
    background: var(--green-dim);
    color: var(--green);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    border-bottom: 1px solid var(--green);
    margin-bottom: 16px;
    z-index: 1;
}

/* Table row strikethrough */
.br-row-resolved td {
    opacity: 0.55;
    text-decoration: line-through;
    text-decoration-color: var(--text-muted);
}

.br-row-resolved .br-resolved-tag {
    text-decoration: none;
}

.br-resolved-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: var(--green);
    background: var(--green-dim);
    padding: 1px 6px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
    margin-right: 4px;
}
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.br-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
    width: 860px;
    max-width: 96vw;
    max-height: 92vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.br-modal-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.br-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}

.br-modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.br-modal-body {
    padding: 20px;
    flex: 1;
}

/* ─── Report detail layout ──────────────── */

.br-detail {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.br-detail-section {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 16px;
}

.br-detail-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
}

.br-detail-description {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Screenshots */
.br-screenshots {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.br-screenshot-box {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
}

.br-screenshot-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.br-screenshot-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.65);
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    padding: 4px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.br-screenshot-missing {
    font-size: 12px;
    color: var(--text-muted);
}

/* Meta grid */
.br-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
}

.br-meta-row {
    display: flex;
    gap: 8px;
    font-size: 12px;
    align-items: baseline;
}

.br-meta-key {
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 90px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.br-meta-val {
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mono blocks */
.br-mono-block {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    word-break: break-all;
    line-height: 1.5;
}

/* Logs pre block */
.br-logs {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 320px;
    overflow-y: auto;
    margin: 0;
    background: var(--bg-primary);
    border-radius: 4px;
    padding: 10px 12px;
}
