/* ========== PDF Review — tool-specific styles ==========
   Loads on top of ../lrf-theme.css (shared LRF brand chrome:
   tokens, header, hero, stage-head, buttons, footer, fields).
   Only the review/comment UI lives here.
*/

/* ---------- Docs list ---------- */
.docs-list { display: flex; flex-direction: column; }
.doc-card {
    display: block;
    padding: 1.5rem 0.25rem;
    border-bottom: 1px solid var(--lrf-line);
    color: var(--lrf-ink);
    transition: padding-left 0.2s ease;
    position: relative;
    text-decoration: none;
}
.doc-card:hover {
    text-decoration: none;
    padding-left: 1rem;
}
.doc-card:hover .doc-card-title { color: var(--lrf-pink); }
.doc-card:hover::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--lrf-pink);
}
.doc-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--lrf-ink);
    margin: 0 0 0.4rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
    transition: color 0.15s;
}
.doc-card-meta {
    font-size: 11px;
    color: var(--lrf-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin: 0;
}

.empty {
    color: var(--lrf-muted);
    font-size: 14px;
    text-align: center;
    padding: 4rem 1rem;
}

.error-msg {
    color: var(--danger);
    font-size: 14px;
    margin: 1rem 0;
    padding: 0.85rem 1rem;
    background: var(--lrf-pink-light);
    border-radius: var(--r);
    border: 1px solid var(--lrf-pink);
}

.hint {
    font-size: 13px;
    color: var(--lrf-muted);
    margin: 6px 0 0;
    line-height: 1.5;
}

/* ========== Review page ========== */
.review-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    border-bottom: 2px solid var(--lrf-ink);
    background: var(--lrf-white);
    gap: 1rem;
    flex-wrap: wrap;
}
.toolbar-left { min-width: 0; }
.toolbar-left h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
    color: var(--lrf-ink);
    line-height: 1.15;
}
.doc-meta {
    font-size: 11px;
    color: var(--lrf-muted);
    margin: 2px 0 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.user-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--lrf-ink-soft);
    background: var(--lrf-bg);
    border: 1px solid var(--lrf-line);
    padding: 7px 14px;
    border-radius: 20px;
    font-weight: 500;
}
.zoom-controls {
    display: flex;
    align-items: center;
    background: var(--lrf-bg);
    border: 1px solid var(--lrf-line);
    border-radius: 20px;
    padding: 2px;
}
.zoom-controls button {
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 600;
    color: var(--lrf-ink-soft);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}
.zoom-controls button:hover { background: var(--lrf-pink); color: white; }
#zoom-label {
    font-size: 12px;
    color: var(--lrf-ink-soft);
    min-width: 44px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.review-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 0;
    min-height: calc(100vh - 120px);
}

/* PDF viewport */
.pdf-viewport {
    background: var(--lrf-cream);
    padding: 2.25rem 1.75rem;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
    position: relative;
}
#pdf-pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}
.pdf-loading {
    text-align: center;
    color: var(--lrf-muted);
    padding: 5rem 1rem;
    font-size: 15px;
}
.page-wrap {
    position: relative;
    background: white;
    box-shadow: var(--shadow-md);
}
.page-wrap canvas { display: block; cursor: crosshair; }
.page-label {
    text-align: center;
    font-size: 10px;
    color: var(--lrf-muted);
    margin-top: 0.5rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
}

/* Pins */
.pin {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50% 50% 50% 0;
    background: var(--lrf-pink);
    transform: translate(-50%, -100%) rotate(-45deg);
    border: 2.5px solid white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 3px 8px rgba(10, 10, 20, 0.3);
    transition: transform 0.15s;
}
.pin.resolved { background: var(--resolved); }
.pin.active { transform: translate(-50%, -100%) rotate(-45deg) scale(1.2); z-index: 20; }
.pin-num {
    transform: rotate(45deg);
    color: white;
    font-size: 13px;
    font-weight: 800;
}

/* Draft popover */
.pin-popover {
    position: absolute;
    background: white;
    border: 1.5px solid var(--lrf-ink);
    border-radius: var(--r);
    padding: 0.9rem;
    width: 280px;
    z-index: 30;
    box-shadow: var(--shadow-lg);
}
.pin-popover textarea {
    min-height: 70px;
    padding: 0.6rem;
    font-size: 14px;
}
.pin-popover-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 0.6rem;
}
.pin-popover-actions button {
    height: 34px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 700;
    border-radius: var(--r);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    border: 1.5px solid var(--lrf-ink);
}
.pin-popover-actions .cancel { background: white; color: var(--lrf-ink); }
.pin-popover-actions .cancel:hover { background: var(--lrf-ink); color: white; }
.pin-popover-actions .save { background: var(--lrf-pink); border-color: var(--lrf-pink); color: white; }
.pin-popover-actions .save:hover { background: var(--lrf-pink-dark); border-color: var(--lrf-pink-dark); }

/* Comments pane */
.comments-pane {
    background: var(--lrf-white);
    border-left: 1px solid var(--lrf-line);
    padding: 1.5rem 1.25rem;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
}
.comments-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0 0 0.85rem;
    letter-spacing: -0.02em;
    color: var(--lrf-ink);
    padding-bottom: 0.85rem;
    border-bottom: 2px solid var(--lrf-ink);
}
.comments-header h2 span {
    font-size: 13px;
    color: var(--lrf-pink);
    font-weight: 700;
    margin-left: 6px;
    letter-spacing: 0;
}
.filter-row {
    display: flex;
    gap: 4px;
    margin-bottom: 1.25rem;
}
.filter-btn {
    background: transparent;
    border: 1px solid transparent;
    padding: 5px 12px;
    font-size: 11px;
    font-family: inherit;
    color: var(--lrf-muted);
    border-radius: 14px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.filter-btn:hover { color: var(--lrf-ink); }
.filter-btn.is-active {
    background: var(--lrf-ink);
    color: white;
    border-color: var(--lrf-ink);
}

.comment-card {
    border: 1px solid var(--lrf-line);
    border-radius: var(--r);
    padding: 0.9rem;
    margin-bottom: 0.6rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: white;
}
.comment-card:hover { border-color: var(--lrf-ink); }
.comment-card.active {
    border-color: var(--lrf-pink);
    background: var(--lrf-pink-light);
    border-left: 3px solid var(--lrf-pink);
    padding-left: calc(0.9rem - 2px);
}
.comment-card.resolved { opacity: 0.6; }
.comment-card.resolved .comment-meta-page {
    background: var(--resolved-soft);
    color: var(--resolved);
}

.comment-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.5rem;
}
.avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--lrf-pink);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    flex-shrink: 0;
}
.comment-author {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--lrf-ink);
}
.comment-meta-page {
    margin-left: auto;
    font-size: 10px;
    color: var(--lrf-muted);
    background: var(--lrf-bg);
    padding: 3px 9px;
    border-radius: 10px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.comment-body {
    font-size: 14px;
    color: var(--lrf-ink);
    line-height: 1.5;
    word-wrap: break-word;
}
.reply-thread {
    margin-top: 0.75rem;
    padding-left: 0.85rem;
    border-left: 2px solid var(--lrf-pink);
}
.reply-item { margin-bottom: 0.6rem; }
.reply-item:last-child { margin-bottom: 0; }
.reply-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0.25rem;
}
.reply-head .avatar { width: 20px; height: 20px; font-size: 9px; }
.reply-head .comment-author { font-size: 12.5px; }
.reply-body { font-size: 13px; color: var(--lrf-ink); line-height: 1.45; }

.card-actions {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--lrf-line);
}
.reply-input-row {
    display: flex;
    gap: 6px;
    margin-bottom: 0.6rem;
}
.reply-input-row input {
    flex: 1;
    height: 34px;
    padding: 0 10px;
    font-size: 13px;
}
.reply-input-row button {
    height: 34px;
    padding: 0 14px;
    background: var(--lrf-pink);
    color: white;
    border: 1.5px solid var(--lrf-pink);
    border-radius: var(--r);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}
.reply-input-row button:hover { background: var(--lrf-pink-dark); border-color: var(--lrf-pink-dark); }

.card-buttons {
    display: flex;
    justify-content: space-between;
    gap: 6px;
}
.card-buttons button {
    background: transparent;
    border: 1px solid var(--lrf-line);
    color: var(--lrf-ink-soft);
    padding: 5px 11px;
    border-radius: var(--r);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.card-buttons button:hover {
    background: var(--lrf-ink);
    color: white;
    border-color: var(--lrf-ink);
}
.card-buttons .admin-delete {
    color: var(--danger);
    border-color: rgba(193, 39, 45, 0.4);
}
.card-buttons .admin-delete:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.comments-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--lrf-muted);
}
.comments-empty p { margin: 4px 0; font-size: 13px; }

/* Admin bar */
.admin-bar {
    position: sticky;
    bottom: 0;
    background: var(--lrf-ink);
    color: var(--lrf-bg);
    z-index: 100;
    border-top: 3px solid var(--lrf-pink);
}
.admin-bar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.85rem 1.5rem;
    max-width: var(--max-w);
    margin: 0 auto;
}
.admin-bar-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.admin-bar-label svg { color: var(--lrf-pink); }

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 20, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1.25rem;
}
.modal {
    background: white;
    border-radius: var(--r);
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    border-top: 4px solid var(--lrf-pink);
}
.modal h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
    color: var(--lrf-ink);
}
.modal h3 .period { color: var(--lrf-pink); }
.modal .hint { margin-bottom: 1.1rem; }
.modal input {
    height: 44px;
    padding: 0 0.9rem;
    font-size: 15px;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 1.25rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--lrf-ink);
    color: var(--lrf-bg);
    padding: 0.75rem 1.25rem;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    z-index: 300;
    box-shadow: var(--shadow-md);
    animation: toast-in 0.2s ease-out;
    border-left: 3px solid var(--lrf-pink);
}
@keyframes toast-in {
    from { opacity: 0; transform: translate(-50%, 12px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- Review-specific responsive ---------- */
@media (max-width: 900px) {
    .review-body { grid-template-columns: 1fr; }
    .comments-pane {
        border-left: none;
        border-top: 1px solid var(--lrf-line);
        max-height: 50vh;
    }
    .pdf-viewport { max-height: 60vh; }
    .review-toolbar { padding: 0.85rem 1.25rem; }
}
@media (max-width: 640px) {
    .doc-card-title { font-size: 1.25rem; }
    .toolbar-left h1 { font-size: 1.15rem; }
}
