/* ============================================
   REVIEW PANEL - Right sidebar
   ============================================ */

/* Toggle button in header */
.review-toggle-btn {
    position: relative;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-hover);
    color: var(--text);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}
.review-toggle-btn:hover { border-color: var(--primary); color: var(--text-bright); }
.review-toggle-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.review-badge {
    position: absolute;
    top: -6px; right: -6px;
    background: var(--error);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
}
.review-badge.hidden { display: none; }

/* Layout adaptation when panel is open */
.body.review-open {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr 340px;
}

.body.review-open .main {
    overflow-y: auto;
}

/* Panel itself */
.review-panel {
    display: none;
    width: 340px;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    height: calc(100vh - var(--header-height));
    position: sticky;
    top: var(--header-height);
    overflow-y: auto;
    flex-shrink: 0;
}

.review-panel.visible { display: flex; flex-direction: column; }

.review-panel-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.review-panel-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-bright);
}

.review-panel-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.2rem;
}
.review-panel-close:hover { color: var(--text-bright); }

/* Filters */
.review-filters {
    display: flex;
    gap: 0.3rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.review-filter-btn {
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.7rem;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition-fast);
}
.review-filter-btn:hover { border-color: var(--primary); color: var(--text-bright); }
.review-filter-btn.active {
    background: rgba(99,102,241,0.15);
    border-color: var(--primary);
    color: var(--primary-light);
    font-weight: 500;
}

/* Comment list in panel */
.review-comments {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.review-comment-item {
    padding: 0.75rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.review-comment-item:hover { border-color: var(--primary); }

.review-comment-section {
    font-size: 0.65rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
}

.review-comment-text {
    font-size: 0.8rem;
    color: var(--text);
    margin-bottom: 0.4rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.review-comment-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.review-comment-author {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.review-comment-actions {
    display: flex;
    gap: 0.2rem;
}

.review-action-btn {
    padding: 0.2rem 0.4rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.65rem;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition-fast);
}
.review-action-btn:hover { border-color: var(--primary); color: var(--text-bright); }
.review-action-btn.validate { border-color: rgba(34,197,94,0.3); color: var(--success); }
.review-action-btn.validate:hover { background: rgba(34,197,94,0.1); }
.review-action-btn.reject { border-color: rgba(234,179,8,0.3); color: var(--warning); }
.review-action-btn.reject:hover { background: rgba(234,179,8,0.1); }
.review-action-btn.delete { border-color: rgba(239,68,68,0.3); color: var(--error); }
.review-action-btn.delete:hover { background: rgba(239,68,68,0.1); }

/* Empty state */
.review-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Stats summary */
.review-stats {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    font-size: 0.75rem;
}

.review-stat {
    text-align: center;
}
.review-stat-value {
    font-weight: 700;
    color: var(--text-bright);
    font-size: 1.1rem;
}
.review-stat-label {
    color: var(--text-muted);
    font-size: 0.65rem;
}

/* Review save button */
.btn-review {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
    font-weight: 600;
}
.btn-review:hover {
    background: #16a34a;
    border-color: #16a34a;
}

@media (max-width: 768px) {
    .body.review-open {
        grid-template-columns: 1fr;
    }
    .review-panel {
        position: fixed;
        right: 0;
        top: var(--header-height);
        z-index: 90;
        box-shadow: -4px 0 20px rgba(0,0,0,0.3);
    }
}
