/* ============================================================
   RecEnroll Staff UI — Design System
   ============================================================ */

/* --- Tokens ----------------------------------------------- */
:root {
  --navy:       #1F3F6B;
  --navy-dark:  #162E50;
  --navy-hover: #2A5489;
  --green:      #7AB951;
  --green-dark: #5F9A3D;
  --ink:        #1A2436;
  --text:       #000000;
  --muted:      #525C70;
  --line:       #C2CAD8;
  --line-soft:  #F0F2F6;
  --bg:         #FFFFFF;
  --bg-soft:    #F8FAFC;
  --bg-row:     #FAFBFD;
  --font:       'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  --mono:       ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Bootstrap 5 variable aliases — required by tom-select.bootstrap5.min.css */
  --bs-body-bg:                  var(--bg);
  --bs-body-color:               var(--ink);
  --bs-border-color:             var(--line);
  --bs-border-color-translucent: rgba(228,232,239,0.5);
  --bs-border-radius:            6px;
  --bs-border-radius-lg:         8px;
  --bs-border-radius-sm:         4px;
  --bs-border-width:             1px;
  --bs-box-shadow-inset:         inset 0 1px 2px rgba(0,0,0,0.075);
  --bs-form-invalid-color:       #DC2626;
  --bs-form-valid-color:         #5F9A3D;
  --bs-secondary-bg:             var(--bg-soft);
  --bs-tertiary-bg:              var(--bg-row);
}

/* --- Base -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg-soft);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy); text-decoration: none; font-weight: 500; }
a:hover { color: var(--navy-hover); text-decoration: underline; }
a:visited { color: var(--navy); }
table a:visited { color: #551A8B; }

p { margin: 0 0 8px; }

ul { list-style: none; margin: 0; padding: 0; }

label { cursor: pointer; }

fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

#simple_form {
  border: none;
}

/* --- Site shell ------------------------------------------- */
.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Header ----------------------------------------------- */
.site-header {
  background: var(--navy);
  color: #fff;
  height: 52px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 18px;
  text-decoration: none;
  flex-shrink: 0;
}
.header-logo:hover { text-decoration: none; }

.logo-mark {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.logo-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: #fff;
  white-space: nowrap;
}
.logo-text .logo-green { color: var(--green); }

.header-icons {
  display: flex;
  gap: 2px;
  margin-right: 8px;
}

.header-icon-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: rgba(255,255,255,0.55);
  font-size: 14px;
  text-decoration: none;
}
.header-icon-btn:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  text-decoration: none;
}
.header-icon-btn:visited { color: rgba(255,255,255,0.55); }

.header-nav { display: flex; gap: 2px; }

.nav-tab {
  color: rgba(255,255,255,0.78);
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
.nav-tab:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  text-decoration: none;
}
.nav-tab:visited { color: rgba(255,255,255,0.78); }
.nav-tab.active { color: #fff; background: rgba(255,255,255,0.10); font-weight: 600; }
.nav-tab.active:visited { color: #fff; }

/* --- Site body -------------------------------------------- */
.site-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-bottom: 48px;
}

/* --- Footer ----------------------------------------------- */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.72);
  padding: 14px 20px;
  font-size: 12px;
  display: flex;
  gap: 22px;
  align-items: center;
  flex-shrink: 0;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  min-height: 48px;
}

.footer-nav { display: flex; gap: 22px; align-items: center; }

.footer-link {
  color: rgba(255,255,255,0.78);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.footer-link:hover { color: #fff; text-decoration: none; }
.footer-link:visited { color: rgba(255,255,255,0.78); }

.footer-copy {
  margin-left: auto;
  opacity: 0.7;
  font-size: 11px;
}

/* --- Messages --------------------------------------------- */
.messages-bar {
  background: #FFF3CD;
  border-bottom: 1px solid #FFE69C;
  padding: 10px 22px;
  font-size: 13px;
  color: #664D03;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.messages-bar ul { margin: 0; padding: 0; list-style: none; }
.messages-bar li.error { color: #842029; }
.messages-close {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}

/* --- List layout ------------------------------------------ */
.list-layout {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

.list-sidebar {
  width: 250px;
  flex-shrink: 0;
  padding: 18px;
  background: var(--bg);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.list-main {
  flex: 1;
  padding: 22px;
  min-width: 0;
  overflow-y: auto;
  background: var(--bg-soft);
}

/* --- Standard page layout --------------------------------- */
.page-main {
  flex: 1;
  width: min(100%, 1440px);
  padding: 22px;
  margin-right: auto;
  background: var(--bg-soft);
}

.page-narrow {
  width: 60% !important;
  min-width: 760px;
  max-width: 1280px;
  margin: 0 auto;
}

.page-wide {
  width: min(100%, 1320px);
  margin: 0 auto;
}

.class-list-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.class-search-panel {
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 16px;
}

.class-search-panel form,
.class-search-panel .filter-section {
  margin: 0 0 22px;
}

.filter-title {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}

.class-search-panel select,
.class-search-panel input[type="search"],
.class-search-panel input[type="text"] {
  width: 100%;
  box-sizing: border-box;
}

.class-search-panel .btn {
  margin-top: 8px;
}

.class-link-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.class-link-list li {
  margin-bottom: 8px;
}

.class-results {
  min-width: 0;
}

.class-detail-page {
  width: min(100%, 1320px);
  margin: 0 auto;
}

.class-form-panel {
  width: 80%;
  min-width: 760px;
}

.class-form-panel .rnr-input-table {
  width: 100%;
  border-collapse: collapse;
}

.class-form-panel .rnr-row {
  line-height: normal;
}

.class-form-panel .rnr-label {
  width: 150px;
  padding: 6px 10px 6px 0;
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
  font-weight: 500;
}

.class-form-panel .rnr-data {
  padding: 6px 18px 6px 0;
  vertical-align: middle;
  white-space: nowrap;
}

.class-form-panel input,
.class-form-panel select,
.class-form-panel textarea {
  max-width: 100%;
}

.class-form-panel input.input-mini,
.class-form-panel select.input-mini {
  width: 72px;
}

.class-form-panel input.input-small,
.class-form-panel select.input-small {
  width: 150px;
}

.class-form-panel input.input-medium,
.class-form-panel select.input-medium {
  width: 220px;
}

.class-form-panel input.input-large,
.class-form-panel select.input-large {
  width: 320px;
}

.class-form-panel textarea,
.class-form-panel .text_widget {
  width: 100%;
  white-space: normal;
}

.class-detail-page .tab-pane {
  display: none;
  padding-top: 20px;
}

.class-detail-page .tab-pane.active {
  display: block;
}

.class-section-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.season-filter-list {
  display: flex;
  gap: 8px 18px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}

.season-filter-list a {
  font-size: 13px;
  font-weight: 500;
}

.section-edit-page {
  width: min(100%, 1320px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}

.section-edit-main,
.section-edit-side {
  min-width: 0;
}

.section-edit-side {
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 16px;
}

.section-edit-side h4 {
  margin: 18px 0 8px;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
}

.section-edit-side h4:first-child {
  margin-top: 0;
}

.section-edit-side input[type="text"] {
  width: 100%;
}

.section-edit-page .form-actions {
  margin-left: 0;
  flex-wrap: wrap;
}

.section-edit-page fieldset {
  margin: 0 0 18px;
}

.section-edit-page legend {
  display: block;
  width: 100%;
  margin: 18px 0 10px;
  padding: 0 0 6px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.section-edit-page .control-group {
  display: grid;
  grid-template-columns: 180px minmax(0, 360px);
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.section-edit-page .control-label {
  text-align: right;
  font-weight: 500;
  color: var(--muted);
}

.section-edit-page .controls {
  min-width: 0;
}

.section-edit-page .controls input,
.section-edit-page .controls select,
.section-edit-page .controls textarea {
  max-width: 100%;
}

.section-edit-page .controls input.input-mini,
.section-edit-page .controls select.input-mini {
  width: 72px;
}

.section-edit-page .controls input.input-small,
.section-edit-page .controls select.input-small {
  width: 150px;
}

.section-edit-page .text_widget {
  width: 100%;
}

/* --- Detail layout ---------------------------------------- */
.detail-layout {
  flex: 1;
  padding: 22px;
  overflow-y: auto;
  background: var(--bg-soft);
}

/* --- Sidebar sections ------------------------------------- */
.sidebar-head {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 18px 0 8px;
}
.sidebar-head:first-child { margin-top: 0; }

hr { border: none; border-top: 1px solid var(--line); margin: 14px 0; }

/* --- Form row (label + input grid) ----------------------- */
.form-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 420px);
  column-gap: 20px;
  row-gap: 4px;
  align-items: baseline;
  margin-bottom: 10px;
}
.form-row > label {
  grid-column: 1;
  text-align: right;
  padding-top: 7px;
  color: var(--text);
}
.form-row > :not(label) { grid-column: 2; }
.field-help { display: none; font-size: 12px; color: var(--muted); }
.errorlist { list-style: none; padding: 0; margin: 0; font-size: 12px; color: #DC2626; }
.form-row.has-error > label { color: #DC2626; }

.form-actions { margin-left: 180px; margin-top: 14px; display: flex; gap: 8px; align-items: center; }

.radio-row { display: flex; gap: 14px; align-items: center; }
.radio-row label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }

/* --- Form controls ---------------------------------------- */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
  font-family: var(--font);
  font-size: 13px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  width: 100%;
  box-sizing: border-box;
  line-height: 1.4;
}

input[type="text"]:focus,
input[type="search"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(31,63,107,0.20);
  border-color: var(--navy);
}

.radio-group {
  display: flex;
  gap: 14px;
  font-size: 13px;
  color: var(--text);
  margin: 10px 0;
}
.radio-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
}
.radio-group input[type="radio"] { width: auto; }

/* --- Buttons ---------------------------------------------- */
.btn {
  font-family: var(--font);
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  padding: 7px 14px;
  margin: .5em .5em;
  font-weight: 600;
  border: 1px solid transparent;
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  text-decoration: none;
  vertical-align: middle;
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(31,63,107,0.20);
}

.btn-primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.btn-primary:hover {
  background: var(--navy-hover);
  border-color: var(--navy-hover);
  color: #fff;
  text-decoration: none;
}
.btn-primary:visited { color: #fff; }

.btn-ghost {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--line);
  font-weight: 500;
}
.btn-ghost:hover { background: var(--bg-soft); text-decoration: none; color: var(--ink); }

.btn-danger {
  background: #DC2626;
  color: #fff !important;
  border-color: #DC2626;
}
.btn-danger:hover { background: #B91C1C; border-color: #B91C1C; color: #fff; text-decoration: none; }

.rnr-button {
  font-family: var(--font);
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  padding: 7px 14px;

  margin: .5em .5em;
  font-weight: 600;
  border: 1px solid var(--line);
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  text-decoration: none;
  vertical-align: middle;
  color: var(--ink);
  background: var(--bg);
}
.rnr-button:hover {
  background: var(--bg-soft);
  color: var(--ink);
  text-decoration: none;
}
.rnr-button:visited { color: var(--ink); }
.rnr-button-small {
  padding: 4px 10px;
  font-size: 12px;
}

/* --- Cards ------------------------------------------------ */
.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}
.card:last-child { margin-bottom: 0; }

.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card h3{
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

.card-body { padding: 10px 16px 14px; }

/* --- Data tables ------------------------------------------ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  white-space: nowrap;
}

.data-table td {
  font-size: 13px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  color: var(--ink);
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table.zebra tbody tr:nth-child(even) td { background: var(--bg-row); }

.data-table .td-muted { color: var(--muted); }
.data-table .td-center { text-align: center; }
.data-table .number { text-align: right; }

/* Empty state row */
.data-table .empty-row td {
  padding: 34px 16px;
  text-align: center;
  color: var(--muted);
  border-bottom: none;
}

/* --- Detail table (registrant card) ----------------------- */
.detail-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}
.detail-table col.lbl  { width: 130px; }
.detail-table col.val  { width: 300px; }
.detail-table col.lbl2 { width: 130px; }

.detail-table .lbl-cell {
  font-weight: 500;
  color: var(--muted);
  padding: 8px 14px 8px 12px;
  white-space: nowrap;
  vertical-align: top;
  font-size: 13px;
}
.detail-table .val-cell {
  padding: 8px 12px 8px 0;
  font-size: 13px;
  color: var(--ink);
  vertical-align: top;
}
.detail-table .val-cell.green { color: var(--green-dark); font-weight: 600; }

/* --- Status pill ------------------------------------------ */
.status-pill {
  background: #EAF5DF;
  color: var(--green-dark);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  display: inline-block;
}
.status-pill.balance-due { background: #FEF3C7; color: #92400E; }
.status-pill.voided { background: #FEE2E2; color: #991B1B; }

/* --- Breadcrumb row --------------------------------------- */
.breadcrumb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--muted);
}
.breadcrumb-row .sep { color: var(--muted); }
.breadcrumb-row .flex-spacer { flex: 1; }

/* --- Action row ------------------------------------------- */
.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.action-row .btn { padding: 6px 12px; font-weight: 500; }

/* --- Section heading (within detail cards) ---------------- */
.section-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- Mono pill (transaction IDs) -------------------------- */
.mono-pill {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--line-soft);
}

/* --- Inline edit form (payer/batch change) ---------------- */
.inline-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.inline-form input[type="text"],
.inline-form select {
  width: auto;
}

/* --- Field group (modal fields) --------------------------- */
.field-group { margin-bottom: 14px; }
.field-group label {
  display: block;
  font-weight: 500;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}
.field-group .field-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* --- Dialog ----------------------------------------------- */
dialog {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  max-width: 90vw;
  width: 760px;
  max-height: 90vh;
  overflow: hidden;
  display: none;
  flex-direction: column;
}
dialog[open] { display: flex; }
dialog::backdrop { background: rgba(0,0,0,0.40); }

.delete-dialog {
  min-height: 300px;
  width: min(440px, calc(100vw - 32px));
}

.delete-dialog .modal-body {
  overflow: visible;
  padding-bottom: 32px;
}

.dialog-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.dialog-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  padding: 0;
}
.dialog-close:hover { color: var(--ink); }

.modal-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.dialog-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
  background: var(--bg-soft);
}

/* --- Tag checkboxes (people edit) ------------------------- */
.tag-checkboxes #id_tag {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.tag-checkboxes #id_tag > div { display: inline-flex; align-items: center; }
.tag-checkboxes #id_tag label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 400;
}

/* --- Void panel ------------------------------------------- */
#void { display: none; padding: 12px 0; }
#void .field-group { max-width: 400px; }

/* --- Email panel ------------------------------------------ */
#emailSpan { display: none; }
.email-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0 12px;
}
.email-form input[type="text"],
.email-form select { width: auto; }

/* --- Inline delete confirm -------------------------------- */
.form_parent { display: none; margin-top: 4px; }
.form_parent label { font-size: 12px; color: var(--muted); margin-right: 4px; }

/* --- Void notice ------------------------------------------ */
.void-notice { color: #DC2626; }
.void-notice .section-title { color: #DC2626; }

/* --- Admin drawer ----------------------------------------- */
.admin-drawer {
  position: fixed;
  top: 0;
  left: -320px;
  width: 320px;
  height: 100vh;
  background: var(--bg);
  border-right: 1px solid var(--line);
  box-shadow: 2px 0 16px rgba(0,0,0,0.12);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transition: left 200ms ease;
  overflow-y: auto;
}
.admin-drawer.open { left: 0; }

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.30);
  z-index: 1049;
  display: none;
}
.drawer-overlay.open { display: block; }

.drawer-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: var(--bg);
}
.drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  padding: 0;
}
.drawer-close:hover { color: var(--ink); }

.drawer-section-head {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 16px 4px;
  border-bottom: 1px solid var(--line-soft);
}

.drawer-subsection {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 16px 2px;
}

.drawer-nav { padding: 0 0 8px; }
.drawer-nav li a {
  display: block;
  padding: 5px 16px 5px 24px;
  font-size: 13px;
  color: var(--navy);
  text-decoration: none;
  font-weight: 400;
}
.drawer-nav li a:hover { background: var(--bg-soft); text-decoration: none; }

/* --- Scroller widget -------------------------------------- */
#scroller {
  position: fixed;
  bottom: 56px;
  left: 0;
  width: 90px;
  padding: 6px 0;
  background: var(--ink);
  color: rgba(255,255,255,0.8);
  font-size: 11px;
  text-align: center;
  border-top-right-radius: 4px;
  cursor: pointer;
  z-index: 100;
}

/* --- Toolbar row (top of list main) ----------------------- */
.main-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.main-toolbar .record-count { font-size: 13px; color: var(--muted); }

/* --- Super search row ------------------------------------- */
.super-search-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.super-search-row textarea {
  flex: 1;
  min-height: 32px;
  resize: vertical;
}

/* --- Quick links ------------------------------------------ */
.quick-links { display: flex; flex-direction: column; gap: 6px; }

/* --- Utilities -------------------------------------------- */
.hidden { display: none !important; }
.no_print { }
.text-muted  { color: var(--muted); }
.text-green  { color: var(--green-dark); font-weight: 600; }
.text-danger { color: #DC2626; }
.text-center { text-align: center; }
.number      { text-align: right; }

/* Strikethrough rows for deleted/voided enrollments & products */
tr.deleted td { color: #DC2626 !important; text-decoration: line-through; }
tr.deleted td.fees,
tr.deleted td.code { color: #DC2626; text-decoration: line-through; }
span.deleted { color: #DC2626 !important; -webkit-print-color-adjust: exact; }

/* Legacy helpers referenced by other pages until they are refreshed */
.field_help   { display: none; color: blue; font-style: italic; }
.strong       { font-weight: 600; }
.pointer      { cursor: pointer; }

/* Bootstrap 2 .inline list — used by build_person() in general.js */
ul.inline { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; padding: 0; margin: 0; }
ul.inline li { display: inline; }

/* --- Bootstrap 5 utility shims (registration pages) ------- */

/* Grid */
.row { display: flex; flex-wrap: wrap; margin: 0 -8px; }
.col-12, [class^="col-"], [class*=" col-"] { padding: 0 8px; box-sizing: border-box; }
.col-12  { width: 100%; }
.col-md-4 { width: 33.333%; }
.col-md-5 { width: 41.666%; }
.col-md-8 { width: 66.666%; }

/* Flex utilities */
.d-flex   { display: flex !important; }
.d-none   { display: none !important; }
.align-items-center { align-items: center !important; }
.gap-2    { gap: 8px !important; }
.ms-auto  { margin-left: auto !important; }
.w-auto   { width: auto !important; }

/* Spacing */
.p-2  { padding: 8px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }

/* Visual */
.bg-light { background-color: var(--bg-soft) !important; }
.border   { border: 1px solid var(--line) !important; }
.rounded  { border-radius: 6px !important; }

/* Nav tabs */
.nav { display: flex; flex-wrap: wrap; padding: 0; margin: 0; list-style: none; }
.nav-tabs { border-bottom: 1px solid var(--line); gap: 4px; align-items: flex-end; }
.nav-link {
  display: block;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  background: none;
}
.nav-link:hover { color: var(--navy-hover); background: var(--line-soft); text-decoration: none; }
.nav-tabs .nav-link.active {
  color: var(--ink);
  background: var(--bg);
  border-color: var(--line) var(--line) var(--bg);
  font-weight: 600;
}

/* Tables — Bootstrap names used on registration pages */
.table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 12px; }
.table th {
  font-size: 11px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase;
  color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line);
  text-align: left; background: var(--bg-soft); white-space: nowrap;
}
.table td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; color: var(--ink); }
.table-striped tbody tr:nth-child(odd) td { background: var(--bg-row); }
.table-condensed th, .table-condensed td { padding: 4px 8px; }

/* Inline list */
.list-inline { display: flex; flex-wrap: wrap; gap: 4px 16px; list-style: none; padding: 0; margin: 0; }
.list-inline-item { display: inline-block; }

/* Alert */
.alert { padding: 12px 16px; border-radius: 6px; border: 1px solid transparent; margin-bottom: 12px; font-size: 13px; }
.alert-warning { background: #FFF3CD; border-color: #FFE69C; color: #664D03; }
.alert-dismissible { padding-right: 40px; position: relative; }

/* Button shims */
.btn-light { background: var(--bg); color: var(--ink); border-color: var(--line); font-weight: 500; }
.btn-light:hover { background: var(--bg-soft); text-decoration: none; color: var(--ink); }
.btn-sm { padding: 4px 10px !important; font-size: 12px !important; }
.btn:disabled, .btn[disabled] { opacity: 0.5; pointer-events: none; cursor: default; }

/* Input group */
.input-group { display: flex; align-items: stretch; }
.input-group .form-control { flex: 1; }
/* button on the right (append) */
.input-group .form-control:first-child { border-radius: 6px 0 0 6px; }
.input-group .btn:last-child  { border-radius: 0 6px 6px 0; border-left: none; flex-shrink: 0; }
/* button on the left (prepend) */
.input-group .btn:first-child { border-radius: 6px 0 0 6px; border-right: none; flex-shrink: 0; }
.input-group .form-control:last-child { border-radius: 0 6px 6px 0; }

/* --- Choice help panel ------------------------------------ */
div.field_help {
  margin-left: 210px;
  margin-top: 1rem;
  padding: 14px 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  max-width: 560px;
}
div.field_help p {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin: 0 0 10px;
}
div.field_help dt {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 10px;
}
div.field_help dd {
  font-size: 13px;
  color: var(--ink);
  margin-left: 0;
  margin-top: 2px;
}

/* Form control shims (Bootstrap 5 class names) */
.form-control { width: 100%; }
.form-select  { width: 100%; }
.form-select-sm { padding: 4px 8px !important; font-size: 12px !important; height: auto; }

/* --- Print ------------------------------------------------ */
@media print {
  .no_print,
  .site-header,
  .site-footer,
  .list-sidebar,
  .action-row,
  .admin-drawer,
  #scroller { display: none !important; }

  a[href]:after { content: none !important; }

  body {
    font: 13pt Georgia, "Times New Roman", Times, serif;
    line-height: 1.3;
    background: #fff;
  }

  tr.deleted td { color: red !important; }
  span.deleted  { color: red !important; }
}

/* --- Index / Home page ------------------------------------- */
.welcome-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.welcome-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 28px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: box-shadow 120ms, border-color 120ms;
  min-width: 130px;
}
.welcome-card i { font-size: 22px; }
.welcome-card:hover {
  border-color: var(--navy);
  box-shadow: 0 2px 8px rgba(31,63,107,0.12);
  text-decoration: none;
  color: var(--navy);
}
.welcome-card:visited { color: var(--navy); }

.change-log h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 18px 0 4px; }
.change-log h3:first-child { margin-top: 0; }
.change-log ul { list-style: disc; padding-left: 20px; margin: 0 0 4px; }
.change-log li { font-size: 13px; color: var(--text); margin-bottom: 4px; line-height: 1.5; }
.change-log ol { padding-left: 20px; }

/* --- People new/edit page layout --------------------------- */
.person-page-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}
.person-page-instructions {
  flex: 0 0 260px;
  font-size: 13px;
  color: var(--muted);
  padding-top: 4px;
}
.person-page-instructions ol { padding-left: 1.25rem; margin: .5rem 0 0; }
.person-page-instructions li { margin-bottom: .4rem; line-height: 1.5; }
.person-page-form { flex: 1; min-width: 0; max-width: 860px; }

@media (max-width: 767px) {
  .page-main { padding: 14px; }
  .page-narrow {
    width: 100%;
    min-width: 0;
  }
  .class-list-layout {
    grid-template-columns: 1fr;
  }
  .class-form-panel {
    width: 100%;
    min-width: 0;
  }
  .section-edit-page {
    grid-template-columns: 1fr;
  }
  .section-edit-page .control-group {
    grid-template-columns: 1fr;
  }
  .section-edit-page .control-label {
    text-align: left;
  }
  .person-page-layout { flex-direction: column; }
  .person-page-instructions { flex: none; }
}

/* --- People new/edit form ---------------------------------- */
.person-input-page input[type="text"],
.person-input-page input[type="number"],
.person-input-page input[type="search"],
.person-input-page select,
.person-input-page textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  display: block;
  padding: .375rem .75rem;
  width: 100%;
}
.person-input-page input[type="checkbox"],
.person-input-page input[type="radio"] { margin-right: .35rem; }

.person-field-grid {
  display: grid;
  gap: .75rem 1rem;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}
.person-name-grid {
  display: grid;
  gap: .75rem 1rem;
  grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1.25fr) minmax(0, .9fr) minmax(0, .9fr);
}
.person-field-grid ul,
.person-field-grid li,
#hh_members { list-style: none; margin: 0; padding: 0; }

.person-field label { display: block; font-weight: 600; margin-bottom: .25rem; }

.field_help  { color: var(--muted); display: block; font-size: .875rem; margin-top: .25rem; }
.help-inline { color: #DC2626;      display: block; font-size: .875rem; margin-top: .25rem; }

.person-section-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin: 1.5rem 0 1rem;
  padding-bottom: .5rem;
}
.person-save-actions { align-items: center; display: flex; gap: .75rem; margin: 1.25rem 0 1rem; }

#possible_duplicates { width: 100%; }

.person-instructions {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 1.5rem;
}
.person-instructions ol { padding-left: 1.25rem; margin: .5rem 0 0; }
.person-instructions li { margin-bottom: .4rem; line-height: 1.5; }

@media (max-width: 767px) {
  .person-name-grid { grid-template-columns: 1fr; }
  .person-section-header { align-items: flex-start; flex-direction: column; }
}
.change-log ol { padding-left: 20px; }

/* Narrow input for fee/count fields */
.input-mini { width: 60px; }


#show_help {
	cursor: pointer;
	vertical-align: middle;
}

.field_help,.field-help,.help-block {
	display: none;
	color: blue;
	font-style: italic;
}

.bi-globe{color:blue;}