/* ============================================================================
   Headline Dashboard (CP-701 / CP-702)
   Tier-varied 5-box headline + inline drill-in sections. All selectors are
   namespaced under .headline-* so they never leak into the other dashboards,
   which keep their own scoped .kpi-card styling.
   ============================================================================ */

.headline-kpi-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
    width: 100%;
    box-sizing: border-box;
}

.headline-box {
    background: #fff;
    border-radius: 20px;
    padding: clamp(16px, 3vw, 26px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.headline-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.headline-box:focus-visible {
    outline: 2px solid #C8A951;
    outline-offset: 2px;
}

/* Gold accent bar by default; overridden per-box by --headline-accent or a band class. */
.headline-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--headline-accent, linear-gradient(135deg, #C8A951 0%, #d4b563 100%));
}

.headline-box.very-low::before  { background: linear-gradient(135deg, #228B22 0%, #1a6b1a 100%); }
.headline-box.low::before       { background: linear-gradient(135deg, #32CD32 0%, #28a428 100%); }
.headline-box.medium::before    { background: linear-gradient(135deg, #FF8C00 0%, #e67e22 100%); }
.headline-box.high::before      { background: linear-gradient(135deg, #DC143C 0%, #c0102b 100%); }
.headline-box.very-high::before { background: linear-gradient(135deg, #8B0000 0%, #6b0000 100%); }

.headline-box .kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.headline-box .kpi-title {
    font-size: 1rem;
    font-weight: 600;
    color: #14213D;
    line-height: 1.25;
}

.headline-box .headline-info {
    font-size: 0.8rem;
    color: #adb5bd;
    margin-left: 6px;
    cursor: help;
    transition: color 0.2s ease;
}

.headline-box .headline-info:hover {
    color: #C8A951;
}

.headline-box .kpi-icon {
    font-size: 1.4rem;
    color: #C8A951;
    opacity: 0.85;
    flex-shrink: 0;
    margin-left: 10px;
}

.headline-box .kpi-value {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 700;
    color: #14213D;
    margin-bottom: 8px;
    line-height: 1;
}

.headline-box .kpi-subtitle {
    font-size: 0.9rem;
    color: #495057;
    margin-bottom: 12px;
}

.headline-box .kpi-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}

.headline-box .breakdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #495057;
}

.headline-box .breakdown-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.headline-box .breakdown-dot.overdue     { background: #e74c3c; }
.headline-box .breakdown-dot.in-progress { background: #3498db; }

.headline-hint {
    margin-top: auto;
    padding-top: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #C8A951;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.headline-box:hover .headline-hint,
.headline-box.active .headline-hint {
    opacity: 1;
}

.headline-box.active {
    box-shadow: 0 12px 34px rgba(200, 169, 81, 0.28);
}

/* ---- Box 1: risk profile + gauge ---- */
.risk-profile-box {
    align-items: center;
    text-align: center;
}

.risk-profile-box .kpi-header {
    width: 100%;
}

.risk-profile-gauge {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 120px;
}

.risk-profile-label {
    font-size: 1.35rem;
    font-weight: 700;
    margin-top: 4px;
}

/* ---- Zero-tolerance chips ---- */
.zero-tolerance-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}

.zt-chip {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 999px;
    background: #f1f3f5;
    color: #6c757d;
}

.zt-chip.has-instances {
    background: rgba(220, 20, 60, 0.12);
    color: #c0102b;
}

/* ---- PSC headline box ---- */
.psc-risk-level {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1;
}

/* ---- Page-level suppression banner (whole hazard cohort below the privacy floor) ---- */
.hazard-suppression-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    background: #f8f9fa;
    border: 1px solid #e2e6ea;
    border-left: 4px solid #C8A951;
    border-radius: 12px;
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.4;
}

.hazard-suppression-banner i {
    color: #C8A951;
    font-size: 1.2rem;
}

/* ---- Suppression ---- */
.headline-suppressed {
    font-size: 0.9rem;
    color: #6c757d;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 14px;
    line-height: 1.4;
}

/* ============================================================================
   Inline drill-in detail sections
   ============================================================================ */

.headline-detail {
    background: #fff;
    border-radius: 20px;
    padding: clamp(18px, 3vw, 28px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 32px;
    border-top: 4px solid #C8A951;
    animation: headline-detail-in 0.25s ease;
}

@keyframes headline-detail-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.headline-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.headline-detail-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #14213D;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.headline-detail-header h3 i {
    color: #C8A951;
}

.headline-detail-close {
    background: transparent;
    border: none;
    color: #6c757d;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
}

.headline-detail-close:hover {
    background: #f1f3f5;
    color: #14213D;
}

.headline-interpretive {
    margin-top: 18px;
    padding: 16px 18px;
    background: #f8f9fa;
    border-left: 4px solid #C8A951;
    border-radius: 10px;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #343a40;
}

/* ---- Zero-tolerance detail ---- */
.zt-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.zt-summary-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 12px;
    background: #f8f9fa;
    min-width: 160px;
}

.zt-summary-item.has-instances {
    background: rgba(220, 20, 60, 0.08);
}

.zt-summary-count {
    font-size: 1.8rem;
    font-weight: 700;
    color: #14213D;
}

.zt-summary-item.has-instances .zt-summary-count {
    color: #c0102b;
}

.zt-summary-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #495057;
}

.zt-trigger-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.zt-trigger-row {
    padding: 14px 16px;
    border: 1px solid #eef0f2;
    border-left: 4px solid #DC143C;
    border-radius: 10px;
    background: #fff;
}

.zt-trigger-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.zt-trigger-hazard {
    font-weight: 700;
    color: #14213D;
}

.zt-trigger-team {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6c757d;
    background: #f1f3f5;
    padding: 2px 10px;
    border-radius: 999px;
}

.zt-trigger-text {
    font-size: 0.9rem;
    color: #495057;
    line-height: 1.5;
}

.zt-empty {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    color: #228B22;
    font-size: 0.95rem;
}

/* ---- PSC detail ---- */
.psc-detail-grid {
    display: grid;
    grid-template-columns: minmax(160px, 220px) 1fr;
    gap: 28px;
    align-items: start;
}

.psc-score-panel {
    text-align: center;
    padding: 18px;
    background: #f8f9fa;
    border-radius: 14px;
}

.psc-score-value {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
}

.psc-score-scale {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 12px;
}

.psc-score-badge {
    display: inline-block;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 4px 14px;
    border-radius: 999px;
    margin-bottom: 10px;
}

.psc-score-respondents {
    font-size: 0.85rem;
    color: #6c757d;
}

.psc-subscales {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.psc-subscale-row {
    display: grid;
    grid-template-columns: minmax(150px, 220px) 1fr auto;
    gap: 14px;
    align-items: center;
}

.psc-subscale-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #14213D;
}

.psc-subscale-bar {
    height: 10px;
    background: #eef0f2;
    border-radius: 999px;
    overflow: hidden;
}

.psc-subscale-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(135deg, #C8A951 0%, #d4b563 100%);
}

.psc-subscale-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.psc-subscale-score {
    font-size: 0.9rem;
    font-weight: 700;
    color: #14213D;
}

.psc-subscale-band {
    font-size: 0.78rem;
    color: #6c757d;
}

.psc-readiness {
    margin-top: 22px;
}

.psc-readiness-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #14213D;
    margin-bottom: 10px;
}

.psc-readiness-track {
    position: relative;
    display: flex;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
}

.psc-readiness-segment {
    height: 100%;
}

.psc-readiness-marker {
    position: absolute;
    top: 50%;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #14213D;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transform: translate(-50%, -50%);
}

.psc-readiness-ends {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #6c757d;
    margin-top: 8px;
}

.psc-readiness-label {
    margin-top: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #14213D;
}

/* ---- Demand/RDS detail ---- */
.demand-rds-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(220, 20, 60, 0.1);
    color: #c0102b;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.demand-rds-composites {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.composite-tile {
    text-align: center;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
}

.composite-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 8px;
}

.composite-value {
    font-size: 2rem;
    font-weight: 800;
    color: #14213D;
    line-height: 1;
}

.composite-band {
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    margin-top: 6px;
}

.demand-rds-ranked {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.ranked-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #14213D;
    margin-bottom: 10px;
}

.ranked-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f5;
}

.ranked-name {
    font-size: 0.9rem;
    color: #343a40;
}

.ranked-score {
    font-size: 0.9rem;
    font-weight: 700;
    color: #14213D;
}

.ranked-band {
    font-size: 0.78rem;
    color: #6c757d;
    min-width: 62px;
    text-align: right;
}

@media (max-width: 720px) {
    .psc-detail-grid { grid-template-columns: 1fr; }
    .psc-subscale-row { grid-template-columns: 1fr; gap: 6px; }
}
