/* === Reset & Base === */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #faf9f7; color: #2c2c2c; line-height: 1.5; }

/* === Login === */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: white; border-radius: 16px; padding: 40px; width: 100%; max-width: 380px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.login-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.login-subtitle { font-size: 14px; color: #888; margin-bottom: 24px; }
.login-card label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; margin-top: 16px; }
.login-card input { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; }
.login-card input:focus { outline: none; border-color: #2c2c2c; }
.error-msg { color: #c0392b; font-size: 13px; margin-top: 12px; }
.btn-primary { width: 100%; padding: 12px; margin-top: 20px; background: #2c2c2c; color: white; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-primary:hover { background: #444; }

/* === Dashboard Layout === */
.dashboard { padding: 24px; max-width: 1400px; margin: 0 auto; }
.header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.header h1 { font-size: 22px; font-weight: 700; }
.header .subtitle { font-size: 14px; color: #888; margin-top: 2px; }
.header-actions { display: flex; gap: 8px; }
.btn-add { padding: 10px 20px; border: 2px solid #2c2c2c; border-radius: 8px; background: white; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; color: #2c2c2c; }
.btn-add:hover { background: #f5f5f5; }
.btn-logout { padding: 10px 16px; border: 1px solid #ddd; border-radius: 8px; background: white; font-size: 13px; cursor: pointer; color: #888; }

/* === Ratios Strip === */
.section-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: #888; margin-bottom: 8px; }
.ratios { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.ratio-card { background: white; border-radius: 12px; padding: 16px; min-width: 0; }
.ratio-card .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: #888; margin-bottom: 4px; }
.ratio-card .value { font-size: 28px; font-weight: 700; }
.ratio-card .bar { height: 4px; border-radius: 2px; margin: 8px 0 6px; background: #eee; }
.ratio-card .bar-fill { height: 100%; border-radius: 2px; }
.ratio-card .detail { font-size: 12px; color: #888; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ratio-card .detail.warning { color: #d4760a; }
.ratio-card .detail.good { color: #2a9d5c; }

.color-warning { color: #d4760a; }
.color-healthy { color: #2a7a9d; }
.color-blue { color: #3a7abd; }
.color-green { color: #2a9d5c; }
.bg-warning { background: #d4760a; }
.bg-healthy { background: #2a7a9d; }
.bg-blue { background: #3a7abd; }
.bg-green { background: #2a9d5c; }

/* === Warning Banner === */
.fed-warning-banner { background: #fef3e2; border-radius: 10px; padding: 14px 18px; margin-bottom: 20px; font-size: 13px; color: #8a5a00; line-height: 1.5; }

/* === Main Layout === */
.main { display: grid; grid-template-columns: 280px 1fr; gap: 24px; }

/* === Enrolled Roster Sidebar === */
.roster { background: white; border-radius: 12px; padding: 20px; height: fit-content; }
.roster h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; font-size: 11px; color: #666; }
.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; }
.legend-dot.dot-a { background: #2d5a3d; }
.legend-dot.dot-b { background: #2a4a7a; }
.legend-dot.dot-c { background: #a8d5b8; }
.legend-dot.dot-d { background: #e8c8a0; }
.legend-dot.dot-open { border: 2px dashed #ccc; background: transparent; }

.room { margin-bottom: 18px; }
.room-header { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 6px; }
.status-full { color: #d4760a; font-weight: 700; }
.status-open { color: #2a9d5c; font-weight: 700; }
.seat-dots { display: flex; gap: 4px; margin-bottom: 6px; flex-wrap: wrap; }
.seat-dot { width: 28px; height: 28px; border-radius: 5px; }
.seat-dot.pt { width: 20px; height: 20px; border-radius: 4px; align-self: center; }
.seat-dot.dot-a { background: #2d5a3d; }
.seat-dot.dot-b { background: #2a4a7a; }
.seat-dot.dot-c { background: #a8d5b8; }
.seat-dot.dot-d { background: #e8c8a0; }
.seat-dot.dot-open { border: 2px dashed #ccc; background: transparent; }
.roster-children { margin: 8px 0; }
.roster-child { display: flex; align-items: center; gap: 6px; padding: 3px 0; font-size: 12px; }
.roster-child-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.roster-child-name { flex: 1; color: #2c2c2c; }
.roster-child-age { color: #888; font-size: 11px; }
.room-stats { font-size: 11px; color: #888; line-height: 1.6; }

/* === Pipeline === */
.pipeline-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.pipeline-row { background: white; border-radius: 12px; padding: 18px 20px; margin-bottom: 12px; display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: start; }
.pipeline-row.recommended { border: 2px solid #d4a04a; }
.pipeline-row.ineligible { opacity: 0.6; }
.rank { font-size: 20px; font-weight: 700; color: #bbb; padding-top: 2px; }
.rank.active { color: #2c2c2c; }
.child-name { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.child-meta { font-size: 13px; color: #888; margin-top: 2px; }
.child-contact { font-size: 12px; color: #aaa; margin-top: 2px; }
.status-tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.status-offered { background: #fff3cd; color: #856404; }
.status-enrolled { background: #d4edda; color: #155724; }
.status-declined { background: #f0f0f0; color: #888; text-decoration: line-through; }

/* === Badges === */
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.badge { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.badge-recommend { background: #e8f5e4; color: #2a7a3a; }
.badge-tier-a { background: #2d5a3d; color: white; }
.badge-tier-b { background: #2a4a7a; color: white; }
.badge-tier-c { background: #c8e6d0; color: #2a5a3a; }
.badge-tier-d { background: #f5e0c8; color: #8a5a2a; }
.badge-sibling { background: #fdecd0; color: #8a6a2a; }
.badge-age-fit { background: #e8f0e8; color: #4a7a4a; border: 1px solid #c0d8c0; }
.badge-fed-warn { background: #fde8e8; color: #9a3a3a; }
.badge-check-sched { background: #f0f0f0; color: #666; border: 1px solid #ddd; }
.badge-ineligible { background: #fde8e8; color: #9a3a3a; }
.badge-offered-status { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }
.badge-declined-status { background: #f0f0f0; color: #888; border: 1px solid #ddd; }

/* === Row Actions === */
.row-actions { margin-top: 12px; display: flex; gap: 8px; }
.btn { padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; }
.btn-offered { background: #2c2c2c; color: white; }
.btn-offered:hover { background: #444; }
.btn-enrolled { background: #2a7a3a; color: white; }
.btn-enrolled:hover { background: #1e5a2a; }
.btn-declined { background: white; color: #c0392b; border: 1px solid #c0392b; }
.btn-declined:hover { background: #fde8e8; }
.btn-details { background: #f0f0f0; color: #2c2c2c; }
.btn-details:hover { background: #e0e0e0; }

/* === Enroll Modal (classroom picker) === */
.enroll-modal-body { padding: 16px 0; }
.enroll-modal-body h3 { margin-bottom: 12px; font-size: 16px; }
.enroll-modal-body p { font-size: 14px; color: #888; margin-bottom: 16px; }
.classroom-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.classroom-option { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 2px solid #eee; border-radius: 10px; cursor: pointer; transition: border-color 0.15s; }
.classroom-option:hover { border-color: #2a7a3a; }
.classroom-option.selected { border-color: #2a7a3a; background: #f0f8f0; }
.classroom-option input[type="radio"] { accent-color: #2a7a3a; }
.classroom-option-label { font-weight: 600; font-size: 14px; }
.classroom-option-detail { font-size: 12px; color: #888; }
.enroll-actions { display: flex; gap: 8px; }
.btn-confirm-enroll { background: #2a7a3a; color: white; padding: 10px 24px; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-confirm-enroll:hover { background: #1e5a2a; }
.btn-confirm-enroll:disabled { background: #ccc; cursor: not-allowed; }
.btn-cancel-enroll { background: #f0f0f0; color: #2c2c2c; padding: 10px 24px; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-cancel-enroll:hover { background: #e0e0e0; }

/* === Right Column (impact indicators) === */
.row-right { text-align: right; padding-top: 2px; white-space: nowrap; }
.impact { font-size: 12px; line-height: 1.6; }
.impact-up { color: #2a9d5c; }
.impact-down { color: #c0392b; }
.impact-neutral { color: #bbb; }
.days { font-size: 13px; color: #888; margin-top: 4px; }

/* === Family Detail Modal === */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); z-index: 100; justify-content: center; align-items: flex-start; padding-top: 60px; }
.modal-overlay.active { display: flex; }
.modal { background: white; border-radius: 16px; width: 100%; max-width: 640px; max-height: 80vh; overflow-y: auto; padding: 32px; box-shadow: 0 8px 32px rgba(0,0,0,0.15); }
.modal h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.modal .modal-subtitle { font-size: 14px; color: #888; margin-bottom: 20px; }
.modal-close { float: right; background: none; border: none; font-size: 24px; cursor: pointer; color: #888; }
.modal-section { margin-bottom: 20px; }
.modal-section h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #888; margin-bottom: 8px; }
.modal-field { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.modal-field .field-label { color: #888; }
.modal-field .field-value { font-weight: 500; }
.badge-image { max-width: 200px; border-radius: 8px; margin-top: 8px; }
.notes-textarea { width: 100%; min-height: 80px; padding: 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; font-family: inherit; resize: vertical; }
.btn-save-notes { margin-top: 8px; }

/* === Status Dropdown === */
.status-select { padding: 6px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; font-weight: 500; }

/* === Loading === */
.loading { text-align: center; padding: 60px; color: #888; font-size: 16px; }

/* === Stream A: Pipeline Filters === */
.pipeline-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; background: white; border-radius: 12px; padding: 14px 18px; margin-bottom: 14px; }
.filter-group { display: flex; align-items: center; gap: 6px; }
.filter-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: #888; font-weight: 600; }
.filter-input { padding: 6px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; font-family: inherit; background: white; }
.filter-input:focus { outline: none; border-color: #2c2c2c; }
.filter-input-num { width: 64px; }
.filter-dash { color: #888; }
.filter-clear-btn { margin-left: auto; padding: 6px 14px; border: 1px solid #ddd; border-radius: 6px; background: white; font-size: 13px; cursor: pointer; color: #666; }
.filter-clear-btn:hover { background: #f5f5f5; color: #2c2c2c; }
.filter-count { font-size: 12px; color: #888; }
select.filter-input[multiple] { min-width: 130px; height: 30px; }
/* === /Stream A === */

/* === Classroom Detail (Stream B) === */
.room-clickable { cursor: pointer; transition: background 0.15s; padding: 6px; border-radius: 6px; margin-left: -6px; margin-right: -6px; }
.room-clickable:hover { background: #f5f5f5; }
.room-age-range { display: flex; gap: 6px; margin: 4px 0 6px; }
.age-pill { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: #f0f0f0; color: #555; }

.day-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.day-cell { padding: 12px 6px; border-radius: 8px; text-align: center; border: 1px solid #eee; }
.day-cell-letter { font-size: 14px; font-weight: 700; color: #2c2c2c; }
.day-cell-count { font-size: 13px; margin-top: 4px; }
.day-cell-open { font-size: 11px; color: #666; margin-top: 2px; }
.day-cell-open .day-cell-open { color: #2a9d5c; }
.day-cell-full { background: #fde8e8; border-color: #f5c0c0; }
.day-cell-tight { background: #fff3cd; border-color: #ffe08a; }
.day-cell-open { background: #e8f5e4; border-color: #c0e0b8; }

.age-range-row { display: flex; gap: 8px; }
.age-range-pill { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 12px; background: #f0f0f0; color: #444; }

.classroom-detail-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.classroom-detail-table th { text-align: left; padding: 6px 8px; border-bottom: 2px solid #eee; color: #888; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; }
.classroom-detail-table td { padding: 6px 8px; border-bottom: 1px solid #f5f5f5; }
/* === End Classroom Detail (Stream B) === */

/* === Editable Detail Modal (Stream C) === */
.modal-edit-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.modal-edit-field .field-label { font-size: 12px; color: #888; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.modal-input { width: 100%; padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; font-family: inherit; background: white; }
.modal-input:focus { outline: none; border-color: #2c2c2c; }
.modal-textarea { min-height: 80px; resize: vertical; }
.modal-field-note { font-size: 11px; color: #aaa; font-style: italic; }
.modal-warning { background: #fff3cd; border: 1px solid #ffe08a; color: #856404; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.modal-save-bar { position: sticky; bottom: 0; background: white; padding: 14px 0 4px; margin-top: 16px; border-top: 1px solid #eee; display: flex; align-items: center; gap: 12px; }
.modal-dirty-count { font-size: 13px; color: #888; flex: 1; }
.modal-edit-field.checkbox-field { flex-direction: row; align-items: center; gap: 8px; margin-bottom: 4px; }
.modal-edit-field.checkbox-field .field-label { text-transform: none; letter-spacing: 0; font-size: 13px; color: #2c2c2c; font-weight: 500; cursor: pointer; }
.modal-checkbox { width: 16px; height: 16px; accent-color: #2a7a3a; cursor: pointer; }
/* === End Editable Detail Modal (Stream C) === */

/* === Global Error Banner === */
.dashboard-error-banner {
  position: sticky;
  top: 0;
  z-index: 200;
  background: #fde8e8;
  color: #9a3a3a;
  border-bottom: 2px solid #c0392b;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
}
.dashboard-error-banner[hidden] { display: none; }
.dashboard-error-banner #dashboard-error-message { flex: 1; }
.dashboard-error-dismiss {
  background: none;
  border: none;
  font-size: 22px;
  color: #9a3a3a;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
}

/* === Pipeline Age-Group Tabs === */
.pipeline-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.pipeline-tab {
  padding: 8px 18px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pipeline-tab:hover { background: #f5f5f5; color: #2c2c2c; }
.pipeline-tab.active {
  background: #2c2c2c;
  color: white;
  border-color: #2c2c2c;
}

.modal-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 4px 0;
}
.modal-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 400;
}
select.modal-input {
  background-color: #fff;
  cursor: pointer;
}
