/* ========================================
   BLOCK 2: Page-Specific CSS (pvi-team-activity)
   (this page only; Block 1 lives in pvi-master-frame.css)
   Header, filter bar, summary strip and table chrome are carried over
   from pvi-photographer-activity-pills.css so the two pages match.
   Per-job badges (clicked, manager-reviewed, grade-adjusted link) are
   not used here and were left out.
   ======================================== */

.pv-content { font-size: 0.875rem; padding: 1.5rem; }
main { flex: 1; }

.pv-breadcrumb { font-size: 0.78rem; color: #6c757d; margin-bottom: 1rem; }
.pv-breadcrumb a { color: #2e9e6b; text-decoration: none; }

.pv-page-title {
    font-size: 1.2rem; font-weight: 700; color: #1b1f2e;
    border-left: 4px solid var(--green);
    padding-left: 0.65rem; margin-bottom: 1.25rem;
}

/* ── Filter bar ── */
.pv-filter-bar {
    background: #fff; border: 1px solid #dde1ea; border-radius: 6px;
    padding: 0.75rem 1rem 0.6rem; margin-bottom: 1.25rem;
}
.pv-filter-controls {
    display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: flex-end;
}
.filter-group { display: flex; flex-direction: column; gap: 0.2rem; }
.filter-group label { font-size: 0.7rem; color: #6c757d; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.pv-filter-controls select,
.pv-filter-controls input[type="date"] { font-size: 0.82rem; min-width: 130px; }
.pv-filter-actions { display: flex; align-items: flex-end; gap: 0.4rem; margin-left: auto; }

/* Narrow accordion toggle (visible only <600px) */
.pv-filter-toggle {
    display: none; width: 100%;
    background: #f6f8fc; border: 1px solid #dde1ea; border-radius: 6px;
    padding: 0.5rem 0.85rem; font-size: 0.82rem; font-weight: 600; color: #1b1f2e;
    text-align: left; cursor: pointer; margin-bottom: 1rem;
}
.pv-filter-toggle .chevron { transition: transform .2s; display: inline-block; float: right; }
.pv-filter-toggle.open .chevron { transform: rotate(180deg); }

/* ── Summary pills ── */
.pv-summary-strip {
    display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.25rem;
}
.pv-summary-pill {
    background: #fff; border: 1px solid #dde1ea; border-radius: 6px;
    padding: 0.65rem 1.1rem; display: flex; align-items: center; gap: 0.6rem;
}
.pv-summary-pill .sp-num { font-size: 1.4rem; font-weight: 700; color: #1b1f2e; }
.pv-summary-pill .sp-lbl { font-size: 0.72rem; color: #6c757d; text-transform: uppercase; letter-spacing: .04em; }

/* Rate beside the raw total: smaller, muted, on the same baseline.
   Scales with .sp-num (em), so the fluid and narrow rules below carry it. */
.pv-summary-pill .sp-num { white-space: nowrap; }
.pv-summary-pill .sp-pct {
    font-size: 0.6em; font-weight: 600; color: #6c757d;
    margin-left: 0.4em; vertical-align: baseline;
}
.pv-summary-pill .sp-pct:empty { display: none; }

/* ── Team activity table ── */
.pv-table-wrap { overflow-x: auto; }
.pv-act-table {
    width: 100%; border-collapse: collapse;
    background: #fff; border: 1px solid #dde1ea; border-radius: 6px; overflow: hidden;
}
.pv-act-table th {
    background: #252b3b; color: #c8d0e0;
    font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
    padding: 0.55rem 0.65rem; white-space: nowrap;
}
.pv-act-table td {
    padding: 0.45rem 0.65rem; border-bottom: 1px solid #eef0f5;
    white-space: nowrap; vertical-align: middle; font-size: 0.82rem;
}
.pv-act-table tr:last-child td { border-bottom: none; }
.pv-act-table tr:hover td { background: #f8f9ff; }

/* Numeric columns right-aligned so counts line up; the name column stays left. */
.pv-team-table th:not(:first-child),
.pv-team-table td:not(:first-child) { text-align: right; }

/* ── Sortable column headers (same as Photographer Activity) ── */
.pv-act-table thead th[data-sort] {
    position: relative;
    padding-right: 1.15rem;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}
.pv-act-table thead th[data-sort]:hover { background: #2e3550; color: #fff; }
.pv-act-table thead th[data-sort]:focus-visible {
    outline: 2px solid var(--dull-blue);
    outline-offset: -2px;
    box-shadow: inset 0 0 0 4px var(--focus-ring-blue);
}
.pv-act-table thead th[data-sort]::after {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f0dc";
    position: absolute;
    right: 0.3rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7em;
    opacity: 0.35;
}
.pv-act-table thead th[data-sort][aria-sort="ascending"]::after  { content: "\f0de"; opacity: 1; }
.pv-act-table thead th[data-sort][aria-sort="descending"]::after { content: "\f0dd"; opacity: 1; }

/* Rate headers are long ("% Images with Accepted Changes"), so they wrap
   to two lines instead of forcing the table wide and tripping the pivot
   early. The name column stays on one line. */
.pv-team-table thead th:not(:first-child) {
    white-space: normal; min-width: 6.5rem; max-width: 9rem;
    vertical-align: bottom; line-height: 1.25;
}

/* ── Count / rate cells ── zeros greyed from data-val, no JS needed */
.act-count { font-weight: 700; color: #252b3b; }
.act-count[data-val="0"],
.act-count[data-val="0.0"] { color: #adb5bd; font-weight: 400; }

/* Rates: engine emits a bare number; the "%" is drawn here so the sort
   comparator reads a clean number from textContent. */
.pct-val::after { content: "%"; font-weight: 400; color: #6c757d; margin-left: 1px; }

/* ── First column drill-down ── */
.ta-name { font-weight: 600; }
a.ta-link { color: #2e9e6b; text-decoration: none; }
a.ta-link:hover, a.ta-link:focus { text-decoration: underline; }
/* Empty href = nothing to drill into. Matches href="" exactly only;
   an unresolved literal token stays live. */
a.ta-link[href=""] { pointer-events: none; color: inherit; }

/* ── Bottom action buttons ──
   "Photographer Activity" + "Return to Menu", side by side and centered;
   they stack when there is no room for both on one line. */
.pv-btn-row {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem;
}

/* ── Return to Menu button (shared by both bottom buttons) ── */
.pv-return-btn {
    display: inline-block;
    background: var(--green);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
    padding: 0.6rem 1.8rem;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s;
}
.pv-return-btn:hover,
.pv-return-btn:focus { background: var(--green-hover); color: #fff; text-decoration: none; }
.pv-return-btn:focus-visible {
    outline: 2px solid var(--dull-blue);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--focus-ring-blue);
}

/* ── Narrow screens ── */
@media (max-width: 600px) {
    .pv-content { padding: 0.75rem; }
    .pv-filter-toggle { display: block; }
    .pv-filter-bar { padding: 0; border: none; background: transparent; margin-bottom: 0; }
    .pv-filter-bar:has(.pv-filter-collapsible.open) {
        padding: 0.75rem 1rem 0.6rem;
        border: 1px solid #dde1ea;
        background: #fff;
        margin-bottom: 1.25rem;
    }
    .pv-filter-collapsible { display: none; }
    .pv-filter-collapsible.open { display: block; }
    .pv-filter-collapsible .pv-filter-controls {
        display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; align-items: start;
    }
    .pv-filter-collapsible .pv-filter-actions { grid-column: 1 / -1; margin-left: 0; justify-content: flex-end; }
    .pv-filter-controls select,
    .pv-filter-controls input[type="date"] { min-width: unset; width: 100%; }
    .pv-summary-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
    .pv-summary-pill { padding: 0.4rem 0.6rem; gap: 0.4rem; }
    .pv-summary-pill .sp-num { font-size: 1rem; }
    .pv-summary-pill .sp-lbl { font-size: 0.63rem; }
    .pv-summary-pill .fa-lg { font-size: 1rem; }
}

/* ── Summary pill fluid scaling: 601px → 1399px ── */
@media (min-width: 601px) and (max-width: 1399px) {
    .pv-summary-strip {
        gap: clamp(0.4rem, calc(0.14rem + 0.7vw), 0.75rem);
    }
    .pv-summary-pill {
        padding: clamp(0.4rem, calc(0.21rem + 0.5vw), 0.65rem)
                 clamp(0.6rem, calc(0.22rem + 1vw), 1.1rem);
        gap: clamp(0.4rem, calc(0.25rem + 0.4vw), 0.6rem);
    }
    .pv-summary-pill .sp-num { font-size: clamp(1rem, calc(0.7rem + 0.8vw), 1.4rem); }
    .pv-summary-pill .sp-lbl { font-size: clamp(0.63rem, calc(0.56rem + 0.18vw), 0.72rem); }
}

/* ── Column-pivot navigator ──
   Same rules as pvi-photographer-activity-pills.css. Not media-gated:
   they only match markup pvPivot builds, and pvPivot builds it whenever
   the table is wider than its container, at any viewport width.
   Layout: one column per team / photographer (100px each, paged), field
   labels down a sticky left column. The thead carries the names; Jobs
   Shown and % of Total sit in the header section above the dividing
   line, the five rates below it. ── */
.pv-pivot { margin-bottom: 1.5rem; }
.pv-pivot-nav {
    display: flex; align-items: center; gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.pv-pivot-nav .pv-nav-pg {
    flex: 1; text-align: center; font-size: 0.78rem; color: #6c757d;
}
.pv-pivot-tbl {
    width: 100%; border-collapse: separate; border-spacing: 0;
    font-size: 0.82rem;
    background: #fff; border: 1px solid #dde1ea; border-radius: 6px; overflow: hidden;
}
.pv-pivot-tbl thead th {
    background: #f6f8fc; border-bottom: 2px solid #dde1ea;
    padding: 0.4rem 0.3rem; white-space: normal;
    vertical-align: middle; text-align: center;
    width: 100px; min-width: 100px; max-width: 100px;
}
.pv-pivot-tbl tbody td {
    padding: 0.3rem 0.3rem; border-bottom: 1px solid #f0f2f8;
    vertical-align: middle; word-break: break-word;
}
.pv-pivot-tbl tbody tr:last-child td { border-bottom: none; }
.pv-pl {
    position: sticky; left: 0; background: #f6f8fc;
    border-right: 2px solid #dde1ea; font-size: 0.68rem;
    font-weight: 700; color: #6c757d; text-transform: uppercase;
    letter-spacing: .03em; white-space: normal; word-break: break-word;
    z-index: 2; width: 90px; min-width: 90px; max-width: 90px;
    padding: 0.3rem 0.4rem;
}
.pv-pivot-tbl thead .pv-pl { z-index: 3; text-align: left; }
.pv-pc { text-align: center; white-space: normal; width: 100px; min-width: 100px; max-width: 100px; }

/* Pivot header-section rows (above the dividing line) */
.pv-pivot-hdr-row td { background: #f0f4f8; }
.pv-pivot-hdr-last td { border-bottom: 2px solid #b0bdd0 !important; }
