/* public/admin/styles/people.css
   People Manager — Section B
   Builds on admin.css.
*/

/* ── Tab bar ──────────────────────────────────────────────────────────────── */
.pm-tabs {
    display: flex;
    background: #fff;
    border-bottom: 2px solid #e5e7eb;
    flex-shrink: 0;
    padding: 0 24px;
}
.pm-tab {
    padding: 11px 20px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 500;
    color: #57606a;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.pm-tab:hover  { color: #1f2328; }
.pm-tab.active { color: #3b82d4; border-bottom-color: #3b82d4; font-weight: 600; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.pm-main  { overflow-y: auto; padding: 20px 28px; }
.pm-panel { display: none; }
.pm-panel.active { display: block; }

/* ── Filter bar ───────────────────────────────────────────────────────────── */
.pm-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.pm-input {
    padding: 7px 11px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 13px;
    outline: none;
    background: #fff;
    min-width: 140px;
}
.pm-input:focus { border-color: #3b82d4; }
.pm-input-sm { min-width: 70px; width: 70px; }

.pm-select {
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 13px;
    background: #fff;
    outline: none;
    cursor: pointer;
}
.pm-select-sm {
    padding: 5px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    background: #fff;
    outline: none;
    cursor: pointer;
}
.pm-hint { font-size: 13px; color: #57606a; flex: 1; }
.pm-field-label { font-size: 13px; color: #57606a; white-space: nowrap; }

/* ── Meta bar ─────────────────────────────────────────────────────────────── */
.pm-list-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}
.pm-count { font-size: 12px; color: #57606a; }
.pm-sort-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #57606a;
}
.pm-sort-label { white-space: nowrap; }

/* ── Loading ──────────────────────────────────────────────────────────────── */
.pm-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 28px 0;
    color: #57606a;
    font-size: 13px;
}
.pm-spinner {
    width: 20px; height: 20px;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82d4;
    border-radius: 50%;
    animation: pm-spin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes pm-spin { to { transform: rotate(360deg); } }

.pm-empty {
    color: #16a34a;
    font-weight: 500;
    font-size: 13px;
    padding: 20px 0;
}

/* ── Table ────────────────────────────────────────────────────────────────── */
.pm-table-wrap { overflow-x: auto; }
.pm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}
.pm-table th {
    text-align: left;
    padding: 7px 10px;
    border-bottom: 2px solid #e5e7eb;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #57606a;
    background: #f7f8fa;
    white-space: nowrap;
    position: sticky;
    top: 0;
}
.pm-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #f0f1f3;
    vertical-align: middle;
}
.pm-table tr:last-child td { border-bottom: none; }
.pm-table tr:hover td { background: #fafbfc; }

.pm-person-link { color: #3b82d4; text-decoration: none; font-weight: 500; }
.pm-person-link:hover { text-decoration: underline; }

.pm-edit-btn { font-size: 11px; padding: 3px 9px; }

/* ── Pagination ───────────────────────────────────────────────────────────── */
.pm-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 14px 0;
}
.pm-page-btn { min-width: 80px; }
.pm-page-info { font-size: 12px; color: #57606a; }

/* ── Duplicate cards ──────────────────────────────────────────────────────── */
.dup-card {
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #fff;
}
.dup-persons {
    display: grid;
    grid-template-columns: 1fr 48px 1fr;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.dup-person-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.dup-person-meta { font-size: 12px; color: #57606a; }
.dup-vs {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #f59e0b;
    background: #fef9c3;
    border-radius: 4px;
    padding: 4px;
}
.dup-match-reason {
    font-size: 11px;
    color: #57606a;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.dup-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Sibling search dropdown ──────────────────────────────────────────────── */
.pm-search-wrap { position: relative; }
.pm-search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 240px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    max-height: 220px;
    overflow-y: auto;
}
.pm-dropdown-item {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
}
.pm-dropdown-item:hover { background: #f7f8fa; }

/* ── Edit + merge modals ──────────────────────────────────────────────────── */
.pm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
}
.pm-modal {
    background: #fff;
    border-radius: 8px;
    padding: 24px 28px;
    min-width: 360px;
    max-width: 520px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.pm-modal-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
}
.pm-modal-body {
    font-size: 13px;
    color: #1f2328;
    margin-bottom: 12px;
    line-height: 1.6;
}
.pm-modal-warn {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 5px;
    padding: 9px 12px;
    font-size: 12px;
    color: #991b1b;
    margin-bottom: 16px;
}
.pm-modal-fields { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.pm-field-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    align-items: center;
    gap: 10px;
}
.pm-field-row .pm-field-label { text-align: right; font-size: 12px; }
.pm-modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
