/* ── captain-heatmap.css ───────────────────────────────────────*/

/* ── CAPTAIN HEATMAP VIEW ───────────────────────────────────────────────── */

.hm-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 8px;
  column-gap: 18px;
  margin-bottom: 12px;
}
.hm-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hm-filter-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.hm-filter-group #hm-duration-pill {
  width: 210px;
}
.hm-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
/* Squad/Side/Location/View pill groups — on desktop this is transparent to
   layout (display: contents keeps .hm-controls' own flex-wrap in charge);
   on small screens it becomes a single scrollable row instead of wrapping. */
.hm-filter-toolbar { display: contents; }
@media (max-width: 767px) {
  .hm-filter-toolbar {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    gap: 8px 18px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .hm-filter-toolbar::-webkit-scrollbar { display: none; }
  .hm-filter-toolbar .hm-filter-group { flex-shrink: 0; }
  .hm-filter-toolbar .hm-pill-row { flex-wrap: nowrap; }
}
.hm-pill {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  border: 0.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s;
}
.hm-pill:hover { background: var(--navy-light); }
.hm-pill.active { background: var(--nav-navy); color: #fff; border-color: var(--nav-navy); }

/* Name search — live filter over window.ROSTER, opens the read-only individual view */
.hm-search-group { position: relative; }
.hm-search-wrap { position: relative; }
.hm-search-input {
  width: 190px;
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-family: inherit;
  border: 0.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  outline: none;
}
.hm-search-input:focus { border-color: var(--navy-mid); }
.hm-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  width: 260px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}
.hm-search-results.open { display: block; }
.hm-search-result {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
}
.hm-search-result:hover { background: var(--navy-light); }
.hm-search-result-name { flex: 1; color: var(--text); font-weight: 500; }
.hm-search-result-tag {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-tertiary);
  text-transform: uppercase;
}
.hm-search-empty { padding: 10px 12px; font-size: 12px; color: var(--text-tertiary); font-style: italic; }

/* Individual read-only view — swapped in over the grid when a search result is picked */
.hm-individual-loading { font-size: 13px; color: var(--text-tertiary); padding: 20px 0; }
.hm-individual-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.hm-individual-name {
  font-family: 'DM Serif Display', serif;
  font-size: 18px;
  font-weight: 400;
  color: var(--text);
}

.hm-grid-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.hm-grid {
  display: grid;
  grid-template-columns: 56px repeat(7, minmax(74px, 1fr));
  gap: 4px;
  min-width: 640px;
}
.hm-colhead {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  text-align: center;
  padding: 4px 2px;
}
.hm-rowlabel {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 4px;
  font-variant-numeric: tabular-nums;
}
.hm-cell {
  position: relative;
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: 6px;
  padding: 6px 4px;
  text-align: center;
  cursor: pointer;
  min-height: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: background 0.1s;
}
.hm-cell-icons {
  position: absolute;
  top: 2px;
  right: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  line-height: 1;
}
.hm-cell-icon { font-size: 14px; }
@media (max-width: 768px) {
  .hm-cell-icons { display: none; }
}
.hm-cell:hover:not(.hm-cell--closed) { background: var(--navy-light); }
.hm-cell--free-1 { background: #dcfce7; }
.hm-cell--free-1:hover { background: #bbf7d0; }
.hm-cell--free-2 { background: #bbf7d0; }
.hm-cell--free-2:hover { background: #86efac; }
.hm-cell--free-3 { background: #86efac; }
.hm-cell--free-3:hover { background: #4ade80; }
[data-theme="dark"] .hm-cell--free-1 { background: rgba(22,163,74,0.15); }
[data-theme="dark"] .hm-cell--free-1:hover { background: rgba(22,163,74,0.22); }
[data-theme="dark"] .hm-cell--free-2 { background: rgba(22,163,74,0.28); }
[data-theme="dark"] .hm-cell--free-2:hover { background: rgba(22,163,74,0.38); }
[data-theme="dark"] .hm-cell--free-3 { background: rgba(22,163,74,0.45); }
[data-theme="dark"] .hm-cell--free-3:hover { background: rgba(22,163,74,0.58); }
.hm-cell--closed { cursor: default; }
.hm-cell-reason {
  font-size: 9px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 2px;
}
.hm-cell-reason:hover { color: var(--text-secondary); }
.hm-cell-count { font-size: 15px; font-weight: 700; color: var(--text); }
.hm-cell--free .hm-cell-count { color: #166534; }
[data-theme="dark"] .hm-cell--free .hm-cell-count { color: #86efac; }
.hm-cell-partial {
  font-size: 9px;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  border-radius: 8px;
  padding: 1px 6px;
}
[data-theme="dark"] .hm-cell-partial { color: #fdba74; background: rgba(217,119,6,0.22); }
/* Names panel (reuses .roster-panel slide-out chrome) */

/* Fully free / Partially free / Coaches / Coxes — each gets a distinct tinted
   header and a divider from the next, so the four groups read as separate
   blocks rather than one continuous list. */
.hm-panel-section { padding-bottom: 6px; }
.hm-panel-section + .hm-panel-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.hm-panel-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 5px 10px;
  border-radius: 6px;
  margin: 0 0 8px;
}
.hm-panel-section--free    .hm-panel-section-title { background: #dcfce7; color: #166534; }
.hm-panel-section--partial .hm-panel-section-title { background: #fef3c7; color: #92400e; }
.hm-panel-section--coach   .hm-panel-section-title { background: #dbeafe; color: #1e40af; }
.hm-panel-section--cox     .hm-panel-section-title { background: #ede9fe; color: #5b21b6; }
[data-theme="dark"] .hm-panel-section--free    .hm-panel-section-title { background: rgba(22,163,74,0.2); color: #86efac; }
[data-theme="dark"] .hm-panel-section--partial .hm-panel-section-title { background: rgba(217,119,6,0.2); color: #fdba74; }
[data-theme="dark"] .hm-panel-section--coach   .hm-panel-section-title { background: rgba(59,130,246,0.2); color: #93c5fd; }
[data-theme="dark"] .hm-panel-section--cox     .hm-panel-section-title { background: rgba(124,58,237,0.2); color: #c4b5fd; }
.hm-panel-empty {
  font-size: 13px;
  color: var(--text-tertiary);
  padding: 12px 0;
}
/* Wraps a row + its expandable member_preferences detail (.cpk-row-detail) —
   the divider moved here (off .hm-row) so it sits below the detail panel
   instead of between the row and its own expand. */
.hm-row-wrap { border-bottom: 0.5px solid var(--border); }
.hm-row-wrap:last-child { border-bottom: none; }
.hm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  flex-wrap: wrap;
  cursor: pointer;
}
.hm-row--partial { opacity: 0.65; }
.hm-row-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  min-width: 0;
}
.hm-row-outings { font-size: 11px; color: var(--text-tertiary); flex-shrink: 0; }
.hm-row-exit { font-size: 11px; color: #92400e; flex-shrink: 0; }
.hm-row-note {
  flex-basis: 100%;
  font-size: 11px;
  color: var(--text-tertiary);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hm-row-day-note {
  flex-basis: 100%;
  font-size: 11px;
  color: #92400e;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hm-side-both { background: #f3f4f6; color: #6b7280; }
[data-theme="dark"] .hm-side-both { background: rgba(255,255,255,0.08); color: var(--text-secondary); }
.hm-row-squad {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 20px;
  flex-shrink: 0;
  white-space: nowrap;
}

