/*! © 2026 Cyber Affinity LLC. All rights reserved. Use is subject to https://www.cyber-affinity.com/terms — copying or redistributing this code is not permitted. */
/* Team Capacity Planner — tool-specific styles (shared classes live in /styles.css) */
.cp-stats { margin-top: 12px; }
.cp-stats .stat small, .cp-was { font-size: 12px; color: var(--muted); }
.cp-stats:empty { display: none; }

/* What-if banner */
.cp-whatif { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; border: 1px solid rgba(253, 224, 71, 0.45); background: rgba(253, 224, 71, 0.08); border-radius: var(--radius); padding: 12px 16px; }
.cp-whatif strong { color: #fde047; }
.cp-whatif-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Settings row */
.cp-settings { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.cp-settings > label { flex: 0 1 200px; min-width: 0; }
.cp-settings-btns { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding-bottom: 6px; }
.cp-copy { align-self: center; }

/* Grid */
.cp-table { border-collapse: collapse; font-size: 14px; width: 100%; }
.cp-table th, .cp-table td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: center; vertical-align: middle; }
.cp-table thead th { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.cp-grid { min-width: 720px; }
.cp-totals { min-width: 640px; }
.cp-name-col { text-align: left !important; min-width: 150px; max-width: 220px; position: sticky; left: 0; background: var(--bg); z-index: 1; }
.cp-table tbody th.cp-name-col { font-weight: 600; overflow-wrap: anywhere; }
.cp-wk { min-width: 76px; }
.cp-wk-of { display: block; font-size: 11px; font-weight: 400; }
.cp-link { font: inherit; font-weight: 600; color: var(--text); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; overflow-wrap: anywhere; }
.cp-link:hover { color: var(--accent); text-decoration-color: var(--accent); }
.cp-sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.cp-cell { line-height: 1.25; }
.cp-cell > span { display: block; }
.cp-pct { font-weight: 800; font-size: 15px; }
.cp-hrs { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cp-status { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
.cp-offd { font-size: 11px; color: var(--accent-2); }
.cp-cell .cp-was { font-style: italic; }
.cp-red { background: rgba(248, 113, 113, 0.18); }
.cp-red .cp-status, .cp-red .cp-pct { color: #fca5a5; }
.cp-yellow { background: rgba(253, 224, 71, 0.12); }
.cp-yellow .cp-status, .cp-yellow .cp-pct { color: #fde047; }
.cp-green { background: rgba(52, 211, 153, 0.08); }
.cp-green .cp-status { color: #6ee7b7; }
.cp-gray { background: rgba(159, 179, 200, 0.06); }
.cp-gray .cp-status { color: var(--muted); }
.cp-off.cp-cell, td.cp-off { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(159, 179, 200, 0.08) 6px 12px); }
td.cp-off .cp-status { color: var(--muted); }
.cp-sub-row th, .cp-sub-row td { border-bottom-style: dashed; }
.cp-sub-row th.cp-name-col { font-weight: 400; padding-left: 20px; font-size: 13px; }
.cp-bd { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cp-strong { color: var(--text); font-weight: 700; }
.cp-total-row th, .cp-total-row td { border-top: 2px solid var(--line); }
.cp-proj { display: inline-flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.cp-pri { font-size: 11px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; }
.cp-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 4px; flex: none; }

.cp-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
.cp-legend li { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); margin: 0; }
.cp-key { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); display: inline-block; }
.cp-key.cp-red { background: rgba(248, 113, 113, 0.5); }
.cp-key.cp-yellow { background: rgba(253, 224, 71, 0.45); }
.cp-key.cp-green { background: rgba(52, 211, 153, 0.35); }
.cp-key.cp-gray { background: rgba(159, 179, 200, 0.2); }
.cp-key.cp-off { background: repeating-linear-gradient(135deg, transparent 0 3px, rgba(159, 179, 200, 0.35) 3px 6px); }

.cp-conflicts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cp-conflicts li { margin: 0; }
.cp-conf-text { color: var(--text); flex: 1 1 260px; min-width: 0; }
.cp-empty .out-actions { margin-top: 4px; }

/* Editing cards */
.cp-person-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr) 120px 110px auto; gap: 10px; align-items: end; }
.cp-project-grid { display: grid; grid-template-columns: minmax(0, 2fr) 120px 160px 160px 150px auto; gap: 10px; align-items: end; }
.cp-alloc-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) 90px 170px 160px 160px auto; gap: 10px; align-items: end; }
@media (max-width: 1000px) {
  .cp-person-grid { grid-template-columns: 1fr 1fr; }
  .cp-project-grid, .cp-alloc-grid { grid-template-columns: 1fr 1fr; }
  .cp-person-grid > label:first-child, .cp-project-grid > label:first-child { grid-column: 1 / -1; }
  .cw-right { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 420px) {
  .cp-person-grid, .cp-project-grid, .cp-alloc-grid { grid-template-columns: minmax(0, 1fr); }
}
.cp-color { display: flex; gap: 8px; align-items: center; }
.cp-color select { min-width: 0; }
.cp-danger { color: #fca5a5; }
.cp-danger:hover { border-color: #fca5a5; }
.cp-warn { color: #fde047; }
.cp-timeoff { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 8px; justify-items: start; }
.cp-timeoff h3 { font-size: 14px; margin: 0; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.cp-to-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; width: 100%; }
.cp-to-row { display: grid; grid-template-columns: 170px 170px minmax(0, 1fr) auto; gap: 8px; align-items: end; margin: 0; }
@media (max-width: 700px) { .cp-to-row { grid-template-columns: 1fr 1fr auto; } .cp-to-row > label:nth-child(3) { grid-column: 1 / 3; grid-row: 2; } .cp-to-row > .rr-x { grid-column: 3; grid-row: 1; } }
.cp-to-row input, .cp-person-grid input, .cp-project-grid input, .cp-project-grid select, .cp-alloc-grid input, .cp-alloc-grid select { padding: 8px 10px; font-size: 14px; min-width: 0; }
.cp-changed { border-color: rgba(253, 224, 71, 0.5); }
.cp-alloc-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cp-effect { flex: 1 1 240px; min-width: 0; }
.cp-shift { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-shift .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.cp-alloc-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.cp-alloc-tools > label { flex: 0 1 240px; min-width: 0; }
.cp-mini .cp-grid { min-width: 560px; }
.cp-offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }

/* Printing: only the generated report is printed — never the editing UI. */
#cp-print { display: none; }
@media print {
  body.cp-printing > *:not(#cp-print) { display: none !important; }
  body.cp-printing #cp-print { display: block; width: 100%; max-width: 100%; overflow: visible; }
  #cp-print, #cp-print * { color: #111 !important; box-shadow: none !important; }
  .cp-doc { display: grid; gap: 12px; font-size: 10pt; }
  .cp-doc h2 { font-size: 18pt; margin: 0; }
  .cp-doc h3 { font-size: 12.5pt; margin: 10px 0 6px; border-bottom: 1px solid #bbb; padding-bottom: 2px; break-after: avoid; }
  .cp-doc p { margin: 2px 0; }
  .cp-doc-head p { color: #444 !important; }
  .cp-doc-note { font-weight: 700; }
  .cp-doc-stats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
  .cp-doc ul li { margin: 2px 0; overflow-wrap: anywhere; }
  .cp-doc-table { width: 100% !important; min-width: 0 !important; table-layout: fixed !important; border-collapse: collapse; margin: 0 0 10px; font-size: 8.5pt; }
  .cp-doc-table col.cp-doc-namecol { width: 22%; }
  .cp-doc-table th, .cp-doc-table td { border: 1px solid #999 !important; padding: 3px 4px !important; font-size: 8.5pt !important; text-align: center; vertical-align: top; overflow-wrap: anywhere; white-space: normal !important; }
  .cp-doc-table thead th { background: #eee !important; }
  .cp-doc-table tbody th { text-align: left; font-weight: 600; background: transparent !important; }
  .cp-doc-table tr { break-inside: avoid; }
  .cp-doc-table td > * { display: block; }
  .cp-doc-name { display: block; }
  .cp-doc-role, .cp-doc-h { display: block; font-weight: 400; font-size: 7.5pt; color: #444 !important; }
  .cp-doc-red { background: #fde2e2 !important; }
  .cp-doc-yellow { background: #fef9c3 !important; }
  .cp-doc-red, .cp-doc-yellow { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cp-doc-red strong { text-decoration: underline; }
  .cp-doc-legend { font-size: 8.5pt; color: #444 !important; }
}
