/* ==========================================================================
   Maynard Leigh — Leadership & Personal Impact Report Styles (.pi-* & .pall-*)
   ========================================================================== */

:root {
    --pi-50: #f8fafc;
    --pi-100: #f1f5f9;
    --pi-200: #e2e8f0;
    --pi-300: #cbd5e1;
    --pi-400: #94a3b8;
    --pi-500: #64748b;
    --pi-600: #475569;
    --pi-700: #334155;
    --pi-800: #1e293b;
    --pi-900: #0f172a;

    --orange: #ed7226;
    --orange-d: #c25512;
    --blue: #2563eb;
    --blue-d: #1d4ed8;
    --green: #10b981;
    --green-d: #047857;
    --red: #ef4444;
    --red-d: #b91c1c;
    --amber: #f59e0b;
    --amber-d: #b45309;
    --indigo: #6366f1;
    --indigo-d: #4338ca;
}

/* ── Report container spacing inside .print-page / .wrapper ──────────────── */
.pi-stats,
.pi-section-hd,
.pi-filter-bar,
.pi-legend,
#pi-filter-content {
    max-width: 1080px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    font-family: 'Lato', 'Raleway', Helvetica, Arial, sans-serif;
    color: var(--pi-800);
}

/* ── Summary Stat Strip ──────────────────────────────────────────────────── */
.pi-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.pi-stat {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #ffffff;
    border: 1px solid var(--pi-200);
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.pi-stat__icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    background: var(--pi-100);
}

.pi-stat__icon-wrap--blue   { background: #eff6ff; color: var(--blue); }
.pi-stat__icon-wrap--orange { background: #fff7ed; color: var(--orange); }
.pi-stat__icon-wrap--green  { background: #ecfdf5; color: var(--green); }
.pi-stat__icon-wrap--red    { background: #fef2f2; color: var(--red); }
.pi-stat__icon-wrap--amber  { background: #fffbeb; color: var(--amber); }
.pi-stat__icon-wrap--indigo { background: #eef2ff; color: var(--indigo); }

.pi-stat__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pi-stat__val {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.15;
    color: var(--pi-900);
}

.pi-stat__lbl {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--pi-700);
    margin-top: 2px;
}

.pi-stat__desc {
    font-size: 12px;
    color: var(--pi-500);
}

/* ── Section Header ──────────────────────────────────────────────────────── */
.pi-section-hd {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 24px auto 16px;
}

.pi-section-hd__icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #fff7ed;
    color: var(--orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.pi-section-hd__icon--blue   { background: #eff6ff; color: var(--blue); }
.pi-section-hd__icon--green  { background: #ecfdf5; color: var(--green); }
.pi-section-hd__icon--indigo { background: #eef2ff; color: var(--indigo); }

.pi-section-hd__text h2 {
    margin: 0 0 2px;
    font-size: 20px;
    font-weight: 800;
    color: var(--pi-900);
    line-height: 1.25;
}

.pi-section-hd__text p {
    margin: 0;
    font-size: 13px;
    color: var(--pi-600);
    line-height: 1.4;
}

/* ── Area Filter Bar ─────────────────────────────────────────────────────── */
.pi-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    background: var(--pi-50);
    border: 1px solid var(--pi-200);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 18px;
}

.pi-filter-bar__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--pi-500);
    margin-right: 4px;
}

.pi-filter-btn {
    appearance: none;
    border: 1px solid var(--pi-300);
    background: #ffffff;
    color: var(--pi-700);
    border-radius: 999px;
    padding: 6px 13px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pi-filter-btn:hover {
    border-color: var(--orange);
    color: var(--orange-d);
}

.pi-filter-btn.is-active {
    background: var(--orange);
    border-color: var(--orange);
    color: #ffffff;
}

/* ── Legend ──────────────────────────────────────────────────────────────── */
.pi-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
    font-size: 12px;
    color: var(--pi-600);
}

.pi-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pi-legend__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    background: var(--pi-400);
}

.pi-legend__dot--own       { background: var(--orange); }
.pi-legend__dot--supporter { background: var(--blue); }
.pi-legend__dot--variance  { background: var(--indigo); }
.pi-legend__dot--green     { background: var(--green); }
.pi-legend__dot--red       { background: var(--red); }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.pi-card {
    background: #ffffff;
    border: 1px solid var(--pi-200);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    overflow: hidden;
    margin-bottom: 20px;
}

.pi-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--pi-50);
    border-bottom: 1px solid var(--pi-200);
}

.pi-card__head-icon {
    font-size: 16px;
    line-height: 1;
}

.pi-card__head-title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: var(--pi-900);
    flex: 1 1 auto;
}

.pi-card__head-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: var(--pi-200);
    color: var(--pi-700);
    white-space: nowrap;
}

.pi-card__head-badge--green { background: #dcfce7; color: var(--green-d); }
.pi-card__head-badge--red   { background: #fee2e2; color: var(--red-d); }

.pi-area-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    background: var(--chip-colour, var(--blue));
    white-space: nowrap;
}

.pi-card__body {
    padding: 18px;
}

.pi-card__body--tight {
    padding: 0;
}

/* ── Empty State ─────────────────────────────────────────────────────────── */
.pi-empty {
    text-align: center;
    padding: 40px 20px;
}

.pi-empty__icon {
    display: block;
    font-size: 32px;
    margin-bottom: 8px;
}

.pi-empty__text {
    margin: 0;
    font-size: 14px;
    color: var(--pi-600);
}

/* ── Detailed Evidence Table ─────────────────────────────────────────────── */
.pi-de-wrap {
    width: 100%;
    overflow-x: auto;
}

.pi-de-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.pi-de-hd {
    padding: 10px 14px;
    background: var(--pi-100);
    color: var(--pi-700);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--pi-200);
}

.pi-de-row td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--pi-100);
    vertical-align: top;
    line-height: 1.45;
}

.pi-de-row:last-child td {
    border-bottom: none;
}

.pi-de-label {
    font-weight: 700;
    color: var(--pi-700);
    white-space: nowrap;
}

.pi-de-question {
    color: var(--pi-800);
}

.pi-de-score {
    text-align: center;
    font-weight: 700;
    white-space: nowrap;
}

.val-pos { color: var(--green-d); }
.val-neg { color: var(--red-d); }

/* ── Chips & Bars (Personal Impact Big Picture & Main Report) ────────────── */
.pi-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.pi-chip {
    background: var(--pi-50);
    border: 1px solid var(--pi-200);
    border-radius: 10px;
    padding: 10px 14px;
    min-width: 100px;
    text-align: center;
}

.pi-chip__val {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: var(--orange-d);
}

.pi-chip__lbl {
    display: block;
    font-size: 12px;
    color: var(--pi-600);
    margin-top: 2px;
}

.pi-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.pi-bar-label {
    width: 140px;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--pi-700);
}

.pi-bar-track {
    flex: 1;
    height: 10px;
    background: var(--pi-100);
    border-radius: 999px;
    overflow: hidden;
}

.pi-bar-fill {
    height: 100%;
    background: var(--orange);
    border-radius: 999px;
}

.pi-bar-fill--blue {
    background: var(--blue);
}

.pi-bar-val {
    width: 44px;
    text-align: right;
    font-size: 13px;
    font-weight: 700;
    color: var(--pi-800);
    flex-shrink: 0;
}

.pi-area-variance {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    background: var(--pi-50);
    color: var(--pi-700);
    margin-top: 6px;
}

.pi-area-variance--pos { background: #ecfdf5; color: var(--green-d); }
.pi-area-variance--neg { background: #fef2f2; color: var(--red-d); }

.pi-area-variance__note {
    color: var(--pi-600);
}

.pi-chart-wrap {
    margin-top: 14px;
    text-align: center;
}

.pi-chart-wrap img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.pi-chart-title {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--pi-500);
}

.pi-hr {
    border: 0;
    border-top: 1px solid var(--pi-200);
    margin: 28px auto;
    max-width: 1080px;
}

.pi-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

/* ── Supporter Comments ──────────────────────────────────────────────────── */
.pi-comments-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pi-comment-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: var(--pi-50);
    border: 1px solid var(--pi-200);
    border-radius: 10px;
}

.pi-comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--indigo);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pi-comment-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--pi-800);
}

.pi-intro {
    max-width: 1080px;
    margin: 20px auto;
    padding: 14px 18px;
    background: var(--pi-50);
    border-left: 4px solid var(--orange);
    border-radius: 6px;
    font-size: 13px;
    color: var(--pi-700);
}

/* ── Personal Impact Complete Report (.pall-*) ────────────────────────────── */
.pi-report.pi-all {
    background: var(--pi-50);
    min-height: 100vh;
    padding-bottom: 64px;
    font-family: 'Lato', 'Raleway', Helvetica, Arial, sans-serif;
    color: var(--pi-800);
}

.pi-body {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
}

.pall-hero {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    padding: 32px 20px 28px;
}

.pall-hero__inner,
.pall-hero__kpis,
.pall-nav__inner {
    max-width: 1080px;
    margin: 0 auto;
}

.pall-hero__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.pall-hero__identity {
    display: flex;
    align-items: center;
    gap: 14px;
}

.pall-hero__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.pall-hero__label {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fdba74;
}

.pall-hero__name {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
}

.pall-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
    font-size: 13px;
    color: #cbd5e1;
}

.pall-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.pall-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.pall-hero__kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.pall-kpi {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pall-kpi__val {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
}

.pall-kpi__lbl {
    font-size: 11px;
    color: #cbd5e1;
}

.pall-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #ffffff;
    border-bottom: 1px solid var(--pi-200);
    margin-bottom: 20px;
}

.pall-nav__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
}

.pall-nav__link {
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    color: var(--pi-600);
    padding: 6px 10px;
    border-radius: 6px;
}

.pall-nav__link.is-active,
.pall-nav__link:hover {
    background: #fff7ed;
    color: var(--orange-d);
}

.pall-nav__expand,
.pall-nav__collapse {
    border: 1px solid var(--pi-300);
    background: #ffffff;
    color: var(--pi-700);
    font-size: 11px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
}

.pall-nav__expand {
    margin-left: auto;
}

.pall-section {
    margin-bottom: 32px;
}

.pall-area-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
}

.pall-area-card {
    background: #ffffff;
    border: 1px solid var(--pi-200);
    border-radius: 12px;
    padding: 14px;
}

.pall-area-card__top {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.pall-area-card__name {
    font-size: 13px;
    font-weight: 700;
    color: var(--pi-800);
    flex: 1;
}

.pall-level {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
}

.pall-level--green { background: #dcfce7; color: var(--green-d); }
.pall-level--blue  { background: #dbeafe; color: var(--blue-d); }
.pall-level--amber { background: #fef3c7; color: var(--amber-d); }
.pall-level--red   { background: #fee2e2; color: var(--red-d); }

.pall-area-card__score {
    font-size: 24px;
    font-weight: 800;
    color: var(--pi-900);
    margin-bottom: 8px;
}

.pall-area-card__bar {
    height: 8px;
    background: var(--pi-100);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 6px;
}

.pall-area-card__fill {
    height: 100%;
    border-radius: 999px;
}

.pall-area-card__label {
    margin: 0;
    font-size: 11px;
    color: var(--pi-500);
}

.pall-accordion {
    background: #ffffff;
    border: 1px solid var(--pi-200);
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
}

.pall-accordion__trigger {
    width: 100%;
    border: 0;
    background: #ffffff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    cursor: pointer;
}

.pall-accordion__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--pi-900);
    flex: 1;
}

.pall-accordion__scores {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.pall-score-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--pi-100);
    color: var(--pi-700);
}

.pall-score-pill--own { background: #fff7ed; color: var(--orange-d); }
.pall-score-pill--sup { background: #eff6ff; color: var(--blue-d); }
.pall-var--pos { background: #dcfce7; color: var(--green-d); }
.pall-var--neg { background: #fee2e2; color: var(--red-d); }
.pall-var--zero { background: var(--pi-100); color: var(--pi-600); }

.pall-accordion__chevron {
    color: var(--pi-500);
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.pall-accordion__trigger[aria-expanded="true"] .pall-accordion__chevron {
    transform: rotate(180deg);
}

.pall-accordion__body {
    padding: 14px 16px;
    border-top: 1px solid var(--pi-100);
}

.pall-comparison__row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.pall-comparison__lbl {
    width: 100px;
    font-size: 12px;
    font-weight: 700;
    color: var(--pi-700);
}

.pall-comparison__val {
    width: 44px;
    text-align: right;
    font-size: 12px;
    font-weight: 700;
}

.pall-gap-badge {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    margin-top: 6px;
}

.pall-insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}

.pall-insight-card {
    background: #ffffff;
    border: 1px solid var(--pi-200);
    border-radius: 12px;
    padding: 16px;
}

.pall-insight-card__hd {
    font-size: 14px;
    font-weight: 800;
    color: var(--pi-900);
    margin-bottom: 10px;
}

.pall-insight-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pall-insight-list li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    color: var(--pi-700);
}

.pall-insight-list__score {
    font-weight: 700;
    color: var(--pi-900);
}

.pall-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 30;
}

.pall-fab__btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 0;
    background: var(--orange);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
    cursor: pointer;
}

.pall-fab__menu {
    position: absolute;
    right: 0;
    bottom: 56px;
    min-width: 210px;
    background: #ffffff;
    border: 1px solid var(--pi-200);
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
    padding: 6px;
}

.pall-fab__item {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    text-decoration: none;
    color: var(--pi-700);
    font-size: 13px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
}

.pall-fab__item:hover {
    background: var(--pi-100);
}

@media print {
    .dont-print,
    .pi-filter-bar,
    .pall-nav,
    .pall-fab {
        display: none !important;
    }
    .pall-accordion__body[hidden] {
        display: block !important;
    }
    .pi-card,
    .pi-stat {
        box-shadow: none;
        break-inside: avoid;
    }
}
