/* ── P&L Headcount Justification Module ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

.pl-page { font-family: Arial, sans-serif; background: #f8f9fa; min-height: 100vh; color: #1a1a1a; }

/* ── Top Bar ──────────────────────────────────────────────────────────────── */
.pl-topbar {
    position: sticky; top: 0; z-index: 100;
    background: white; border-bottom: 1px solid #dee2e6;
    padding: 10px 20px; display: flex; align-items: center;
    gap: 12px; flex-wrap: wrap;
}
.pl-topbar .pl-scenario-name { font-size: 16px; font-weight: 600; flex: 1; }
.pl-topbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Sticky Summary Row ───────────────────────────────────────────────────── */
.pl-sticky-summary {
    position: sticky; top: 52px; z-index: 90;
    background: #1a2744; color: white;
    display: flex; gap: 0; overflow-x: auto;
}
.pl-sticky-summary .ss-cell {
    flex: 1; min-width: 120px; padding: 10px 14px;
    border-right: 1px solid rgba(255,255,255,0.1);
}
.pl-sticky-summary .ss-cell:last-child { border-right: none; }
.pl-sticky-summary .ss-label { font-size: 10px; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px; }
.pl-sticky-summary .ss-value { font-size: 16px; font-weight: 600; }
.pl-sticky-summary .ss-roi-green { color: #6adf9e; }
.pl-sticky-summary .ss-roi-amber { color: #ffd770; }
.pl-sticky-summary .ss-roi-red   { color: #ff8080; }

/* ── Page Wrap ────────────────────────────────────────────────────────────── */
.pl-wrap { max-width: 1340px; margin: 0 auto; padding: 20px; }

/* ── Stepper ──────────────────────────────────────────────────────────────── */
.pl-stepper {
    display: flex; align-items: center; gap: 0;
    margin-bottom: 28px; padding: 16px 24px;
    background: white; border-radius: 10px; border: 1px solid #dee2e6;
}
.pl-step { display: flex; align-items: center; gap: 10px; flex: 1; }
.pl-step-num {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; flex-shrink: 0;
    background: #e9ecef; color: #6c757d;
}
.pl-step.active .pl-step-num  { background: #007bff; color: white; }
.pl-step.done   .pl-step-num  { background: #28a745; color: white; }
.pl-step-label { font-size: 13px; color: #6c757d; }
.pl-step.active .pl-step-label { color: #007bff; font-weight: 600; }
.pl-step.done   .pl-step-label { color: #28a745; }
.pl-step-connector { flex: 1; height: 2px; background: #dee2e6; margin: 0 12px; min-width: 20px; }
.pl-step-connector.done { background: #28a745; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.pl-card {
    background: white; border-radius: 10px;
    border: 1px solid #dee2e6; margin-bottom: 16px;
    transition: box-shadow 0.2s;
}
.pl-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.pl-card.dragging { opacity: 0.4; border: 2px dashed #007bff; }
.pl-card.drag-over { border: 2px dashed #28a745; }

.pl-card-header {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px; border-bottom: 1px solid #f0f0f0;
    cursor: grab;
}
.pl-card-header:active { cursor: grabbing; }
.pl-drag-handle { color: #ccc; font-size: 16px; user-select: none; }
.pl-dept-name-input {
    font-size: 15px; font-weight: 600; border: none; outline: none;
    flex: 1; background: transparent; color: #1a1a1a;
    padding: 2px 4px; border-radius: 4px;
}
.pl-dept-name-input:focus { background: #f8f9ff; border-bottom: 2px solid #007bff; }
.pl-card-actions { display: flex; gap: 6px; }

.pl-card-body { padding: 18px; }
.pl-card-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin-bottom: 16px; }
@media (max-width: 900px) { .pl-card-cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .pl-card-cols { grid-template-columns: 1fr; } }

.pl-col-label {
    font-size: 11px; font-weight: 700; color: #6c757d;
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px;
}

/* ── Form Fields ──────────────────────────────────────────────────────────── */
.pl-field { margin-bottom: 14px; }
.pl-field label {
    display: flex; align-items: center; gap: 4px;
    font-size: 12px; color: #555; margin-bottom: 4px; font-weight: 500;
}
.pl-field input[type="number"],
.pl-field input[type="text"],
.pl-field select,
.pl-field textarea {
    width: 100%; padding: 8px 10px; border: 1px solid #ccc;
    border-radius: 6px; font-size: 13px; color: #1a1a1a;
    transition: border-color 0.2s;
}
.pl-field input:focus, .pl-field select:focus, .pl-field textarea:focus {
    border-color: #007bff; outline: none; box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}
.pl-field input.field-error { border-color: #dc3545; }
.pl-field .field-error-msg { color: #dc3545; font-size: 11px; margin-top: 3px; display: none; }
.pl-field .field-error-msg.visible { display: block; }
.pl-field textarea { resize: vertical; min-height: 72px; }

/* ROI capacity multiplier badge */
.ss-roi-multiple {
    font-size: 11px; font-weight: 600; color: #155724;
    background: #d4edda; border-radius: 4px;
    padding: 2px 7px; margin-top: 4px; display: inline-block;
    cursor: default; letter-spacing: 0.2px;
}

/* AI narrative generate */
.pl-narrative-ai-row { display: flex; align-items: center; gap: 10px; margin-top: 7px; }
.pl-btn-ai-generate {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 13px; border-radius: 6px; border: none; cursor: pointer;
    font-size: 12px; font-weight: 600; letter-spacing: 0.2px;
    background: linear-gradient(135deg, #6f42c1, #007bff);
    color: white; transition: opacity 0.15s;
}
.pl-btn-ai-generate:hover:not(:disabled) { opacity: 0.88; }
.pl-btn-ai-generate:disabled { opacity: 0.55; cursor: not-allowed; }
.pl-narrative-ai-status { font-size: 12px; color: #6c757d; }
.pl-narrative-ai-status.pl-ai-success { color: #28a745; }
.pl-narrative-ai-status.pl-ai-error   { color: #dc3545; }

/* ── Format hint (live $X,XXX display below number inputs) ───────────────── */
.pl-fmt-hint-wrap {
    display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 5px;
    margin-top: 2px; min-height: 14px;
}
.pl-fmt-hint {
    display: block; font-size: 11px; color: #28a745; font-weight: 600;
    letter-spacing: 0.2px;
}
.pl-field-hint {
    font-size: 10.5px; color: #aaa; font-style: italic; font-weight: 400;
}

/* ── Slider ───────────────────────────────────────────────────────────────── */
.pl-slider-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.pl-slider-wrap input[type="range"] { flex: 1; accent-color: #007bff; min-width: 60px; }
.pl-slider-val {
    font-size: 13px; font-weight: 600; color: #007bff;
    min-width: 38px; text-align: right; white-space: nowrap;
}
.pl-growth-rev {
    font-size: 11px; font-weight: 700; color: #28a745;
    white-space: nowrap; min-width: 72px;
}
.pl-growth-rev-editable { cursor: text; }
.pl-growth-rev-editable:hover { text-decoration: underline dashed; text-underline-offset: 2px; }
.pl-gr-arrow { color: #28a745; }
.pl-rev-edit-prefix {
    font-size: 11px; font-weight: 700; color: #007bff; margin-right: 1px;
}
.pl-rev-edit-input {
    width: 80px; border: none; border-bottom: 2px solid #007bff;
    border-radius: 0; outline: none; padding: 0 2px;
    font-size: 11px; font-weight: 700; color: #1a1a1a;
    background: transparent;
}
.pl-rev-edit-input::-webkit-inner-spin-button,
.pl-rev-edit-input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ── Growth Ladder (mini bar chart below sliders) ─────────────────────────── */
.pl-growth-ladder {
    margin-top: 12px; padding: 10px 10px 8px;
    background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px;
}
.pl-gl-row { display: flex; align-items: flex-end; }
.pl-gl-node { flex: 1; text-align: center; }
.pl-gl-bar-wrap {
    display: flex; align-items: flex-end; justify-content: center;
    height: 60px; margin-bottom: 4px;
}
.pl-gl-bar {
    width: 26px; border-radius: 4px 4px 0 0;
    transition: height 0.25s ease;
}
.pl-gl-bar-base { background: #adb5bd; }
.pl-gl-bar-y1   { background: #20c997; }
.pl-gl-bar-y2   { background: #17a2b8; }
.pl-gl-bar-y3   { background: #007bff; }
.pl-gl-label { font-size: 9px; font-weight: 700; color: #6c757d; text-transform: uppercase; letter-spacing: 0.4px; }
.pl-gl-amt   { font-size: 10px; font-weight: 700; color: #1a1a1a; margin-top: 2px; }
.pl-gl-pct   { font-size: 9px; color: #28a745; font-weight: 600; margin-top: 1px; }
.pl-gl-connector {
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
    flex-shrink: 0; padding: 0 2px; padding-bottom: 30px; gap: 2px;
}
.pl-gl-arrow { font-size: 14px; color: #ced4da; line-height: 1; }
.pl-gl-delta {
    font-size: 10px; font-weight: 700; color: #28a745;
    white-space: nowrap; line-height: 1;
}
.pl-gl-delta-neg { color: #dc3545; }

/* ── Benchmark Dropdown ───────────────────────────────────────────────────── */
.pl-bench-preset-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.pl-bench-preview { font-size: 11px; color: #28a745; font-weight: 600; margin-top: 4px; }
.pl-mode-hint-current {
    margin-top: 6px; padding: 7px 10px;
    background: #fff8ee; border: 1px solid #ffd480; border-radius: 6px;
    font-size: 11px; color: #856404; line-height: 1.5;
}

/* ── Advanced Options Toggle ──────────────────────────────────────────────── */
.pl-advanced-toggle {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: #007bff; cursor: pointer;
    background: none; border: none; padding: 4px 0;
    margin-top: 4px;
}
.pl-advanced-toggle svg { transition: transform 0.2s; }
.pl-advanced-toggle.open svg { transform: rotate(180deg); }
.pl-advanced-body { display: none; margin-top: 12px; padding-top: 12px; border-top: 1px solid #f0f0f0; }
.pl-advanced-body.open { display: block; }

/* ── Results Strip ────────────────────────────────────────────────────────── */
.pl-results-strip {
    display: flex; flex-wrap: wrap; gap: 0;
    background: #f8f9fa; border-top: 1px solid #e9ecef;
    border-radius: 0 0 10px 10px; padding: 0;
    margin: 0 -18px -18px;
}
.pl-results-strip .rs-cell {
    flex: 1; min-width: 100px; padding: 10px 14px;
    border-right: 1px solid #e9ecef;
}
.pl-results-strip .rs-cell:last-child { border-right: none; }
.pl-results-strip .rs-label { font-size: 10px; color: #888; text-transform: uppercase; margin-bottom: 3px; }
.pl-results-strip .rs-value { font-size: 15px; font-weight: 600; color: #1a1a1a; }
.pl-results-strip .rs-hint  { font-size: 10px; color: #aaa; margin-top: 1px; }

/* ── ROI Badge ────────────────────────────────────────────────────────────── */
.pl-roi-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
}
.pl-roi-green { background: #d4edda; color: #155724; }
.pl-roi-amber { background: #fff3cd; color: #856404; }
.pl-roi-red   { background: #f8d7da; color: #721c24; }
.pl-roi-gray  { background: #e9ecef; color: #495057; }

/* ── What-If Mode ─────────────────────────────────────────────────────────── */
.whatif-active .pl-slider-wrap input[type="range"] { accent-color: #fd7e14; }
.whatif-active .pl-card { border-color: #fd7e14; }
.pl-whatif-val {
    font-size: 11px; color: #6c757d; text-decoration: line-through;
    margin-left: 4px;
}
.pl-whatif-new { color: #fd7e14; font-weight: 700; }

/* ── Status Badges ────────────────────────────────────────────────────────── */
.pl-status {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 600; white-space: nowrap;
}
.pl-status-draft     { background: #e9ecef; color: #495057; }
.pl-status-submitted { background: #cce5ff; color: #004085; }
.pl-status-approved  { background: #d4edda; color: #155724; }
.pl-status-rejected  { background: #f8d7da; color: #721c24; }

/* ── Scenario List Table ──────────────────────────────────────────────────── */
.pl-list-wrap { background: white; border-radius: 10px; border: 1px solid #dee2e6; overflow: hidden; }
.pl-list-table { width: 100%; border-collapse: collapse; }
.pl-list-table th {
    padding: 10px 14px; background: #f8f9fa; font-size: 12px;
    font-weight: 600; color: #555; border-bottom: 1px solid #dee2e6;
    text-align: left; white-space: nowrap;
}
.pl-list-table td { padding: 11px 14px; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.pl-list-table tr:last-child td { border-bottom: none; }
.pl-list-table tr:hover td { background: #f9f9f9; }

/* ── Comments Thread ──────────────────────────────────────────────────────── */
.pl-comments { background: white; border-radius: 10px; border: 1px solid #dee2e6; padding: 20px; }
.pl-comment { display: flex; gap: 12px; margin-bottom: 16px; }
.pl-comment-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: #007bff; color: white; display: flex;
    align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.pl-comment-body { flex: 1; }
.pl-comment-meta { font-size: 11px; color: #888; margin-bottom: 4px; }
.pl-comment-meta strong { color: #333; }
.pl-comment-text { font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.pl-comment.system .pl-comment-text {
    background: #f8f9fa; border-left: 3px solid #007bff;
    padding: 8px 12px; border-radius: 0 6px 6px 0;
    font-size: 12px; color: #555;
}
.pl-comment-input-wrap { display: flex; gap: 8px; margin-top: 16px; }
.pl-comment-input-wrap textarea {
    flex: 1; padding: 8px 10px; border: 1px solid #ccc;
    border-radius: 6px; font-size: 13px; resize: none; min-height: 60px;
}
.pl-comment-input-wrap textarea:focus { border-color: #007bff; outline: none; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.pl-btn { padding: 8px 16px; border-radius: 6px; border: none; cursor: pointer; font-size: 13px; font-weight: 500; transition: opacity 0.15s; }
.pl-btn:hover { opacity: 0.85; }
.pl-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.pl-btn-primary  { background: #007bff; color: white; }
.pl-btn-success  { background: #28a745; color: white; }
.pl-btn-danger   { background: #dc3545; color: white; }
.pl-btn-secondary{ background: #6c757d; color: white; }
.pl-btn-outline  { background: white; color: #007bff; border: 1px solid #007bff; }
.pl-btn-warning  { background: #fd7e14; color: white; }
.pl-btn-sm { padding: 5px 10px; font-size: 12px; }
.pl-btn-icon { padding: 5px 8px; background: transparent; border: none; cursor: pointer; color: #6c757d; border-radius: 4px; }
.pl-btn-icon:hover { background: #f0f0f0; color: #dc3545; }

/* ── Empty State ──────────────────────────────────────────────────────────── */
.pl-empty {
    text-align: center; padding: 60px 20px; color: #6c757d;
}
.pl-empty-icon { font-size: 48px; margin-bottom: 12px; }
.pl-empty h3 { font-size: 18px; margin-bottom: 8px; color: #333; }
.pl-empty p  { font-size: 14px; margin-bottom: 20px; }
.pl-empty-hint { font-size: 12px; color: #aaa; margin-bottom: 16px; }

/* ── Onboarding Banner ────────────────────────────────────────────────────── */
.pl-onboarding {
    background: #e8f0fe; border: 1px solid #c5d5fb;
    border-radius: 10px; padding: 16px 20px; margin-bottom: 20px;
    display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap;
}
.pl-onboarding-steps { flex: 1; }
.pl-onboarding-steps h4 { font-size: 14px; margin-bottom: 8px; color: #1a2744; }
.pl-onboarding-step { font-size: 13px; color: #333; margin-bottom: 4px; }
.pl-onboarding-step.done { color: #28a745; text-decoration: line-through; }
.pl-onboarding-dismiss { font-size: 12px; color: #6c757d; cursor: pointer; background: none; border: none; white-space: nowrap; }

/* ── Tooltip ──────────────────────────────────────────────────────────────── */
.pl-tip {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    background: #e9ecef; color: #6c757d; font-size: 10px; font-weight: 700;
    cursor: help; position: relative; flex-shrink: 0;
}
.pl-tip::after {
    content: attr(data-tip);
    position: absolute; bottom: calc(100% + 6px); left: 50%;
    transform: translateX(-50%);
    background: #1a2744; color: white; border-radius: 6px;
    padding: 7px 10px; font-size: 12px; font-weight: 400;
    white-space: normal; min-width: 200px; max-width: 280px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2); z-index: 999;
    pointer-events: none; opacity: 0; transition: opacity 0.15s;
    line-height: 1.5;
}
.pl-tip:hover::after { opacity: 1; }

/* ── Modal ────────────────────────────────────────────────────────────────── */
.pl-modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 500;
    background: rgba(0,0,0,0.45); align-items: center; justify-content: center;
}
.pl-modal-overlay.open { display: flex; }
.pl-modal {
    background: white; border-radius: 12px; padding: 28px;
    max-width: 540px; width: 92%; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}
.pl-modal h3 { margin: 0 0 6px; font-size: 18px; }
.pl-modal .pl-modal-sub { font-size: 13px; color: #6c757d; margin-bottom: 20px; }
.pl-modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ── Setup Form ───────────────────────────────────────────────────────────── */
.pl-setup-wrap { max-width: 560px; margin: 40px auto; }
.pl-setup-card { background: white; border-radius: 12px; border: 1px solid #dee2e6; padding: 36px; }
.pl-setup-card h2 { font-size: 22px; margin: 0 0 4px; }
.pl-setup-card .pl-setup-sub { font-size: 14px; color: #6c757d; margin-bottom: 28px; }
.pl-radio-group { display: flex; gap: 10px; margin-top: 6px; }
.pl-radio-option {
    flex: 1; border: 2px solid #dee2e6; border-radius: 8px;
    padding: 10px 12px; cursor: pointer; text-align: center;
    font-size: 13px; transition: border-color 0.15s;
}
.pl-radio-option:has(input:checked) { border-color: #007bff; background: #f0f7ff; }
.pl-radio-option input { display: none; }

/* ── Summary Table ────────────────────────────────────────────────────────── */
.pl-summary-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pl-summary-table th { background: #003366; color: white; padding: 9px 12px; text-align: left; font-size: 12px; }
.pl-summary-table td { padding: 9px 12px; border-bottom: 1px solid #f0f0f0; }
.pl-summary-table tfoot td { background: #f8f9fa; font-weight: 700; border-top: 2px solid #dee2e6; }

/* ── Chart Container ──────────────────────────────────────────────────────── */
.pl-chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 24px 0; }
@media (max-width: 700px) { .pl-chart-row { grid-template-columns: 1fr; } }
.pl-chart-card { background: white; border-radius: 10px; border: 1px solid #dee2e6; padding: 18px; }
.pl-chart-card h4 { font-size: 14px; margin: 0 0 14px; color: #333; }

/* ── Compare Panel ────────────────────────────────────────────────────────── */
.pl-compare-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pl-compare-table th,
.pl-compare-table td { padding: 8px 12px; border: 1px solid #dee2e6; }
.pl-compare-table th { background: #003366; color: white; }
.pl-compare-table .row-label { background: #f8f9fa; font-weight: 600; color: #333; }

/* ── Report Page ──────────────────────────────────────────────────────────── */
.pl-report-page { font-family: Arial, sans-serif; max-width: 960px; margin: 0 auto; padding: 30px 20px; }
.pl-report-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.pl-report-header h1 { font-size: 24px; margin: 0 0 4px; }
.pl-approval-stamp {
    border: 2px solid #28a745; color: #155724; padding: 12px 20px;
    border-radius: 8px; text-align: center; background: #d4edda;
}
.pl-approval-stamp .stamp-label { font-size: 11px; text-transform: uppercase; font-weight: 700; }
.pl-approval-stamp .stamp-name  { font-size: 16px; font-weight: 700; margin: 4px 0; }
.pl-approval-stamp .stamp-date  { font-size: 12px; }

@media print {
    .pl-topbar, .pl-sticky-summary, .pl-btn, .no-print { display: none !important; }
    .pl-card { box-shadow: none; break-inside: avoid; }
    .pl-report-page { padding: 0; }
    body { background: white; }
}

/* ── Utility ──────────────────────────────────────────────────────────────── */
.pl-section-title { font-size: 15px; font-weight: 700; color: #333; margin: 24px 0 12px; }
.pl-divider { border: none; border-top: 1px solid #dee2e6; margin: 20px 0; }
.pl-text-muted { color: #6c757d; }
.pl-text-success { color: #28a745; }
.pl-text-danger  { color: #dc3545; }
.pl-fw-bold { font-weight: 700; }
.pl-mt-4 { margin-top: 16px; }
.pl-flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }

/* ── Headcount Inline Section (inside pl_scenario.php dept cards) ────────── */
.pl-hcp-inline {
    border-top: 2px solid #e9ecef;
    margin-top: 16px;
}
.pl-hcp-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0 0;
    flex-wrap: wrap;
    font-size: 13px;
}
.pl-hcp-hc-match    { font-size: 11px; color: #28a745; font-weight: 600; }
.pl-hcp-hc-mismatch { font-size: 11px; color: #856404; background: #fff3cd; padding: 2px 8px; border-radius: 4px; font-weight: 600; cursor: help; }
.pl-hcp-inline .hcp-body { padding: 12px 0 4px; }
.pl-hcp-inline .hcp-section-title { font-size: 12px; }
.pl-hcp-inline .hcp-hint { font-size: 11px; margin-bottom: 8px; }

/* ── Headcount Planning Page (pl_headcount.php) ───────────────────────────── */
.hcp-card { margin-bottom: 24px; }
.hcp-card .pl-card-header { cursor: default; }

.hcp-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 20px;
}
@media (max-width: 900px) {
    .hcp-body { grid-template-columns: 1fr; }
}

.hcp-section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #495057;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e9ecef;
}
.hcp-hint {
    font-size: 12px;
    color: #6c757d;
    margin: 0 0 12px;
    line-height: 1.5;
}

/* ── Current HC table ────────────────────────────────────────────────────── */
.hcp-hc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.hcp-hc-table th {
    background: #f8f9fa;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #6c757d;
    padding: 6px 8px;
    border-bottom: 1px solid #dee2e6;
    white-space: nowrap;
}
.hcp-hc-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.hcp-hc-table tfoot td {
    border-bottom: none;
    border-top: 2px solid #dee2e6;
}
.hcp-totals-row td { padding-top: 8px; }

.hcp-type-sel {
    font-size: 12px;
    padding: 3px 6px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    color: #333;
    width: 90px;
}
.hcp-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.hcp-type-revenue { background: #d4edda; color: #155724; }
.hcp-type-support { background: #fff3cd; color: #856404; }

.hcp-label-inp {
    font-size: 12px;
    padding: 3px 6px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    width: 100%;
    min-width: 100px;
    color: #333;
}
.hcp-label-inp:focus { outline: none; border-color: #007bff; box-shadow: 0 0 0 2px rgba(0,123,255,.15); }

.hcp-hc-inp {
    width: 56px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    padding: 3px 4px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}
.hcp-hc-inp:focus { outline: none; border-color: #007bff; box-shadow: 0 0 0 2px rgba(0,123,255,.15); }

.hcp-rev-supported { font-weight: 600; color: #28a745; font-size: 12px; }
.hcp-overhead-label { font-size: 11px; color: #aaa; font-style: italic; }

/* Enablement row styles */
.hcp-enablement-cell { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.hcp-enbl-inline { display: flex; align-items: center; gap: 4px; }
.hcp-cpct-inp {
    width: 44px; padding: 2px 4px; font-size: 12px; border: 1px solid #ced4da;
    border-radius: 4px; text-align: right;
}
.hcp-cscope-sel { font-size: 11px; padding: 2px 4px; border: 1px solid #ced4da; border-radius: 4px; }
.hcp-protected-amt { font-size: 11px; color: #4a90d9; font-weight: 600; }
.hcp-type-badge.hcp-type-enablement { background: #e8f0fe; color: #1a5cde; }

/* HC plan table: Revenue Protected and At Risk rows */
.hcp-revprot-row td { background: #f0f6ff; }
.hcp-yr-revprot { color: #4a90d9 !important; font-weight: 600; }
.hcp-atrisk-row td { background: #fff5f5; }
.hcp-atrisk-label { color: #c0392b !important; font-weight: 600; }
.hcp-yr-atrisk { color: #c0392b !important; font-weight: 700; }

.hcp-del-row { color: #dc3545 !important; font-size: 11px !important; padding: 2px 5px !important; }
.hcp-del-row:hover { background: #ffe8e8 !important; }

.hcp-add-row { margin-top: 8px; }
.hcp-rpe-display { color: #007bff; }

/* Model Assumptions row (ramp_pct + max_cap) */
.hcp-model-assumptions {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
    background: #f0f4ff; border: 1px solid #d0d9f0; border-radius: 6px;
    padding: 7px 12px; margin-bottom: 10px; font-size: 12px;
}
.hcp-ma-label { font-weight: 600; color: #4a6085; white-space: nowrap; }
.hcp-ma-item  { display: flex; align-items: center; gap: 4px; color: #555; cursor: help; white-space: nowrap; }
.hcp-ma-inp   { width: 44px; padding: 2px 4px; font-size: 12px; border: 1px solid #b0bdd0; border-radius: 4px; text-align: right; }
.hcp-ma-inp-wide { width: 80px; }
.hcp-ma-cap-wrap { display: flex; flex-direction: column; gap: 1px; }
.hcp-ma-fmt-hint { font-size: 10px; color: #28a745; font-weight: 600; min-height: 13px; line-height: 1.2; }
.hcp-ma-eff   { color: #003366; font-size: 11px; margin-left: auto; white-space: nowrap; }

/* ── Year-plan table ─────────────────────────────────────────────────────── */
.hcp-plan-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.hcp-plan-table th {
    background: #f8f9fa;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #6c757d;
    padding: 6px 8px;
    border-bottom: 1px solid #dee2e6;
    white-space: nowrap;
}
.hcp-plan-table td {
    padding: 7px 8px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.hcp-row-label {
    font-size: 12px;
    color: #495057;
    white-space: nowrap;
    min-width: 130px;
    padding-right: 12px !important;
}
.hcp-proj-row td { background: #f0f5ff; }
.hcp-proj-rev-cell { font-size: 13px; }
.hcp-suggest-row td { background: #fafafa; }
.hcp-suggest-val { font-size: 12px; color: #6c757d; line-height: 1.5; }
.hcp-suggest-min { font-weight: 600; color: #495057; }
.hcp-suggest-frac { font-size: 11px; color: #868e96; }
.hcp-suggest-lbl { font-weight: 400; color: #adb5bd; }
.hcp-total-row td { border-top: 2px solid #dee2e6; border-bottom: none; }
.hcp-cost-row td { background: #fafafa; font-size: 12px; color: #6c757d; }

/* Spinner controls */
.hcp-spinner {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 2px 4px;
}
.hcp-spin-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 10px;
    color: #007bff;
    padding: 2px 4px;
    border-radius: 3px;
    line-height: 1;
}
.hcp-spin-btn:hover { background: #e7f3ff; }
.hcp-spin-val {
    min-width: 24px;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    color: #1a1a1a;
}

/* Impact badges */
.hcp-impact-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 5px 6px;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.3;
}
.hcp-impact-purple { background: #e8d5f5; color: #5a1a8a; }
.hcp-impact-green  { background: #d4edda; color: #155724; }
.hcp-impact-amber  { background: #fff3cd; color: #856404; }
.hcp-impact-red    { background: #f8d7da; color: #721c24; }
.hcp-impact-icon    { font-size: 13px; font-weight: 700; }
.hcp-impact-msg     { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.hcp-impact-bullets { display: flex; flex-direction: column; gap: 1px; font-size: 10px; font-weight: 600; width: 100%; text-align: left; padding: 1px 0; }
.hcp-impact-vs      { font-size: 9px; opacity: 0.75; }
.hcp-net-positive   { color: #155724 !important; }
.hcp-net-negative   { color: #721c24 !important; }
.hcp-revcap-row td  { background: #f0fff4; }
.hcp-net-row td     { border-top: 1px solid #dee2e6; }

/* Save bar */
.hcp-save-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 10px 20px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    border-radius: 0 0 10px 10px;
}
.hcp-save-status {
    font-size: 12px;
    color: #6c757d;
    transition: opacity 0.3s;
}
.hcp-save-status.hcp-saved { color: #28a745; }
.hcp-save-status.hcp-error { color: #dc3545; }
