html, body {
  height: 100%;
  margin: 0;
}

/* ── Top bar ─────────────────────────────────────────────── */
#top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: stretch;
  background: #EEEEF0;
  border-bottom: 2px solid #072332;
  font-family: Arial, sans-serif;
  font-size: 13px;
  min-height: 56px;
}

#map {
  position: fixed;
  top: 56px; left: 0; right: 0; bottom: 0;
  width: 100vw;
  height: calc(100vh - 56px);
}

.leaflet-container {
  font-family: Arial, sans-serif;
}

.tb-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-right: 1px solid #B9C1C6;
  position: relative;
}

.tb-section:last-child {
  border-right: none;
}

.tb-label {
  font-size: 11px;
  font-weight: 700;
  color: #072332;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  white-space: nowrap;
  text-align: center;
}

.tb-btn {
  background: #990000;
  color: #fff;
  border: 1px solid #990000;
  border-radius: 6px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, color 0.15s;
}

.tb-btn:hover {
  background: #fff;
  color: #990000;
}

.tb-btn--disabled,
.tb-btn:disabled {
  background: #F5E3CC;
  color: #B9C1C6;
  border-color: #F5E3CC;
  cursor: not-allowed;
}

.tb-btn--disabled:hover,
.tb-btn:disabled:hover {
  background: #F5E3CC;
  color: #B9C1C6;
}


/* ── Modals ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-box {
  background: #fff;
  border: 1px solid #B9C1C6;
  border-radius: 8px;
  padding: 0 0 16px;
  min-width: 320px;
  max-width: 440px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  font-family: Arial, sans-serif;
  overflow: hidden;
}

.modal-header {
  background: #990000;
  border-radius: 6px 6px 0 0;
  padding: 10px 16px 9px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 8px;
  opacity: 0.8;
}

.modal-close-btn:hover {
  opacity: 1;
}

.modal-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
  padding: 0 20px;
}

.modal-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  cursor: pointer;
  color: #072332;
}

.modal-checkbox-row input[type="checkbox"] {
  accent-color: #990000;
  width: 15px;
  height: 15px;
  cursor: pointer;
  flex-shrink: 0;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 20px 0;
  margin-top: 4px;
}

.modal-btn {
  padding: 4px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  background: #990000;
  color: #fff;
  border: 1px solid #990000;
  transition: background 0.15s, color 0.15s;
}

.modal-btn:hover {
  background: #fff;
  color: #990000;
}

.modal-btn--primary {
  background: #990000;
  color: #fff;
}

.modal-btn--secondary {
  background: #990000;
  color: #fff;
}

/* ── Legend Panel ─────────────────────────────────────────── */
#legend-panel {
  position: fixed;
  top: 68px;
  right: 16px;
  z-index: 1000;
  background: #EEEEF0;
  border: 2px solid #B9C1C6;
  border-radius: 8px;
  padding: 10px 14px 12px;
  font-family: Arial, sans-serif;
  font-size: 13px;
  min-width: 160px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

#last-updated {
  font-size: 11px;
  color: #072332;
  text-align: center;
  margin-bottom: 8px;
  opacity: 0.7;
}

.legend-reset-btn {
  width: 100%;
  background: #990000;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 7px 0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  text-align: center;
}

.legend-reset-btn:hover {
  background: #6D0808;
}

/* ── Leaflet popup styles ─────────────────────────────────── */
.leaflet-popup-content-wrapper {
  background: #EEEEF0;
  border: 2px solid #B9C1C6;
  border-radius: 8px;
  box-shadow: none;
}

.leaflet-popup-tip {
  background: #EEEEF0;
}

.popup-container { max-width: 360px; font-family: Arial, sans-serif; font-size: 13px; color: #072332; }
.popup-top-menu { font-weight: 600; margin-bottom: 6px; }
.popup-top-menu .popup-tab-btn { background: transparent; border: none; color: #072332; padding: 4px 6px; cursor: pointer; }
.popup-top-menu .popup-tab-btn.active { background: #990000; color: #fff; border-radius: 4px; text-decoration: none; }
.iu-crimson-line { height: 2px; background: #990000; margin: 8px 0 10px; border-radius: 1px; }
.entity-name { margin: 0; font-size: 16px; font-weight: 700; color: #fff; }
.section-label { font-size: 11px; font-weight: 600; color: #072332; margin-top: 8px; text-transform: uppercase; letter-spacing: 0.04em; }
.campus-section { padding-bottom: 4px; }
.campus-name { font-size: 14px; font-weight: 600; color: #072332; margin-top: 2px; }
.campus-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
}

.campus-row-divider {
  height: 2px;
  background: #B9C1C6;
  margin: 6px 0 8px;
}

.location-pin {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.program-block {
  padding: 4px 0 2px;
}

.campus-section:not(:last-child) .program-block:last-child {
  border-bottom: none;
}

.program-badge {
  display: inline-block;
  background: #990000;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 12px;
  margin: 4px 0 6px;
  letter-spacing: 0.02em;
}

a.org-link-btn {
  display: inline-block;
  background: #990000;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #990000;
  border-radius: 4px;
  padding: 3px 8px;
  margin: 2px 0 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

a.org-link-btn:hover {
  background: #fff;
  color: #990000;
}

.program-link {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #072332;
  text-decoration: underline;
  margin: 4px 0 2px;
}

.program-link:hover {
  color: #990000;
}

.activity-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 0;
  font-size: 12px;
  color: #072332;
  border-bottom: 1px solid #F5E3CC;
}

.activity-row:last-child {
  border-bottom: none;
}

.activity-name {
  font-weight: 600;
  flex: 1;
}

.course-code {
  font-size: 11px;
  color: #072332;
  white-space: nowrap;
  margin-left: auto;
}

.leaflet-popup-content-wrapper .leaflet-popup-content {
  margin: 0;
  padding: 0;
  min-width: 300px;
  max-width: 360px;
}

.popup-header {
  background: #990000;
  border-radius: 6px 6px 0 0;
  padding: 10px 14px 8px;
}

.popup-body {
  padding: 8px 14px 4px;
}

.acp-activities {
  margin: 4px 0 2px;
}

.acp-activity-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 11px;
  padding: 3px 0;
}

.acp-subject {
  flex: 0 0 100px;
  color: #072332;
  font-weight: 500;
}

.acp-codes {
  flex: 1;
  color: #777;
  word-break: break-word;
}

.program-divider {
  height: 1px;
  background: #B9C1C6;
  margin: 4px 0;
}

.campus-separator {
  height: 2px;
  background: #990000;
  margin: 8px 0;
  border-radius: 1px;
}

/* ── Organization filter modal ───────────────────────────── */
.modal-body--org {
  padding: 0;
  gap: 0;
  margin-bottom: 18px;
}

.org-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border: none;
  border-bottom: 2px solid #B9C1C6;
  font-size: 13px;
  font-family: Arial, sans-serif;
  outline: none;
  color: #072332;
}

.org-search-input::placeholder {
  color: #B9C1C6;
}

.org-checkbox-list {
  height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

#org-checkbox-list .modal-checkbox-row {
  border-bottom: 1px solid #F5E3CC;
  padding: 8px 14px;
  margin: 0;
}

#org-checkbox-list .modal-checkbox-row:last-child {
  border-bottom: none;
}
